diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index 90a2a4f161..20f3754861 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -55,11 +55,11 @@ carry. | `github.com/go-openapi/swag/cmdutils` | Apache-2.0 | `github.com/go-openapi/swag/cmdutils` | | `github.com/go-openapi/swag/conv` | Apache-2.0 | `github.com/go-openapi/swag/conv` | | `github.com/go-openapi/swag/fileutils` | Apache-2.0 | `github.com/go-openapi/swag/fileutils` | -| `github.com/go-openapi/swag/jsonname` | Apache-2.0 | `github.com/go-openapi/swag/jsonname` | | `github.com/go-openapi/swag/jsonutils` | Apache-2.0 | `github.com/go-openapi/swag/jsonutils` | | `github.com/go-openapi/swag/loading` | Apache-2.0 | `github.com/go-openapi/swag/loading` | | `github.com/go-openapi/swag/mangling` | Apache-2.0 | `github.com/go-openapi/swag/mangling` | | `github.com/go-openapi/swag/netutils` | Apache-2.0 | `github.com/go-openapi/swag/netutils` | +| `github.com/go-openapi/swag/pools` | Apache-2.0 | `github.com/go-openapi/swag/pools` | | `github.com/go-openapi/swag/stringutils` | Apache-2.0 | `github.com/go-openapi/swag/stringutils` | | `github.com/go-openapi/swag/typeutils` | Apache-2.0 | `github.com/go-openapi/swag/typeutils` | | `github.com/go-openapi/swag/yamlutils` | Apache-2.0 | `github.com/go-openapi/swag/yamlutils` | @@ -3671,7 +3671,7 @@ It ships with copies of other software which license terms are recalled below. The original software was authored on 25-02-2013 by sigu-399 (https://github.com/sigu-399, sigu.399@gmail.com). -github.com/sigh-399/jsonpointer +github.com/sigu-399/jsonpointer =========================== // SPDX-FileCopyrightText: Copyright 2013 sigu-399 ( https://github.com/sigu-399 ) @@ -3915,7 +3915,7 @@ Copyright 2015-2025 go-swagger maintainers // SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers // SPDX-License-Identifier: Apache-2.0 -This software library, github.com/go-openapi/jsonpointer, includes software developed +This software library, github.com/go-openapi/jsonreference, includes software developed by the go-swagger and go-openapi maintainers ("go-swagger maintainers"). Licensed under the Apache License, Version 2.0 (the "License"); @@ -3930,7 +3930,7 @@ It ships with copies of other software which license terms are recalled below. The original software was authored on 25-02-2013 by sigu-399 (https://github.com/sigu-399, sigu.399@gmail.com). -github.com/sigh-399/jsonpointer +github.com/sigh-399/jsonreference =========================== // SPDX-FileCopyrightText: Copyright 2013 sigu-399 ( https://github.com/sigu-399 ) @@ -4809,10 +4809,10 @@ limitations under the License. ``` -### github.com/go-openapi/swag/jsonname +### github.com/go-openapi/swag/jsonutils * License: Apache-2.0 -* Module: github.com/go-openapi/swag/jsonname +* Module: github.com/go-openapi/swag/jsonutils #### LICENSE @@ -5023,10 +5023,10 @@ limitations under the License. ``` -### github.com/go-openapi/swag/jsonutils +### github.com/go-openapi/swag/loading * License: Apache-2.0 -* Module: github.com/go-openapi/swag/jsonutils +* Module: github.com/go-openapi/swag/loading #### LICENSE @@ -5237,10 +5237,10 @@ limitations under the License. ``` -### github.com/go-openapi/swag/loading +### github.com/go-openapi/swag/mangling * License: Apache-2.0 -* Module: github.com/go-openapi/swag/loading +* Module: github.com/go-openapi/swag/mangling #### LICENSE @@ -5451,10 +5451,10 @@ limitations under the License. ``` -### github.com/go-openapi/swag/mangling +### github.com/go-openapi/swag/netutils * License: Apache-2.0 -* Module: github.com/go-openapi/swag/mangling +* Module: github.com/go-openapi/swag/netutils #### LICENSE @@ -5665,10 +5665,10 @@ limitations under the License. ``` -### github.com/go-openapi/swag/netutils +### github.com/go-openapi/swag/pools * License: Apache-2.0 -* Module: github.com/go-openapi/swag/netutils +* Module: github.com/go-openapi/swag/pools #### LICENSE diff --git a/bundle/manifests/nvidia.com_clusterpolicies.yaml b/bundle/manifests/nvidia.com_clusterpolicies.yaml index 9b80c2cd14..6257b44d5a 100644 --- a/bundle/manifests/nvidia.com_clusterpolicies.yaml +++ b/bundle/manifests/nvidia.com_clusterpolicies.yaml @@ -270,11 +270,8 @@ spec: Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their CSIDriver instance. Other volumes are always re-labelled recursively. - "MountOption" value is allowed only when SELinuxMount feature gate is enabled. - If not specified and SELinuxMount feature gate is enabled, "MountOption" is used. - If not specified and SELinuxMount feature gate is disabled, "MountOption" is used for ReadWriteOncePod volumes - and "Recursive" for all other volumes. + If not specified, "MountOption" is used. This field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers. diff --git a/bundle/manifests/nvidia.com_gpuclusters.yaml b/bundle/manifests/nvidia.com_gpuclusters.yaml index 30ff8543d7..d0666b36b0 100644 --- a/bundle/manifests/nvidia.com_gpuclusters.yaml +++ b/bundle/manifests/nvidia.com_gpuclusters.yaml @@ -168,11 +168,8 @@ spec: Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their CSIDriver instance. Other volumes are always re-labelled recursively. - "MountOption" value is allowed only when SELinuxMount feature gate is enabled. - If not specified and SELinuxMount feature gate is enabled, "MountOption" is used. - If not specified and SELinuxMount feature gate is disabled, "MountOption" is used for ReadWriteOncePod volumes - and "Recursive" for all other volumes. + If not specified, "MountOption" is used. This field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers. diff --git a/bundle/manifests/nvidia.com_nvidiadrivers.yaml b/bundle/manifests/nvidia.com_nvidiadrivers.yaml index 959d57c5dc..96f9a6bd8d 100644 --- a/bundle/manifests/nvidia.com_nvidiadrivers.yaml +++ b/bundle/manifests/nvidia.com_nvidiadrivers.yaml @@ -638,11 +638,8 @@ spec: Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their CSIDriver instance. Other volumes are always re-labelled recursively. - "MountOption" value is allowed only when SELinuxMount feature gate is enabled. - If not specified and SELinuxMount feature gate is enabled, "MountOption" is used. - If not specified and SELinuxMount feature gate is disabled, "MountOption" is used for ReadWriteOncePod volumes - and "Recursive" for all other volumes. + If not specified, "MountOption" is used. This field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers. diff --git a/config/crd/bases/nvidia.com_clusterpolicies.yaml b/config/crd/bases/nvidia.com_clusterpolicies.yaml index 9b80c2cd14..6257b44d5a 100644 --- a/config/crd/bases/nvidia.com_clusterpolicies.yaml +++ b/config/crd/bases/nvidia.com_clusterpolicies.yaml @@ -270,11 +270,8 @@ spec: Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their CSIDriver instance. Other volumes are always re-labelled recursively. - "MountOption" value is allowed only when SELinuxMount feature gate is enabled. - If not specified and SELinuxMount feature gate is enabled, "MountOption" is used. - If not specified and SELinuxMount feature gate is disabled, "MountOption" is used for ReadWriteOncePod volumes - and "Recursive" for all other volumes. + If not specified, "MountOption" is used. This field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers. diff --git a/config/crd/bases/nvidia.com_gpuclusters.yaml b/config/crd/bases/nvidia.com_gpuclusters.yaml index 30ff8543d7..d0666b36b0 100644 --- a/config/crd/bases/nvidia.com_gpuclusters.yaml +++ b/config/crd/bases/nvidia.com_gpuclusters.yaml @@ -168,11 +168,8 @@ spec: Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their CSIDriver instance. Other volumes are always re-labelled recursively. - "MountOption" value is allowed only when SELinuxMount feature gate is enabled. - If not specified and SELinuxMount feature gate is enabled, "MountOption" is used. - If not specified and SELinuxMount feature gate is disabled, "MountOption" is used for ReadWriteOncePod volumes - and "Recursive" for all other volumes. + If not specified, "MountOption" is used. This field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers. diff --git a/config/crd/bases/nvidia.com_nvidiadrivers.yaml b/config/crd/bases/nvidia.com_nvidiadrivers.yaml index 959d57c5dc..96f9a6bd8d 100644 --- a/config/crd/bases/nvidia.com_nvidiadrivers.yaml +++ b/config/crd/bases/nvidia.com_nvidiadrivers.yaml @@ -638,11 +638,8 @@ spec: Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their CSIDriver instance. Other volumes are always re-labelled recursively. - "MountOption" value is allowed only when SELinuxMount feature gate is enabled. - If not specified and SELinuxMount feature gate is enabled, "MountOption" is used. - If not specified and SELinuxMount feature gate is disabled, "MountOption" is used for ReadWriteOncePod volumes - and "Recursive" for all other volumes. + If not specified, "MountOption" is used. This field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers. diff --git a/deployments/gpu-operator/crds/nvidia.com_clusterpolicies.yaml b/deployments/gpu-operator/crds/nvidia.com_clusterpolicies.yaml index 9b80c2cd14..6257b44d5a 100644 --- a/deployments/gpu-operator/crds/nvidia.com_clusterpolicies.yaml +++ b/deployments/gpu-operator/crds/nvidia.com_clusterpolicies.yaml @@ -270,11 +270,8 @@ spec: Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their CSIDriver instance. Other volumes are always re-labelled recursively. - "MountOption" value is allowed only when SELinuxMount feature gate is enabled. - If not specified and SELinuxMount feature gate is enabled, "MountOption" is used. - If not specified and SELinuxMount feature gate is disabled, "MountOption" is used for ReadWriteOncePod volumes - and "Recursive" for all other volumes. + If not specified, "MountOption" is used. This field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers. diff --git a/deployments/gpu-operator/crds/nvidia.com_gpuclusters.yaml b/deployments/gpu-operator/crds/nvidia.com_gpuclusters.yaml index 30ff8543d7..d0666b36b0 100644 --- a/deployments/gpu-operator/crds/nvidia.com_gpuclusters.yaml +++ b/deployments/gpu-operator/crds/nvidia.com_gpuclusters.yaml @@ -168,11 +168,8 @@ spec: Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their CSIDriver instance. Other volumes are always re-labelled recursively. - "MountOption" value is allowed only when SELinuxMount feature gate is enabled. - If not specified and SELinuxMount feature gate is enabled, "MountOption" is used. - If not specified and SELinuxMount feature gate is disabled, "MountOption" is used for ReadWriteOncePod volumes - and "Recursive" for all other volumes. + If not specified, "MountOption" is used. This field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers. diff --git a/deployments/gpu-operator/crds/nvidia.com_nvidiadrivers.yaml b/deployments/gpu-operator/crds/nvidia.com_nvidiadrivers.yaml index 959d57c5dc..96f9a6bd8d 100644 --- a/deployments/gpu-operator/crds/nvidia.com_nvidiadrivers.yaml +++ b/deployments/gpu-operator/crds/nvidia.com_nvidiadrivers.yaml @@ -638,11 +638,8 @@ spec: Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their CSIDriver instance. Other volumes are always re-labelled recursively. - "MountOption" value is allowed only when SELinuxMount feature gate is enabled. - If not specified and SELinuxMount feature gate is enabled, "MountOption" is used. - If not specified and SELinuxMount feature gate is disabled, "MountOption" is used for ReadWriteOncePod volumes - and "Recursive" for all other volumes. + If not specified, "MountOption" is used. This field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers. diff --git a/go.mod b/go.mod index 744041e83a..d004580f14 100644 --- a/go.mod +++ b/go.mod @@ -26,12 +26,12 @@ require ( github.com/urfave/cli/v3 v3.11.0 go.uber.org/zap v1.28.0 golang.org/x/mod v0.40.0 - k8s.io/api v0.36.4 - k8s.io/apiextensions-apiserver v0.36.4 - k8s.io/apimachinery v0.36.4 - k8s.io/client-go v0.36.4 + k8s.io/api v0.37.0 + k8s.io/apiextensions-apiserver v0.37.0 + k8s.io/apimachinery v0.37.0 + k8s.io/client-go v0.37.0 k8s.io/klog/v2 v2.140.0 - k8s.io/utils v0.0.0-20260507154919-ff6756f316d2 + k8s.io/utils v0.0.0-20260626114624-be93311217bd sigs.k8s.io/controller-runtime v0.24.1 sigs.k8s.io/yaml v1.6.0 ) @@ -56,20 +56,20 @@ require ( github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/fxamacker/cbor/v2 v2.9.2 // indirect github.com/go-errors/errors v1.5.1 // indirect - github.com/go-openapi/jsonpointer v0.22.4 // indirect - github.com/go-openapi/jsonreference v0.21.4 // indirect - github.com/go-openapi/swag v0.25.4 // indirect - github.com/go-openapi/swag/cmdutils v0.25.4 // indirect - github.com/go-openapi/swag/conv v0.25.4 // indirect - github.com/go-openapi/swag/fileutils v0.25.4 // indirect - github.com/go-openapi/swag/jsonname v0.25.4 // indirect - github.com/go-openapi/swag/jsonutils v0.25.4 // indirect - github.com/go-openapi/swag/loading v0.25.4 // indirect - github.com/go-openapi/swag/mangling v0.25.4 // indirect - github.com/go-openapi/swag/netutils v0.25.4 // indirect - github.com/go-openapi/swag/stringutils v0.25.4 // indirect - github.com/go-openapi/swag/typeutils v0.25.4 // indirect - github.com/go-openapi/swag/yamlutils v0.25.4 // indirect + github.com/go-openapi/jsonpointer v1.0.0 // indirect + github.com/go-openapi/jsonreference v1.0.0 // indirect + github.com/go-openapi/swag v0.27.1 // indirect + github.com/go-openapi/swag/cmdutils v0.27.1 // indirect + github.com/go-openapi/swag/conv v0.27.1 // indirect + github.com/go-openapi/swag/fileutils v0.27.1 // indirect + github.com/go-openapi/swag/jsonutils v0.27.1 // indirect + github.com/go-openapi/swag/loading v0.27.1 // indirect + github.com/go-openapi/swag/mangling v0.27.1 // indirect + github.com/go-openapi/swag/netutils v0.27.1 // indirect + github.com/go-openapi/swag/pools v0.27.1 // indirect + github.com/go-openapi/swag/stringutils v0.27.1 // indirect + github.com/go-openapi/swag/typeutils v0.27.1 // indirect + github.com/go-openapi/swag/yamlutils v0.27.1 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/google/btree v1.1.3 // indirect github.com/google/gnostic-models v0.7.1 // indirect @@ -114,19 +114,19 @@ require ( golang.org/x/sys v0.47.0 // indirect golang.org/x/term v0.45.0 // indirect golang.org/x/text v0.41.0 // indirect - golang.org/x/time v0.14.0 // indirect + golang.org/x/time v0.15.0 // indirect golang.org/x/tools v0.49.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect k8s.io/cli-runtime v0.36.0 // indirect - k8s.io/component-base v0.36.4 // indirect - k8s.io/kube-openapi v0.0.0-20260603220949-865597e52e25 // indirect + k8s.io/component-base v0.37.0 // indirect + k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad // indirect k8s.io/kubectl v0.36.0 // indirect sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect sigs.k8s.io/kustomize/api v0.21.1 // indirect sigs.k8s.io/kustomize/kyaml v0.21.1 // indirect sigs.k8s.io/randfill v1.0.0 // indirect - sigs.k8s.io/structured-merge-diff/v6 v6.4.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.4.2 // indirect ) diff --git a/go.sum b/go.sum index c91cf8e539..d3e932673c 100644 --- a/go.sum +++ b/go.sum @@ -67,40 +67,40 @@ github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= -github.com/go-openapi/jsonpointer v0.22.4 h1:dZtK82WlNpVLDW2jlA1YCiVJFVqkED1MegOUy9kR5T4= -github.com/go-openapi/jsonpointer v0.22.4/go.mod h1:elX9+UgznpFhgBuaMQ7iu4lvvX1nvNsesQ3oxmYTw80= -github.com/go-openapi/jsonreference v0.21.4 h1:24qaE2y9bx/q3uRK/qN+TDwbok1NhbSmGjjySRCHtC8= -github.com/go-openapi/jsonreference v0.21.4/go.mod h1:rIENPTjDbLpzQmQWCj5kKj3ZlmEh+EFVbz3RTUh30/4= -github.com/go-openapi/swag v0.25.4 h1:OyUPUFYDPDBMkqyxOTkqDYFnrhuhi9NR6QVUvIochMU= -github.com/go-openapi/swag v0.25.4/go.mod h1:zNfJ9WZABGHCFg2RnY0S4IOkAcVTzJ6z2Bi+Q4i6qFQ= -github.com/go-openapi/swag/cmdutils v0.25.4 h1:8rYhB5n6WawR192/BfUu2iVlxqVR9aRgGJP6WaBoW+4= -github.com/go-openapi/swag/cmdutils v0.25.4/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0= -github.com/go-openapi/swag/conv v0.25.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4= -github.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU= -github.com/go-openapi/swag/fileutils v0.25.4 h1:2oI0XNW5y6UWZTC7vAxC8hmsK/tOkWXHJQH4lKjqw+Y= -github.com/go-openapi/swag/fileutils v0.25.4/go.mod h1:cdOT/PKbwcysVQ9Tpr0q20lQKH7MGhOEb6EwmHOirUk= -github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI= -github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag= -github.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA= -github.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4 h1:IACsSvBhiNJwlDix7wq39SS2Fh7lUOCJRmx/4SN4sVo= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4/go.mod h1:Mt0Ost9l3cUzVv4OEZG+WSeoHwjWLnarzMePNDAOBiM= -github.com/go-openapi/swag/loading v0.25.4 h1:jN4MvLj0X6yhCDduRsxDDw1aHe+ZWoLjW+9ZQWIKn2s= -github.com/go-openapi/swag/loading v0.25.4/go.mod h1:rpUM1ZiyEP9+mNLIQUdMiD7dCETXvkkC30z53i+ftTE= -github.com/go-openapi/swag/mangling v0.25.4 h1:2b9kBJk9JvPgxr36V23FxJLdwBrpijI26Bx5JH4Hp48= -github.com/go-openapi/swag/mangling v0.25.4/go.mod h1:6dxwu6QyORHpIIApsdZgb6wBk/DPU15MdyYj/ikn0Hg= -github.com/go-openapi/swag/netutils v0.25.4 h1:Gqe6K71bGRb3ZQLusdI8p/y1KLgV4M/k+/HzVSqT8H0= -github.com/go-openapi/swag/netutils v0.25.4/go.mod h1:m2W8dtdaoX7oj9rEttLyTeEFFEBvnAx9qHd5nJEBzYg= -github.com/go-openapi/swag/stringutils v0.25.4 h1:O6dU1Rd8bej4HPA3/CLPciNBBDwZj9HiEpdVsb8B5A8= -github.com/go-openapi/swag/stringutils v0.25.4/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0= -github.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw= -github.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE= -github.com/go-openapi/swag/yamlutils v0.25.4 h1:6jdaeSItEUb7ioS9lFoCZ65Cne1/RZtPBZ9A56h92Sw= -github.com/go-openapi/swag/yamlutils v0.25.4/go.mod h1:MNzq1ulQu+yd8Kl7wPOut/YHAAU/H6hL91fF+E2RFwc= -github.com/go-openapi/testify/enable/yaml/v2 v2.0.2 h1:0+Y41Pz1NkbTHz8NngxTuAXxEodtNSI1WG1c/m5Akw4= -github.com/go-openapi/testify/enable/yaml/v2 v2.0.2/go.mod h1:kme83333GCtJQHXQ8UKX3IBZu6z8T5Dvy5+CW3NLUUg= -github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls= -github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= +github.com/go-openapi/jsonpointer v1.0.0 h1:kR9tHqY0CtZaOPVFm622dPVNhrvYpwr4uCxgL3h1H8s= +github.com/go-openapi/jsonpointer v1.0.0/go.mod h1:Z3rw7dWu1p9IgitXCFamSlA5lmDiklEB6vkaxcNZW5Y= +github.com/go-openapi/jsonreference v1.0.0 h1:jlmTr6torcd1YgDQvSfNmRtKzYDO4FGBkrAdlAVWnpY= +github.com/go-openapi/jsonreference v1.0.0/go.mod h1:jtwdyGbJk0Xhe5Y+rwtglQP6Sb1WZST4rT32LWB+sv0= +github.com/go-openapi/swag v0.27.1 h1:VotvOLWW8q/EAxB0YdsBBGC8XYyeL1YwBj2ungAGPNg= +github.com/go-openapi/swag v0.27.1/go.mod h1:GTkJPwHfhJp6MWr4/rCh64HVI3Ofu+tcsbfjfHmTxpE= +github.com/go-openapi/swag/cmdutils v0.27.1 h1:I7sYqaWVl5mq0NEmNQkAmFDyNin9ufvMX/p2zwtQaOE= +github.com/go-openapi/swag/cmdutils v0.27.1/go.mod h1:Sm1MVFMkF6guJJ+pQqHnQA3N0j9qALV3NxzDSv6bETM= +github.com/go-openapi/swag/conv v0.27.1 h1:8wi9ZG+olmY1wXphl93EWniPtbSPkXM/feH7FgjsvrU= +github.com/go-openapi/swag/conv v0.27.1/go.mod h1:QbqMivkpKhC3g1B1GGGOJ6ANewI3S62dbzYu3Duowqs= +github.com/go-openapi/swag/fileutils v0.27.1 h1:QQqBSoi5mW4XpU85nS0mLcA+zAE6vLzrb0QkmLKf9oM= +github.com/go-openapi/swag/fileutils v0.27.1/go.mod h1:VvJFZLTZS0AI854gEQz5tk7dBESdLjiNUMSZ/th2ry8= +github.com/go-openapi/swag/jsonutils v0.27.1 h1:SVgK3i4USzCU5mibOOS/l4ea2h9UQXy7J7RNLTjuXjU= +github.com/go-openapi/swag/jsonutils v0.27.1/go.mod h1:tdlEpZqdcQ17uj6J4YdK9vd8It5qWMwjWXOs0tjpRlk= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.27.1 h1:mJu3COL9WEaZVp/Kf2PRMi7tPszPEJfSr/OO75ynCs8= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.27.1/go.mod h1:mofwUWx70wvskwESqRJ//k/9kURmCgyJl5m5Ppoh5kY= +github.com/go-openapi/swag/loading v0.27.1 h1:/DxUgDXKbBX4bcn7r9uEXfJyzN5XpiJmZplzQTjrRCY= +github.com/go-openapi/swag/loading v0.27.1/go.mod h1:jvGh3iA2+zyUUycB5fgJWzeHnhrpvGnJJM0RVE9ZShE= +github.com/go-openapi/swag/mangling v0.27.1 h1:yC9D0HyUE8gbP+BfmGx9+AA89ikwZTMjESK3OnnoaqA= +github.com/go-openapi/swag/mangling v0.27.1/go.mod h1:jtBE2+V+3pILxOR7Vgce+Cwp6A2PgZbvVqfNntbVs0w= +github.com/go-openapi/swag/netutils v0.27.1 h1:mICMFoS82F5TZ4Zy3cqmcQk+BFeCp3Uyq3Np7GI0/qU= +github.com/go-openapi/swag/netutils v0.27.1/go.mod h1:J+WYyFMLtvtCGqa6jLv+YNUmIKI3ZRQRrvfNDMoQoEQ= +github.com/go-openapi/swag/pools v0.27.1 h1:9LeadcMyb2GJCbXX5hVQDbZ2Lq9TL4dCs/nx1j5DO0E= +github.com/go-openapi/swag/pools v0.27.1/go.mod h1:kVQefhSK5RWuRe7BXsL8htgBPAMpN7HDGpGEknqugeE= +github.com/go-openapi/swag/stringutils v0.27.1 h1:ZXePZ0r2p1qSjo8tD3Un4vFj8+FqlCkczxDrJIhYUp8= +github.com/go-openapi/swag/stringutils v0.27.1/go.mod h1:lzRN95CxXmA03XcDWHLOb6nOMcxCqR5rGY0lOgsfRoM= +github.com/go-openapi/swag/typeutils v0.27.1 h1:KSTdFlfnse4r6dP9IrEnwMldjE+zs71UeEB3//PtVXc= +github.com/go-openapi/swag/typeutils v0.27.1/go.mod h1:Srm0xFNRZ1Y+vCxJclo5qzx8aj+1pAKda/YfFPrG0dQ= +github.com/go-openapi/swag/yamlutils v0.27.1 h1:ftxv6xvXb1E3zohUc+okZ9nSqNb9StQX/FXnKZ98sQA= +github.com/go-openapi/swag/yamlutils v0.27.1/go.mod h1:bnxFIB1qewGRiZHypXGZ3fNgf13/0HfRgnS/iZBDrOo= +github.com/go-openapi/testify/enable/yaml/v2 v2.6.0 h1:gGHwAJ0R/5jU8BEGDbfRNR3hL68dAVi84WuOApp29B0= +github.com/go-openapi/testify/enable/yaml/v2 v2.6.0/go.mod h1:tY+St1SGq4NFl0QIqdTY4aEdbChAHxhyB77XQi9iJCo= +github.com/go-openapi/testify/v2 v2.6.0 h1:5PKH2HE7YJ/LuRPQGvSxBRlFXNQhSetBLlGAgUEu3ug= +github.com/go-openapi/testify/v2 v2.6.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw= 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/goccy/go-yaml v1.19.2 h1:PmFC1S6h8ljIz6gMRBopkjP1TVT7xuwrButHID66PoM= @@ -264,8 +264,8 @@ golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0= golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w= golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8= golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M= -golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= -golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= +golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= +golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= golang.org/x/tools v0.49.0 h1:3NI7VXzL9+1WZD52Dx2ttoPwD5DWrFGpl9mFZDlmisI= golang.org/x/tools v0.49.0/go.mod h1:SJNXV9DBKT0UbdttsQjbfJlAE/q+y36++zo3uL3N0Oo= gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= @@ -280,26 +280,26 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.36.4 h1:RxrvqCL6vgH5/+UnTeu1IIFqYmGfy0hnyrod1rn35Oo= -k8s.io/api v0.36.4/go.mod h1:S2B3orCFBDhrgyWbLeuKcT2QdHIpQesBkCYSlWtwUOw= -k8s.io/apiextensions-apiserver v0.36.4 h1:SfvCVt+4CqKWvzuVytYDT5g9hyb9MztoiYELIkPVrFc= -k8s.io/apiextensions-apiserver v0.36.4/go.mod h1:JT9V2Ju7ys1FY4zbSpmX9XOvKB3/BwsODc4hFQEa+Xo= -k8s.io/apimachinery v0.36.4 h1:PT2UzkupGuAx/+xT5XjiMJ1WGpY3fn9/hdAvjweRet4= -k8s.io/apimachinery v0.36.4/go.mod h1:p2I2dipt7JHG+quVwQ1d02d28O4GdDi77RByQ13MTpk= +k8s.io/api v0.37.0 h1:Z//Vj9N7RA/yS2sDmxyeo7h+RR4zbUrd2vrd3Z0TbB4= +k8s.io/api v0.37.0/go.mod h1:LKXgcJWMc+f4OLbP5SFR8rulEg07zZhpi/zMULiBImk= +k8s.io/apiextensions-apiserver v0.37.0 h1:zRMQ3+/LIE5oZ0tVvXwYHC+dIkSP5cjNWju7AZU1LOI= +k8s.io/apiextensions-apiserver v0.37.0/go.mod h1:HU0PfSBwchHL5iDau6jjt9zU6ryWkDDlaVUiq91NK80= +k8s.io/apimachinery v0.37.0 h1:Np2AbDtf8x6RDHiD8T9LbKJ9gaegeVNa8yNm5FuGKm0= +k8s.io/apimachinery v0.37.0/go.mod h1:RN3nhprFSCxOi5Selxd7oMTXOe/c+ZbcE7Im+TS2zkE= k8s.io/cli-runtime v0.36.0 h1:HNxciQpQMMOKS0/GiUXcKDyA6J2FDILJj9NmP2BZrTg= k8s.io/cli-runtime v0.36.0/go.mod h1:KObkknK9Ro5LYX+1RdiKc7C8CvGg4aX+V/Zv+E8WPHA= -k8s.io/client-go v0.36.4 h1:MDvfDNvMSt0Br94SK8neviVlwL9qifw9B26hJCpD1K0= -k8s.io/client-go v0.36.4/go.mod h1:pNK4WKELbwlEDvtbE8l22lEZL5THYF61H5EealokZmA= -k8s.io/component-base v0.36.4 h1:tz75yC2xgq3kd7vPdBtR8do5iMx0OHf6Zd1kuaxDB84= -k8s.io/component-base v0.36.4/go.mod h1:DCwb306U8ou89NNAp45Csuy8ok+1rp1ELDVPhzN5AWc= +k8s.io/client-go v0.37.0 h1:nsN31fy8wBySuZ+QRnKmrjRSQLOG2rvoGN0tKd12zhQ= +k8s.io/client-go v0.37.0/go.mod h1:FcGqw+Ll/gNQiq+nPGY1Oyt9y7SgDh1d3MW3RFDEbn0= +k8s.io/component-base v0.37.0 h1:3SdSa4+itMdFTDFTeR8CxKGmSTSMXFlKL4ky8OqjguM= +k8s.io/component-base v0.37.0/go.mod h1:LjOebp4R9y6LODWZQv102ZQxGheLcDO2ZJLAw6bbh4I= k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc= k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0= -k8s.io/kube-openapi v0.0.0-20260603220949-865597e52e25 h1:mPMaPMpBij2V1Wv/fR+HW124vVGXXvOSS9ver/9yjWs= -k8s.io/kube-openapi v0.0.0-20260603220949-865597e52e25/go.mod h1:V/QaCUYDa+0QpcHhVVc5l99Uz56wEMEXBSj9oCDkNDY= +k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad h1:oXImqH8mQNk7PmvzKhmN3ddJoY6OnyM225MXwGHPm0A= +k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad/go.mod h1:0/mqHCVhlumdJ3BhCfnjSZQE037nAhNodh1/hK0T8/I= k8s.io/kubectl v0.36.0 h1:hEGr8NvIm2Wjqs2Xy48Uzmvo6lpHdGKlLyMvau2gTms= k8s.io/kubectl v0.36.0/go.mod h1:iDe8aV5BEi45W8k+5n71I2pJ/nwE0PHDu+/2cejzYoo= -k8s.io/utils v0.0.0-20260507154919-ff6756f316d2 h1:wU4tMEhLGgIbLvXQb1cfN+EcM0wf7zC6CPF+C79jroc= -k8s.io/utils v0.0.0-20260507154919-ff6756f316d2/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= +k8s.io/utils v0.0.0-20260626114624-be93311217bd h1:Ea7fgQ5we8Y9T0OX5o0dAHzQOBRI07D/dEYRaB9ZZEs= +k8s.io/utils v0.0.0-20260626114624-be93311217bd/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= sigs.k8s.io/controller-runtime v0.24.1 h1:miPEwrmirImAvgME1L9qebGHrOnGJoVmVdtOU9fRfo4= sigs.k8s.io/controller-runtime v0.24.1/go.mod h1:vFkfY5fGt5xAC/sKb8IBFKgWPNKG9OUG29dR8Y2wImw= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= @@ -310,7 +310,7 @@ sigs.k8s.io/kustomize/kyaml v0.21.1 h1:IVlbmhC076nf6foyL6Taw4BkrLuEsXUXNpsE+ScX7 sigs.k8s.io/kustomize/kyaml v0.21.1/go.mod h1:hmxADesM3yUN2vbA5z1/YTBnzLJ1dajdqpQonwBL1FQ= 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/v6 v6.4.0 h1:qmp2e3ZfFi1/jJbDGpD4mt3wyp6PE1NfKHCYLqgNQJo= -sigs.k8s.io/structured-merge-diff/v6 v6.4.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= +sigs.k8s.io/structured-merge-diff/v6 v6.4.2 h1:qdOxHwrl2Kaag1aQEarlYcOA9vSyGCp3CIki3aW8c4Q= +sigs.k8s.io/structured-merge-diff/v6 v6.4.2/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/vendor/github.com/go-openapi/jsonpointer/.cliff.toml b/vendor/github.com/go-openapi/jsonpointer/.cliff.toml deleted file mode 100644 index 702629f5dc..0000000000 --- a/vendor/github.com/go-openapi/jsonpointer/.cliff.toml +++ /dev/null @@ -1,181 +0,0 @@ -# git-cliff ~ configuration file -# https://git-cliff.org/docs/configuration - -[changelog] -header = """ -""" - -footer = """ - ------ - -**[{{ remote.github.repo }}]({{ self::remote_url() }}) license terms** - -[![License][license-badge]][license-url] - -[license-badge]: http://img.shields.io/badge/license-Apache%20v2-orange.svg -[license-url]: {{ self::remote_url() }}/?tab=Apache-2.0-1-ov-file#readme - -{%- macro remote_url() -%} - https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} -{%- endmacro -%} -""" - -body = """ -{%- if version %} -## [{{ version | trim_start_matches(pat="v") }}]({{ self::remote_url() }}/tree/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }} -{%- else %} -## [unreleased] -{%- endif %} -{%- if message %} - {%- raw %}\n{% endraw %} -{{ message }} - {%- raw %}\n{% endraw %} -{%- endif %} -{%- if version %} - {%- if previous.version %} - -**Full Changelog**: <{{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }}> - {%- endif %} -{%- else %} - {%- raw %}\n{% endraw %} -{%- endif %} - -{%- if statistics %}{% if statistics.commit_count %} - {%- raw %}\n{% endraw %} -{{ statistics.commit_count }} commits in this release. - {%- raw %}\n{% endraw %} -{%- endif %}{% endif %} ------ - -{%- for group, commits in commits | group_by(attribute="group") %} - {%- raw %}\n{% endraw %} -### {{ group | upper_first }} - {%- raw %}\n{% endraw %} - {%- for commit in commits %} - {%- if commit.remote.pr_title %} - {%- set commit_message = commit.remote.pr_title %} - {%- else %} - {%- set commit_message = commit.message %} - {%- endif %} -* {{ commit_message | split(pat="\n") | first | trim }} - {%- if commit.remote.username %} -{%- raw %} {% endraw %}by [@{{ commit.remote.username }}](https://github.com/{{ commit.remote.username }}) - {%- endif %} - {%- if commit.remote.pr_number %} -{%- raw %} {% endraw %}in [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) - {%- endif %} -{%- raw %} {% endraw %}[...]({{ self::remote_url() }}/commit/{{ commit.id }}) - {%- endfor %} -{%- endfor %} - -{%- if github %} -{%- raw %}\n{% endraw -%} - {%- set all_contributors = github.contributors | length %} - {%- if github.contributors | filter(attribute="username", value="dependabot[bot]") | length < all_contributors %} ------ - -### People who contributed to this release - {% endif %} - {%- for contributor in github.contributors | filter(attribute="username") | sort(attribute="username") %} - {%- if contributor.username != "dependabot[bot]" and contributor.username != "github-actions[bot]" %} -* [@{{ contributor.username }}](https://github.com/{{ contributor.username }}) - {%- endif %} - {%- endfor %} - - {% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} ------ - {%- raw %}\n{% endraw %} - -### New Contributors - {%- endif %} - - {%- for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} - {%- if contributor.username != "dependabot[bot]" and contributor.username != "github-actions[bot]" %} -* @{{ contributor.username }} made their first contribution - {%- if contributor.pr_number %} - in [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \ - {%- endif %} - {%- endif %} - {%- endfor %} -{%- endif %} - -{%- raw %}\n{% endraw %} - -{%- macro remote_url() -%} - https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} -{%- endmacro -%} -""" -# Remove leading and trailing whitespaces from the changelog's body. -trim = true -# Render body even when there are no releases to process. -render_always = true -# An array of regex based postprocessors to modify the changelog. -postprocessors = [ - # Replace the placeholder with a URL. - #{ pattern = '', replace = "https://github.com/orhun/git-cliff" }, -] -# output file path -# output = "test.md" - -[git] -# Parse commits according to the conventional commits specification. -# See https://www.conventionalcommits.org -conventional_commits = false -# Exclude commits that do not match the conventional commits specification. -filter_unconventional = false -# Require all commits to be conventional. -# Takes precedence over filter_unconventional. -require_conventional = false -# Split commits on newlines, treating each line as an individual commit. -split_commits = false -# An array of regex based parsers to modify commit messages prior to further processing. -commit_preprocessors = [ - # Replace issue numbers with link templates to be updated in `changelog.postprocessors`. - #{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](/issues/${2}))"}, - # Check spelling of the commit message using https://github.com/crate-ci/typos. - # If the spelling is incorrect, it will be fixed automatically. - #{ pattern = '.*', replace_command = 'typos --write-changes -' } -] -# Prevent commits that are breaking from being excluded by commit parsers. -protect_breaking_commits = false -# An array of regex based parsers for extracting data from the commit message. -# Assigns commits to groups. -# Optionally sets the commit's scope and can decide to exclude commits from further processing. -commit_parsers = [ - { message = "^[Cc]hore\\([Rr]elease\\): prepare for", skip = true }, - { message = "(^[Mm]erge)|([Mm]erge conflict)", skip = true }, - { field = "author.name", pattern = "dependabot*", group = "Updates" }, - { message = "([Ss]ecurity)|([Vv]uln)", group = "Security" }, - { body = "(.*[Ss]ecurity)|([Vv]uln)", group = "Security" }, - { message = "([Cc]hore\\(lint\\))|(style)|(lint)|(codeql)|(golangci)", group = "Code quality" }, - { message = "(^[Dd]oc)|((?i)readme)|(badge)|(typo)|(documentation)", group = "Documentation" }, - { message = "(^[Ff]eat)|(^[Ee]nhancement)", group = "Implemented enhancements" }, - { message = "(^ci)|(\\(ci\\))|(fixup\\s+ci)|(fix\\s+ci)|(license)|(example)", group = "Miscellaneous tasks" }, - { message = "^test", group = "Testing" }, - { message = "(^fix)|(panic)", group = "Fixed bugs" }, - { message = "(^refact)|(rework)", group = "Refactor" }, - { message = "(^[Pp]erf)|(performance)", group = "Performance" }, - { message = "(^[Cc]hore)", group = "Miscellaneous tasks" }, - { message = "^[Rr]evert", group = "Reverted changes" }, - { message = "(upgrade.*?go)|(go\\s+version)", group = "Updates" }, - { message = ".*", group = "Other" }, -] -# Exclude commits that are not matched by any commit parser. -filter_commits = false -# An array of link parsers for extracting external references, and turning them into URLs, using regex. -link_parsers = [] -# Include only the tags that belong to the current branch. -use_branch_tags = false -# Order releases topologically instead of chronologically. -topo_order = false -# Order releases topologically instead of chronologically. -topo_order_commits = true -# Order of commits in each group/release within the changelog. -# Allowed values: newest, oldest -sort_commits = "newest" -# Process submodules commits -recurse_submodules = false - -#[remote.github] -#owner = "go-openapi" diff --git a/vendor/github.com/go-openapi/jsonpointer/.gitignore b/vendor/github.com/go-openapi/jsonpointer/.gitignore index 59cd294891..d8f4186fe5 100644 --- a/vendor/github.com/go-openapi/jsonpointer/.gitignore +++ b/vendor/github.com/go-openapi/jsonpointer/.gitignore @@ -2,3 +2,4 @@ *.cov .idea .env +.mcp.json diff --git a/vendor/github.com/go-openapi/jsonpointer/.golangci.yml b/vendor/github.com/go-openapi/jsonpointer/.golangci.yml index fdae591bce..9d2733176e 100644 --- a/vendor/github.com/go-openapi/jsonpointer/.golangci.yml +++ b/vendor/github.com/go-openapi/jsonpointer/.golangci.yml @@ -4,7 +4,10 @@ linters: disable: - depguard - funlen + - goconst - godox + - gomodguard + - gomodguard_v2 - exhaustruct - nlreturn - nonamedreturns @@ -12,6 +15,7 @@ linters: - paralleltest - recvcheck - testpackage + - thelper - tparallel - varnamelen - whitespace diff --git a/vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md index 9322b065e3..bac878f216 100644 --- a/vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md +++ b/vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md @@ -23,7 +23,9 @@ include: Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or + advances + * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic @@ -55,7 +57,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All +reported by contacting the project team at . All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. @@ -68,7 +70,7 @@ members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] +available at [][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/jsonpointer/CONTRIBUTORS.md b/vendor/github.com/go-openapi/jsonpointer/CONTRIBUTORS.md index 03c098316d..de0bf5c04b 100644 --- a/vendor/github.com/go-openapi/jsonpointer/CONTRIBUTORS.md +++ b/vendor/github.com/go-openapi/jsonpointer/CONTRIBUTORS.md @@ -4,21 +4,22 @@ | Total Contributors | Total Contributions | | --- | --- | -| 12 | 95 | +| 13 | 132 | | Username | All Time Contribution Count | All Commits | | --- | --- | --- | -| @fredbi | 48 | https://github.com/go-openapi/jsonpointer/commits?author=fredbi | -| @casualjim | 33 | https://github.com/go-openapi/jsonpointer/commits?author=casualjim | -| @magodo | 3 | https://github.com/go-openapi/jsonpointer/commits?author=magodo | -| @youyuanwu | 3 | https://github.com/go-openapi/jsonpointer/commits?author=youyuanwu | -| @gaiaz-iusipov | 1 | https://github.com/go-openapi/jsonpointer/commits?author=gaiaz-iusipov | -| @gbjk | 1 | https://github.com/go-openapi/jsonpointer/commits?author=gbjk | -| @gordallott | 1 | https://github.com/go-openapi/jsonpointer/commits?author=gordallott | -| @ianlancetaylor | 1 | https://github.com/go-openapi/jsonpointer/commits?author=ianlancetaylor | -| @mfleader | 1 | https://github.com/go-openapi/jsonpointer/commits?author=mfleader | -| @Neo2308 | 1 | https://github.com/go-openapi/jsonpointer/commits?author=Neo2308 | -| @olivierlemasle | 1 | https://github.com/go-openapi/jsonpointer/commits?author=olivierlemasle | -| @testwill | 1 | https://github.com/go-openapi/jsonpointer/commits?author=testwill | +| @fredbi | 83 | | +| @casualjim | 33 | | +| @magodo | 3 | | +| @youyuanwu | 3 | | +| @alexandear | 2 | | +| @gaiaz-iusipov | 1 | | +| @gbjk | 1 | | +| @gordallott | 1 | | +| @ianlancetaylor | 1 | | +| @mfleader | 1 | | +| @Neo2308 | 1 | | +| @olivierlemasle | 1 | | +| @testwill | 1 | | - _this file was generated by the [Contributors GitHub Action](https://github.com/github/contributors)_ + _this file was generated by the [Contributors GitHub Action](https://github.com/github-community-projects/contributors)_ diff --git a/vendor/github.com/go-openapi/jsonpointer/NOTICE b/vendor/github.com/go-openapi/jsonpointer/NOTICE index f3b51939a9..201908d2f0 100644 --- a/vendor/github.com/go-openapi/jsonpointer/NOTICE +++ b/vendor/github.com/go-openapi/jsonpointer/NOTICE @@ -18,7 +18,7 @@ It ships with copies of other software which license terms are recalled below. The original software was authored on 25-02-2013 by sigu-399 (https://github.com/sigu-399, sigu.399@gmail.com). -github.com/sigh-399/jsonpointer +github.com/sigu-399/jsonpointer =========================== // SPDX-FileCopyrightText: Copyright 2013 sigu-399 ( https://github.com/sigu-399 ) diff --git a/vendor/github.com/go-openapi/jsonpointer/README.md b/vendor/github.com/go-openapi/jsonpointer/README.md index b61b63fd9a..6e7929c64b 100644 --- a/vendor/github.com/go-openapi/jsonpointer/README.md +++ b/vendor/github.com/go-openapi/jsonpointer/README.md @@ -8,15 +8,42 @@ [![Release][release-badge]][release-url] [![Go Report Card][gocard-badge]][gocard-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] -[![GoDoc][godoc-badge]][godoc-url] [![Slack Channel][slack-logo]![slack-badge]][slack-url] [![go version][goversion-badge]][goversion-url] ![Top language][top-badge] ![Commits since latest release][commits-badge] +[![GoDoc][godoc-badge]][godoc-url] [![Discord Channel][discord-badge]][discord-url] [![go version][goversion-badge]][goversion-url] ![Top language][top-badge] ![Commits since latest release][commits-badge] --- An implementation of JSON Pointer for golang, which supports go `struct`. +## Announcements + +* **2026-07-07** : landing v1.0.0 + * stable API pledge + +* **2026-06-29** : reinsourced external dependency to swag (v0.24.0) + * module `github.com/go-openapi/swag/jsonname` is source directly here, so we no longer have any external dependency + * `jsonname` was never really used by any other package, so it makes sense to deprecate it away from the `swag` family + and retrofit its functionality here. `jsonpointer` no longer get external dependencies, besides test dependencies. + +* **2026-04-15** : added support for trailing "-" for arrays (v0.23.0) + * this brings full support of [RFC6901][RFC6901] + * this is supported for types relying on the reflection-based implemented + * API semantics remain essentially unaltered. Exception: `Pointer.Set(document any,value any) (document any, err error)` + can only perform a best-effort to mutate the input document in place. In the case of adding elements to an array with a + trailing "-", either pass a mutable array (`*[]T`) as the input document, or use the returned updated document instead. + * types that implement the `JSONSetable` interface may not implement the mutation implied by the trailing "-" + +* **2026-04-15** : added support for optional alternate JSON name providers + * for struct support the defaults might not suit all situations: there are known limitations + when it comes to handle untagged fields or embedded types. + * the default name provider in use is not fully aligned with go JSON stdlib + * exposed an option (or global setting) to change the provider that resolves a struct into json keys + * the default behavior is not altered + ## Status -API is stable. +API is stable and feature-complete. + +The project continues to receive regular updates, bug fixes and hygiene maintenance (CI, linting, etc). ## Import this library in your project @@ -78,7 +105,7 @@ See -also known as [RFC6901](https://www.rfc-editor.org/rfc/rfc6901) +also known as [RFC6901][RFC6901]. ## Licensing @@ -89,19 +116,19 @@ on top of which it has been built. ## Limitations -The 4.Evaluation part of the previous reference, starting with 'If the currently referenced value is a JSON array, -the reference token MUST contain either...' is not implemented. - -That is because our implementation of the JSON pointer only supports explicit references to array elements: -the provision in the spec to resolve non-existent members as "the last element in the array", -using the special trailing character "-" is not implemented. +* [RFC6901][RFC6901] is now fully supported, including trailing "-" semantics for arrays (for `Set` operations). +* Default behavior: JSON name detection in go `struct`s + - Unlike go standard marshaling, untagged fields do not default to the go field name and are ignored. + - anonymous fields are not traversed if untagged + - the above limitations may be overcome by calling `UseGoNameProvider()` at initialization time. + - alternatively, users may inject the desired custom behavior for naming fields as an option. ## Other documentation * [All-time contributors](./CONTRIBUTORS.md) -* [Contributing guidelines](.github/CONTRIBUTING.md) -* [Maintainers documentation](docs/MAINTAINERS.md) -* [Code style](docs/STYLE.md) +* [Contributing guidelines][contributing-doc-site] +* [Maintainers documentation][maintainers-doc-site] +* [Code style][style-doc-site] ## Cutting a new release @@ -124,21 +151,17 @@ Maintainers can cut a new release by either: [release-badge]: https://badge.fury.io/gh/go-openapi%2Fjsonpointer.svg [release-url]: https://badge.fury.io/gh/go-openapi%2Fjsonpointer -[gomod-badge]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fjsonpointer.svg -[gomod-url]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fjsonpointer [gocard-badge]: https://goreportcard.com/badge/github.com/go-openapi/jsonpointer [gocard-url]: https://goreportcard.com/report/github.com/go-openapi/jsonpointer [codefactor-badge]: https://img.shields.io/codefactor/grade/github/go-openapi/jsonpointer [codefactor-url]: https://www.codefactor.io/repository/github/go-openapi/jsonpointer -[doc-badge]: https://img.shields.io/badge/doc-site-blue?link=https%3A%2F%2Fgoswagger.io%2Fgo-openapi%2F -[doc-url]: https://goswagger.io/go-openapi [godoc-badge]: https://pkg.go.dev/badge/github.com/go-openapi/jsonpointer [godoc-url]: http://pkg.go.dev/github.com/go-openapi/jsonpointer -[slack-logo]: https://a.slack-edge.com/e6a93c1/img/icons/favicon-32.png -[slack-badge]: https://img.shields.io/badge/slack-blue?link=https%3A%2F%2Fgoswagger.slack.com%2Farchives%2FC04R30YM -[slack-url]: https://goswagger.slack.com/archives/C04R30YMU +[discord-badge]: https://img.shields.io/discord/1446918742398341256?logo=discord&label=discord&color=blue +[discord-url]: https://discord.gg/FfnFYaC3k5 + [license-badge]: http://img.shields.io/badge/license-Apache%20v2-orange.svg [license-url]: https://github.com/go-openapi/jsonpointer/?tab=Apache-2.0-1-ov-file#readme @@ -147,3 +170,8 @@ Maintainers can cut a new release by either: [goversion-url]: https://github.com/go-openapi/jsonpointer/blob/master/go.mod [top-badge]: https://img.shields.io/github/languages/top/go-openapi/jsonpointer [commits-badge]: https://img.shields.io/github/commits-since/go-openapi/jsonpointer/latest +[RFC6901]: https://www.rfc-editor.org/rfc/rfc6901 + +[contributing-doc-site]: https://go-openapi.github.io/doc-site/contributing/contributing/index.html +[maintainers-doc-site]: https://go-openapi.github.io/doc-site/maintainers/index.html +[style-doc-site]: https://go-openapi.github.io/doc-site/contributing/style/index.html diff --git a/vendor/github.com/go-openapi/jsonpointer/SECURITY.md b/vendor/github.com/go-openapi/jsonpointer/SECURITY.md index 2a7b6f0910..1fea2c5736 100644 --- a/vendor/github.com/go-openapi/jsonpointer/SECURITY.md +++ b/vendor/github.com/go-openapi/jsonpointer/SECURITY.md @@ -6,14 +6,32 @@ This policy outlines the commitment and practices of the go-openapi maintainers | Version | Supported | | ------- | ------------------ | -| 0.22.x | :white_check_mark: | +| O.x | :white_check_mark: | + +## Vulnerability checks in place + +This repository uses automated vulnerability scans, at every merged commit and at least once a week. + +We use: + +* [`GitHub CodeQL`][codeql-url] +* [`trivy`][trivy-url] +* [`govulncheck`][govulncheck-url] + +Reports are centralized in github security reports and visible only to the maintainers. ## Reporting a vulnerability If you become aware of a security vulnerability that affects the current repository, -please report it privately to the maintainers. +**please report it privately to the maintainers** +rather than opening a publicly visible GitHub issue. + +Please follow the instructions provided by github to [Privately report a security vulnerability][github-guidance-url]. -Please follow the instructions provided by github to -[Privately report a security vulnerability](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability). +> [!NOTE] +> On Github, navigate to the project's "Security" tab then click on "Report a vulnerability". -TL;DR: on Github, navigate to the project's "Security" tab then click on "Report a vulnerability". +[codeql-url]: https://github.com/github/codeql +[trivy-url]: https://trivy.dev/docs/latest/getting-started +[govulncheck-url]: https://go.dev/blog/govulncheck +[github-guidance-url]: https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability diff --git a/vendor/github.com/go-openapi/jsonpointer/errors.go b/vendor/github.com/go-openapi/jsonpointer/errors.go index 8c50dde8bc..2ae6e3cfb3 100644 --- a/vendor/github.com/go-openapi/jsonpointer/errors.go +++ b/vendor/github.com/go-openapi/jsonpointer/errors.go @@ -16,12 +16,25 @@ const ( ErrPointer pointerError = "JSON pointer error" // ErrInvalidStart states that a JSON pointer must start with a separator ("/"). - ErrInvalidStart pointerError = `JSON pointer must be empty or start with a "` + pointerSeparator + ErrInvalidStart pointerError = `JSON pointer must be empty or start with a "` + pointerSeparator + `"` // ErrUnsupportedValueType indicates that a value of the wrong type is being set. ErrUnsupportedValueType pointerError = "only structs, pointers, maps and slices are supported for setting values" + + // ErrDashToken indicates use of the RFC 6901 "-" reference token in a context where it cannot be + // resolved. + // + // Per RFC 6901 §4 the "-" token refers to the (nonexistent) element after the last array element. + // It may only be used as the terminal token of a [Pointer.Set] against a slice, where it means + // "append". + // + // Any other use (get, offset, intermediate traversal, non-slice target) is an error condition that + // wraps this sentinel. + ErrDashToken pointerError = `the "-" array token cannot be resolved here` //nolint:gosec // G101 false positive: this is a JSON Pointer reference token, not a credential. ) +const dashToken = "-" + func errNoKey(key string) error { return fmt.Errorf("object has no key %q: %w", key, ErrPointer) } @@ -33,3 +46,15 @@ func errOutOfBounds(length, idx int) error { func errInvalidReference(token string) error { return fmt.Errorf("invalid token reference %q: %w", token, ErrPointer) } + +func errDashOnGet() error { + return fmt.Errorf("cannot resolve %q token on get: %w: %w", dashToken, ErrDashToken, ErrPointer) +} + +func errDashIntermediate() error { + return fmt.Errorf("the %q token may only appear as the terminal token of a pointer: %w: %w", dashToken, ErrDashToken, ErrPointer) +} + +func errDashOnOffset() error { + return fmt.Errorf("cannot compute offset for %q token (nonexistent element): %w: %w", dashToken, ErrDashToken, ErrPointer) +} diff --git a/vendor/github.com/go-openapi/jsonpointer/ifaces.go b/vendor/github.com/go-openapi/jsonpointer/ifaces.go new file mode 100644 index 0000000000..31359c48fa --- /dev/null +++ b/vendor/github.com/go-openapi/jsonpointer/ifaces.go @@ -0,0 +1,50 @@ +// SPDX-FileCopyrightText: Copyright (c) 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package jsonpointer + +import "reflect" + +// JSONPointable is an interface for structs to implement, when they need to customize the json +// pointer process or want to avoid the use of reflection. +type JSONPointable interface { + // JSONLookup returns a value pointed at this (unescaped) key. + JSONLookup(key string) (any, error) +} + +// JSONSetable is an interface for structs to implement, when they need to customize the json +// pointer process or want to avoid the use of reflection. +// +// # Handling of the RFC 6901 "-" token +// +// When a type implementing JSONSetable is the terminal parent of a [Pointer.Set] call, the library +// passes the raw reference token to JSONSet without interpretation. +// +// In particular, the RFC 6901 "-" token (which conventionally means "append" for arrays, per RFC +// 6902) is forwarded verbatim as the key argument. +// +// Implementations that model an array-like container are expected to give "-" the append semantics; +// implementations that do not should return an error wrapping [ErrDashToken] (or [ErrPointer]) for +// clarity. +// +// Implementations are responsible for any in-place mutation: the library does not attempt to rebind +// the result of JSONSet into a parent container. +type JSONSetable interface { + // JSONSet sets the value pointed at the (unescaped) key. + // + // The key may be the RFC 6901 "-" token when the pointer targets a slice-like member; see the + // interface documentation for details. + JSONSet(key string, value any) error +} + +// NameProvider knows how to resolve go struct fields into json names. +// +// The default provider is brought by +// [github.com/go-openapi/jsonpointer/jsonname.DefaultJSONNameProvider]. +type NameProvider interface { + // GetGoName gets the go name for a json property name + GetGoName(subject any, name string) (string, bool) + + // GetGoNameForType gets the go name for a given type for a json property name + GetGoNameForType(tpe reflect.Type, name string) (string, bool) +} diff --git a/vendor/github.com/go-openapi/swag/jsonname/doc.go b/vendor/github.com/go-openapi/jsonpointer/jsonname/doc.go similarity index 100% rename from vendor/github.com/go-openapi/swag/jsonname/doc.go rename to vendor/github.com/go-openapi/jsonpointer/jsonname/doc.go diff --git a/vendor/github.com/go-openapi/jsonpointer/jsonname/go_name_provider.go b/vendor/github.com/go-openapi/jsonpointer/jsonname/go_name_provider.go new file mode 100644 index 0000000000..5eec18fbfd --- /dev/null +++ b/vendor/github.com/go-openapi/jsonpointer/jsonname/go_name_provider.go @@ -0,0 +1,288 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package jsonname + +import ( + "reflect" + "strings" + "sync" +) + +var _ providerIface = (*GoNameProvider)(nil) + +// GoNameProvider resolves json property names to go struct field names following the same rules as +// the standard library's [encoding/json] package. +// +// Contrary to [NameProvider], it considers exported fields without a json tag, and promotes fields +// from anonymous embedded struct types. +// +// Rules (aligned with encoding/json): +// +// - unexported fields are ignored; +// - a field tagged `json:"-"` is ignored; +// - a field tagged `json:"-,"` is kept under the json name "-" (stdlib quirk); +// - a field tagged `json:""` or with no json tag at all keeps its Go name as json name; +// - anonymous struct fields without an explicit json tag have their fields +// promoted into the parent, following breadth-first depth rules: +// a shallower field wins over a deeper one; at equal depth, a conflict +// discards all conflicting fields unless exactly one has an explicit json tag. +// +// This type is safe for concurrent use. +type GoNameProvider struct { + lock sync.Mutex + index map[reflect.Type]nameIndex +} + +// NewGoNameProvider creates a new [GoNameProvider]. +func NewGoNameProvider() *GoNameProvider { + return &GoNameProvider{ + index: make(map[reflect.Type]nameIndex), + } +} + +// GetJSONNames gets all the json property names for a type. +func (n *GoNameProvider) GetJSONNames(subject any) []string { + n.lock.Lock() + defer n.lock.Unlock() + + tpe := reflect.Indirect(reflect.ValueOf(subject)).Type() + names := n.nameIndexFor(tpe) + + res := make([]string, 0, len(names.jsonNames)) + for k := range names.jsonNames { + res = append(res, k) + } + + return res +} + +// GetJSONName gets the json name for a go property name. +func (n *GoNameProvider) GetJSONName(subject any, name string) (string, bool) { + tpe := reflect.Indirect(reflect.ValueOf(subject)).Type() + + return n.GetJSONNameForType(tpe, name) +} + +// GetJSONNameForType gets the json name for a go property name on a given type. +func (n *GoNameProvider) GetJSONNameForType(tpe reflect.Type, name string) (string, bool) { + n.lock.Lock() + defer n.lock.Unlock() + + names := n.nameIndexFor(tpe) + nme, ok := names.goNames[name] + + return nme, ok +} + +// GetGoName gets the go name for a json property name. +func (n *GoNameProvider) GetGoName(subject any, name string) (string, bool) { + tpe := reflect.Indirect(reflect.ValueOf(subject)).Type() + + return n.GetGoNameForType(tpe, name) +} + +// GetGoNameForType gets the go name for a given type for a json property name. +func (n *GoNameProvider) GetGoNameForType(tpe reflect.Type, name string) (string, bool) { + n.lock.Lock() + defer n.lock.Unlock() + + names := n.nameIndexFor(tpe) + nme, ok := names.jsonNames[name] + + return nme, ok +} + +func (n *GoNameProvider) nameIndexFor(tpe reflect.Type) nameIndex { + if names, ok := n.index[tpe]; ok { + return names + } + + names := buildGoNameIndex(tpe) + n.index[tpe] = names + + return names +} + +// fieldEntry captures a candidate field discovered while walking a struct along with the +// indirection path from the root type (used to resolve conflicts by depth in the same way +// encoding/json does). +type fieldEntry struct { + goName string + jsonName string + index []int + tagged bool +} + +func buildGoNameIndex(tpe reflect.Type) nameIndex { + fields := collectGoFields(tpe) + + idx := make(map[string]string, len(fields)) + reverseIdx := make(map[string]string, len(fields)) + for _, f := range fields { + idx[f.jsonName] = f.goName + reverseIdx[f.goName] = f.jsonName + } + + return nameIndex{jsonNames: idx, goNames: reverseIdx} +} + +// collectGoFields walks tpe breadth-first along anonymous struct fields, +// reproducing the field selection performed by encoding/json.typeFields. +// +//nolint:gocognit // everything is inlined to help the compiler determine what escapes and what doesn't +func collectGoFields(tpe reflect.Type) []fieldEntry { + if tpe.Kind() != reflect.Struct { + return nil + } + + type queued struct { + typ reflect.Type + index []int + } + + current := []queued{} + next := []queued{{typ: tpe}} + visited := map[reflect.Type]bool{tpe: true} + + var ( + candidates []fieldEntry + count = map[string]int{} + nextCount = map[string]int{} + ) + + for len(next) > 0 { + current, next = next, current[:0] + count, nextCount = nextCount, count + for k := range nextCount { + delete(nextCount, k) + } + + for _, q := range current { + for i := range q.typ.NumField() { + sf := q.typ.Field(i) + + if sf.Anonymous { + ft := sf.Type + if ft.Kind() == reflect.Pointer { + ft = ft.Elem() + } + if !sf.IsExported() && ft.Kind() != reflect.Struct { + continue + } + } else if !sf.IsExported() { + continue + } + + tag := sf.Tag.Get("json") + if tag == "-" { + continue + } + jsonName, _ := parseJSONTag(tag) + tagged := jsonName != "" + + ft := sf.Type + if ft.Kind() == reflect.Pointer { + ft = ft.Elem() + } + + if sf.Anonymous && ft.Kind() == reflect.Struct && !tagged { + if visited[ft] { + continue + } + visited[ft] = true + + index := make([]int, len(q.index)+1) + copy(index, q.index) + index[len(q.index)] = i + next = append(next, queued{typ: ft, index: index}) + + continue + } + + name := jsonName + if name == "" { + name = sf.Name + } + + index := make([]int, len(q.index)+1) + copy(index, q.index) + index[len(q.index)] = i + + candidates = append(candidates, fieldEntry{ + goName: sf.Name, + jsonName: name, + index: index, + tagged: tagged, + }) + nextCount[name]++ + } + } + } + + return dominantFields(candidates) +} + +// dominantFields applies the Go encoding/json conflict resolution rules: at each JSON name, the +// shallowest field wins; at equal depth, a uniquely tagged candidate wins; otherwise all candidates +// for that name are dropped. +func dominantFields(candidates []fieldEntry) []fieldEntry { + byName := make(map[string][]fieldEntry, len(candidates)) + for _, c := range candidates { + byName[c.jsonName] = append(byName[c.jsonName], c) + } + + out := make([]fieldEntry, 0, len(byName)) + for _, group := range byName { + if len(group) == 1 { + out = append(out, group[0]) + + continue + } + + minDepth := len(group[0].index) + for _, c := range group[1:] { + if len(c.index) < minDepth { + minDepth = len(c.index) + } + } + + var shallow []fieldEntry + for _, c := range group { + if len(c.index) == minDepth { + shallow = append(shallow, c) + } + } + + if len(shallow) == 1 { + out = append(out, shallow[0]) + + continue + } + + var tagged []fieldEntry + for _, c := range shallow { + if c.tagged { + tagged = append(tagged, c) + } + } + if len(tagged) == 1 { + out = append(out, tagged[0]) + } + } + + return out +} + +// parseJSONTag returns the name component of a json struct tag and whether it carried any non-name +// option (kept for future-proofing, e.g. "omitempty"). +func parseJSONTag(tag string) (string, string) { + if tag == "" { + return "", "" + } + if before, after, ok := strings.Cut(tag, ","); ok { + return before, after + } + + return tag, "" +} diff --git a/vendor/github.com/go-openapi/jsonpointer/jsonname/ifaces.go b/vendor/github.com/go-openapi/jsonpointer/jsonname/ifaces.go new file mode 100644 index 0000000000..64871f0d27 --- /dev/null +++ b/vendor/github.com/go-openapi/jsonpointer/jsonname/ifaces.go @@ -0,0 +1,16 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package jsonname + +import "reflect" + +// providerIface is an unexported compile-time contract that every name provider in this package is +// expected to satisfy. +// +// It mirrors the interface declared by the main consumer of this module: +// [github.com/go-openapi/jsonpointer.NameProvider]. +type providerIface interface { + GetGoName(subject any, name string) (string, bool) + GetGoNameForType(tpe reflect.Type, name string) (string, bool) +} diff --git a/vendor/github.com/go-openapi/swag/jsonname/name_provider.go b/vendor/github.com/go-openapi/jsonpointer/jsonname/name_provider.go similarity index 82% rename from vendor/github.com/go-openapi/swag/jsonname/name_provider.go rename to vendor/github.com/go-openapi/jsonpointer/jsonname/name_provider.go index 8eaf1bece8..1bec2406b5 100644 --- a/vendor/github.com/go-openapi/swag/jsonname/name_provider.go +++ b/vendor/github.com/go-openapi/jsonpointer/jsonname/name_provider.go @@ -10,10 +10,12 @@ import ( ) // DefaultJSONNameProvider is the default cache for types. -var DefaultJSONNameProvider = NewNameProvider() +var DefaultJSONNameProvider = NewNameProvider() //nolint:gochecknoglobals // default settings, for backward compatible package-level settings -// NameProvider represents an object capable of translating from go property names -// to json property names. +var _ providerIface = (*NameProvider)(nil) + +// NameProvider represents an object capable of translating from go property names to json property +// names. // // This type is thread-safe. // @@ -28,7 +30,7 @@ type nameIndex struct { goNames map[string]string } -// NewNameProvider creates a new name provider +// NewNameProvider creates a new name provider. func NewNameProvider() *NameProvider { return &NameProvider{ lock: &sync.Mutex{}, @@ -37,7 +39,7 @@ func NewNameProvider() *NameProvider { } func buildnameIndex(tpe reflect.Type, idx, reverseIdx map[string]string) { - for i := 0; i < tpe.NumField(); i++ { + for i := range tpe.NumField() { targetDes := tpe.Field(i) if targetDes.PkgPath != "" { // unexported @@ -71,14 +73,14 @@ func buildnameIndex(tpe reflect.Type, idx, reverseIdx map[string]string) { } func newNameIndex(tpe reflect.Type) nameIndex { - var idx = make(map[string]string, tpe.NumField()) - var reverseIdx = make(map[string]string, tpe.NumField()) + idx := make(map[string]string, tpe.NumField()) + reverseIdx := make(map[string]string, tpe.NumField()) buildnameIndex(tpe, idx, reverseIdx) return nameIndex{jsonNames: idx, goNames: reverseIdx} } -// GetJSONNames gets all the json property names for a type +// GetJSONNames gets all the json property names for a type. func (n *NameProvider) GetJSONNames(subject any) []string { n.lock.Lock() defer n.lock.Unlock() @@ -95,13 +97,13 @@ func (n *NameProvider) GetJSONNames(subject any) []string { return res } -// GetJSONName gets the json name for a go property name +// GetJSONName gets the json name for a go property name. func (n *NameProvider) GetJSONName(subject any, name string) (string, bool) { tpe := reflect.Indirect(reflect.ValueOf(subject)).Type() return n.GetJSONNameForType(tpe, name) } -// GetJSONNameForType gets the json name for a go property name on a given type +// GetJSONNameForType gets the json name for a go property name on a given type. func (n *NameProvider) GetJSONNameForType(tpe reflect.Type, name string) (string, bool) { n.lock.Lock() defer n.lock.Unlock() @@ -113,13 +115,13 @@ func (n *NameProvider) GetJSONNameForType(tpe reflect.Type, name string) (string return nme, ok } -// GetGoName gets the go name for a json property name +// GetGoName gets the go name for a json property name. func (n *NameProvider) GetGoName(subject any, name string) (string, bool) { tpe := reflect.Indirect(reflect.ValueOf(subject)).Type() return n.GetGoNameForType(tpe, name) } -// GetGoNameForType gets the go name for a given type for a json property name +// GetGoNameForType gets the go name for a given type for a json property name. func (n *NameProvider) GetGoNameForType(tpe reflect.Type, name string) (string, bool) { n.lock.Lock() defer n.lock.Unlock() diff --git a/vendor/github.com/go-openapi/jsonpointer/options.go b/vendor/github.com/go-openapi/jsonpointer/options.go new file mode 100644 index 0000000000..223c1e5ff0 --- /dev/null +++ b/vendor/github.com/go-openapi/jsonpointer/options.go @@ -0,0 +1,85 @@ +// SPDX-FileCopyrightText: Copyright (c) 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package jsonpointer + +import ( + "sync" + + "github.com/go-openapi/jsonpointer/jsonname" +) + +// Option to tune the behavior of a JSON [Pointer]. +type Option func(*options) + +var ( + //nolint:gochecknoglobals // package level defaults are provided as a convenient, backward-compatible way to adopt options. + defaultOptions = options{ + provider: jsonname.DefaultJSONNameProvider, + } + //nolint:gochecknoglobals // guards defaultOptions against concurrent SetDefaultNameProvider / read races (testing) + defaultOptionsMu sync.RWMutex +) + +// SetDefaultNameProvider sets the [NameProvider] as a package-level default. +// +// By default, the default provider is [jsonname.DefaultJSONNameProvider]. +// +// It is safe to call concurrently with [Pointer.Get], [Pointer.Set], [GetForToken] and +// [SetForToken]. +// The typical usage is to call it once at initialization time. +// +// A nil provider is ignored. +func SetDefaultNameProvider(provider NameProvider) { + if provider == nil { + return + } + + defaultOptionsMu.Lock() + defer defaultOptionsMu.Unlock() + + defaultOptions.provider = provider +} + +// UseGoNameProvider sets the [NameProvider] as a package-level default to the alternative provider +// [jsonname.GoNameProvider], that covers a few areas not supported by the default name provider. +// +// This implementation supports untagged exported fields and embedded types in go struct. +// It follows strictly the behavior of the JSON standard library regarding field naming conventions. +// +// It is safe to call concurrently with [Pointer.Get], [Pointer.Set], [GetForToken] and +// [SetForToken]. +// The typical usage is to call it once at initialization time. +func UseGoNameProvider() { + SetDefaultNameProvider(jsonname.NewGoNameProvider()) +} + +// DefaultNameProvider returns the current package-level [NameProvider]. +func DefaultNameProvider() NameProvider { //nolint:ireturn // returning the interface is the point — callers pick their own implementation. + defaultOptionsMu.RLock() + defer defaultOptionsMu.RUnlock() + + return defaultOptions.provider +} + +// WithNameProvider injects a custom [NameProvider] to resolve json names from go struct types. +func WithNameProvider(provider NameProvider) Option { + return func(o *options) { + o.provider = provider + } +} + +type options struct { + provider NameProvider +} + +func optionsWithDefaults(opts []Option) options { + var o options + o.provider = DefaultNameProvider() + + for _, apply := range opts { + apply(&o) + } + + return o +} diff --git a/vendor/github.com/go-openapi/jsonpointer/pointer.go b/vendor/github.com/go-openapi/jsonpointer/pointer.go index 7df49af3b9..05fc863ee6 100644 --- a/vendor/github.com/go-openapi/jsonpointer/pointer.go +++ b/vendor/github.com/go-openapi/jsonpointer/pointer.go @@ -11,8 +11,6 @@ import ( "reflect" "strconv" "strings" - - "github.com/go-openapi/swag/jsonname" ) const ( @@ -20,20 +18,6 @@ const ( pointerSeparator = `/` ) -// JSONPointable is an interface for structs to implement, -// when they need to customize the json pointer process or want to avoid the use of reflection. -type JSONPointable interface { - // JSONLookup returns a value pointed at this (unescaped) key. - JSONLookup(key string) (any, error) -} - -// JSONSetable is an interface for structs to implement, -// when they need to customize the json pointer process or want to avoid the use of reflection. -type JSONSetable interface { - // JSONSet sets the value pointed at the (unescaped) key. - JSONSet(key string, value any) error -} - // Pointer is a representation of a json pointer. // // Use [Pointer.Get] to retrieve a value or [Pointer.Set] to set a value. @@ -41,7 +25,7 @@ type JSONSetable interface { // It works with any go type interpreted as a JSON document, which means: // // - if a type implements [JSONPointable], its [JSONPointable.JSONLookup] method is used to resolve [Pointer.Get] -// - if a type implements [JSONSetable], its [JSONPointable.JSONSet] method is used to resolve [Pointer.Set] +// - if a type implements [JSONSetable], its [JSONSetable.JSONSet] method is used to resolve [Pointer.Set] // - a go map[K]V is interpreted as an object, with type K assignable to a string // - a go slice []T is interpreted as an array // - a go struct is interpreted as an object, with exported fields interpreted as keys @@ -50,7 +34,8 @@ type JSONSetable interface { // // For struct s resolved by reflection, key mappings honor the conventional struct tag `json`. // -// Fields that do not specify a `json` tag, or specify an empty one, or are tagged as `json:"-"` are ignored. +// Fields that do not specify a `json` tag, or specify an empty one, or are tagged as `json:"-"` are +// ignored. // // # Limitations // @@ -71,16 +56,36 @@ func New(jsonPointerString string) (Pointer, error) { // Get uses the pointer to retrieve a value from a JSON document. // // It returns the value with its type as a [reflect.Kind] or an error. -func (p *Pointer) Get(document any) (any, reflect.Kind, error) { - return p.get(document, jsonname.DefaultJSONNameProvider) +func (p *Pointer) Get(document any, opts ...Option) (any, reflect.Kind, error) { + o := optionsWithDefaults(opts) + + return p.get(document, o.provider) } -// Set uses the pointer to set a value from a data type -// that represent a JSON document. +// Set uses the pointer to set a value from a data type that represent a JSON document. +// +// # Mutation contract // -// It returns the updated document. -func (p *Pointer) Set(document any, value any) (any, error) { - return document, p.set(document, value, jsonname.DefaultJSONNameProvider) +// Set mutates the provided document in place whenever Go's type system allows it: when document is +// a map, a pointer, or when the targeted value is reached through an addressable ancestor (e.g. a +// struct field traversed via a pointer, a slice element). +// +// Callers that rely on this in-place behavior may continue to ignore the returned document. +// +// The returned document is only load-bearing when Set cannot mutate in place. +// +// This happens in one specific case: appending to a top-level slice passed by value (e.g. document +// of type []T rather than *[]T) via the RFC 6901 "-" terminal token. reflect.Append produces a new +// slice header that the library cannot rebind into the caller's variable; the updated document is +// returned instead. +// +// Pass *[]T if you want in-place rebind for that case as well. +// +// See [ErrDashToken] for the semantics of the "-" token. +func (p *Pointer) Set(document any, value any, opts ...Option) (any, error) { + o := optionsWithDefaults(opts) + + return p.set(document, value, o.provider) } // DecodedTokens returns the decoded (unescaped) tokens of this JSON pointer. @@ -109,6 +114,46 @@ func (p *Pointer) String() string { return pointerSeparator + strings.Join(p.referenceTokens, pointerSeparator) } +// Offset returns the byte offset, in the raw JSON text of document, of the location referenced by +// this pointer's terminal token. +// +// Unlike [Pointer.Get] and [Pointer.Set], which operate on a decoded Go value, Offset operates +// directly on the textual JSON source. +// +// It drives an [encoding/json.Decoder] over the string and stops at the terminal token, returning +// the position at which the decoder was about to read that token. +// +// It is primarily intended for tooling that needs to map a pointer back to a region of the original +// source: reporting line/column for validation or parse diagnostics, extracting a sub-document by +// slicing the raw bytes, or highlighting the referenced span in an editor. +// +// # Offset semantics +// +// The meaning of the returned offset depends on whether the terminal token addresses an object +// property or an array element: +// +// - Object property: the offset points to the first byte of the key (its +// opening quote character), not to the associated value. For example, +// pointer "/foo/bar" against {"foo": {"bar": 21}} returns 9, the index of +// the opening quote of "bar". +// - Array element: the offset points to the first byte of the value at that +// index. For example, pointer "/0/1" against [[1,2], [3,4]] returns 4, +// the index of the digit 2. +// +// # Errors +// +// Offset returns an error in any of these cases: +// +// - document is not syntactically valid JSON; +// - the structure of document does not match the pointer (e.g. traversing +// into a scalar, or a token that is neither a valid key nor a valid +// numeric index); +// - a referenced key or index does not exist in document; +// - the pointer's terminal token is the RFC 6901 "-" array token, which +// designates a nonexistent element and therefore has no offset in the +// source. The returned error wraps [ErrDashToken]. +// +// All errors wrap [ErrPointer]. func (p *Pointer) Offset(document string) (int64, error) { dec := json.NewDecoder(strings.NewReader(document)) var offset int64 @@ -137,7 +182,34 @@ func (p *Pointer) Offset(document string) (int64, error) { return 0, fmt.Errorf("invalid token %#v: %w", tk, ErrPointer) } } - return offset, nil + return skipJSONSeparator(document, offset), nil +} + +// skipJSONSeparator advances offset past trailing JSON whitespace and at most one value separator +// (comma) in document, so the result points at the first byte of the next JSON token. +// +// The streaming decoder's InputOffset sits right after the most recently consumed token, which +// between values is the comma (or whitespace) — not the following token. +// +// Normalizing here keeps Offset's contract uniform: for both object keys and array elements, and +// regardless of position within the parent container, the returned offset always points at the +// first byte of the addressed token. +func skipJSONSeparator(document string, offset int64) int64 { + n := int64(len(document)) + for offset < n && isJSONWhitespace(document[offset]) { + offset++ + } + if offset < n && document[offset] == ',' { + offset++ + } + for offset < n && isJSONWhitespace(document[offset]) { + offset++ + } + return offset +} + +func isJSONWhitespace(c byte) bool { + return c == ' ' || c == '\t' || c == '\n' || c == '\r' } // "Constructor", parses the given string JSON pointer. @@ -157,9 +229,9 @@ func (p *Pointer) parse(jsonPointerString string) error { return nil } -func (p *Pointer) get(node any, nameProvider *jsonname.NameProvider) (any, reflect.Kind, error) { +func (p *Pointer) get(node any, nameProvider NameProvider) (any, reflect.Kind, error) { if nameProvider == nil { - nameProvider = jsonname.DefaultJSONNameProvider + nameProvider = defaultOptions.provider } kind := reflect.Invalid @@ -185,50 +257,128 @@ func (p *Pointer) get(node any, nameProvider *jsonname.NameProvider) (any, refle return node, kind, nil } -func (p *Pointer) set(node, data any, nameProvider *jsonname.NameProvider) error { +func (p *Pointer) set(node, data any, nameProvider NameProvider) (any, error) { knd := reflect.ValueOf(node).Kind() if knd != reflect.Pointer && knd != reflect.Struct && knd != reflect.Map && knd != reflect.Slice && knd != reflect.Array { - return errors.Join( + return node, errors.Join( fmt.Errorf("unexpected type: %T", node), //nolint:err113 // err wrapping is carried out by errors.Join, not fmt.Errorf. ErrUnsupportedValueType, ErrPointer, ) } - l := len(p.referenceTokens) - // full document when empty - if l == 0 { - return nil + if len(p.referenceTokens) == 0 { + return node, nil } if nameProvider == nil { - nameProvider = jsonname.DefaultJSONNameProvider + nameProvider = defaultOptions.provider } - var decodedToken string - lastIndex := l - 1 + return p.setAt(node, p.referenceTokens, data, nameProvider) +} - if lastIndex > 0 { // skip if we only have one token in pointer - for _, token := range p.referenceTokens[:lastIndex] { - decodedToken = Unescape(token) - next, err := p.resolveNodeForToken(node, decodedToken, nameProvider) - if err != nil { - return err - } +// setAt recursively walks the token list, setting the data at the terminal token and rebinding any +// new child reference (e.g. a slice header returned by an "-" append) into its parent on the way +// back up. +// +// Returning the (possibly new) node at each level is what makes append work at any depth without +// requiring the caller to pass a pointer to the containing slice: the new slice header propagates +// up and each parent rebinds it via the appropriate kind-specific setter. +func (p *Pointer) setAt(node any, tokens []string, data any, nameProvider NameProvider) (any, error) { + decodedToken := Unescape(tokens[0]) + + if len(tokens) == 1 { + return setSingleImpl(node, data, decodedToken, nameProvider) + } - node = next - } + child, err := p.resolveNodeForToken(node, decodedToken, nameProvider) + if err != nil { + return node, err } - // last token - decodedToken = Unescape(p.referenceTokens[lastIndex]) + newChild, err := p.setAt(child, tokens[1:], data, nameProvider) + if err != nil { + return node, err + } - return setSingleImpl(node, data, decodedToken, nameProvider) + return rebindChild(node, decodedToken, newChild, nameProvider) } -func (p *Pointer) resolveNodeForToken(node any, decodedToken string, nameProvider *jsonname.NameProvider) (next any, err error) { +// rebindChild writes newChild back into node at decodedToken. +// +// For cases where the child was already mutated in place (pointer aliasing, addressable slice +// elements) the rebind is a safe no-op. +// +// For cases where the child was returned by value (map entries holding a slice, slices reached +// through a non-addressable ancestor), the rebind propagates the new value into the parent. +// +// Parents implementing [JSONPointable] are left alone: they took ownership of the child via +// JSONLookup and did not opt into a JSONSet-based rebind on intermediate tokens. +func rebindChild(node any, decodedToken string, newChild any, nameProvider NameProvider) (any, error) { + if _, ok := node.(JSONPointable); ok { + return node, nil + } + + rValue := reflect.Indirect(reflect.ValueOf(node)) + + switch rValue.Kind() { + case reflect.Struct: + nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) + if !ok { + return node, fmt.Errorf("object has no field %q: %w", decodedToken, ErrPointer) + } + fld := rValue.FieldByName(nm) + if !fld.CanSet() { + return node, nil + } + assignReflectValue(fld, newChild) + return node, nil + + case reflect.Map: + rValue.SetMapIndex(reflect.ValueOf(decodedToken), reflect.ValueOf(newChild)) + return node, nil + + case reflect.Slice: + if decodedToken == dashToken { + return node, errDashIntermediate() + } + idx, err := strconv.Atoi(decodedToken) + if err != nil { + return node, errors.Join(err, ErrPointer) + } + elem := rValue.Index(idx) + if !elem.CanSet() { + return node, nil + } + assignReflectValue(elem, newChild) + return node, nil + + default: + return node, errInvalidReference(decodedToken) + } +} + +// assignReflectValue assigns src into dst, unwrapping a pointer when dst expects the pointee type. +// +// This tolerates the pointer-wrapping performed by [typeFromValue] for addressable fields. +func assignReflectValue(dst reflect.Value, src any) { + nv := reflect.ValueOf(src) + if !nv.IsValid() { + return + } + if nv.Type().AssignableTo(dst.Type()) { + dst.Set(nv) + return + } + if nv.Kind() == reflect.Pointer && nv.Elem().Type().AssignableTo(dst.Type()) { + dst.Set(nv.Elem()) + } +} + +func (p *Pointer) resolveNodeForToken(node any, decodedToken string, nameProvider NameProvider) (next any, err error) { // check for nil during traversal if isNil(node) { return nil, fmt.Errorf("cannot traverse through nil value at %q: %w", decodedToken, ErrPointer) @@ -272,6 +422,9 @@ func (p *Pointer) resolveNodeForToken(node any, decodedToken string, nameProvide return typeFromValue(mv), nil case reflect.Slice: + if decodedToken == dashToken { + return nil, errDashIntermediate() + } tokenIndex, err := strconv.Atoi(decodedToken) if err != nil { return nil, errors.Join(err, ErrPointer) @@ -312,16 +465,23 @@ func typeFromValue(v reflect.Value) any { } // GetForToken gets a value for a json pointer token 1 level deep. -func GetForToken(document any, decodedToken string) (any, reflect.Kind, error) { - return getSingleImpl(document, decodedToken, jsonname.DefaultJSONNameProvider) +func GetForToken(document any, decodedToken string, opts ...Option) (any, reflect.Kind, error) { + o := optionsWithDefaults(opts) + + return getSingleImpl(document, decodedToken, o.provider) } // SetForToken sets a value for a json pointer token 1 level deep. -func SetForToken(document any, decodedToken string, value any) (any, error) { - return document, setSingleImpl(document, value, decodedToken, jsonname.DefaultJSONNameProvider) +// +// See [Pointer.Set] for the mutation contract, in particular the handling of the RFC 6901 "-" token +// on slices. +func SetForToken(document any, decodedToken string, value any, opts ...Option) (any, error) { + o := optionsWithDefaults(opts) + + return setSingleImpl(document, value, decodedToken, o.provider) } -func getSingleImpl(node any, decodedToken string, nameProvider *jsonname.NameProvider) (any, reflect.Kind, error) { +func getSingleImpl(node any, decodedToken string, nameProvider NameProvider) (any, reflect.Kind, error) { rValue := reflect.Indirect(reflect.ValueOf(node)) kind := rValue.Kind() if isNil(node) { @@ -361,6 +521,9 @@ func getSingleImpl(node any, decodedToken string, nameProvider *jsonname.NamePro return nil, kind, errNoKey(decodedToken) case reflect.Slice: + if decodedToken == dashToken { + return nil, kind, errDashOnGet() + } tokenIndex, err := strconv.Atoi(decodedToken) if err != nil { return nil, kind, errors.Join(err, ErrPointer) @@ -378,14 +541,14 @@ func getSingleImpl(node any, decodedToken string, nameProvider *jsonname.NamePro } } -func setSingleImpl(node, data any, decodedToken string, nameProvider *jsonname.NameProvider) error { +func setSingleImpl(node, data any, decodedToken string, nameProvider NameProvider) (any, error) { // check for nil to prevent panic when calling rValue.Type() if isNil(node) { - return fmt.Errorf("cannot set field %q on nil value: %w", decodedToken, ErrPointer) + return node, fmt.Errorf("cannot set field %q on nil value: %w", decodedToken, ErrPointer) } if ns, ok := node.(JSONSetable); ok { - return ns.JSONSet(decodedToken, data) + return node, ns.JSONSet(decodedToken, data) } rValue := reflect.Indirect(reflect.ValueOf(node)) @@ -394,12 +557,12 @@ func setSingleImpl(node, data any, decodedToken string, nameProvider *jsonname.N case reflect.Struct: nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) if !ok { - return fmt.Errorf("object has no field %q: %w", decodedToken, ErrPointer) + return node, fmt.Errorf("object has no field %q: %w", decodedToken, ErrPointer) } fld := rValue.FieldByName(nm) if !fld.CanSet() { - return fmt.Errorf("can't set struct field %s to %v: %w", nm, data, ErrPointer) + return node, fmt.Errorf("can't set struct field %s to %v: %w", nm, data, ErrPointer) } value := reflect.ValueOf(data) @@ -407,33 +570,51 @@ func setSingleImpl(node, data any, decodedToken string, nameProvider *jsonname.N assignedType := fld.Type() if !valueType.AssignableTo(assignedType) { - return fmt.Errorf("can't set value with type %T to field %s with type %v: %w", data, nm, assignedType, ErrPointer) + return node, fmt.Errorf("can't set value with type %T to field %s with type %v: %w", data, nm, assignedType, ErrPointer) } fld.Set(value) - return nil + return node, nil case reflect.Map: kv := reflect.ValueOf(decodedToken) rValue.SetMapIndex(kv, reflect.ValueOf(data)) - return nil + return node, nil case reflect.Slice: + if decodedToken == dashToken { + // RFC 6901 §4 / RFC 6902 append semantics: terminal "-" appends the value to the slice. + // + // We rebind in place when the slice is reachable via an addressable ancestor; otherwise we + // return the new slice header for the parent (or the public Set) to rebind. + value := reflect.ValueOf(data) + elemType := rValue.Type().Elem() + if !value.Type().AssignableTo(elemType) { + return node, fmt.Errorf("can't append value of type %T to slice of %v: %w", data, elemType, ErrPointer) + } + newSlice := reflect.Append(rValue, value) + if rValue.CanSet() { + rValue.Set(newSlice) + return node, nil + } + return newSlice.Interface(), nil + } + tokenIndex, err := strconv.Atoi(decodedToken) if err != nil { - return errors.Join(err, ErrPointer) + return node, errors.Join(err, ErrPointer) } sLength := rValue.Len() if tokenIndex < 0 || tokenIndex >= sLength { - return errOutOfBounds(sLength, tokenIndex) + return node, errOutOfBounds(sLength, tokenIndex) } elem := rValue.Index(tokenIndex) if !elem.CanSet() { - return fmt.Errorf("can't set slice index %s to %v: %w", decodedToken, data, ErrPointer) + return node, fmt.Errorf("can't set slice index %s to %v: %w", decodedToken, data, ErrPointer) } value := reflect.ValueOf(data) @@ -441,15 +622,15 @@ func setSingleImpl(node, data any, decodedToken string, nameProvider *jsonname.N assignedType := elem.Type() if !valueType.AssignableTo(assignedType) { - return fmt.Errorf("can't set value with type %T to slice element %d with type %v: %w", data, tokenIndex, assignedType, ErrPointer) + return node, fmt.Errorf("can't set value with type %T to slice element %d with type %v: %w", data, tokenIndex, assignedType, ErrPointer) } elem.Set(value) - return nil + return node, nil default: - return errInvalidReference(decodedToken) + return node, errInvalidReference(decodedToken) } } @@ -460,24 +641,27 @@ func offsetSingleObject(dec *json.Decoder, decodedToken string) (int64, error) { if err != nil { return 0, err } - switch tk := tk.(type) { - case json.Delim: - switch tk { - case '{': - if err = drainSingle(dec); err != nil { - return 0, err - } - case '[': + key, ok := tk.(string) + if !ok { + return 0, fmt.Errorf("invalid key token %#v: %w", tk, ErrPointer) + } + if key == decodedToken { + return offset, nil + } + + // Consume the associated value. + // Scalars are fully read by a single Token() call; composite values must be drained. + tk, err = dec.Token() + if err != nil { + return 0, err + } + if delim, isDelim := tk.(json.Delim); isDelim { + switch delim { + case '{', '[': if err = drainSingle(dec); err != nil { return 0, err } } - case string: - if tk == decodedToken { - return offset, nil - } - default: - return 0, fmt.Errorf("invalid token %#v: %w", tk, ErrPointer) } } @@ -485,6 +669,9 @@ func offsetSingleObject(dec *json.Decoder, decodedToken string) (int64, error) { } func offsetSingleArray(dec *json.Decoder, decodedToken string) (int64, error) { + if decodedToken == dashToken { + return 0, errDashOnOffset() + } idx, err := strconv.Atoi(decodedToken) if err != nil { return 0, fmt.Errorf("token reference %q is not a number: %w: %w", decodedToken, err, ErrPointer) @@ -548,10 +735,7 @@ func drainSingle(dec *json.Decoder) error { return nil } -// JSON pointer encoding: -// ~0 => ~ -// ~1 => / -// ... and vice versa +// JSON pointer encoding: ~0 => ~ ~1 => / ... and vice versa. const ( encRefTok0 = `~0` diff --git a/vendor/github.com/go-openapi/jsonreference/.cliff.toml b/vendor/github.com/go-openapi/jsonreference/.cliff.toml deleted file mode 100644 index 702629f5dc..0000000000 --- a/vendor/github.com/go-openapi/jsonreference/.cliff.toml +++ /dev/null @@ -1,181 +0,0 @@ -# git-cliff ~ configuration file -# https://git-cliff.org/docs/configuration - -[changelog] -header = """ -""" - -footer = """ - ------ - -**[{{ remote.github.repo }}]({{ self::remote_url() }}) license terms** - -[![License][license-badge]][license-url] - -[license-badge]: http://img.shields.io/badge/license-Apache%20v2-orange.svg -[license-url]: {{ self::remote_url() }}/?tab=Apache-2.0-1-ov-file#readme - -{%- macro remote_url() -%} - https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} -{%- endmacro -%} -""" - -body = """ -{%- if version %} -## [{{ version | trim_start_matches(pat="v") }}]({{ self::remote_url() }}/tree/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }} -{%- else %} -## [unreleased] -{%- endif %} -{%- if message %} - {%- raw %}\n{% endraw %} -{{ message }} - {%- raw %}\n{% endraw %} -{%- endif %} -{%- if version %} - {%- if previous.version %} - -**Full Changelog**: <{{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }}> - {%- endif %} -{%- else %} - {%- raw %}\n{% endraw %} -{%- endif %} - -{%- if statistics %}{% if statistics.commit_count %} - {%- raw %}\n{% endraw %} -{{ statistics.commit_count }} commits in this release. - {%- raw %}\n{% endraw %} -{%- endif %}{% endif %} ------ - -{%- for group, commits in commits | group_by(attribute="group") %} - {%- raw %}\n{% endraw %} -### {{ group | upper_first }} - {%- raw %}\n{% endraw %} - {%- for commit in commits %} - {%- if commit.remote.pr_title %} - {%- set commit_message = commit.remote.pr_title %} - {%- else %} - {%- set commit_message = commit.message %} - {%- endif %} -* {{ commit_message | split(pat="\n") | first | trim }} - {%- if commit.remote.username %} -{%- raw %} {% endraw %}by [@{{ commit.remote.username }}](https://github.com/{{ commit.remote.username }}) - {%- endif %} - {%- if commit.remote.pr_number %} -{%- raw %} {% endraw %}in [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) - {%- endif %} -{%- raw %} {% endraw %}[...]({{ self::remote_url() }}/commit/{{ commit.id }}) - {%- endfor %} -{%- endfor %} - -{%- if github %} -{%- raw %}\n{% endraw -%} - {%- set all_contributors = github.contributors | length %} - {%- if github.contributors | filter(attribute="username", value="dependabot[bot]") | length < all_contributors %} ------ - -### People who contributed to this release - {% endif %} - {%- for contributor in github.contributors | filter(attribute="username") | sort(attribute="username") %} - {%- if contributor.username != "dependabot[bot]" and contributor.username != "github-actions[bot]" %} -* [@{{ contributor.username }}](https://github.com/{{ contributor.username }}) - {%- endif %} - {%- endfor %} - - {% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} ------ - {%- raw %}\n{% endraw %} - -### New Contributors - {%- endif %} - - {%- for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} - {%- if contributor.username != "dependabot[bot]" and contributor.username != "github-actions[bot]" %} -* @{{ contributor.username }} made their first contribution - {%- if contributor.pr_number %} - in [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \ - {%- endif %} - {%- endif %} - {%- endfor %} -{%- endif %} - -{%- raw %}\n{% endraw %} - -{%- macro remote_url() -%} - https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} -{%- endmacro -%} -""" -# Remove leading and trailing whitespaces from the changelog's body. -trim = true -# Render body even when there are no releases to process. -render_always = true -# An array of regex based postprocessors to modify the changelog. -postprocessors = [ - # Replace the placeholder with a URL. - #{ pattern = '', replace = "https://github.com/orhun/git-cliff" }, -] -# output file path -# output = "test.md" - -[git] -# Parse commits according to the conventional commits specification. -# See https://www.conventionalcommits.org -conventional_commits = false -# Exclude commits that do not match the conventional commits specification. -filter_unconventional = false -# Require all commits to be conventional. -# Takes precedence over filter_unconventional. -require_conventional = false -# Split commits on newlines, treating each line as an individual commit. -split_commits = false -# An array of regex based parsers to modify commit messages prior to further processing. -commit_preprocessors = [ - # Replace issue numbers with link templates to be updated in `changelog.postprocessors`. - #{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](/issues/${2}))"}, - # Check spelling of the commit message using https://github.com/crate-ci/typos. - # If the spelling is incorrect, it will be fixed automatically. - #{ pattern = '.*', replace_command = 'typos --write-changes -' } -] -# Prevent commits that are breaking from being excluded by commit parsers. -protect_breaking_commits = false -# An array of regex based parsers for extracting data from the commit message. -# Assigns commits to groups. -# Optionally sets the commit's scope and can decide to exclude commits from further processing. -commit_parsers = [ - { message = "^[Cc]hore\\([Rr]elease\\): prepare for", skip = true }, - { message = "(^[Mm]erge)|([Mm]erge conflict)", skip = true }, - { field = "author.name", pattern = "dependabot*", group = "Updates" }, - { message = "([Ss]ecurity)|([Vv]uln)", group = "Security" }, - { body = "(.*[Ss]ecurity)|([Vv]uln)", group = "Security" }, - { message = "([Cc]hore\\(lint\\))|(style)|(lint)|(codeql)|(golangci)", group = "Code quality" }, - { message = "(^[Dd]oc)|((?i)readme)|(badge)|(typo)|(documentation)", group = "Documentation" }, - { message = "(^[Ff]eat)|(^[Ee]nhancement)", group = "Implemented enhancements" }, - { message = "(^ci)|(\\(ci\\))|(fixup\\s+ci)|(fix\\s+ci)|(license)|(example)", group = "Miscellaneous tasks" }, - { message = "^test", group = "Testing" }, - { message = "(^fix)|(panic)", group = "Fixed bugs" }, - { message = "(^refact)|(rework)", group = "Refactor" }, - { message = "(^[Pp]erf)|(performance)", group = "Performance" }, - { message = "(^[Cc]hore)", group = "Miscellaneous tasks" }, - { message = "^[Rr]evert", group = "Reverted changes" }, - { message = "(upgrade.*?go)|(go\\s+version)", group = "Updates" }, - { message = ".*", group = "Other" }, -] -# Exclude commits that are not matched by any commit parser. -filter_commits = false -# An array of link parsers for extracting external references, and turning them into URLs, using regex. -link_parsers = [] -# Include only the tags that belong to the current branch. -use_branch_tags = false -# Order releases topologically instead of chronologically. -topo_order = false -# Order releases topologically instead of chronologically. -topo_order_commits = true -# Order of commits in each group/release within the changelog. -# Allowed values: newest, oldest -sort_commits = "newest" -# Process submodules commits -recurse_submodules = false - -#[remote.github] -#owner = "go-openapi" diff --git a/vendor/github.com/go-openapi/jsonreference/.gitignore b/vendor/github.com/go-openapi/jsonreference/.gitignore index 769c244007..d8f4186fe5 100644 --- a/vendor/github.com/go-openapi/jsonreference/.gitignore +++ b/vendor/github.com/go-openapi/jsonreference/.gitignore @@ -1 +1,5 @@ -secrets.yml +*.out +*.cov +.idea +.env +.mcp.json diff --git a/vendor/github.com/go-openapi/jsonreference/.golangci.yml b/vendor/github.com/go-openapi/jsonreference/.golangci.yml index fdae591bce..dc7c96053d 100644 --- a/vendor/github.com/go-openapi/jsonreference/.golangci.yml +++ b/vendor/github.com/go-openapi/jsonreference/.golangci.yml @@ -12,6 +12,7 @@ linters: - paralleltest - recvcheck - testpackage + - thelper - tparallel - varnamelen - whitespace diff --git a/vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md index 9322b065e3..bac878f216 100644 --- a/vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md +++ b/vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md @@ -23,7 +23,9 @@ include: Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or + advances + * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic @@ -55,7 +57,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All +reported by contacting the project team at . All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. @@ -68,7 +70,7 @@ members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] +available at [][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/jsonreference/CONTRIBUTORS.md b/vendor/github.com/go-openapi/jsonreference/CONTRIBUTORS.md index 9907d5d212..d20737c946 100644 --- a/vendor/github.com/go-openapi/jsonreference/CONTRIBUTORS.md +++ b/vendor/github.com/go-openapi/jsonreference/CONTRIBUTORS.md @@ -4,18 +4,18 @@ | Total Contributors | Total Contributions | | --- | --- | -| 9 | 68 | +| 9 | 83 | | Username | All Time Contribution Count | All Commits | | --- | --- | --- | -| @fredbi | 31 | https://github.com/go-openapi/jsonreference/commits?author=fredbi | -| @casualjim | 25 | https://github.com/go-openapi/jsonreference/commits?author=casualjim | -| @youyuanwu | 5 | https://github.com/go-openapi/jsonreference/commits?author=youyuanwu | -| @olivierlemasle | 2 | https://github.com/go-openapi/jsonreference/commits?author=olivierlemasle | -| @apelisse | 1 | https://github.com/go-openapi/jsonreference/commits?author=apelisse | -| @gbjk | 1 | https://github.com/go-openapi/jsonreference/commits?author=gbjk | -| @honza | 1 | https://github.com/go-openapi/jsonreference/commits?author=honza | -| @Neo2308 | 1 | https://github.com/go-openapi/jsonreference/commits?author=Neo2308 | -| @erraggy | 1 | https://github.com/go-openapi/jsonreference/commits?author=erraggy | +| @fredbi | 46 | | +| @casualjim | 25 | | +| @youyuanwu | 5 | | +| @olivierlemasle | 2 | | +| @apelisse | 1 | | +| @gbjk | 1 | | +| @honza | 1 | | +| @Neo2308 | 1 | | +| @erraggy | 1 | | - _this file was generated by the [Contributors GitHub Action](https://github.com/github/contributors)_ + _this file was generated by the [Contributors GitHub Action](https://github.com/github-community-projects/contributors)_ diff --git a/vendor/github.com/go-openapi/jsonreference/NOTICE b/vendor/github.com/go-openapi/jsonreference/NOTICE index f3b51939a9..814e87ef8c 100644 --- a/vendor/github.com/go-openapi/jsonreference/NOTICE +++ b/vendor/github.com/go-openapi/jsonreference/NOTICE @@ -3,7 +3,7 @@ Copyright 2015-2025 go-swagger maintainers // SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers // SPDX-License-Identifier: Apache-2.0 -This software library, github.com/go-openapi/jsonpointer, includes software developed +This software library, github.com/go-openapi/jsonreference, includes software developed by the go-swagger and go-openapi maintainers ("go-swagger maintainers"). Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,7 +18,7 @@ It ships with copies of other software which license terms are recalled below. The original software was authored on 25-02-2013 by sigu-399 (https://github.com/sigu-399, sigu.399@gmail.com). -github.com/sigh-399/jsonpointer +github.com/sigh-399/jsonreference =========================== // SPDX-FileCopyrightText: Copyright 2013 sigu-399 ( https://github.com/sigu-399 ) diff --git a/vendor/github.com/go-openapi/jsonreference/README.md b/vendor/github.com/go-openapi/jsonreference/README.md index d479dbdc73..fbd16cf892 100644 --- a/vendor/github.com/go-openapi/jsonreference/README.md +++ b/vendor/github.com/go-openapi/jsonreference/README.md @@ -8,12 +8,17 @@ [![Release][release-badge]][release-url] [![Go Report Card][gocard-badge]][gocard-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] -[![GoDoc][godoc-badge]][godoc-url] [![Slack Channel][slack-logo]![slack-badge]][slack-url] [![go version][goversion-badge]][goversion-url] ![Top language][top-badge] ![Commits since latest release][commits-badge] +[![GoDoc][godoc-badge]][godoc-url] [![Discord Channel][discord-badge]][discord-url] [![go version][goversion-badge]][goversion-url] ![Top language][top-badge] ![Commits since latest release][commits-badge] --- An implementation of JSON Reference for golang. +## Announcements + +* **2026-07-07** : landing v1.0.0 + * stable API pledge + ## Status API is stable. @@ -26,18 +31,33 @@ go get github.com/go-openapi/jsonreference ## Dependencies -* https://github.com/go-openapi/jsonpointer +* ## Basic usage +```go +// Creating a new reference +ref, err := jsonreference.New("http://example.com/doc.json#/definitions/Pet") + +// Fragment-only reference +fragRef := jsonreference.MustCreateRef("#/definitions/Pet") + +// Resolving references +parent, _ := jsonreference.New("http://example.com/base.json") +child, _ := jsonreference.New("#/definitions/Pet") +resolved, _ := parent.Inherits(child) +// Result: "http://example.com/base.json#/definitions/Pet" +``` + + ## Change log See ## References -* http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07 -* http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03 +* +* ## Licensing @@ -49,9 +69,9 @@ on top of which it has been built. ## Other documentation * [All-time contributors](./CONTRIBUTORS.md) -* [Contributing guidelines](.github/CONTRIBUTING.md) -* [Maintainers documentation](docs/MAINTAINERS.md) -* [Code style](docs/STYLE.md) +* [Contributing guidelines][contributing-doc-site] +* [Maintainers documentation][maintainers-doc-site] +* [Code style][style-doc-site] ## Cutting a new release @@ -86,9 +106,9 @@ Maintainers can cut a new release by either: [doc-url]: https://goswagger.io/go-openapi [godoc-badge]: https://pkg.go.dev/badge/github.com/go-openapi/jsonreference [godoc-url]: http://pkg.go.dev/github.com/go-openapi/jsonreference -[slack-logo]: https://a.slack-edge.com/e6a93c1/img/icons/favicon-32.png -[slack-badge]: https://img.shields.io/badge/slack-blue?link=https%3A%2F%2Fgoswagger.slack.com%2Farchives%2FC04R30YM -[slack-url]: https://goswagger.slack.com/archives/C04R30YMU +[discord-badge]: https://img.shields.io/discord/1446918742398341256?logo=discord&label=discord&color=blue +[discord-url]: https://discord.gg/FfnFYaC3k5 + [license-badge]: http://img.shields.io/badge/license-Apache%20v2-orange.svg [license-url]: https://github.com/go-openapi/jsonreference/?tab=Apache-2.0-1-ov-file#readme @@ -97,3 +117,7 @@ Maintainers can cut a new release by either: [goversion-url]: https://github.com/go-openapi/jsonreference/blob/master/go.mod [top-badge]: https://img.shields.io/github/languages/top/go-openapi/jsonreference [commits-badge]: https://img.shields.io/github/commits-since/go-openapi/jsonreference/latest + +[contributing-doc-site]: https://go-openapi.github.io/doc-site/contributing/contributing/index.html +[maintainers-doc-site]: https://go-openapi.github.io/doc-site/maintainers/index.html +[style-doc-site]: https://go-openapi.github.io/doc-site/contributing/style/index.html diff --git a/vendor/github.com/go-openapi/jsonreference/SECURITY.md b/vendor/github.com/go-openapi/jsonreference/SECURITY.md index 2a7b6f0910..1fea2c5736 100644 --- a/vendor/github.com/go-openapi/jsonreference/SECURITY.md +++ b/vendor/github.com/go-openapi/jsonreference/SECURITY.md @@ -6,14 +6,32 @@ This policy outlines the commitment and practices of the go-openapi maintainers | Version | Supported | | ------- | ------------------ | -| 0.22.x | :white_check_mark: | +| O.x | :white_check_mark: | + +## Vulnerability checks in place + +This repository uses automated vulnerability scans, at every merged commit and at least once a week. + +We use: + +* [`GitHub CodeQL`][codeql-url] +* [`trivy`][trivy-url] +* [`govulncheck`][govulncheck-url] + +Reports are centralized in github security reports and visible only to the maintainers. ## Reporting a vulnerability If you become aware of a security vulnerability that affects the current repository, -please report it privately to the maintainers. +**please report it privately to the maintainers** +rather than opening a publicly visible GitHub issue. + +Please follow the instructions provided by github to [Privately report a security vulnerability][github-guidance-url]. -Please follow the instructions provided by github to -[Privately report a security vulnerability](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability). +> [!NOTE] +> On Github, navigate to the project's "Security" tab then click on "Report a vulnerability". -TL;DR: on Github, navigate to the project's "Security" tab then click on "Report a vulnerability". +[codeql-url]: https://github.com/github/codeql +[trivy-url]: https://trivy.dev/docs/latest/getting-started +[govulncheck-url]: https://go.dev/blog/govulncheck +[github-guidance-url]: https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability diff --git a/vendor/github.com/go-openapi/jsonreference/reference.go b/vendor/github.com/go-openapi/jsonreference/reference.go index 6e3ae49951..003ba7a838 100644 --- a/vendor/github.com/go-openapi/jsonreference/reference.go +++ b/vendor/github.com/go-openapi/jsonreference/reference.go @@ -16,6 +16,7 @@ const ( fragmentRune = `#` ) +// ErrChildURL is raised when there is no child. var ErrChildURL = errors.New("child url is nil") // Ref represents a json reference object. diff --git a/vendor/github.com/go-openapi/swag/.gitignore b/vendor/github.com/go-openapi/swag/.gitignore index c4b1b64f04..3ceb596fa2 100644 --- a/vendor/github.com/go-openapi/swag/.gitignore +++ b/vendor/github.com/go-openapi/swag/.gitignore @@ -3,3 +3,5 @@ vendor Godeps .idea *.out +.mcp.json +.worktrees diff --git a/vendor/github.com/go-openapi/swag/.golangci.yml b/vendor/github.com/go-openapi/swag/.golangci.yml index 126264a6b8..099c0a78c6 100644 --- a/vendor/github.com/go-openapi/swag/.golangci.yml +++ b/vendor/github.com/go-openapi/swag/.golangci.yml @@ -14,7 +14,10 @@ linters: - gocognit - godot - godox + - goconst - gomoddirectives + - gomodguard + - gomodguard_v2 - gosmopolitan - inamedparam - intrange diff --git a/vendor/github.com/go-openapi/swag/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/swag/CODE_OF_CONDUCT.md index 9322b065e3..bac878f216 100644 --- a/vendor/github.com/go-openapi/swag/CODE_OF_CONDUCT.md +++ b/vendor/github.com/go-openapi/swag/CODE_OF_CONDUCT.md @@ -23,7 +23,9 @@ include: Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or + advances + * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic @@ -55,7 +57,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All +reported by contacting the project team at . All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. @@ -68,7 +70,7 @@ members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] +available at [][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/swag/CONTRIBUTORS.md b/vendor/github.com/go-openapi/swag/CONTRIBUTORS.md new file mode 100644 index 0000000000..0f0711cd5f --- /dev/null +++ b/vendor/github.com/go-openapi/swag/CONTRIBUTORS.md @@ -0,0 +1,36 @@ +# Contributors + +- Repository: ['go-openapi/swag'] + +| Total Contributors | Total Contributions | +| --- | --- | +| 24 | 251 | + +| Username | All Time Contribution Count | All Commits | +| --- | --- | --- | +| @fredbi | 121 | | +| @casualjim | 98 | | +| @alexandear | 4 | | +| @orisano | 3 | | +| @reinerRubin | 2 | | +| @n-inja | 2 | | +| @nitinmohan87 | 2 | | +| @Neo2308 | 2 | | +| @michaelbowler-form3 | 2 | | +| @ujjwalsh | 1 | | +| @griffin-stewie | 1 | | +| @POD666 | 1 | | +| @pytlesk4 | 1 | | +| @shirou | 1 | | +| @seanprince | 1 | | +| @petrkotas | 1 | | +| @mszczygiel | 1 | | +| @sosiska | 1 | | +| @kzys | 1 | | +| @faguirre1 | 1 | | +| @posener | 1 | | +| @diego-fu-hs | 1 | | +| @davidalpert | 1 | | +| @Xe | 1 | | + + _this file was generated by the [Contributors GitHub Action](https://github.com/github-community-projects/contributors)_ diff --git a/vendor/github.com/go-openapi/swag/README.md b/vendor/github.com/go-openapi/swag/README.md index 371fd55fdc..c6c2d21e94 100644 --- a/vendor/github.com/go-openapi/swag/README.md +++ b/vendor/github.com/go-openapi/swag/README.md @@ -1,26 +1,57 @@ -# Swag [![Build Status](https://github.com/go-openapi/swag/actions/workflows/go-test.yml/badge.svg)](https://github.com/go-openapi/swag/actions?query=workflow%3A"go+test") [![codecov](https://codecov.io/gh/go-openapi/swag/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/swag) +# Swag + + +[![Tests][test-badge]][test-url] [![Coverage][cov-badge]][cov-url] [![CI vuln scan][vuln-scan-badge]][vuln-scan-url] [![CodeQL][codeql-badge]][codeql-url] + + + +[![Release][release-badge]][release-url] [![Go Report Card][gocard-badge]][gocard-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] + + +[![GoDoc][godoc-badge]][godoc-url] [![Discord Channel][discord-badge]][discord-url] [![go version][goversion-badge]][goversion-url] ![Top language][top-badge] ![Commits since latest release][commits-badge] -[![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) -[![license](https://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/swag/master/LICENSE) -[![Go Reference](https://pkg.go.dev/badge/github.com/go-openapi/swag.svg)](https://pkg.go.dev/github.com/go-openapi/swag) -[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/swag)](https://goreportcard.com/report/github.com/go-openapi/swag) +--- -Package `swag` contains a bunch of helper functions for go-openapi and go-swagger projects. +A bunch of helper functions for go-openapi and go-swagger projects. You may also use it standalone for your projects. > **NOTE** > `swag` is one of the foundational building blocks of the go-openapi initiative. +> > Most repositories in `github.com/go-openapi/...` depend on it in some way. > And so does our CLI tool `github.com/go-swagger/go-swagger`, > as well as the code generated by this tool. * [Contents](#contents) * [Dependencies](#dependencies) -* [Release Notes](#release-notes) +* [Change log](#change-log) * [Licensing](#licensing) * [Note to contributors](#note-to-contributors) -* [TODOs, suggestions and plans](#todos-suggestions-and-plans) +* [Roadmap](#roadmap) + +## Announcements + +* **2025-12-19** : new community chat on discord + * a new discord community channel is available to be notified of changes and support users + +You may join the discord community by clicking the invite link on the discord badge (also above). [![Discord Channel][discord-badge]][discord-url] + +## Status + +API is stable. + +## Import this library in your project + +```cmd +go get github.com/go-openapi/swag/{module} +``` + +Or for backward compatibility: + +```cmd +go get github.com/go-openapi/swag +``` ## Contents @@ -36,11 +67,12 @@ Child modules will continue to evolve and some new ones may be added in the futu | `cmdutils` | utilities to work with CLIs || | `conv` | type conversion utilities | convert between values and pointers for any types
convert from string to builtin types (wraps `strconv`)
require `./typeutils` (test dependency)
| | `fileutils` | file utilities | | -| `jsonname` | JSON utilities | infer JSON names from `go` properties
| +| `jsonname` | JSON utilities (deprecated) | infer JSON names from `go` properties
use `github.com/go-openapi/jsonpointer/jsonname` instead | | `jsonutils` | JSON utilities | fast json concatenation
read and write JSON from and to dynamic `go` data structures
~require `github.com/mailru/easyjson`~
| | `loading` | file loading | load from file or http
require `./yamlutils`
| | `mangling` | safe name generation | name mangling for `go`
| | `netutils` | networking utilities | host, port from address
| +| `pools` | utilities to work with sync.Pools | | | `stringutils` | `string` utilities | search in slice (with case-insensitive)
split/join query parameters as arrays
| | `typeutils` | `go` types utilities | check the zero value for any type
safe check for a nil value
| | `yamlutils` | YAML utilities | converting YAML to JSON
loading YAML into a dynamic YAML document
maintaining the original order of keys in YAML objects
require `./jsonutils`
~require `github.com/mailru/easyjson`~
require `go.yaml.in/yaml/v3`
| @@ -49,84 +81,19 @@ Child modules will continue to evolve and some new ones may be added in the futu ## Dependencies -The root module `github.com/go-openapi/swag` at the repo level maintains a few +The root module `github.com/go-openapi/swag` at the repo level maintains a few dependencies outside of the standard library. * YAML utilities depend on `go.yaml.in/yaml/v3` * JSON utilities depend on their registered adapter module: - * by default, only the standard library is used - * `github.com/mailru/easyjson` is now only a dependency for module - `github.com/go-openapi/swag/jsonutils/adapters/easyjson/json`, - for users willing to import that module. - * integration tests and benchmarks use all the dependencies are published as their own module + * by default, only the standard library is used + * `github.com/mailru/easyjson` is now only a dependency for module + `github.com/go-openapi/swag/jsonutils/adapters/easyjson/json`, + for users willing to import that module. + * integration tests and benchmarks use all the dependencies are published as their own module * other dependencies are test dependencies drawn from `github.com/stretchr/testify` -## Release notes - -### v0.25.4 - -** mangling** - -Bug fix - -* [x] mangler may panic with pluralized overlapping initialisms - -Tests - -* [x] introduced fuzz tests - -### v0.25.3 - -** mangling** - -Bug fix - -* [x] mangler may panic with pluralized initialisms - -### v0.25.2 - -Minor changes due to internal maintenance that don't affect the behavior of the library. - -* [x] removed indirect test dependencies by switching all tests to `go-openapi/testify`, - a fork of `stretch/testify` with zero-dependencies. -* [x] improvements to CI to catch test reports. -* [x] modernized licensing annotations in source code, using the more compact SPDX annotations - rather than the full license terms. -* [x] simplified a bit JSON & YAML testing by using newly available assertions -* started the journey to an OpenSSF score card badge: - * [x] explicited permissions in CI workflows - * [x] published security policy - * pinned dependencies to github actions - * introduced fuzzing in tests - -### v0.25.1 - -* fixes a data race that could occur when using the standard library implementation of a JSON ordered map - -### v0.25.0 - -**New with this release**: - -* requires `go1.24`, as iterators are being introduced -* removes the dependency to `mailru/easyjson` by default (#68) - * functionality remains the same, but performance may somewhat degrade for applications - that relied on `easyjson` - * users of the JSON or YAML utilities who want to use `easyjson` as their preferred JSON serializer library - will be able to do so by registering this the corresponding JSON adapter at runtime. See below. - * ordered keys in JSON and YAML objects: this feature used to rely solely on `easyjson`. - With this release, an implementation relying on the standard `encoding/json` is provided. - * an independent [benchmark](./jsonutils/adapters/testintegration/benchmarks/README.md) to compare the different adapters -* improves the "float is integer" check (`conv.IsFloat64AJSONInteger`) (#59) -* removes the _direct_ dependency to `gopkg.in/yaml.v3` (indirect dependency is still incurred through `stretchr/testify`) (#127) -* exposed `conv.IsNil()` (previously kept private): a safe nil check (accounting for the "non-nil interface with nil value" nonsensical go trick) - -**What coming next?** - -Moving forward, we want to : -* provide an implementation of the JSON adapter based on `encoding/json/v2`, for `go1.25` builds. -* provide similar implementations for `goccy/go-json` and `jsoniterator/go`, and perhaps some other - similar libraries may be interesting too. - +## Usage **How to explicitly register a dependency at runtime**? @@ -150,90 +117,107 @@ or fallback to the standard library. For more details, you may also look at our [integration tests](jsonutils/adapters/testintegration/integration_suite_test.go#29). -### v0.24.0 +--- -With this release, we have largely modernized the API of `swag`: +## Note to contributors -* The traditional `swag` API is still supported: code that imports `swag` will still - compile and work the same. -* A deprecation notice is published to encourage consumers of this library to adopt - the newer API -* **Deprecation notice** - * configuration through global variables is now deprecated, in favor of options passed as parameters - * all helper functions are moved to more specialized packages, which are exposed as - go modules. Importing such a module would reduce the footprint of dependencies. - * _all_ functions, variables, constants exposed by the deprecated API have now moved, so - that consumers of the new API no longer need to import github.com/go-openapi/swag, but - should import the desired sub-module(s). +All kinds of contributions are welcome. -**New with this release**: +This repo is a go mono-repo. See [docs](docs/MAINTAINERS.md). -* [x] type converters and pointer to value helpers now support generic types -* [x] name mangling now support pluralized initialisms (issue #46) - Strings like "contact IDs" are now recognized as such a plural form and mangled as a linter would expect. -* [x] performance: small improvements to reduce the overhead of convert/format wrappers (see issues #110, or PR #108) -* [x] performance: name mangling utilities run ~ 10% faster (PR #115) +More general guidelines are available [here](.github/CONTRIBUTING.md). ---- +## Roadmap -## Licensing +See the current [TODO list](docs/TODOS.md) -This library ships under the [SPDX-License-Identifier: Apache-2.0](./LICENSE). +## Change log -## Note to contributors +See -A mono-repo structure comes with some unavoidable extra pains... +For pre-v0.26.0 releases, see [release notes](./docs/NOTES.md). -* Testing +**What coming next?** -> The usual `go test ./...` command, run from the root of this repo won't work any longer to test all submodules. -> -> Each module constitutes an independant unit of test. So you have to run `go test` inside each module. -> Or you may take a look at how this is achieved by CI -> [here] https://github.com/go-openapi/swag/blob/master/.github/workflows/go-test.yml). -> -> There are also some alternative tricks using `go work`, for local development, if you feel comfortable with -> go workspaces. Perhaps some day, we'll have a `go work test` to run all tests without any hack. +Moving forward, we want to : -* Releasing +* provide an implementation of the JSON adapter based on `encoding/json/v2`, for `go1.25` builds. +* provide similar implementations for `goccy/go-json` and `jsoniterator/go`, and perhaps some other + similar libraries may be interesting too. -> Each module follows its own independant module versioning. -> -> So you have tags like `mangling/v0.24.0`, `fileutils/v0.24.0` etc that are used by `go mod` and `go get` -> to refer to the tagged version of each module specifically. -> -> This means we may release patches etc to each module independently. -> -> We'd like to adopt the rule that modules in this repo would only differ by a patch version -> (e.g. `v0.24.5` vs `v0.24.3`), and we'll level all modules whenever a minor version is introduced. -> -> A script in `./hack` is provided to tag all modules with the same version in one go. + -## Todos, suggestions and plans +## Licensing -All kinds of contributions are welcome. +This library ships under the [SPDX-License-Identifier: Apache-2.0](./LICENSE). -A few ideas: - -* [x] Complete the split of dependencies to isolate easyjson from the rest -* [x] Improve CI to reduce needed tests -* [x] Replace dependency to `gopkg.in/yaml.v3` (`yamlutil`) -* [ ] Improve mangling utilities (improve readability, support for capitalized words, - better word substitution for non-letter symbols...) -* [ ] Move back to this common shared pot a few of the technical features introduced by go-swagger independently - (e.g. mangle go package names, search package with go modules support, ...) -* [ ] Apply a similar mono-repo approach to go-openapi/strfmt which suffer from similar woes: bloated API, - imposed dependency to some database driver. -* [ ] Adapt `go-swagger` (incl. generated code) to the new `swag` API. -* [ ] Factorize some tests, as there is a lot of redundant testing code in `jsonutils` -* [ ] Benchmark & profiling: publish independently the tool built to analyze and chart benchmarks (e.g. similar to `benchvisual`) -* [ ] more thorough testing for nil / null case -* [ ] ci pipeline to manage releases -* [ ] cleaner mockery generation (doesn't work out of the box for all sub-modules) + + + + +## Other documentation + +* [All-time contributors](./CONTRIBUTORS.md) +* [Contributing guidelines][contributing-doc-site] +* [Maintainers documentation][maintainers-doc-site] +* [Code style][style-doc-site] + +## Cutting a new release + +Maintainers can cut a new release by either: + +* running [this workflow](https://github.com/go-openapi/swag/actions/workflows/bump-release.yml) +* or pushing a semver tag + * signed tags are preferred + * The tag message is prepended to release notes + + +[test-badge]: https://github.com/go-openapi/swag/actions/workflows/go-test.yml/badge.svg +[test-url]: https://github.com/go-openapi/swag/actions/workflows/go-test.yml +[cov-badge]: https://codecov.io/gh/go-openapi/swag/branch/master/graph/badge.svg +[cov-url]: https://codecov.io/gh/go-openapi/swag +[vuln-scan-badge]: https://github.com/go-openapi/swag/actions/workflows/scanner.yml/badge.svg +[vuln-scan-url]: https://github.com/go-openapi/swag/actions/workflows/scanner.yml +[codeql-badge]: https://github.com/go-openapi/swag/actions/workflows/codeql.yml/badge.svg +[codeql-url]: https://github.com/go-openapi/swag/actions/workflows/codeql.yml + +[release-badge]: https://badge.fury.io/gh/go-openapi%2Fswag.svg +[release-url]: https://badge.fury.io/gh/go-openapi%2Fswag +[gomod-badge]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fswag.svg +[gomod-url]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fswag + +[gocard-badge]: https://goreportcard.com/badge/github.com/go-openapi/swag +[gocard-url]: https://goreportcard.com/report/github.com/go-openapi/swag +[codefactor-badge]: https://img.shields.io/codefactor/grade/github/go-openapi/swag +[codefactor-url]: https://www.codefactor.io/repository/github/go-openapi/swag + +[doc-badge]: https://img.shields.io/badge/doc-site-blue?link=https%3A%2F%2Fgoswagger.io%2Fgo-openapi%2F +[doc-url]: https://goswagger.io/go-openapi +[godoc-badge]: https://pkg.go.dev/badge/github.com/go-openapi/swag +[godoc-url]: http://pkg.go.dev/github.com/go-openapi/swag +[discord-badge]: https://img.shields.io/discord/1446918742398341256?logo=discord&label=discord&color=blue +[discord-url]: https://discord.gg/FfnFYaC3k5 + + +[license-badge]: http://img.shields.io/badge/license-Apache%20v2-orange.svg +[license-url]: https://github.com/go-openapi/swag/?tab=Apache-2.0-1-ov-file#readme + +[goversion-badge]: https://img.shields.io/github/go-mod/go-version/go-openapi/swag +[goversion-url]: https://github.com/go-openapi/swag/blob/master/go.mod +[top-badge]: https://img.shields.io/github/languages/top/go-openapi/swag +[commits-badge]: https://img.shields.io/github/commits-since/go-openapi/swag/latest + +[contributing-doc-site]: https://go-openapi.github.io/doc-site/contributing/contributing/index.html +[maintainers-doc-site]: https://go-openapi.github.io/doc-site/maintainers/index.html +[style-doc-site]: https://go-openapi.github.io/doc-site/contributing/style/index.html diff --git a/vendor/github.com/go-openapi/swag/SECURITY.md b/vendor/github.com/go-openapi/swag/SECURITY.md index 72296a8313..1fea2c5736 100644 --- a/vendor/github.com/go-openapi/swag/SECURITY.md +++ b/vendor/github.com/go-openapi/swag/SECURITY.md @@ -6,14 +6,32 @@ This policy outlines the commitment and practices of the go-openapi maintainers | Version | Supported | | ------- | ------------------ | -| 0.25.x | :white_check_mark: | +| O.x | :white_check_mark: | + +## Vulnerability checks in place + +This repository uses automated vulnerability scans, at every merged commit and at least once a week. + +We use: + +* [`GitHub CodeQL`][codeql-url] +* [`trivy`][trivy-url] +* [`govulncheck`][govulncheck-url] + +Reports are centralized in github security reports and visible only to the maintainers. ## Reporting a vulnerability If you become aware of a security vulnerability that affects the current repository, -please report it privately to the maintainers. +**please report it privately to the maintainers** +rather than opening a publicly visible GitHub issue. + +Please follow the instructions provided by github to [Privately report a security vulnerability][github-guidance-url]. -Please follow the instructions provided by github to -[Privately report a security vulnerability](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability). +> [!NOTE] +> On Github, navigate to the project's "Security" tab then click on "Report a vulnerability". -TL;DR: on Github, navigate to the project's "Security" tab then click on "Report a vulnerability". +[codeql-url]: https://github.com/github/codeql +[trivy-url]: https://trivy.dev/docs/latest/getting-started +[govulncheck-url]: https://go.dev/blog/govulncheck +[github-guidance-url]: https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability diff --git a/vendor/github.com/go-openapi/swag/go.work b/vendor/github.com/go-openapi/swag/go.work index 1e537f0749..f1dddc436e 100644 --- a/vendor/github.com/go-openapi/swag/go.work +++ b/vendor/github.com/go-openapi/swag/go.work @@ -12,9 +12,10 @@ use ( ./loading ./mangling ./netutils + ./pools ./stringutils ./typeutils ./yamlutils ) -go 1.24.0 +go 1.25.0 diff --git a/vendor/github.com/go-openapi/swag/jsonname_iface.go b/vendor/github.com/go-openapi/swag/jsonname_iface.go index 303a007f6f..443560caad 100644 --- a/vendor/github.com/go-openapi/swag/jsonname_iface.go +++ b/vendor/github.com/go-openapi/swag/jsonname_iface.go @@ -4,21 +4,21 @@ package swag import ( - "github.com/go-openapi/swag/jsonname" + "github.com/go-openapi/jsonpointer/jsonname" ) // DefaultJSONNameProvider is the default cache for types // -// Deprecated: use [jsonname.DefaultJSONNameProvider] instead. +// Deprecated: use [github.com/go-openapi/jsonpointer/jsonname.DefaultJSONNameProvider] instead. var DefaultJSONNameProvider = jsonname.DefaultJSONNameProvider // NameProvider represents an object capable of translating from go property names // to json property names. // -// Deprecated: use [jsonname.NameProvider] instead. +// Deprecated: use [github.com/go-openapi/jsonpointer/jsonname.NameProvider] instead. type NameProvider = jsonname.NameProvider // NewNameProvider creates a new name provider // -// Deprecated: use [jsonname.NewNameProvider] instead. +// Deprecated: use [github.com/go-openapi/jsonpointer/jsonname.NewNameProvider] instead. func NewNameProvider() *NameProvider { return jsonname.NewNameProvider() } diff --git a/vendor/github.com/go-openapi/swag/jsonutils/README.md b/vendor/github.com/go-openapi/swag/jsonutils/README.md index d745cdb466..07a2ca1d71 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/README.md +++ b/vendor/github.com/go-openapi/swag/jsonutils/README.md @@ -1,11 +1,11 @@ - # jsonutils +# jsonutils `jsonutils` exposes a few tools to work with JSON: - a fast, simple `Concat` to concatenate (not merge) JSON objects and arrays - `FromDynamicJSON` to convert a data structure into a "dynamic JSON" data structure - `ReadJSON` and `WriteJSON` behave like `json.Unmarshal` and `json.Marshal`, - with the ability to use another underlying serialization library through an `Adapter` + with the ability to use another underlying serialization library through an `Adapter` configured at runtime - a `JSONMapSlice` structure that may be used to store JSON objects with the order of keys maintained @@ -64,7 +64,7 @@ find a registered implementation that support ordered keys in objects. Our standard library implementation supports this. As of `v0.25.0`, we support through such an adapter the popular `mailru/easyjson` -library, which kicks in when the passed values support the `easyjson.Unmarshaler` +library, which kicks in when the passed values support the `easyjson.Unmarshaler` or `easyjson.Marshaler` interfaces. In the future, we plan to add more similar libraries that compete on the go JSON @@ -77,8 +77,9 @@ In package `github.com/go-openapi/swag/easyjson/adapters`, several adapters are Each adapter is an independent go module. Hence you'll pick its dependencies only if you import it. At this moment we provide: -* `stdlib`: JSON adapter based on the standard library -* `easyjson`: JSON adapter based on the `github.com/mailru/easyjson` + +- `stdlib`: JSON adapter based on the standard library +- `easyjson`: JSON adapter based on the `github.com/mailru/easyjson` The adapters provide the basic `Marshal` and `Unmarshal` capabilities, plus an implementation of the `MapSlice` pattern. diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go index 0213ff5c29..94185f79c1 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go @@ -5,6 +5,7 @@ package json import ( stdjson "encoding/json" + "fmt" "github.com/go-openapi/swag/jsonutils/adapters/ifaces" "github.com/go-openapi/swag/typeutils" @@ -24,11 +25,16 @@ var ErrStdlib jsonError = "error from the JSON adapter stdlib" var _ ifaces.Adapter = &Adapter{} type Adapter struct { + options } // NewAdapter yields an [ifaces.Adapter] using the standard library. -func NewAdapter() *Adapter { - return &Adapter{} +func NewAdapter(opts ...Option) *Adapter { + var o options + + return &Adapter{ + options: buildOptions(o, opts), + } } func (a *Adapter) Marshal(value any) ([]byte, error) { @@ -40,45 +46,18 @@ func (a *Adapter) Unmarshal(data []byte, value any) error { } func (a *Adapter) OrderedMarshal(value ifaces.Ordered) ([]byte, error) { - w := poolOfWriters.Borrow() - defer func() { - poolOfWriters.Redeem(w) - }() - - if typeutils.IsNil(value) { - w.RawString("null") - - return w.BuildBytes() - } - - w.RawByte('{') - first := true - for k, v := range value.OrderedItems() { - if first { - first = false - } else { - w.RawByte(',') - } + w, redeem := poolOfWriters.BorrowWithRedeem() + defer redeem() + w.setBuf() - w.String(k) - w.RawByte(':') - - switch val := v.(type) { - case ifaces.Ordered: - w.Raw(a.OrderedMarshal(val)) - default: - w.Raw(stdjson.Marshal(v)) - } - } - - w.RawByte('}') + a.orderedMarshal(w, value, 1) return w.BuildBytes() } func (a *Adapter) OrderedUnmarshal(data []byte, value ifaces.SetOrdered) error { var m MapSlice - if err := m.OrderedUnmarshalJSON(data); err != nil { + if err := m.orderedUnmarshalJSON(data, a.maxDepth()); err != nil { return err } @@ -112,4 +91,43 @@ func (a *Adapter) Redeem() { } func (a *Adapter) Reset() { + a.options = options{} +} + +// orderedMarshal writes value to w, tracking the container nesting depth to guard +// against stack overflow on deeply nested structures. +func (a *Adapter) orderedMarshal(w *jwriter, value ifaces.Ordered, depth int) { + if typeutils.IsNil(value) { + w.RawString("null") + + return + } + + if maxDepth := a.maxDepth(); depth > maxDepth { + w.SetErr(fmt.Errorf("maximum nesting depth of %d exceeded: %w", maxDepth, ErrStdlib)) + + return + } + + w.RawByte('{') + first := true + for k, v := range value.OrderedItems() { + if first { + first = false + } else { + w.RawByte(',') + } + + w.String(k) + w.RawByte(':') + + switch val := v.(type) { + case ifaces.Ordered: + a.orderedMarshal(w, val, depth+1) + default: + w.Raw(stdjson.Marshal(v)) + } + } + + w.RawByte('}') } diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go index b5aa1c7972..ac81cbc75f 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go @@ -54,7 +54,7 @@ func (t token) Delim() byte { return 0 } - return byte(r) + return byte(r) //nolint:gosec // delimiter runes are single byte } type tokenKind uint8 @@ -91,6 +91,13 @@ type jlexer struct { // current token next token // started bool + + // depth tracks the current JSON container nesting level, and maxDepth caps it + // to guard against stack-overflow on adversarially deep documents. The standard + // library's streaming [encoding/json.Decoder.Token] API (used here) does not + // enforce the max-depth guard that [encoding/json.Unmarshal] provides, so we do. + depth int + maxDepth int } type bytesReader struct { @@ -130,7 +137,8 @@ var _ io.Reader = &bytesReader{} func newLexer(data []byte) *jlexer { l := &jlexer{ // current: undefToken, - next: undefToken, + next: undefToken, + maxDepth: defaultMaxNestingDepth, } l.buf = &bytesReader{ buf: data, @@ -143,7 +151,11 @@ func newLexer(data []byte) *jlexer { func (l *jlexer) Reset() { l.err = nil l.next = undefToken - // leave l.dec and l.buf alone, since they are replaced at every Borrow + l.depth = 0 + l.maxDepth = defaultMaxNestingDepth + l.dec = nil + // leave l.buf alone, since they are replaced at every Borrow + l.buf = nil } func (l *jlexer) Error() error { @@ -228,6 +240,21 @@ func (l *jlexer) Delim(c byte) { if tok.Delim() != c { l.err = fmt.Errorf("expected delimiter '%q' but got '%q': %w", c, tok.Delim(), ErrStdlib) + + return + } + + // Track container nesting depth centrally: every '{' or '[' opens a level and + // every '}' or ']' closes one. This guards the mutually-recursive unmarshal + // routines (unmarshalObject/unmarshalArray/asInterface) against stack overflow. + switch c { + case '{', '[': + l.depth++ + if l.maxDepth > 0 && l.depth > l.maxDepth { + l.err = fmt.Errorf("maximum nesting depth of %d exceeded: %w", l.maxDepth, ErrStdlib) + } + case '}', ']': + l.depth-- } } @@ -318,3 +345,12 @@ func (l *jlexer) fetchToken() token { return token{Token: jtok} } + +func (l *jlexer) setBuf(data []byte) func() { + rdr, redeemBuf := poolOfReaders.BorrowWithRedeem() + l.buf = rdr + l.buf.buf = data + l.dec = stdjson.NewDecoder(l.buf) // cannot pool, not exposed by the encoding/json API + + return redeemBuf +} diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/options.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/options.go new file mode 100644 index 0000000000..f114f1f1a1 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/options.go @@ -0,0 +1,52 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package json + +// defaultMaxNestingDepth is the default maximum number of nested JSON containers +// ('{' or '[') that the ordered-JSON marshaler and unmarshaler will process before +// returning an error. +// +// It mirrors the limit enforced by the standard library's [encoding/json] decoder +// (see encoding/json's internal maxNestingDepth), which this adapter would otherwise +// not benefit from since it drives [encoding/json.Decoder.Token] directly. +const defaultMaxNestingDepth = 10000 + +// Option selects options for the stdlib adapter. +type Option func(o options) options + +type options struct { + maxNestingDepth int +} + +func buildOptions(o options, opts []Option) options { + for _, apply := range opts { + o = apply(o) + } + + return o +} + +// maxDepth returns the configured maximum nesting depth, or the default when unset. +func (o options) maxDepth() int { + if o.maxNestingDepth <= 0 { + return defaultMaxNestingDepth + } + + return o.maxNestingDepth +} + +// WithMaxNestingDepth sets the maximum number of nested JSON containers accepted +// when marshaling or unmarshaling ordered JSON. +// +// A value <= 0 selects the default (10,000). +// +// This guards against stack-overflow crashes on deeply nested (possibly adversarial) +// JSON documents or in-memory structures. +func WithMaxNestingDepth(depth int) Option { + return func(o options) options { + o.maxNestingDepth = depth + + return o + } +} diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go index 54deef406f..a5a8f4b631 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go @@ -70,12 +70,11 @@ func (s MapSlice) MarshalJSON() ([]byte, error) { } func (s MapSlice) OrderedMarshalJSON() ([]byte, error) { - w := poolOfWriters.Borrow() - defer func() { - poolOfWriters.Redeem(w) - }() + w, redeem := poolOfWriters.BorrowWithRedeem() + defer redeem() + w.setBuf() - s.marshalObject(w) + s.marshalObject(w, 1) return w.BuildBytes() // this clones data, so it's okay to redeem the writer and its buffer } @@ -88,23 +87,38 @@ func (s *MapSlice) UnmarshalJSON(data []byte) error { } func (s *MapSlice) OrderedUnmarshalJSON(data []byte) error { - l := poolOfLexers.Borrow(data) - defer func() { - poolOfLexers.Redeem(l) - }() + return s.orderedUnmarshalJSON(data, defaultMaxNestingDepth) +} + +func (s *MapSlice) orderedUnmarshalJSON(data []byte, maxDepth int) error { + l, redeem := poolOfLexers.BorrowWithRedeem() + defer redeem() + + redeemBuf := l.setBuf(data) + defer redeemBuf() + + if maxDepth > 0 { + l.maxDepth = maxDepth + } s.unmarshalObject(l) return l.Error() } -func (s MapSlice) marshalObject(w *jwriter) { +func (s MapSlice) marshalObject(w *jwriter, depth int) { if s == nil { w.RawString("null") return } + if depth > defaultMaxNestingDepth { + w.SetErr(fmt.Errorf("maximum nesting depth of %d exceeded: %w", defaultMaxNestingDepth, ErrStdlib)) + + return + } + w.RawByte('{') if len(s) == 0 { @@ -113,11 +127,11 @@ func (s MapSlice) marshalObject(w *jwriter) { return } - s[0].marshalJSON(w) + s[0].marshalJSON(w, depth) for i := 1; i < len(s); i++ { w.RawByte(',') - s[i].marshalJSON(w) + s[i].marshalJSON(w, depth) } w.RawByte('}') @@ -162,9 +176,18 @@ type MapItem struct { Value any } -func (s MapItem) marshalJSON(w *jwriter) { +func (s MapItem) marshalJSON(w *jwriter, depth int) { w.String(s.Key) w.RawByte(':') + + // Recurse internally for nested ordered maps so the depth guard is not lost across + // the stdjson.Marshal boundary (which would reset it and re-enable stack overflow). + if nested, ok := s.Value.(MapSlice); ok { + nested.marshalObject(w, depth+1) + + return + } + w.Raw(stdjson.Marshal(s.Value)) } diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go index 709b97c304..2f06b88e80 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go @@ -4,118 +4,15 @@ package json import ( - "encoding/json" - "sync" - "github.com/go-openapi/swag/jsonutils/adapters/ifaces" + "github.com/go-openapi/swag/pools" ) -type adaptersPool struct { - sync.Pool -} - -func (p *adaptersPool) Borrow() *Adapter { - return p.Get().(*Adapter) -} - -func (p *adaptersPool) BorrowIface() ifaces.Adapter { - return p.Get().(*Adapter) -} - -func (p *adaptersPool) Redeem(a *Adapter) { - p.Put(a) -} - -type writersPool struct { - sync.Pool -} - -func (p *writersPool) Borrow() *jwriter { - ptr := p.Get() - - jw := ptr.(*jwriter) - jw.Reset() - - return jw -} - -func (p *writersPool) Redeem(w *jwriter) { - p.Put(w) -} - -type lexersPool struct { - sync.Pool -} - -func (p *lexersPool) Borrow(data []byte) *jlexer { - ptr := p.Get() - - l := ptr.(*jlexer) - l.buf = poolOfReaders.Borrow(data) - l.dec = json.NewDecoder(l.buf) // cannot pool, not exposed by the encoding/json API - l.Reset() - - return l -} - -func (p *lexersPool) Redeem(l *jlexer) { - l.dec = nil - discard := l.buf - l.buf = nil - poolOfReaders.Redeem(discard) - p.Put(l) -} - -type readersPool struct { - sync.Pool -} - -func (p *readersPool) Borrow(data []byte) *bytesReader { - ptr := p.Get() - - b := ptr.(*bytesReader) - b.Reset() - b.buf = data - - return b -} - -func (p *readersPool) Redeem(b *bytesReader) { - p.Put(b) -} - var ( - poolOfAdapters = &adaptersPool{ - Pool: sync.Pool{ - New: func() any { - return NewAdapter() - }, - }, - } - - poolOfWriters = &writersPool{ - Pool: sync.Pool{ - New: func() any { - return newJWriter() - }, - }, - } - - poolOfLexers = &lexersPool{ - Pool: sync.Pool{ - New: func() any { - return newLexer(nil) - }, - }, - } - - poolOfReaders = &readersPool{ - Pool: sync.Pool{ - New: func() any { - return &bytesReader{} - }, - }, - } + poolOfAdapters = pools.New[Adapter]() + poolOfWriters = pools.NewRedeemable[jwriter]() + poolOfLexers = pools.NewRedeemable[jlexer]() + poolOfReaders = pools.NewRedeemable[bytesReader]() ) // BorrowAdapter borrows an [Adapter] from the pool, recycling already allocated instances. @@ -124,10 +21,12 @@ func BorrowAdapter() *Adapter { } // BorrowAdapterIface borrows a stdlib [Adapter] and converts it directly -// to [ifaces.Adapter]. This is useful to avoid further allocations when -// translating the concrete type into an interface. +// to [ifaces.Adapter]. +// +// This is useful to avoid further allocations when translating the concrete type into +// an interface. func BorrowAdapterIface() ifaces.Adapter { - return poolOfAdapters.BorrowIface() + return poolOfAdapters.Borrow() } // RedeemAdapter redeems an [Adapter] to the pool, so it may be recycled. diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go index fc8818694e..0dec85425b 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go @@ -10,14 +10,22 @@ import ( "github.com/go-openapi/swag/jsonutils/adapters/ifaces" ) -func Register(dispatcher ifaces.Registrar) { +func Register(dispatcher ifaces.Registrar, opts ...Option) { t := reflect.TypeOf(Adapter{}) + var o options + o = buildOptions(o, opts) + dispatcher.RegisterFor( ifaces.RegistryEntry{ - Who: fmt.Sprintf("%s.%s", t.PkgPath(), t.Name()), - What: ifaces.AllCapabilities, - Constructor: BorrowAdapterIface, - Support: support, + Who: fmt.Sprintf("%s.%s", t.PkgPath(), t.Name()), + What: ifaces.AllCapabilities, + Constructor: func() ifaces.Adapter { + a := BorrowAdapter() + a.options = o + + return a + }, + Support: support, }) } diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go index dc2325c1a3..c84e02cd83 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go @@ -14,17 +14,21 @@ type jwriter struct { err error } -func newJWriter() *jwriter { - buf := make([]byte, 0, sensibleBufferSize) - - return &jwriter{buf: bytes.NewBuffer(buf)} -} - func (w *jwriter) Reset() { - w.buf.Reset() + if w.buf != nil { + w.buf.Reset() + } w.err = nil } +// SetErr records the first error encountered while building the JSON output. +func (w *jwriter) SetErr(err error) { + if w.err != nil { + return + } + w.err = err +} + func (w *jwriter) RawString(s string) { if w.err != nil { return @@ -73,3 +77,12 @@ func (w *jwriter) BuildBytes() ([]byte, error) { return bytes.Clone(w.buf.Bytes()), nil } + +func (w *jwriter) setBuf() { + if w.buf != nil { + return + } + + buf := make([]byte, 0, sensibleBufferSize) + w.buf = bytes.NewBuffer(buf) +} diff --git a/vendor/github.com/go-openapi/swag/loading/doc.go b/vendor/github.com/go-openapi/swag/loading/doc.go index 8cf7bcb8b9..112c49968b 100644 --- a/vendor/github.com/go-openapi/swag/loading/doc.go +++ b/vendor/github.com/go-openapi/swag/loading/doc.go @@ -2,4 +2,28 @@ // SPDX-License-Identifier: Apache-2.0 // Package loading provides tools to load a file from http or from a local file system. +// +// # Security +// +// By default, the local loader reads any path the process can access, including absolute +// paths and "file://" URIs (for example "file:///etc/passwd"). Applications that pass +// untrusted input to [LoadFromFileOrHTTP], [JSONDoc] (or to downstream consumers such as +// go-openapi/loads) must confine local loading to a trusted directory. +// +// Use [WithRoot] to do so: it resolves every requested path relative to a chosen directory +// and rejects anything that escapes it, including via symlink. It is built on [os.Root] +// and is therefore safer than passing an [os.DirFS] to [WithFS], which does not block +// symlink escapes. +// +// Remote loading uses a standard [net/http] client. +// By default it follows redirects and performs no destination filtering — exactly like [net/http.DefaultClient]. +// +// A caller-controlled URL may therefore reach internal services or cloud metadata endpoints +// (server-side request forgery). +// +// This package does not, and should not, embed a network policy: +// when the URL may derive from untrusted input, supply a restricted client with +// [WithHTTPClient] whose transport rejects unwanted destinations at dial time — which also +// covers redirects and DNS rebinding. +// See the example on [LoadFromFileOrHTTP]. package loading diff --git a/vendor/github.com/go-openapi/swag/loading/loading.go b/vendor/github.com/go-openapi/swag/loading/loading.go index 269fb74d16..0b38ac1e38 100644 --- a/vendor/github.com/go-openapi/swag/loading/loading.go +++ b/vendor/github.com/go-openapi/swag/loading/loading.go @@ -17,7 +17,11 @@ import ( "strings" ) -// LoadFromFileOrHTTP loads the bytes from a file or a remote http server based on the path passed in +// LoadFromFileOrHTTP loads the bytes from a file or a remote http server based on the path passed in. +// +// Security: by default a local path is read with no confinement, so a caller-controlled path +// (including a "file://" URI or an absolute path) may read any file the process can access. +// When the path may derive from untrusted input, confine local loading with [WithRoot]. func LoadFromFileOrHTTP(pth string, opts ...Option) ([]byte, error) { o := optionsWithDefaults(opts) return LoadStrategy(pth, o.ReadFileFunc(), loadHTTPBytes(opts...), opts...)(pth) @@ -54,11 +58,14 @@ func LoadFromFileOrHTTP(pth string, opts ...Option) ([]byte, error) { // - `file:///c:/folder/file` becomes `C:\folder\file` // - `file://c:/folder/file` is tolerated (without leading `/`) and becomes `c:\folder\file` func LoadStrategy(pth string, local, remote func(string) ([]byte, error), opts ...Option) func(string) ([]byte, error) { - if strings.HasPrefix(pth, "http") { + if hasHTTPScheme(pth) { return remote } o := optionsWithDefaults(opts) _, isEmbedFS := o.fs.(embed.FS) + // any loader backed by an fs.FS or an os.Root consumes forward-slash paths on every + // platform, so it must not go through the windows-native file:// preprocessing below. + isFSBacked := o.fs != nil || o.root != "" return func(p string) ([]byte, error) { upth, err := url.PathUnescape(p) @@ -67,14 +74,20 @@ func LoadStrategy(pth string, local, remote func(string) ([]byte, error), opts . } cpth, hasPrefix := strings.CutPrefix(upth, "file://") - if !hasPrefix || isEmbedFS || runtime.GOOS != "windows" { + if !hasPrefix || isFSBacked || runtime.GOOS != "windows" { // crude processing: trim the file:// prefix. This leaves full URIs with a host with a (mostly) unexpected result // regular file path provided: just normalize slashes if isEmbedFS { - // on windows, we need to slash the path if FS is an embed FS. + // embed.FS always uses "/" as separator, even on windows, and rejects leading "./" or "/". return local(strings.TrimLeft(filepath.ToSlash(cpth), "./")) // remove invalid leading characters for embed FS } + if isFSBacked { + // other fs.FS (e.g. os.DirFS) and os.Root loaders also use "/" on every platform. + // Escaping paths (absolute, "..", escaping symlinks) are rejected by the loader, not rewritten here. + return local(filepath.ToSlash(cpth)) + } + return local(filepath.FromSlash(cpth)) } @@ -113,6 +126,21 @@ func LoadStrategy(pth string, local, remote func(string) ([]byte, error), opts . } } +// hasHTTPScheme reports whether pth is an absolute URL with an http or https scheme, +// selecting the remote loader. The comparison is case-insensitive, as URL schemes are. +// +// Requiring the "://" separator (rather than a bare "http" prefix) avoids misrouting a +// local file whose name merely starts with "http" (e.g. "httpbin.json") to the remote loader. +func hasHTTPScheme(pth string) bool { + for _, scheme := range [...]string{"http://", "https://"} { + if len(pth) >= len(scheme) && strings.EqualFold(pth[:len(scheme)], scheme) { + return true + } + } + + return false +} + func loadHTTPBytes(opts ...Option) func(path string) ([]byte, error) { o := optionsWithDefaults(opts) diff --git a/vendor/github.com/go-openapi/swag/loading/options.go b/vendor/github.com/go-openapi/swag/loading/options.go index 6674ac69e6..2c12823172 100644 --- a/vendor/github.com/go-openapi/swag/loading/options.go +++ b/vendor/github.com/go-openapi/swag/loading/options.go @@ -4,6 +4,7 @@ package loading import ( + "errors" "io/fs" "net/http" "os" @@ -23,7 +24,8 @@ type ( } fileOptions struct { - fs fs.ReadFileFS + fs fs.ReadFileFS + root string // when non-empty, local reads are confined to this directory via os.Root } options struct { @@ -33,6 +35,20 @@ type ( ) func (fo fileOptions) ReadFileFunc() func(string) ([]byte, error) { + if fo.root != "" { + root := fo.root + + return func(name string) ([]byte, error) { + r, err := os.OpenRoot(root) + if err != nil { + return nil, errors.Join(err, ErrLoader) + } + defer func() { _ = r.Close() }() + + return r.ReadFile(name) + } + } + if fo.fs == nil { return os.ReadFile } @@ -87,8 +103,15 @@ func WithHTTPClient(client *http.Client) Option { // By default, the file system is the one provided by the os package. // // For example, this may be set to consume from an embedded file system, or a rooted FS. +// +// WithFS and [WithRoot] are mutually exclusive: the last one applied wins. +// +// Security note: a file system built from [os.DirFS] confines paths but does NOT protect +// against symlinks that escape the root. To load from a directory derived from untrusted +// input, prefer [WithRoot], which is symlink-escape resistant. func WithFS(filesystem fs.FS) Option { return func(o *options) { + o.root = "" // last-wins vs WithRoot if rfs, ok := filesystem.(fs.ReadFileFS); ok { o.fs = rfs @@ -98,6 +121,28 @@ func WithFS(filesystem fs.FS) Option { } } +// WithRoot confines local file loading to dir. +// +// Every requested path is resolved relative to dir, and any path that would escape dir — +// whether through an absolute path, ".." traversal, or a symlink pointing outside dir — is +// rejected. This is built on [os.Root] and is therefore resistant to the symlink escapes +// that a plain [os.DirFS] does not prevent. +// +// WithRoot is the recommended option when loading specs from a location derived from +// untrusted input. It applies to local loading only and has no effect on remote +// (http/https) loading. WithRoot and [WithFS] are mutually exclusive: the last one applied +// wins. +// +// Note: [os.Root] confines path resolution but does not, by itself, protect against +// traversal of mount/bind boundaries, /proc special files, or device files. Point WithRoot +// at a directory that holds only the documents you intend to expose. +func WithRoot(dir string) Option { + return func(o *options) { + o.root = dir + o.fs = nil // last-wins vs WithFS + } +} + type readFileFS struct { fs.FS } diff --git a/vendor/github.com/go-openapi/swag/loading_iface.go b/vendor/github.com/go-openapi/swag/loading_iface.go index 27ec3fb8c3..78dadfccdf 100644 --- a/vendor/github.com/go-openapi/swag/loading_iface.go +++ b/vendor/github.com/go-openapi/swag/loading_iface.go @@ -80,11 +80,13 @@ func YAMLData(path string) (any, error) { // loadingOptionsWithDefaults bridges deprecated default settings that use package-level variables, // with the recommended use of loading.Option. func loadingOptionsWithDefaults(opts []loading.Option) []loading.Option { - o := []loading.Option{ + const defaultOptions = 3 + o := make([]loading.Option, 0, defaultOptions+len(opts)) + o = append(o, []loading.Option{ loading.WithTimeout(LoadHTTPTimeout), loading.WithBasicAuth(LoadHTTPBasicAuthUsername, LoadHTTPBasicAuthPassword), loading.WithCustomHeaders(LoadHTTPCustomHeaders), - } + }...) o = append(o, opts...) return o diff --git a/vendor/github.com/go-openapi/swag/mangling/BENCHMARK.md b/vendor/github.com/go-openapi/swag/mangling/BENCHMARK.md index 6674c63b72..abe6e9533e 100644 --- a/vendor/github.com/go-openapi/swag/mangling/BENCHMARK.md +++ b/vendor/github.com/go-openapi/swag/mangling/BENCHMARK.md @@ -4,7 +4,7 @@ go test -bench XXX -run XXX -benchtime 30s ``` -## Benchmarks at b3e7a5386f996177e4808f11acb2aa93a0f660df +## Benchmarks at `b3e7a5386f996177e4808f11acb2aa93a0f660df` ``` goos: linux @@ -49,7 +49,7 @@ BenchmarkToXXXName/ToHumanNameLower-16 18599661 1946 ns/op 92 B/op BenchmarkToXXXName/ToHumanNameTitle-16 17581353 2054 ns/op 105 B/op 6 allocs/op ``` -## Benchmarks at d7d2d1b895f5b6747afaff312dd2a402e69e818b +## Benchmarks at `d7d2d1b895f5b6747afaff312dd2a402e69e818b` go1.24 diff --git a/vendor/github.com/go-openapi/swag/jsonname/LICENSE b/vendor/github.com/go-openapi/swag/pools/LICENSE similarity index 100% rename from vendor/github.com/go-openapi/swag/jsonname/LICENSE rename to vendor/github.com/go-openapi/swag/pools/LICENSE diff --git a/vendor/github.com/go-openapi/swag/pools/README.md b/vendor/github.com/go-openapi/swag/pools/README.md new file mode 100644 index 0000000000..1966461cb5 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/pools/README.md @@ -0,0 +1 @@ +# pools diff --git a/vendor/github.com/go-openapi/swag/pools/debug.go b/vendor/github.com/go-openapi/swag/pools/debug.go new file mode 100644 index 0000000000..94415e989e --- /dev/null +++ b/vendor/github.com/go-openapi/swag/pools/debug.go @@ -0,0 +1,17 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package pools + +// TB is the subset of [testing.TB] used by [AssertNoLeaks]. +// +// It is satisfied by *[testing.T] and *[testing.B]. +// +// A local interface is used (rather than importing "testing") so that the +// release build does not pull the testing package — and its flags — into +// production binaries. +type TB interface { + Helper() + Errorf(format string, args ...any) + Logf(format string, args ...any) +} diff --git a/vendor/github.com/go-openapi/swag/pools/debug_off.go b/vendor/github.com/go-openapi/swag/pools/debug_off.go new file mode 100644 index 0000000000..9163d6d60e --- /dev/null +++ b/vendor/github.com/go-openapi/swag/pools/debug_off.go @@ -0,0 +1,51 @@ +//go:build !poolsdebug + +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package pools + +// This is the release implementation of the pool instrumentation: it does +// nothing. +// +// tracker is an empty struct, so it adds no field to the pool types and its +// methods inline away to nothing. +// +// Build with -tags poolsdebug to get the instrumented variant (see +// debug_on.go). + +// debugBuild reports whether the pool instrumentation is compiled in (the +// poolsdebug tag). +const debugBuild = false + +// DebugBuild reports whether the pool instrumentation is compiled in (the +// poolsdebug build tag). +// +// It lets a test that must run in both modes skip the parts that are invalid +// under instrumentation — e.g. an allocation-count assertion, since the +// instrumented build allocates a per-borrow tracker. +const DebugBuild = debugBuild + +type tracker[T any] struct{} + +func (tracker[T]) register() {} + +func (tracker[T]) onBorrow(*T) {} + +func (tracker[T]) onRedeem(*T) {} + +func (tracker[T]) borrowRedeemer(_ *T, cached func()) func() { return cached } + +// AssertNoLeaks reports whether every borrowed object has been redeemed across +// all pools. +// +// It is only meaningful in the instrumented build (-tags poolsdebug). +// +// In a release build it is a no-op that always reports true, so the same test +// can run in both modes. +func AssertNoLeaks(TB) bool { return true } + +// ResetTracking clears all recorded borrow/redeem tracking. +// +// This is a no-op in a release build. +func ResetTracking() {} diff --git a/vendor/github.com/go-openapi/swag/pools/debug_on.go b/vendor/github.com/go-openapi/swag/pools/debug_on.go new file mode 100644 index 0000000000..64ccc57d38 --- /dev/null +++ b/vendor/github.com/go-openapi/swag/pools/debug_on.go @@ -0,0 +1,237 @@ +//go:build poolsdebug + +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package pools + +import ( + "fmt" + "runtime" + "sync" +) + +// This is the instrumented implementation of the pool tracking, enabled with +// -tags poolsdebug. +// +// Each pool carries a tracker that records, per recycled pointer, whether it is +// currently borrowed or redeemed, together with the call sites of the last +// borrow and redeem. +// It panics loudly (with those call sites) when it detects misuse: +// +// - a double redeem (the same object returned to the pool twice — corrupts sync.Pool); +// - for the redeemable pools, a redeem of a stale borrow (the slot was re-borrowed since — the +// ABA case the production atomic guard cannot catch), thanks to a per-borrow generation; +// - a redeem of an object the pool never handed out; +// - a borrow of an object still checked out (a symptom of an earlier double-Put). +// +// Borrowed-but-never-redeemed objects (leaks) are reported by [AssertNoLeaks]. + +// debugBuild reports whether the pool instrumentation is compiled in (the +// poolsdebug tag). +const debugBuild = true + +// DebugBuild reports whether the pool instrumentation is compiled in (the +// poolsdebug build tag). +// +// See the release-build doc for usage. +const DebugBuild = debugBuild + +type trackStatus uint8 + +const ( + trackBorrowed trackStatus = iota + 1 + trackRedeemed +) + +type trackEntry struct { + status trackStatus + gen uint64 // identifies the current borrow, to detect a redeem racing a re-borrow (ABA) + borrowedAt string + redeemedAt string +} + +type tracker[T any] struct { + mu sync.Mutex + entries map[*T]*trackEntry + nextGen uint64 +} + +func (t *tracker[T]) register() { + t.mu.Lock() + if t.entries == nil { + t.entries = make(map[*T]*trackEntry) + } + t.mu.Unlock() + + registerLeakChecker(t) +} + +// markBorrow records a borrow of ptr and returns its generation. +// +// Caller must hold no lock. +func (t *tracker[T]) markBorrow(ptr *T, site string) uint64 { + t.mu.Lock() + defer t.mu.Unlock() + + e := t.entries[ptr] + if e == nil { + e = &trackEntry{} + t.entries[ptr] = e + } else if e.status == trackBorrowed { + panic(fmt.Sprintf( + "pools: borrow of an object still checked out (borrowed at %s); "+ + "this usually means it was redeemed twice earlier", e.borrowedAt)) + } + + t.nextGen++ + e.status = trackBorrowed + e.gen = t.nextGen + e.borrowedAt = site + + return t.nextGen +} + +// markRedeem validates and records a redeem of ptr. gen is the borrow +// generation the caller is redeeming, or 0 to skip the ABA check (plain +// Pool[T], which has no per-borrow token). +func (t *tracker[T]) markRedeem(ptr *T, gen uint64, site string) { + t.mu.Lock() + defer t.mu.Unlock() + + e := t.entries[ptr] + switch { + case e == nil: + panic("pools: redeem of an object this pool never handed out") + case e.status != trackBorrowed: + panic(fmt.Sprintf("pools: double redeem (first redeemed at %s)", e.redeemedAt)) + case gen != 0 && e.gen != gen: + panic(fmt.Sprintf( + "pools: redeem of a stale borrow (the slot was re-borrowed at %s since this borrow); "+ + "a redeem is racing a re-borrow of the same slot (ABA)", e.borrowedAt)) + } + + e.status = trackRedeemed + e.redeemedAt = site +} + +const stackOffset = 3 + +func (t *tracker[T]) onBorrow(ptr *T) { + t.markBorrow(ptr, caller(stackOffset)) +} + +func (t *tracker[T]) onRedeem(ptr *T) { + t.markRedeem(ptr, 0, caller(stackOffset)) +} + +// borrowRedeemer records the borrow and returns a generation-stamped redeemer +// that validates the redeem (catching double-redeem and ABA) before delegating +// to the cached redeemer. +func (t *tracker[T]) borrowRedeemer(ptr *T, cached func()) func() { + gen := t.markBorrow(ptr, caller(stackOffset)) + + return func() { + t.markRedeem(ptr, gen, caller(stackOffset-1)) + cached() + } +} + +func (t *tracker[T]) checkLeaks(tb TB) bool { + t.mu.Lock() + defer t.mu.Unlock() + + ok := true + for _, e := range t.entries { + if e.status != trackRedeemed { + tb.Logf("pools: object borrowed but never redeemed (borrowed at %s)", e.borrowedAt) + ok = false + } + } + + return ok +} + +func (t *tracker[T]) resetTracking() { + t.mu.Lock() + t.entries = make(map[*T]*trackEntry) + t.nextGen = 0 + t.mu.Unlock() +} + +// leakChecker is the build-erased view of a tracker that the global registry +// holds, so trackers of different element types can be checked uniformly. +type leakChecker interface { + checkLeaks(tb TB) bool + resetTracking() +} + +var ( + registryMu sync.Mutex + registry []leakChecker +) + +func registerLeakChecker(c leakChecker) { + registryMu.Lock() + registry = append(registry, c) + registryMu.Unlock() +} + +// AssertNoLeaks reports whether every borrowed object has been redeemed across +// all pools created so far. +// +// It logs the borrow call site of each leaked object and fails tb when any are +// found. +// +// Typical use, with [ResetTracking] to isolate the test from earlier ones: +// +// func TestX(t *testing.T) { +// pools.ResetTracking() +// t.Cleanup(func() { pools.AssertNoLeaks(t) }) +// // ... exercise code that borrows/redeems ... +// } +func AssertNoLeaks(tb TB) bool { + tb.Helper() + registryMu.Lock() + defer registryMu.Unlock() + + ok := true + for _, c := range registry { + if !c.checkLeaks(tb) { + ok = false + } + } + if !ok { + tb.Errorf("pools: leaked pooled objects detected (borrowed but never redeemed)") + } + + return ok +} + +// ResetTracking clears all recorded borrow/redeem tracking across every pool. +// +// Call it at the start of a test so leaks from earlier tests are not attributed +// to it. +func ResetTracking() { + registryMu.Lock() + defer registryMu.Unlock() + + for _, c := range registry { + c.resetTracking() + } +} + +// caller returns "file:line" of the frame skip levels above caller itself. +func caller(skip int) string { + pc, _, _, ok := runtime.Caller(skip) + if !ok { + return "unknown" + } + fn := runtime.FuncForPC(pc) + if fn == nil { + return "unknown" + } + file, line := fn.FileLine(pc) + + return fmt.Sprintf("%s:%d", file, line) +} diff --git a/vendor/github.com/go-openapi/swag/pools/doc.go b/vendor/github.com/go-openapi/swag/pools/doc.go new file mode 100644 index 0000000000..395c24d29a --- /dev/null +++ b/vendor/github.com/go-openapi/swag/pools/doc.go @@ -0,0 +1,26 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +// Package pools provide utilities to recycle allocated objects. +// +// This package provides: +// +// - a generic [Pool] type that wraps [sync.Pool], +// - a [PoolRedeemable] variant that hands out a cached redeem closure, +// - a [PoolSlice] for recycling slices without juggling pointers. +// +// # Debug build +// +// Building with the "poolsdebug" tag (go test -tags poolsdebug ./...) turns on +// instrumentation that tracks every borrow and redeem and panics on misuse: +// +// - double redeem (including the A -> B -> A case for the redeemable pools), +// - redeem of a foreign object, +// - borrow of an object still checked out +// +// It reports the offending call sites. +// +// [AssertNoLeaks] then reports any object borrowed but never redeemed. +// +// The instrumentation is a no-op with zero overhead when the tag is absent. +package pools diff --git a/vendor/github.com/go-openapi/swag/pools/pools.go b/vendor/github.com/go-openapi/swag/pools/pools.go new file mode 100644 index 0000000000..d78ea5790a --- /dev/null +++ b/vendor/github.com/go-openapi/swag/pools/pools.go @@ -0,0 +1,410 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package pools + +import ( + "iter" + "slices" + "sync" + "sync/atomic" +) + +// Resettable is an interface for types that want to recycle a clean instance +// from a [Pool]. +// +// When T (or rather *T) implements [Resettable], the pool calls Reset on an +// instance both when it is redeemed and when it is borrowed: +// +// - on redeem, so that no references held by the instance are retained while it sits idle in the +// pool (which would pin a reference graph alive across a GC cycle); +// - on borrow, so that the next borrower receives a clean object regardless of how the instance +// reached the pool. +// +// Reset must be safe to call more than once on the same instance (it runs at +// least twice per cycle). +type Resettable interface { + Reset() +} + +// resetIfResettable calls Reset on v when *T implements [Resettable]. +func resetIfResettable[T any](v *T) { + if r, ok := any(v).(Resettable); ok { + r.Reset() + } +} + +// borrow state of a [redeemable] wrapper, used to detect double-redeem. +const ( + stateIdle uint32 = iota // sitting in the pool (or freshly created), not checked out + stateBorrowed // checked out by a borrower +) + +type redeemable[T any] struct { + inner *T + redeemer func() + // state guards against a double-redeem (the same wrapper Put into the pool + // twice, which would let one object be handed to two borrowers). + // + // It is set to stateBorrowed on borrow and atomically flipped back to + // stateIdle on redeem; a redeem that finds it already idle panics. + state atomic.Uint32 +} + +// redeemPanic is the message raised when a slot is redeemed while already idle. +const redeemPanic = "pools: " + + "double redeem detected (object already returned to the pool); " + + "a borrowed object must be redeemed exactly once" + +// Pool wraps a [sync.Pool] to make it available for any type. +// +// T must be the value type of the pooled object (e.g. Pool[bytes.Buffer]): +// [Pool.Borrow] returns a *T. Using a pointer type as T (e.g. +// Pool[*bytes.Buffer]) would yield a **T and is almost certainly a mistake. +type Pool[T any] struct { + pool sync.Pool + tracker tracker[T] // empty (zero-cost) unless built with the poolsdebug tag +} + +// PoolRedeemable wraps a [sync.Pool] to make it available for any type. +// +// It differs from [Pool] in the way objects are redeemed to the pool: borrowing +// also yields a cached redeem closure, so no closure is allocated at redeem +// time. +type PoolRedeemable[T any] struct { + pool sync.Pool + tracker tracker[redeemable[T]] // empty (zero-cost) unless built with the poolsdebug tag +} + +// New builds a new [Pool] to recycle allocations of type T explicitly using +// [Pool.Redeem] and the allocated pointer. +// +// Freshly allocated instances of type T are set to their zero value; like +// recycled instances they are reset (if [Resettable]) when borrowed, so +// [Pool.Borrow] always yields a clean object. +func New[T any]() *Pool[T] { + p := &Pool[T]{} + p.pool = sync.Pool{ + New: func() any { + return new(T) + }, + } + p.tracker.register() + + return p +} + +// NewRedeemable builds a new redeemable [Pool] to recycle allocations of type +// T, and use the inner redeemer to relinquish objects to the pool. +func NewRedeemable[T any]() *PoolRedeemable[T] { + p := &PoolRedeemable[T]{} + p.pool = sync.Pool{ + New: func() any { + r := &redeemable[T]{inner: new(T)} + r.redeemer = func() { + if !r.state.CompareAndSwap(stateBorrowed, stateIdle) { + panic(redeemPanic) + } + resetIfResettable(r.inner) + p.pool.Put(r) + } + + return r + }, + } + p.tracker.register() + + return p +} + +// Borrow an instance from the pool. +// +// If the type implements [Resettable], the returned instance is reset before +// being handed out, so it is always clean. +func (p *Pool[T]) Borrow() *T { + target := p.pool.Get().(*T) + resetIfResettable(target) + p.tracker.onBorrow(target) + + return target +} + +// Redeem a borrowed instance to the pool. +// +// A nil pointer is ignored (it would otherwise corrupt the pool: a typed-nil +// boxed into an interface is not the nil interface that [sync.Pool.Put] skips). +// +// The instance is reset (if it implements [Resettable]) before being returned +// to the pool. +// After calling Redeem, the caller must drop its reference to ptr: continuing +// to use it is a use-after-redeem bug. +// +// Unlike [PoolRedeemable], this plain pool holds no per-object state, so it +// cannot detect a double-redeem of the same pointer (which corrupts the pool). +// +// Prefer [PoolRedeemable] when you want that guard, or the debug build for full +// tracking. +func (p *Pool[T]) Redeem(ptr *T) { + if ptr == nil { + return + } + p.tracker.onRedeem(ptr) + resetIfResettable(ptr) + p.pool.Put(ptr) +} + +// BorrowWithRedeem borrows an instance from the pool and provides the +// corresponding redeem function. +// +// This is useful for instance to use with defer. +// +// The instance is reset (if it implements [Resettable]) both when borrowed and +// when the returned redeem closure is called. +// After calling the redeem closure, the caller must drop its reference to the +// returned instance. +// +// Calling the redeem closure more than once panics (see [redeemable.state]): a +// borrowed instance must be redeemed exactly once. +func (p *PoolRedeemable[T]) BorrowWithRedeem() (*T, func()) { + container := p.pool.Get().(*redeemable[T]) + container.state.Store(stateBorrowed) + resetIfResettable(container.inner) + + // In release builds borrowRedeemer returns container.redeemer unchanged (zero + // cost). + // Under the poolsdebug tag it returns a generation-stamped wrapper that tracks + // the borrow and detects double-redeem (incl. + // + // ABA), foreign-redeem and leaks. + return container.inner, p.tracker.borrowRedeemer(container, container.redeemer) +} + +// Slice is a struct that wraps a slice []T. +// +// This is useful to borrow and redeem slices from a pool, without having to +// constantly manipulate pointers to the slice. +// +// The wrapper holds the authoritative slice header. +// +// Its mutating methods ([Slice.Append], [Slice.Concat], [Slice.Grow]) return +// the current backing slice for convenience, so it reads as an idiomatic []T. +// +// But the returned slice is only a snapshot of the wrapper's state at that +// moment: if you keep it and grow it yourself with the builtin append and it +// reallocates, the new backing array lives only in your local copy and is NOT +// tracked by the wrapper — it will not be recycled when the wrapper is +// redeemed (and a later borrower would get the old, smaller array). +// +// Rule of thumb: it is fine to read or pass the returned []T to a consumer; but +// if you plan to grow the slice, keep calling the wrapper's methods so the +// growth is tracked and recycled. +type Slice[T any] struct { + length int + inner []T +} + +// Slice returns the inner slice. +// +// Treat the result as a read-only view (for ranging or passing to a consumer), +// valid until the next mutation or redeem. +// To grow or append, use the wrapper methods so the new backing array is +// tracked and recycled (see [Slice]). +func (s *Slice[T]) Slice() []T { + return s.inner +} + +// Grow the inner slice so it can accommodate at least size more elements +// without reallocating, and return the current backing slice. +// +// Growth is tracked by the wrapper, so the enlarged backing array is recycled +// on redeem. +// See [Slice] for the caveat about growing the returned slice yourself. +func (s *Slice[T]) Grow(size int) []T { + s.inner = slices.Grow(s.inner, size) + + return s.inner +} + +func (s *Slice[T]) Len() int { + return len(s.inner) +} + +func (s *Slice[T]) Cap() int { + return cap(s.inner) +} + +// Append elements to the inner slice and return the current backing slice. +// +// This should be preferred to the append builtin if you plan that the slice will +// grow and you want the newly allocated space to be tracked and recycled. +// See [Slice] for the caveat about growing the returned slice yourself. +func (s *Slice[T]) Append(elems ...T) []T { + s.inner = append(s.inner, elems...) + + return s.inner +} + +// Concat another slice to the inner slice and return the current backing slice. +// +// Unlike [slices.Concat], this reuses the inner slice's capacity instead of +// always allocating a fresh backing array. +// See [Slice] for the caveat about growing the returned slice yourself. +func (s *Slice[T]) Concat(slice []T) []T { + s.inner = append(s.inner, slice...) + + return s.inner +} + +// IndexedElems iterates over the inner slice. +func (s *Slice[T]) IndexedElems() iter.Seq2[int, T] { + return func(yield func(int, T) bool) { + for i, elem := range s.inner { + if !yield(i, elem) { + return + } + } + } +} + +// Reset the inner slice to its configured initial length, keeping allocated +// capacity. +// +// All elements are zeroed, so the pool never retains stale element references +// (which would keep a referenced graph alive for slices of pointers) and so a +// [WithLength] slice is handed out clean rather than carrying data from a +// previous borrower. +func (s *Slice[T]) Reset() { + clear(s.inner) + if s.length > cap(s.inner) { + s.inner = slices.Grow(s.inner[:0], s.length) + } + s.inner = s.inner[:s.length] +} + +// Clip removes unused capacity from the inner slice. +func (s *Slice[T]) Clip() { + s.inner = slices.Clip(s.inner) +} + +// resetWithCapacity discards the current backing array and replaces it with a +// fresh one of the configured length and the given capacity. +// +// It is used by a capacity-capped pool to stop recycling an oversized backing +// array (the old array is left for the GC). +func (s *Slice[T]) resetWithCapacity(capacity int) { + s.inner = make([]T, s.length, max(s.length, capacity)) +} + +// PoolSlice is a pool of [Slice[T]]. +// +// [PoolSlice.BorrowWithRedeem] will return an empty inner slice by default. +// This default may be altered using [WithMinimumCapacity]. +// +// Use [PoolSlice.BorrowWithSizeAndRedeem] or [Slice.Grow] to grow the capacity +// of the inner slice. +type PoolSlice[T any] struct { + // redeemable is held as an unexported field rather than embedded, so the + // underlying [PoolRedeemable] and its [sync.Pool] are not part of PoolSlice's + // public surface. + redeemable *PoolRedeemable[Slice[T]] +} + +// PoolSliceOption alters the default settings to allocate new pooled slices +type PoolSliceOption func(*poolSliceOptions) + +type poolSliceOptions struct { + minCapacity int + length int + maxCapacity int +} + +func WithMinimumCapacity(size int) PoolSliceOption { + return func(o *poolSliceOptions) { + o.minCapacity = size + } +} + +// WithMaxCapacity bounds the capacity of recycled slices. +// +// When a borrowed slice has grown past size at redeem time, its (oversized) +// backing array is discarded and replaced with a fresh one sized to the minimum +// capacity, instead of being recycled. +// +// This stops the pool from accumulating large backing arrays after an +// occasional large request, keeping the steady-state memory bounded. +// +// The trade-off: a workload that genuinely needs slices larger than size will +// reallocate on every cycle. +// Set size from the high-water mark you actually expect, not below it. +// A size of 0 (the default) means no cap: grown slices are recycled as-is. +func WithMaxCapacity(size int) PoolSliceOption { + return func(o *poolSliceOptions) { + o.maxCapacity = size + } +} + +// WithLength ensures that the borrowed slices have a fixed given initial +// length. +// +// By default, the borrowed slices are reset to length 0. +func WithLength(size int) PoolSliceOption { + return func(o *poolSliceOptions) { + o.length = size + } +} + +// NewPoolSlice builds a pool to recycle slices of type []T. +func NewPoolSlice[T any](opts ...PoolSliceOption) *PoolSlice[T] { + var o poolSliceOptions + for _, apply := range opts { + apply(&o) + } + + rp := &PoolRedeemable[Slice[T]]{} + rp.pool = sync.Pool{ + New: func() any { + s := &redeemable[Slice[T]]{ + inner: &Slice[T]{ + length: o.length, + inner: make([]T, o.length, max(o.length, o.minCapacity)), + }, + } + + s.redeemer = func() { + if !s.state.CompareAndSwap(stateBorrowed, stateIdle) { + panic(redeemPanic) + } + if o.maxCapacity > 0 && s.inner.Cap() > o.maxCapacity { + s.inner.resetWithCapacity(o.minCapacity) + } else { + s.inner.Reset() + } + rp.pool.Put(s) + } + + return s + }, + } + rp.tracker.register() + + return &PoolSlice[T]{redeemable: rp} +} + +// BorrowWithRedeem returns the slice wrapper and the redeem closure to +// relinquish the allocated wrapper. +// +// The wrapper is reset (elements zeroed, length restored) both on borrow and +// when the redeem closure is called. +// Calling the redeem closure more than once panics. +func (p *PoolSlice[T]) BorrowWithRedeem() (*Slice[T], func()) { + return p.redeemable.BorrowWithRedeem() +} + +// BorrowWithSizeAndRedeem borrows a slice []T from the pool and ensures that +// its capacity is at least the provided size. +func (p *PoolSlice[T]) BorrowWithSizeAndRedeem(size int) (*Slice[T], func()) { + s, redeem := p.BorrowWithRedeem() + s.Grow(size) + + return s, redeem +} diff --git a/vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go b/vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go index 3daf68dbba..24d951f8de 100644 --- a/vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go +++ b/vendor/github.com/go-openapi/swag/yamlutils/ordered_map.go @@ -123,7 +123,7 @@ func (s YAMLMapSlice) MarshalYAML() (any, error) { var nodes []*yaml.Node for _, item := range s { - nn, err := json2yaml(item.Value) + nn, err := json2yaml(item.Value, 1) if err != nil { return nil, err } @@ -153,6 +153,17 @@ func (s YAMLMapSlice) MarshalYAML() (any, error) { // // It implements [yaml.Unmarshaler]. func (s *YAMLMapSlice) UnmarshalYAML(node *yaml.Node) error { + return s.unmarshalYAML(newYAMLWalker(), node, 0) +} + +// unmarshalYAML builds the slice from a [yaml.Node], tracking the recursion depth (against +// stack-overflow) and threading the [yamlWalker] so anchor/alias expansion stays bounded +// across the whole document. +func (s *YAMLMapSlice) unmarshalYAML(w *yamlWalker, node *yaml.Node, depth int) error { + if depth > defaultMaxNestingDepth { + return errMaxNestingDepth + } + if typeutils.IsNil(*s) { // allow to unmarshal with a simple var declaration (nil slice) *s = YAMLMapSlice{} @@ -167,13 +178,17 @@ func (s *YAMLMapSlice) UnmarshalYAML(node *yaml.Node) error { m = m[:0] for i := 0; i < len(node.Content); i += 2 { + if err := w.account(); err != nil { // account the key node + return err + } + var nmi YAMLMapItem k, err := yamlStringScalarC(node.Content[i]) if err != nil { return fmt.Errorf("unable to decode YAML map key: %w: %w", err, ErrYAML) } nmi.Key = k - v, err := yamlNode(node.Content[i+1]) + v, err := w.node(node.Content[i+1], depth+1) if err != nil { return fmt.Errorf("unable to process YAML map value for key %q: %w: %w", k, err, ErrYAML) } @@ -186,7 +201,11 @@ func (s *YAMLMapSlice) UnmarshalYAML(node *yaml.Node) error { return nil } -func json2yaml(item any) (*yaml.Node, error) { +func json2yaml(item any, depth int) (*yaml.Node, error) { + if depth > defaultMaxNestingDepth { + return nil, errMaxNestingDepth + } + if typeutils.IsNil(item) { return &yaml.Node{ Kind: yaml.ScalarNode, @@ -196,7 +215,7 @@ func json2yaml(item any) (*yaml.Node, error) { switch val := item.(type) { case ifaces.Ordered: - return orderedYAML(val) + return orderedYAML(val, depth) case map[string]any: var n yaml.Node @@ -209,7 +228,7 @@ func json2yaml(item any) (*yaml.Node, error) { for _, k := range keys { v := val[k] - childNode, err := json2yaml(v) + childNode, err := json2yaml(v, depth+1) if err != nil { return nil, err } @@ -225,7 +244,7 @@ func json2yaml(item any) (*yaml.Node, error) { var n yaml.Node n.Kind = yaml.SequenceNode for i := range val { - childNode, err := json2yaml(val[i]) + childNode, err := json2yaml(val[i], depth+1) if err != nil { return nil, err } @@ -297,11 +316,11 @@ func uintegerNode[T conv.Unsigned](val T) (*yaml.Node, error) { }, nil } -func orderedYAML[T ifaces.Ordered](val T) (*yaml.Node, error) { +func orderedYAML[T ifaces.Ordered](val T, depth int) (*yaml.Node, error) { var n yaml.Node n.Kind = yaml.MappingNode for key, value := range val.OrderedItems() { - childNode, err := json2yaml(value) + childNode, err := json2yaml(value, depth+1) if err != nil { return nil, err } diff --git a/vendor/github.com/go-openapi/swag/yamlutils/yaml.go b/vendor/github.com/go-openapi/swag/yamlutils/yaml.go index e3aff3c2fd..d4b5335f6f 100644 --- a/vendor/github.com/go-openapi/swag/yamlutils/yaml.go +++ b/vendor/github.com/go-openapi/swag/yamlutils/yaml.go @@ -12,13 +12,99 @@ import ( yaml "go.yaml.in/yaml/v3" ) +// defaultMaxNestingDepth caps the recursion depth of the YAML<->JSON transforms to +// guard against stack-overflow on deeply nested (possibly adversarial) input. +// +// It matches the limit enforced by go.yaml.in/yaml/v3's own parser and by +// encoding/json's decoder. +const defaultMaxNestingDepth = 10000 + +// Bounds on YAML anchor/alias expansion. +// +// go.yaml.in/yaml/v3 enforces these when decoding into Go values, but that guard is +// coupled to the library's own tree walk: when we decode into a low-level [yaml.Node] +// (to preserve key order) and expand aliases ourselves in [yamlWalker.node], we bypass +// it. We therefore reproduce it here, with the same constants and ratio schedule as the +// library's decoder (see go.yaml.in/yaml/v3 decode.go, "excessive aliasing"). +const ( + aliasCountThreshold = 100 + decodeCountThreshold = 1000 + + // 400,000 decode operations is ~500kb of dense object declarations, or + // ~5kb of dense object declarations with 10000% alias expansion. + aliasRatioRangeLow = 400000 + // 4,000,000 decode operations is ~5MB of dense object declarations. + aliasRatioRangeHigh = 4000000 + aliasRatioRange = float64(aliasRatioRangeHigh - aliasRatioRangeLow) + + // tolerated share of alias-driven decodes: from aliasRatioSmall (small/medium documents) + // down to aliasRatioLarge (very large ones), interpolated with slope aliasRatioSlope. + aliasRatioSmall = 0.99 + aliasRatioLarge = 0.10 + aliasRatioSlope = aliasRatioSmall - aliasRatioLarge +) + +var ( + // errMaxNestingDepth is returned when a document nests deeper than [defaultMaxNestingDepth]. + errMaxNestingDepth = fmt.Errorf("maximum nesting depth of %d exceeded: %w", defaultMaxNestingDepth, ErrYAML) + + // errExcessiveAliasing is returned when anchor/alias expansion is disproportionate to the + // size of the document, i.e. an "alias bomb". + errExcessiveAliasing = fmt.Errorf("document contains excessive aliasing: %w", ErrYAML) +) + +// allowedAliasRatio scales the tolerated share of alias-driven decode operations from 99% +// for small-to-medium documents down to 10% for very large ones, mirroring go.yaml.in/yaml/v3. +func allowedAliasRatio(decodeCount int) float64 { + switch { + case decodeCount <= aliasRatioRangeLow: + return aliasRatioSmall + case decodeCount >= aliasRatioRangeHigh: + return aliasRatioLarge + default: + return aliasRatioSmall - aliasRatioSlope*(float64(decodeCount-aliasRatioRangeLow)/aliasRatioRange) + } +} + +// yamlWalker carries the state needed to bound a single YAML-tree traversal: +// anchor/alias expansion accounting and cycle detection. +// +// A fresh walker is created per top-level conversion; it is threaded (not copied) through +// the whole recursive walk so its counters accumulate across the entire document. +type yamlWalker struct { + decodeCount int + aliasCount int + aliasDepth int + aliases map[*yaml.Node]bool // anchors currently being expanded, for cycle detection +} + +func newYAMLWalker() *yamlWalker { + return &yamlWalker{aliases: make(map[*yaml.Node]bool)} +} + +// account records one processed node and fails if alias expansion has become excessive. +func (w *yamlWalker) account() error { + w.decodeCount++ + if w.aliasDepth > 0 { + w.aliasCount++ + } + + if w.aliasCount > aliasCountThreshold && + w.decodeCount > decodeCountThreshold && + float64(w.aliasCount)/float64(w.decodeCount) > allowedAliasRatio(w.decodeCount) { + return errExcessiveAliasing + } + + return nil +} + // YAMLToJSON converts a YAML document into JSON bytes. // // Note: a YAML document is the output from a [yaml.Marshaler], e.g a pointer to a [yaml.Node]. // // [YAMLToJSON] is typically called after [BytesToYAMLDoc]. func YAMLToJSON(value any) (json.RawMessage, error) { - jm, err := transformData(value) + jm, err := transformData(value, 0) if err != nil { return nil, err } @@ -44,46 +130,73 @@ func BytesToYAMLDoc(data []byte) (any, error) { return &document, nil } -func yamlNode(root *yaml.Node) (any, error) { +func (w *yamlWalker) node(root *yaml.Node, depth int) (any, error) { + if depth > defaultMaxNestingDepth { + return nil, errMaxNestingDepth + } + if err := w.account(); err != nil { + return nil, err + } + switch root.Kind { case yaml.DocumentNode: - return yamlDocument(root) + return w.document(root, depth) case yaml.SequenceNode: - return yamlSequence(root) + return w.sequence(root, depth) case yaml.MappingNode: - return yamlMapping(root) + return w.mapping(root, depth) case yaml.ScalarNode: return yamlScalar(root) case yaml.AliasNode: - return yamlNode(root.Alias) + return w.alias(root, depth) default: return nil, fmt.Errorf("unsupported YAML node type: %v: %w", root.Kind, ErrYAML) } } -func yamlDocument(node *yaml.Node) (any, error) { +// alias resolves an anchor reference, expanding the anchored subtree. It detects cycles +// (an anchor whose expansion transitively references itself) and accounts the expansion +// against the alias-bomb budget via [yamlWalker.aliasDepth]. +func (w *yamlWalker) alias(node *yaml.Node, depth int) (any, error) { + if node.Alias == nil { + return nil, fmt.Errorf("invalid YAML alias node %q: %w", node.Value, ErrYAML) + } + if w.aliases[node.Alias] { + return nil, fmt.Errorf("anchor %q contains itself: %w", node.Value, ErrYAML) + } + + w.aliases[node.Alias] = true + w.aliasDepth++ + out, err := w.node(node.Alias, depth+1) + w.aliasDepth-- + delete(w.aliases, node.Alias) + + return out, err +} + +func (w *yamlWalker) document(node *yaml.Node, depth int) (any, error) { if len(node.Content) != 1 { return nil, fmt.Errorf("unexpected YAML Document node content length: %d: %w", len(node.Content), ErrYAML) } - return yamlNode(node.Content[0]) + return w.node(node.Content[0], depth+1) } -func yamlMapping(node *yaml.Node) (any, error) { +func (w *yamlWalker) mapping(node *yaml.Node, depth int) (any, error) { const sensibleAllocDivider = 2 // nodes concatenate (key,value) sequences m := make(YAMLMapSlice, len(node.Content)/sensibleAllocDivider) - if err := m.UnmarshalYAML(node); err != nil { + if err := m.unmarshalYAML(w, node, depth); err != nil { return nil, err } return m, nil } -func yamlSequence(node *yaml.Node) (any, error) { +func (w *yamlWalker) sequence(node *yaml.Node, depth int) (any, error) { s := make([]any, 0) for i := range len(node.Content) { - v, err := yamlNode(node.Content[i]) + v, err := w.node(node.Content[i], depth+1) if err != nil { return nil, fmt.Errorf("unable to decode YAML sequence value: %w: %w", err, ErrYAML) } @@ -174,12 +287,16 @@ func format(t any) (string, error) { } } -func transformData(input any) (out any, err error) { +func transformData(input any, depth int) (out any, err error) { + if depth > defaultMaxNestingDepth { + return nil, errMaxNestingDepth + } + switch in := input.(type) { case yaml.Node: - return yamlNode(&in) + return newYAMLWalker().node(&in, depth) case *yaml.Node: - return yamlNode(in) + return newYAMLWalker().node(in, depth) case map[any]any: o := make(YAMLMapSlice, 0, len(in)) for ke, va := range in { @@ -188,7 +305,7 @@ func transformData(input any) (out any, err error) { return nil, err } - v, ert := transformData(va) + v, ert := transformData(va, depth+1) if ert != nil { return nil, ert } @@ -200,7 +317,7 @@ func transformData(input any) (out any, err error) { len1 := len(in) o := make([]any, len1) for i := range len1 { - o[i], err = transformData(in[i]) + o[i], err = transformData(in[i], depth+1) if err != nil { return nil, err } diff --git a/vendor/k8s.io/api/admission/v1/types.go b/vendor/k8s.io/api/admission/v1/types.go index 34cbf2f59b..f9a79ecd75 100644 --- a/vendor/k8s.io/api/admission/v1/types.go +++ b/vendor/k8s.io/api/admission/v1/types.go @@ -28,7 +28,7 @@ import ( // AdmissionReview describes an admission review request/response. type AdmissionReview struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // request describes the attributes for the admission request. // +optional Request *AdmissionRequest `json:"request,omitempty" protobuf:"bytes,1,opt,name=request"` diff --git a/vendor/k8s.io/api/admission/v1beta1/types.go b/vendor/k8s.io/api/admission/v1beta1/types.go index 015dc8ba3e..cb32a2fa07 100644 --- a/vendor/k8s.io/api/admission/v1beta1/types.go +++ b/vendor/k8s.io/api/admission/v1beta1/types.go @@ -32,7 +32,7 @@ import ( // AdmissionReview describes an admission review request/response. type AdmissionReview struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // request describes the attributes for the admission request. // +optional Request *AdmissionRequest `json:"request,omitempty" protobuf:"bytes,1,opt,name=request"` diff --git a/vendor/k8s.io/api/admissionregistration/v1/generated.proto b/vendor/k8s.io/api/admissionregistration/v1/generated.proto index 89c1475b2e..718b7c14e8 100644 --- a/vendor/k8s.io/api/admissionregistration/v1/generated.proto +++ b/vendor/k8s.io/api/admissionregistration/v1/generated.proto @@ -872,6 +872,7 @@ message TypeChecking { } // ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it. +// +k8s:supportsSubresource="/status" message ValidatingAdmissionPolicy { // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional @@ -926,7 +927,7 @@ message ValidatingAdmissionPolicyBindingSpec { // If the referenced resource does not exist, this binding is considered invalid and will be ignored // Required. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string policyName = 1; // paramRef specifies the parameter resource used to configure the admission control policy. @@ -985,7 +986,7 @@ message ValidatingAdmissionPolicyBindingSpec { // Required. // +listType=set // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required repeated string validationActions = 4; } @@ -1099,6 +1100,9 @@ message ValidatingAdmissionPolicyStatus { // +optional // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 3; } diff --git a/vendor/k8s.io/api/admissionregistration/v1/types.go b/vendor/k8s.io/api/admissionregistration/v1/types.go index f7a07b6453..8047d5c5f9 100644 --- a/vendor/k8s.io/api/admissionregistration/v1/types.go +++ b/vendor/k8s.io/api/admissionregistration/v1/types.go @@ -139,8 +139,9 @@ const ( // +k8s:prerelease-lifecycle-gen:introduced=1.30 // ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it. +// +k8s:supportsSubresource="/status" type ValidatingAdmissionPolicy struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -167,6 +168,9 @@ type ValidatingAdmissionPolicyStatus struct { // +optional // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" protobuf:"bytes,3,rep,name=conditions"` } @@ -199,7 +203,7 @@ type ExpressionWarning struct { // ValidatingAdmissionPolicyList is a list of ValidatingAdmissionPolicy. type ValidatingAdmissionPolicyList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -447,7 +451,7 @@ type AuditAnnotation struct { // Adding/removing policies, bindings, or params can not affect whether a // given (policy, binding, param) combination is within its own CEL budget. type ValidatingAdmissionPolicyBinding struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -461,7 +465,7 @@ type ValidatingAdmissionPolicyBinding struct { // ValidatingAdmissionPolicyBindingList is a list of ValidatingAdmissionPolicyBinding. type ValidatingAdmissionPolicyBindingList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -476,7 +480,7 @@ type ValidatingAdmissionPolicyBindingSpec struct { // If the referenced resource does not exist, this binding is considered invalid and will be ignored // Required. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required PolicyName string `json:"policyName,omitempty" protobuf:"bytes,1,rep,name=policyName"` // paramRef specifies the parameter resource used to configure the admission control policy. @@ -535,7 +539,7 @@ type ValidatingAdmissionPolicyBindingSpec struct { // Required. // +listType=set // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required ValidationActions []ValidationAction `json:"validationActions,omitempty" protobuf:"bytes,4,rep,name=validationActions"` } @@ -714,7 +718,7 @@ type NamedRuleWithOperations struct { // +optional ResourceNames []string `json:"resourceNames,omitempty" protobuf:"bytes,1,rep,name=resourceNames"` // RuleWithOperations is a tuple of Operations and Resources. - RuleWithOperations `json:",inline" protobuf:"bytes,2,opt,name=ruleWithOperations"` + RuleWithOperations `json:"" protobuf:"bytes,2,opt,name=ruleWithOperations"` } // +genclient @@ -724,7 +728,7 @@ type NamedRuleWithOperations struct { // ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it. type ValidatingWebhookConfiguration struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -742,7 +746,7 @@ type ValidatingWebhookConfiguration struct { // ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration. type ValidatingWebhookConfigurationList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -758,7 +762,7 @@ type ValidatingWebhookConfigurationList struct { // MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object. type MutatingWebhookConfiguration struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -776,7 +780,7 @@ type MutatingWebhookConfiguration struct { // MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration. type MutatingWebhookConfigurationList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -1110,7 +1114,7 @@ type MutatingWebhook struct { // MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain. type MutatingAdmissionPolicy struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -1123,7 +1127,7 @@ type MutatingAdmissionPolicy struct { // MutatingAdmissionPolicyList is a list of MutatingAdmissionPolicy. type MutatingAdmissionPolicyList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -1383,7 +1387,7 @@ type JSONPatch struct { // Adding/removing policies, bindings, or params can not affect whether a // given (policy, binding, param) combination is within its own CEL budget. type MutatingAdmissionPolicyBinding struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -1396,7 +1400,7 @@ type MutatingAdmissionPolicyBinding struct { // MutatingAdmissionPolicyBindingList is a list of MutatingAdmissionPolicyBinding. type MutatingAdmissionPolicyBindingList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -1458,7 +1462,7 @@ type RuleWithOperations struct { Operations []OperationType `json:"operations,omitempty" protobuf:"bytes,1,rep,name=operations,casttype=OperationType"` // Rule is embedded, it describes other criteria of the rule, like // APIGroups, APIVersions, Resources, etc. - Rule `json:",inline" protobuf:"bytes,2,opt,name=rule"` + Rule `json:"" protobuf:"bytes,2,opt,name=rule"` } // OperationType specifies an operation for a request. diff --git a/vendor/k8s.io/api/admissionregistration/v1alpha1/generated.proto b/vendor/k8s.io/api/admissionregistration/v1alpha1/generated.proto index 57c7cd2b1d..8802ac92db 100644 --- a/vendor/k8s.io/api/admissionregistration/v1alpha1/generated.proto +++ b/vendor/k8s.io/api/admissionregistration/v1alpha1/generated.proto @@ -594,6 +594,7 @@ message TypeChecking { } // ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it. +// +k8s:supportsSubresource="/status" message ValidatingAdmissionPolicy { // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional @@ -648,7 +649,7 @@ message ValidatingAdmissionPolicyBindingSpec { // If the referenced resource does not exist, this binding is considered invalid and will be ignored // Required. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string policyName = 1; // paramRef specifies the parameter resource used to configure the admission control policy. @@ -707,7 +708,7 @@ message ValidatingAdmissionPolicyBindingSpec { // Required. // +listType=set // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required repeated string validationActions = 4; } @@ -821,6 +822,9 @@ message ValidatingAdmissionPolicyStatus { // +optional // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 3; } diff --git a/vendor/k8s.io/api/admissionregistration/v1alpha1/types.go b/vendor/k8s.io/api/admissionregistration/v1alpha1/types.go index 6a789b2d7f..39ff0abdc3 100644 --- a/vendor/k8s.io/api/admissionregistration/v1alpha1/types.go +++ b/vendor/k8s.io/api/admissionregistration/v1alpha1/types.go @@ -81,8 +81,9 @@ const ( // +k8s:prerelease-lifecycle-gen:introduced=1.26 // ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it. +// +k8s:supportsSubresource="/status" type ValidatingAdmissionPolicy struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -109,6 +110,9 @@ type ValidatingAdmissionPolicyStatus struct { // +optional // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" protobuf:"bytes,3,rep,name=conditions"` } @@ -138,7 +142,7 @@ type ExpressionWarning struct { // ValidatingAdmissionPolicyList is a list of ValidatingAdmissionPolicy. type ValidatingAdmissionPolicyList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -387,7 +391,7 @@ type AuditAnnotation struct { // Adding/removing policies, bindings, or params can not affect whether a // given (policy, binding, param) combination is within its own CEL budget. type ValidatingAdmissionPolicyBinding struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -401,7 +405,7 @@ type ValidatingAdmissionPolicyBinding struct { // ValidatingAdmissionPolicyBindingList is a list of ValidatingAdmissionPolicyBinding. type ValidatingAdmissionPolicyBindingList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -416,7 +420,7 @@ type ValidatingAdmissionPolicyBindingSpec struct { // If the referenced resource does not exist, this binding is considered invalid and will be ignored // Required. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required PolicyName string `json:"policyName,omitempty" protobuf:"bytes,1,rep,name=policyName"` // paramRef specifies the parameter resource used to configure the admission control policy. @@ -475,7 +479,7 @@ type ValidatingAdmissionPolicyBindingSpec struct { // Required. // +listType=set // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required ValidationActions []ValidationAction `json:"validationActions,omitempty" protobuf:"bytes,4,rep,name=validationActions"` } @@ -652,7 +656,7 @@ type NamedRuleWithOperations struct { // +optional ResourceNames []string `json:"resourceNames,omitempty" protobuf:"bytes,1,rep,name=resourceNames"` // RuleWithOperations is a tuple of Operations and Resources. - RuleWithOperations `json:",inline" protobuf:"bytes,2,opt,name=ruleWithOperations"` + RuleWithOperations `json:"" protobuf:"bytes,2,opt,name=ruleWithOperations"` } // RuleWithOperations is a tuple of Operations and Resources. It is recommended to make @@ -679,7 +683,7 @@ const ( // MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain. type MutatingAdmissionPolicy struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -692,7 +696,7 @@ type MutatingAdmissionPolicy struct { // MutatingAdmissionPolicyList is a list of MutatingAdmissionPolicy. type MutatingAdmissionPolicyList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -967,7 +971,7 @@ const ( // Adding/removing policies, bindings, or params can not affect whether a // given (policy, binding, param) combination is within its own CEL budget. type MutatingAdmissionPolicyBinding struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -980,7 +984,7 @@ type MutatingAdmissionPolicyBinding struct { // MutatingAdmissionPolicyBindingList is a list of MutatingAdmissionPolicyBinding. type MutatingAdmissionPolicyBindingList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional diff --git a/vendor/k8s.io/api/admissionregistration/v1beta1/generated.proto b/vendor/k8s.io/api/admissionregistration/v1beta1/generated.proto index 5fcb74f8ba..4654292316 100644 --- a/vendor/k8s.io/api/admissionregistration/v1beta1/generated.proto +++ b/vendor/k8s.io/api/admissionregistration/v1beta1/generated.proto @@ -820,6 +820,7 @@ message TypeChecking { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.28 // ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it. +// +k8s:supportsSubresource="/status" message ValidatingAdmissionPolicy { // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional @@ -874,7 +875,7 @@ message ValidatingAdmissionPolicyBindingSpec { // If the referenced resource does not exist, this binding is considered invalid and will be ignored // Required. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string policyName = 1; // paramRef specifies the parameter resource used to configure the admission control policy. @@ -933,7 +934,7 @@ message ValidatingAdmissionPolicyBindingSpec { // Required. // +listType=set // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required repeated string validationActions = 4; } @@ -1049,6 +1050,9 @@ message ValidatingAdmissionPolicyStatus { // +optional // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 3; } diff --git a/vendor/k8s.io/api/admissionregistration/v1beta1/types.go b/vendor/k8s.io/api/admissionregistration/v1beta1/types.go index 734a606f4b..1fb6728fc0 100644 --- a/vendor/k8s.io/api/admissionregistration/v1beta1/types.go +++ b/vendor/k8s.io/api/admissionregistration/v1beta1/types.go @@ -93,8 +93,9 @@ const ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.28 // ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it. +// +k8s:supportsSubresource="/status" type ValidatingAdmissionPolicy struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -121,6 +122,9 @@ type ValidatingAdmissionPolicyStatus struct { // +optional // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" protobuf:"bytes,3,rep,name=conditions"` } @@ -152,7 +156,7 @@ type ExpressionWarning struct { // +k8s:prerelease-lifecycle-gen:introduced=1.28 // ValidatingAdmissionPolicyList is a list of ValidatingAdmissionPolicy. type ValidatingAdmissionPolicyList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -400,7 +404,7 @@ type AuditAnnotation struct { // Adding/removing policies, bindings, or params can not affect whether a // given (policy, binding, param) combination is within its own CEL budget. type ValidatingAdmissionPolicyBinding struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -414,7 +418,7 @@ type ValidatingAdmissionPolicyBinding struct { // ValidatingAdmissionPolicyBindingList is a list of ValidatingAdmissionPolicyBinding. type ValidatingAdmissionPolicyBindingList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -429,7 +433,7 @@ type ValidatingAdmissionPolicyBindingSpec struct { // If the referenced resource does not exist, this binding is considered invalid and will be ignored // Required. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required PolicyName string `json:"policyName,omitempty" protobuf:"bytes,1,rep,name=policyName"` // paramRef specifies the parameter resource used to configure the admission control policy. @@ -488,7 +492,7 @@ type ValidatingAdmissionPolicyBindingSpec struct { // Required. // +listType=set // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required ValidationActions []ValidationAction `json:"validationActions,omitempty" protobuf:"bytes,4,rep,name=validationActions"` } @@ -667,7 +671,7 @@ type NamedRuleWithOperations struct { // +optional ResourceNames []string `json:"resourceNames,omitempty" protobuf:"bytes,1,rep,name=resourceNames"` // RuleWithOperations is a tuple of Operations and Resources. - RuleWithOperations `json:",inline" protobuf:"bytes,2,opt,name=ruleWithOperations"` + RuleWithOperations `json:"" protobuf:"bytes,2,opt,name=ruleWithOperations"` } // +genclient @@ -681,7 +685,7 @@ type NamedRuleWithOperations struct { // ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it. // Deprecated in v1.16, planned for removal in v1.19. Use admissionregistration.k8s.io/v1 ValidatingWebhookConfiguration instead. type ValidatingWebhookConfiguration struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -702,7 +706,7 @@ type ValidatingWebhookConfiguration struct { // ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration. type ValidatingWebhookConfigurationList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -722,7 +726,7 @@ type ValidatingWebhookConfigurationList struct { // MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object. // Deprecated in v1.16, planned for removal in v1.19. Use admissionregistration.k8s.io/v1 MutatingWebhookConfiguration instead. type MutatingWebhookConfiguration struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -743,7 +747,7 @@ type MutatingWebhookConfiguration struct { // MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration. type MutatingWebhookConfigurationList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -1213,7 +1217,7 @@ type MatchCondition struct { // MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain. type MutatingAdmissionPolicy struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -1227,7 +1231,7 @@ type MutatingAdmissionPolicy struct { // MutatingAdmissionPolicyList is a list of MutatingAdmissionPolicy. type MutatingAdmissionPolicyList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -1488,7 +1492,7 @@ type JSONPatch struct { // Adding/removing policies, bindings, or params can not affect whether a // given (policy, binding, param) combination is within its own CEL budget. type MutatingAdmissionPolicyBinding struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -1502,7 +1506,7 @@ type MutatingAdmissionPolicyBinding struct { // MutatingAdmissionPolicyBindingList is a list of MutatingAdmissionPolicyBinding. type MutatingAdmissionPolicyBindingList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional diff --git a/vendor/k8s.io/api/apidiscovery/v2/generated.proto b/vendor/k8s.io/api/apidiscovery/v2/generated.proto index 7f58048e17..e42fec4711 100644 --- a/vendor/k8s.io/api/apidiscovery/v2/generated.proto +++ b/vendor/k8s.io/api/apidiscovery/v2/generated.proto @@ -38,12 +38,14 @@ message APIGroupDiscovery { // name is allowed to be "" to represent the legacy, ungroupified resources. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // versions are the versions supported in this group. They are sorted in descending order of preference, // with the preferred version being the first entry. // +listType=map // +listMapKey=version + // +optional repeated APIVersionDiscovery versions = 2; } @@ -58,6 +60,7 @@ message APIGroupDiscoveryList { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; // items is the list of groups for discovery. The groups are listed in priority order. + // +optional repeated APIGroupDiscovery items = 2; } @@ -67,40 +70,48 @@ message APIResourceDiscovery { // for this resource across all versions in the API group. // Resources with non-empty groups are located at /apis/// // Resources with empty groups are located at /api/v1/ + // +optional optional string resource = 1; // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns. // APIs may return other objects types at their discretion, such as error conditions, requests for alternate representations, or other operation specific behavior. // This value will be null or empty if an APIService reports subresources but supports no operations on the parent resource + // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind responseKind = 2; // scope indicates the scope of a resource, either Cluster or Namespaced + // +optional optional string scope = 3; // singularResource is the singular name of the resource. This allows clients to handle plural and singular opaquely. // For many clients the singular form of the resource will be more understandable to users reading messages and should be used when integrating the name of the resource into a sentence. // The command line tool kubectl, for example, allows use of the singular resource name in place of plurals. // The singular form of a resource should always be an optional element - when in doubt use the canonical resource name. + // +optional optional string singularResource = 4; // verbs is a list of supported API operation types (this includes // but is not limited to get, list, watch, create, update, patch, // delete, deletecollection, and proxy). // +listType=set + // +optional repeated string verbs = 5; // shortNames is a list of suggested short names of the resource. // +listType=set + // +optional repeated string shortNames = 6; // categories is a list of the grouped resources this resource belongs to (e.g. 'all'). // Clients may use this to simplify acting on multiple resource types at once. // +listType=set + // +optional repeated string categories = 7; // subresources is a list of subresources provided by this resource. Subresources are located at /apis////name-of-instance/ // +listType=map // +listMapKey=subresource + // +optional repeated APISubresourceDiscovery subresources = 8; } @@ -108,10 +119,12 @@ message APIResourceDiscovery { message APISubresourceDiscovery { // subresource is the name of the subresource. This is used in the URL path and is the unique identifier // for this resource across all versions. + // +optional optional string subresource = 1; // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns. // Some subresources do not return normal resources, these will have null or empty return types. + // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind responseKind = 2; // acceptedTypes describes the kinds that this endpoint accepts. @@ -122,6 +135,7 @@ message APISubresourceDiscovery { // +listMapKey=group // +listMapKey=version // +listMapKey=kind + // +optional repeated .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind acceptedTypes = 3; // verbs is a list of supported API operation types (this includes @@ -131,17 +145,20 @@ message APISubresourceDiscovery { // should expect the behavior of standard verbs to align with // Kubernetes interaction conventions. // +listType=set + // +optional repeated string verbs = 4; } // APIVersionDiscovery holds a list of APIResourceDiscovery types that are served for a particular version within an API Group. message APIVersionDiscovery { // version is the name of the version within a group version. + // +optional optional string version = 1; // resources is a list of APIResourceDiscovery objects for the corresponding group version. // +listType=map // +listMapKey=resource + // +optional repeated APIResourceDiscovery resources = 2; // freshness marks whether a group version's discovery document is up to date. @@ -151,6 +168,7 @@ message APIVersionDiscovery { // significantly out of date. Clients that require the latest // version of the discovery information be retrieved before // performing an operation should not use the aggregated document + // +optional optional string freshness = 3; } diff --git a/vendor/k8s.io/api/apidiscovery/v2/types.go b/vendor/k8s.io/api/apidiscovery/v2/types.go index 761bb6990b..5cf6d9c551 100644 --- a/vendor/k8s.io/api/apidiscovery/v2/types.go +++ b/vendor/k8s.io/api/apidiscovery/v2/types.go @@ -28,12 +28,13 @@ import ( // list of API resources (built-ins, Custom Resource Definitions, resources from aggregated servers) // that a cluster supports. type APIGroupDiscoveryList struct { - v1.TypeMeta `json:",inline"` + v1.TypeMeta `json:""` // ResourceVersion will not be set, because this does not have a replayable ordering among multiple apiservers. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional v1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // items is the list of groups for discovery. The groups are listed in priority order. + // +optional Items []APIGroupDiscovery `json:"items" protobuf:"bytes,2,rep,name=items"` } @@ -44,28 +45,32 @@ type APIGroupDiscoveryList struct { // It contains a list of APIVersionDiscovery that holds a list of APIResourceDiscovery types served for a version. // Versions are in descending order of preference, with the first version being the preferred entry. type APIGroupDiscovery struct { - v1.TypeMeta `json:",inline"` + v1.TypeMeta `json:""` // metadata is standard object's metadata. // The only field completed will be name. For instance, resourceVersion will be empty. // name is the name of the API group whose discovery information is presented here. // name is allowed to be "" to represent the legacy, ungroupified resources. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // versions are the versions supported in this group. They are sorted in descending order of preference, // with the preferred version being the first entry. // +listType=map // +listMapKey=version + // +optional Versions []APIVersionDiscovery `json:"versions,omitempty" protobuf:"bytes,2,rep,name=versions"` } // APIVersionDiscovery holds a list of APIResourceDiscovery types that are served for a particular version within an API Group. type APIVersionDiscovery struct { // version is the name of the version within a group version. + // +optional Version string `json:"version" protobuf:"bytes,1,opt,name=version"` // resources is a list of APIResourceDiscovery objects for the corresponding group version. // +listType=map // +listMapKey=resource + // +optional Resources []APIResourceDiscovery `json:"resources,omitempty" protobuf:"bytes,2,rep,name=resources"` // freshness marks whether a group version's discovery document is up to date. // "Current" indicates the discovery document was recently @@ -74,6 +79,7 @@ type APIVersionDiscovery struct { // significantly out of date. Clients that require the latest // version of the discovery information be retrieved before // performing an operation should not use the aggregated document + // +optional Freshness DiscoveryFreshness `json:"freshness,omitempty" protobuf:"bytes,3,opt,name=freshness"` } @@ -83,33 +89,41 @@ type APIResourceDiscovery struct { // for this resource across all versions in the API group. // Resources with non-empty groups are located at /apis/// // Resources with empty groups are located at /api/v1/ + // +optional Resource string `json:"resource" protobuf:"bytes,1,opt,name=resource"` // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns. // APIs may return other objects types at their discretion, such as error conditions, requests for alternate representations, or other operation specific behavior. // This value will be null or empty if an APIService reports subresources but supports no operations on the parent resource + // +optional ResponseKind *v1.GroupVersionKind `json:"responseKind,omitempty" protobuf:"bytes,2,opt,name=responseKind"` // scope indicates the scope of a resource, either Cluster or Namespaced + // +optional Scope ResourceScope `json:"scope" protobuf:"bytes,3,opt,name=scope"` // singularResource is the singular name of the resource. This allows clients to handle plural and singular opaquely. // For many clients the singular form of the resource will be more understandable to users reading messages and should be used when integrating the name of the resource into a sentence. // The command line tool kubectl, for example, allows use of the singular resource name in place of plurals. // The singular form of a resource should always be an optional element - when in doubt use the canonical resource name. + // +optional SingularResource string `json:"singularResource" protobuf:"bytes,4,opt,name=singularResource"` // verbs is a list of supported API operation types (this includes // but is not limited to get, list, watch, create, update, patch, // delete, deletecollection, and proxy). // +listType=set + // +optional Verbs []string `json:"verbs" protobuf:"bytes,5,opt,name=verbs"` // shortNames is a list of suggested short names of the resource. // +listType=set + // +optional ShortNames []string `json:"shortNames,omitempty" protobuf:"bytes,6,rep,name=shortNames"` // categories is a list of the grouped resources this resource belongs to (e.g. 'all'). // Clients may use this to simplify acting on multiple resource types at once. // +listType=set + // +optional Categories []string `json:"categories,omitempty" protobuf:"bytes,7,rep,name=categories"` // subresources is a list of subresources provided by this resource. Subresources are located at /apis////name-of-instance/ // +listType=map // +listMapKey=subresource + // +optional Subresources []APISubresourceDiscovery `json:"subresources,omitempty" protobuf:"bytes,8,rep,name=subresources"` } @@ -133,9 +147,11 @@ const ( type APISubresourceDiscovery struct { // subresource is the name of the subresource. This is used in the URL path and is the unique identifier // for this resource across all versions. + // +optional Subresource string `json:"subresource" protobuf:"bytes,1,opt,name=subresource"` // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns. // Some subresources do not return normal resources, these will have null or empty return types. + // +optional ResponseKind *v1.GroupVersionKind `json:"responseKind,omitempty" protobuf:"bytes,2,opt,name=responseKind"` // acceptedTypes describes the kinds that this endpoint accepts. // Subresources may accept the standard content types or define @@ -145,6 +161,7 @@ type APISubresourceDiscovery struct { // +listMapKey=group // +listMapKey=version // +listMapKey=kind + // +optional AcceptedTypes []v1.GroupVersionKind `json:"acceptedTypes,omitempty" protobuf:"bytes,3,rep,name=acceptedTypes"` // verbs is a list of supported API operation types (this includes // but is not limited to get, list, watch, create, update, patch, @@ -153,5 +170,6 @@ type APISubresourceDiscovery struct { // should expect the behavior of standard verbs to align with // Kubernetes interaction conventions. // +listType=set + // +optional Verbs []string `json:"verbs" protobuf:"bytes,4,opt,name=verbs"` } diff --git a/vendor/k8s.io/api/apidiscovery/v2beta1/generated.pb.go b/vendor/k8s.io/api/apidiscovery/v2beta1/generated.pb.go deleted file mode 100644 index 8994f570f5..0000000000 --- a/vendor/k8s.io/api/apidiscovery/v2beta1/generated.pb.go +++ /dev/null @@ -1,1537 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: k8s.io/api/apidiscovery/v2beta1/generated.proto - -package v2beta1 - -import ( - fmt "fmt" - - io "io" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -func (m *APIGroupDiscovery) Reset() { *m = APIGroupDiscovery{} } - -func (m *APIGroupDiscoveryList) Reset() { *m = APIGroupDiscoveryList{} } - -func (m *APIResourceDiscovery) Reset() { *m = APIResourceDiscovery{} } - -func (m *APISubresourceDiscovery) Reset() { *m = APISubresourceDiscovery{} } - -func (m *APIVersionDiscovery) Reset() { *m = APIVersionDiscovery{} } - -func (m *APIGroupDiscovery) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *APIGroupDiscovery) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *APIGroupDiscovery) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Versions) > 0 { - for iNdEx := len(m.Versions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Versions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *APIGroupDiscoveryList) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *APIGroupDiscoveryList) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *APIGroupDiscoveryList) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *APIResourceDiscovery) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *APIResourceDiscovery) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *APIResourceDiscovery) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Subresources) > 0 { - for iNdEx := len(m.Subresources) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Subresources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - } - if len(m.Categories) > 0 { - for iNdEx := len(m.Categories) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Categories[iNdEx]) - copy(dAtA[i:], m.Categories[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Categories[iNdEx]))) - i-- - dAtA[i] = 0x3a - } - } - if len(m.ShortNames) > 0 { - for iNdEx := len(m.ShortNames) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ShortNames[iNdEx]) - copy(dAtA[i:], m.ShortNames[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.ShortNames[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(m.Verbs) > 0 { - for iNdEx := len(m.Verbs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Verbs[iNdEx]) - copy(dAtA[i:], m.Verbs[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Verbs[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - i -= len(m.SingularResource) - copy(dAtA[i:], m.SingularResource) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.SingularResource))) - i-- - dAtA[i] = 0x22 - i -= len(m.Scope) - copy(dAtA[i:], m.Scope) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Scope))) - i-- - dAtA[i] = 0x1a - if m.ResponseKind != nil { - { - size, err := m.ResponseKind.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(m.Resource) - copy(dAtA[i:], m.Resource) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Resource))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *APISubresourceDiscovery) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *APISubresourceDiscovery) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *APISubresourceDiscovery) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Verbs) > 0 { - for iNdEx := len(m.Verbs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Verbs[iNdEx]) - copy(dAtA[i:], m.Verbs[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Verbs[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.AcceptedTypes) > 0 { - for iNdEx := len(m.AcceptedTypes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.AcceptedTypes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.ResponseKind != nil { - { - size, err := m.ResponseKind.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(m.Subresource) - copy(dAtA[i:], m.Subresource) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Subresource))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *APIVersionDiscovery) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *APIVersionDiscovery) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *APIVersionDiscovery) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i -= len(m.Freshness) - copy(dAtA[i:], m.Freshness) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Freshness))) - i-- - dAtA[i] = 0x1a - if len(m.Resources) > 0 { - for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Resources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { - offset -= sovGenerated(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *APIGroupDiscovery) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Versions) > 0 { - for _, e := range m.Versions { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *APIGroupDiscoveryList) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *APIResourceDiscovery) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Resource) - n += 1 + l + sovGenerated(uint64(l)) - if m.ResponseKind != nil { - l = m.ResponseKind.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - l = len(m.Scope) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.SingularResource) - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Verbs) > 0 { - for _, s := range m.Verbs { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - if len(m.ShortNames) > 0 { - for _, s := range m.ShortNames { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - if len(m.Categories) > 0 { - for _, s := range m.Categories { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - if len(m.Subresources) > 0 { - for _, e := range m.Subresources { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *APISubresourceDiscovery) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Subresource) - n += 1 + l + sovGenerated(uint64(l)) - if m.ResponseKind != nil { - l = m.ResponseKind.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if len(m.AcceptedTypes) > 0 { - for _, e := range m.AcceptedTypes { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - if len(m.Verbs) > 0 { - for _, s := range m.Verbs { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *APIVersionDiscovery) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Version) - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - l = len(m.Freshness) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func sovGenerated(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenerated(x uint64) (n int) { - return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *APIGroupDiscovery) String() string { - if this == nil { - return "nil" - } - repeatedStringForVersions := "[]APIVersionDiscovery{" - for _, f := range this.Versions { - repeatedStringForVersions += strings.Replace(strings.Replace(f.String(), "APIVersionDiscovery", "APIVersionDiscovery", 1), `&`, ``, 1) + "," - } - repeatedStringForVersions += "}" - s := strings.Join([]string{`&APIGroupDiscovery{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Versions:` + repeatedStringForVersions + `,`, - `}`, - }, "") - return s -} -func (this *APIGroupDiscoveryList) String() string { - if this == nil { - return "nil" - } - repeatedStringForItems := "[]APIGroupDiscovery{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "APIGroupDiscovery", "APIGroupDiscovery", 1), `&`, ``, 1) + "," - } - repeatedStringForItems += "}" - s := strings.Join([]string{`&APIGroupDiscoveryList{`, - `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `}`, - }, "") - return s -} -func (this *APIResourceDiscovery) String() string { - if this == nil { - return "nil" - } - repeatedStringForSubresources := "[]APISubresourceDiscovery{" - for _, f := range this.Subresources { - repeatedStringForSubresources += strings.Replace(strings.Replace(f.String(), "APISubresourceDiscovery", "APISubresourceDiscovery", 1), `&`, ``, 1) + "," - } - repeatedStringForSubresources += "}" - s := strings.Join([]string{`&APIResourceDiscovery{`, - `Resource:` + fmt.Sprintf("%v", this.Resource) + `,`, - `ResponseKind:` + strings.Replace(fmt.Sprintf("%v", this.ResponseKind), "GroupVersionKind", "v1.GroupVersionKind", 1) + `,`, - `Scope:` + fmt.Sprintf("%v", this.Scope) + `,`, - `SingularResource:` + fmt.Sprintf("%v", this.SingularResource) + `,`, - `Verbs:` + fmt.Sprintf("%v", this.Verbs) + `,`, - `ShortNames:` + fmt.Sprintf("%v", this.ShortNames) + `,`, - `Categories:` + fmt.Sprintf("%v", this.Categories) + `,`, - `Subresources:` + repeatedStringForSubresources + `,`, - `}`, - }, "") - return s -} -func (this *APISubresourceDiscovery) String() string { - if this == nil { - return "nil" - } - repeatedStringForAcceptedTypes := "[]GroupVersionKind{" - for _, f := range this.AcceptedTypes { - repeatedStringForAcceptedTypes += fmt.Sprintf("%v", f) + "," - } - repeatedStringForAcceptedTypes += "}" - s := strings.Join([]string{`&APISubresourceDiscovery{`, - `Subresource:` + fmt.Sprintf("%v", this.Subresource) + `,`, - `ResponseKind:` + strings.Replace(fmt.Sprintf("%v", this.ResponseKind), "GroupVersionKind", "v1.GroupVersionKind", 1) + `,`, - `AcceptedTypes:` + repeatedStringForAcceptedTypes + `,`, - `Verbs:` + fmt.Sprintf("%v", this.Verbs) + `,`, - `}`, - }, "") - return s -} -func (this *APIVersionDiscovery) String() string { - if this == nil { - return "nil" - } - repeatedStringForResources := "[]APIResourceDiscovery{" - for _, f := range this.Resources { - repeatedStringForResources += strings.Replace(strings.Replace(f.String(), "APIResourceDiscovery", "APIResourceDiscovery", 1), `&`, ``, 1) + "," - } - repeatedStringForResources += "}" - s := strings.Join([]string{`&APIVersionDiscovery{`, - `Version:` + fmt.Sprintf("%v", this.Version) + `,`, - `Resources:` + repeatedStringForResources + `,`, - `Freshness:` + fmt.Sprintf("%v", this.Freshness) + `,`, - `}`, - }, "") - return s -} -func valueToStringGenerated(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *APIGroupDiscovery) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: APIGroupDiscovery: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: APIGroupDiscovery: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Versions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Versions = append(m.Versions, APIVersionDiscovery{}) - if err := m.Versions[len(m.Versions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *APIGroupDiscoveryList) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: APIGroupDiscoveryList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: APIGroupDiscoveryList: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Items = append(m.Items, APIGroupDiscovery{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *APIResourceDiscovery) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: APIResourceDiscovery: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: APIResourceDiscovery: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponseKind", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ResponseKind == nil { - m.ResponseKind = &v1.GroupVersionKind{} - } - if err := m.ResponseKind.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Scope = ResourceScope(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SingularResource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SingularResource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Verbs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Verbs = append(m.Verbs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShortNames", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ShortNames = append(m.ShortNames, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Categories", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Categories = append(m.Categories, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subresources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Subresources = append(m.Subresources, APISubresourceDiscovery{}) - if err := m.Subresources[len(m.Subresources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *APISubresourceDiscovery) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: APISubresourceDiscovery: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: APISubresourceDiscovery: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subresource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Subresource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponseKind", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ResponseKind == nil { - m.ResponseKind = &v1.GroupVersionKind{} - } - if err := m.ResponseKind.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AcceptedTypes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AcceptedTypes = append(m.AcceptedTypes, v1.GroupVersionKind{}) - if err := m.AcceptedTypes[len(m.AcceptedTypes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Verbs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Verbs = append(m.Verbs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *APIVersionDiscovery) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: APIVersionDiscovery: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: APIVersionDiscovery: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, APIResourceDiscovery{}) - if err := m.Resources[len(m.Resources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Freshness", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Freshness = DiscoveryFreshness(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenerated(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGenerated - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenerated - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenerated - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") -) diff --git a/vendor/k8s.io/api/apidiscovery/v2beta1/generated.proto b/vendor/k8s.io/api/apidiscovery/v2beta1/generated.proto deleted file mode 100644 index f81449e6a9..0000000000 --- a/vendor/k8s.io/api/apidiscovery/v2beta1/generated.proto +++ /dev/null @@ -1,156 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = "proto2"; - -package k8s.io.api.apidiscovery.v2beta1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "k8s.io/api/apidiscovery/v2beta1"; - -// APIGroupDiscovery holds information about which resources are being served for all version of the API Group. -// It contains a list of APIVersionDiscovery that holds a list of APIResourceDiscovery types served for a version. -// Versions are in descending order of preference, with the first version being the preferred entry. -message APIGroupDiscovery { - // metadata is standard object's metadata. - // The only field completed will be name. For instance, resourceVersion will be empty. - // name is the name of the API group whose discovery information is presented here. - // name is allowed to be "" to represent the legacy, ungroupified resources. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // versions are the versions supported in this group. They are sorted in descending order of preference, - // with the preferred version being the first entry. - // +listType=map - // +listMapKey=version - repeated APIVersionDiscovery versions = 2; -} - -// APIGroupDiscoveryList is a resource containing a list of APIGroupDiscovery. -// This is one of the types able to be returned from the /api and /apis endpoint and contains an aggregated -// list of API resources (built-ins, Custom Resource Definitions, resources from aggregated servers) -// that a cluster supports. -message APIGroupDiscoveryList { - // ResourceVersion will not be set, because this does not have a replayable ordering among multiple apiservers. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // items is the list of groups for discovery. The groups are listed in priority order. - repeated APIGroupDiscovery items = 2; -} - -// APIResourceDiscovery provides information about an API resource for discovery. -message APIResourceDiscovery { - // resource is the plural name of the resource. This is used in the URL path and is the unique identifier - // for this resource across all versions in the API group. - // Resources with non-empty groups are located at /apis/// - // Resources with empty groups are located at /api/v1/ - optional string resource = 1; - - // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns. - // APIs may return other objects types at their discretion, such as error conditions, requests for alternate representations, or other operation specific behavior. - // This value will be null or empty if an APIService reports subresources but supports no operations on the parent resource - optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind responseKind = 2; - - // scope indicates the scope of a resource, either Cluster or Namespaced - optional string scope = 3; - - // singularResource is the singular name of the resource. This allows clients to handle plural and singular opaquely. - // For many clients the singular form of the resource will be more understandable to users reading messages and should be used when integrating the name of the resource into a sentence. - // The command line tool kubectl, for example, allows use of the singular resource name in place of plurals. - // The singular form of a resource should always be an optional element - when in doubt use the canonical resource name. - optional string singularResource = 4; - - // verbs is a list of supported API operation types (this includes - // but is not limited to get, list, watch, create, update, patch, - // delete, deletecollection, and proxy). - // +listType=set - repeated string verbs = 5; - - // shortNames is a list of suggested short names of the resource. - // +listType=set - repeated string shortNames = 6; - - // categories is a list of the grouped resources this resource belongs to (e.g. 'all'). - // Clients may use this to simplify acting on multiple resource types at once. - // +listType=set - repeated string categories = 7; - - // subresources is a list of subresources provided by this resource. Subresources are located at /apis////name-of-instance/ - // +listType=map - // +listMapKey=subresource - repeated APISubresourceDiscovery subresources = 8; -} - -// APISubresourceDiscovery provides information about an API subresource for discovery. -message APISubresourceDiscovery { - // subresource is the name of the subresource. This is used in the URL path and is the unique identifier - // for this resource across all versions. - optional string subresource = 1; - - // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns. - // Some subresources do not return normal resources, these will have null or empty return types. - optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind responseKind = 2; - - // acceptedTypes describes the kinds that this endpoint accepts. - // Subresources may accept the standard content types or define - // custom negotiation schemes. The list may not be exhaustive for - // all operations. - // +listType=map - // +listMapKey=group - // +listMapKey=version - // +listMapKey=kind - repeated .k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind acceptedTypes = 3; - - // verbs is a list of supported API operation types (this includes - // but is not limited to get, list, watch, create, update, patch, - // delete, deletecollection, and proxy). Subresources may define - // custom verbs outside the standard Kubernetes verb set. Clients - // should expect the behavior of standard verbs to align with - // Kubernetes interaction conventions. - // +listType=set - repeated string verbs = 4; -} - -// APIVersionDiscovery holds a list of APIResourceDiscovery types that are served for a particular version within an API Group. -message APIVersionDiscovery { - // version is the name of the version within a group version. - optional string version = 1; - - // resources is a list of APIResourceDiscovery objects for the corresponding group version. - // +listType=map - // +listMapKey=resource - repeated APIResourceDiscovery resources = 2; - - // freshness marks whether a group version's discovery document is up to date. - // "Current" indicates the discovery document was recently - // refreshed. "Stale" indicates the discovery document could not - // be retrieved and the returned discovery document may be - // significantly out of date. Clients that require the latest - // version of the discovery information be retrieved before - // performing an operation should not use the aggregated document - optional string freshness = 3; -} - diff --git a/vendor/k8s.io/api/apidiscovery/v2beta1/types.go b/vendor/k8s.io/api/apidiscovery/v2beta1/types.go deleted file mode 100644 index 306264da4d..0000000000 --- a/vendor/k8s.io/api/apidiscovery/v2beta1/types.go +++ /dev/null @@ -1,163 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v2beta1 - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.26 -// +k8s:prerelease-lifecycle-gen:deprecated=1.32 -// +k8s:prerelease-lifecycle-gen:removed=1.35 -// The deprecate and remove versions stated above are rough estimates and may be subject to change. We are estimating v2 types will be available in 1.28 and will support 4 versions where both v2beta1 and v2 are supported before deprecation. - -// APIGroupDiscoveryList is a resource containing a list of APIGroupDiscovery. -// This is one of the types able to be returned from the /api and /apis endpoint and contains an aggregated -// list of API resources (built-ins, Custom Resource Definitions, resources from aggregated servers) -// that a cluster supports. -type APIGroupDiscoveryList struct { - v1.TypeMeta `json:",inline"` - // ResourceVersion will not be set, because this does not have a replayable ordering among multiple apiservers. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - v1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // items is the list of groups for discovery. The groups are listed in priority order. - Items []APIGroupDiscovery `json:"items" protobuf:"bytes,2,rep,name=items"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.26 -// +k8s:prerelease-lifecycle-gen:deprecated=1.32 -// +k8s:prerelease-lifecycle-gen:removed=1.35 -// The deprecate and remove versions stated above are rough estimates and may be subject to change. We are estimating v2 types will be available in 1.28 and will support 4 versions where both v2beta1 and v2 are supported before deprecation. - -// APIGroupDiscovery holds information about which resources are being served for all version of the API Group. -// It contains a list of APIVersionDiscovery that holds a list of APIResourceDiscovery types served for a version. -// Versions are in descending order of preference, with the first version being the preferred entry. -type APIGroupDiscovery struct { - v1.TypeMeta `json:",inline"` - // metadata is standard object's metadata. - // The only field completed will be name. For instance, resourceVersion will be empty. - // name is the name of the API group whose discovery information is presented here. - // name is allowed to be "" to represent the legacy, ungroupified resources. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // versions are the versions supported in this group. They are sorted in descending order of preference, - // with the preferred version being the first entry. - // +listType=map - // +listMapKey=version - Versions []APIVersionDiscovery `json:"versions,omitempty" protobuf:"bytes,2,rep,name=versions"` -} - -// APIVersionDiscovery holds a list of APIResourceDiscovery types that are served for a particular version within an API Group. -type APIVersionDiscovery struct { - // version is the name of the version within a group version. - Version string `json:"version" protobuf:"bytes,1,opt,name=version"` - // resources is a list of APIResourceDiscovery objects for the corresponding group version. - // +listType=map - // +listMapKey=resource - Resources []APIResourceDiscovery `json:"resources,omitempty" protobuf:"bytes,2,rep,name=resources"` - // freshness marks whether a group version's discovery document is up to date. - // "Current" indicates the discovery document was recently - // refreshed. "Stale" indicates the discovery document could not - // be retrieved and the returned discovery document may be - // significantly out of date. Clients that require the latest - // version of the discovery information be retrieved before - // performing an operation should not use the aggregated document - Freshness DiscoveryFreshness `json:"freshness,omitempty" protobuf:"bytes,3,opt,name=freshness"` -} - -// APIResourceDiscovery provides information about an API resource for discovery. -type APIResourceDiscovery struct { - // resource is the plural name of the resource. This is used in the URL path and is the unique identifier - // for this resource across all versions in the API group. - // Resources with non-empty groups are located at /apis/// - // Resources with empty groups are located at /api/v1/ - Resource string `json:"resource" protobuf:"bytes,1,opt,name=resource"` - // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns. - // APIs may return other objects types at their discretion, such as error conditions, requests for alternate representations, or other operation specific behavior. - // This value will be null or empty if an APIService reports subresources but supports no operations on the parent resource - ResponseKind *v1.GroupVersionKind `json:"responseKind,omitempty" protobuf:"bytes,2,opt,name=responseKind"` - // scope indicates the scope of a resource, either Cluster or Namespaced - Scope ResourceScope `json:"scope" protobuf:"bytes,3,opt,name=scope"` - // singularResource is the singular name of the resource. This allows clients to handle plural and singular opaquely. - // For many clients the singular form of the resource will be more understandable to users reading messages and should be used when integrating the name of the resource into a sentence. - // The command line tool kubectl, for example, allows use of the singular resource name in place of plurals. - // The singular form of a resource should always be an optional element - when in doubt use the canonical resource name. - SingularResource string `json:"singularResource" protobuf:"bytes,4,opt,name=singularResource"` - // verbs is a list of supported API operation types (this includes - // but is not limited to get, list, watch, create, update, patch, - // delete, deletecollection, and proxy). - // +listType=set - Verbs []string `json:"verbs" protobuf:"bytes,5,opt,name=verbs"` - // shortNames is a list of suggested short names of the resource. - // +listType=set - ShortNames []string `json:"shortNames,omitempty" protobuf:"bytes,6,rep,name=shortNames"` - // categories is a list of the grouped resources this resource belongs to (e.g. 'all'). - // Clients may use this to simplify acting on multiple resource types at once. - // +listType=set - Categories []string `json:"categories,omitempty" protobuf:"bytes,7,rep,name=categories"` - // subresources is a list of subresources provided by this resource. Subresources are located at /apis////name-of-instance/ - // +listType=map - // +listMapKey=subresource - Subresources []APISubresourceDiscovery `json:"subresources,omitempty" protobuf:"bytes,8,rep,name=subresources"` -} - -// ResourceScope is an enum defining the different scopes available to a resource. -type ResourceScope string - -const ( - ScopeCluster ResourceScope = "Cluster" - ScopeNamespace ResourceScope = "Namespaced" -) - -// DiscoveryFreshness is an enum defining whether the Discovery document published by an apiservice is up to date (fresh). -type DiscoveryFreshness string - -const ( - DiscoveryFreshnessCurrent DiscoveryFreshness = "Current" - DiscoveryFreshnessStale DiscoveryFreshness = "Stale" -) - -// APISubresourceDiscovery provides information about an API subresource for discovery. -type APISubresourceDiscovery struct { - // subresource is the name of the subresource. This is used in the URL path and is the unique identifier - // for this resource across all versions. - Subresource string `json:"subresource" protobuf:"bytes,1,opt,name=subresource"` - // responseKind describes the group, version, and kind of the serialization schema for the object type this endpoint typically returns. - // Some subresources do not return normal resources, these will have null or empty return types. - ResponseKind *v1.GroupVersionKind `json:"responseKind,omitempty" protobuf:"bytes,2,opt,name=responseKind"` - // acceptedTypes describes the kinds that this endpoint accepts. - // Subresources may accept the standard content types or define - // custom negotiation schemes. The list may not be exhaustive for - // all operations. - // +listType=map - // +listMapKey=group - // +listMapKey=version - // +listMapKey=kind - AcceptedTypes []v1.GroupVersionKind `json:"acceptedTypes,omitempty" protobuf:"bytes,3,rep,name=acceptedTypes"` - // verbs is a list of supported API operation types (this includes - // but is not limited to get, list, watch, create, update, patch, - // delete, deletecollection, and proxy). Subresources may define - // custom verbs outside the standard Kubernetes verb set. Clients - // should expect the behavior of standard verbs to align with - // Kubernetes interaction conventions. - // +listType=set - Verbs []string `json:"verbs" protobuf:"bytes,4,opt,name=verbs"` -} diff --git a/vendor/k8s.io/api/apidiscovery/v2beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/apidiscovery/v2beta1/zz_generated.deepcopy.go deleted file mode 100644 index cf8f98c6fb..0000000000 --- a/vendor/k8s.io/api/apidiscovery/v2beta1/zz_generated.deepcopy.go +++ /dev/null @@ -1,190 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v2beta1 - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIGroupDiscovery) DeepCopyInto(out *APIGroupDiscovery) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.Versions != nil { - in, out := &in.Versions, &out.Versions - *out = make([]APIVersionDiscovery, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIGroupDiscovery. -func (in *APIGroupDiscovery) DeepCopy() *APIGroupDiscovery { - if in == nil { - return nil - } - out := new(APIGroupDiscovery) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *APIGroupDiscovery) 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 *APIGroupDiscoveryList) DeepCopyInto(out *APIGroupDiscoveryList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]APIGroupDiscovery, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIGroupDiscoveryList. -func (in *APIGroupDiscoveryList) DeepCopy() *APIGroupDiscoveryList { - if in == nil { - return nil - } - out := new(APIGroupDiscoveryList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *APIGroupDiscoveryList) 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 *APIResourceDiscovery) DeepCopyInto(out *APIResourceDiscovery) { - *out = *in - if in.ResponseKind != nil { - in, out := &in.ResponseKind, &out.ResponseKind - *out = new(v1.GroupVersionKind) - **out = **in - } - if in.Verbs != nil { - in, out := &in.Verbs, &out.Verbs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.ShortNames != nil { - in, out := &in.ShortNames, &out.ShortNames - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Categories != nil { - in, out := &in.Categories, &out.Categories - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Subresources != nil { - in, out := &in.Subresources, &out.Subresources - *out = make([]APISubresourceDiscovery, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIResourceDiscovery. -func (in *APIResourceDiscovery) DeepCopy() *APIResourceDiscovery { - if in == nil { - return nil - } - out := new(APIResourceDiscovery) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APISubresourceDiscovery) DeepCopyInto(out *APISubresourceDiscovery) { - *out = *in - if in.ResponseKind != nil { - in, out := &in.ResponseKind, &out.ResponseKind - *out = new(v1.GroupVersionKind) - **out = **in - } - if in.AcceptedTypes != nil { - in, out := &in.AcceptedTypes, &out.AcceptedTypes - *out = make([]v1.GroupVersionKind, len(*in)) - copy(*out, *in) - } - if in.Verbs != nil { - in, out := &in.Verbs, &out.Verbs - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APISubresourceDiscovery. -func (in *APISubresourceDiscovery) DeepCopy() *APISubresourceDiscovery { - if in == nil { - return nil - } - out := new(APISubresourceDiscovery) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIVersionDiscovery) DeepCopyInto(out *APIVersionDiscovery) { - *out = *in - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = make([]APIResourceDiscovery, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIVersionDiscovery. -func (in *APIVersionDiscovery) DeepCopy() *APIVersionDiscovery { - if in == nil { - return nil - } - out := new(APIVersionDiscovery) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/k8s.io/api/apidiscovery/v2beta1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/apidiscovery/v2beta1/zz_generated.prerelease-lifecycle.go deleted file mode 100644 index aa8f15fb4c..0000000000 --- a/vendor/k8s.io/api/apidiscovery/v2beta1/zz_generated.prerelease-lifecycle.go +++ /dev/null @@ -1,58 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by prerelease-lifecycle-gen. DO NOT EDIT. - -package v2beta1 - -// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. -// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. -func (in *APIGroupDiscovery) APILifecycleIntroduced() (major, minor int) { - return 1, 26 -} - -// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. -// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. -func (in *APIGroupDiscovery) APILifecycleDeprecated() (major, minor int) { - return 1, 32 -} - -// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. -// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. -func (in *APIGroupDiscovery) APILifecycleRemoved() (major, minor int) { - return 1, 35 -} - -// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. -// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. -func (in *APIGroupDiscoveryList) APILifecycleIntroduced() (major, minor int) { - return 1, 26 -} - -// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. -// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. -func (in *APIGroupDiscoveryList) APILifecycleDeprecated() (major, minor int) { - return 1, 32 -} - -// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. -// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. -func (in *APIGroupDiscoveryList) APILifecycleRemoved() (major, minor int) { - return 1, 35 -} diff --git a/vendor/k8s.io/api/apiserverinternal/v1alpha1/generated.proto b/vendor/k8s.io/api/apiserverinternal/v1alpha1/generated.proto index e8f8c339df..73f007a651 100644 --- a/vendor/k8s.io/api/apiserverinternal/v1alpha1/generated.proto +++ b/vendor/k8s.io/api/apiserverinternal/v1alpha1/generated.proto @@ -55,6 +55,7 @@ message ServerStorageVersion { } // Storage version of a specific resource. +// +k8s:supportsSubresource="/status" message StorageVersion { // metadata is the standard object metadata. // The name is .. diff --git a/vendor/k8s.io/api/apiserverinternal/v1alpha1/types.go b/vendor/k8s.io/api/apiserverinternal/v1alpha1/types.go index 69c21fd3c4..f30cc53813 100644 --- a/vendor/k8s.io/api/apiserverinternal/v1alpha1/types.go +++ b/vendor/k8s.io/api/apiserverinternal/v1alpha1/types.go @@ -25,8 +25,9 @@ import ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Storage version of a specific resource. +// +k8s:supportsSubresource="/status" type StorageVersion struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object metadata. // The name is .. // +required @@ -135,7 +136,7 @@ type StorageVersionCondition struct { // A list of StorageVersions. type StorageVersionList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional diff --git a/vendor/k8s.io/api/apps/v1/generated.proto b/vendor/k8s.io/api/apps/v1/generated.proto index 42d5415c2f..0c55e2ebce 100644 --- a/vendor/k8s.io/api/apps/v1/generated.proto +++ b/vendor/k8s.io/api/apps/v1/generated.proto @@ -46,9 +46,11 @@ message ControllerRevision { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Data is the serialized representation of the state. + // +required optional .k8s.io.apimachinery.pkg.runtime.RawExtension data = 2; // Revision indicates the revision of the state represented by Data. + // +optional optional int64 revision = 3; } @@ -63,6 +65,7 @@ message ControllerRevisionList { } // DaemonSet represents the configuration of a daemon set. +// +k8s:supportsSubresource="/status" message DaemonSet { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -71,7 +74,7 @@ message DaemonSet { // The desired behavior of this daemon set. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required optional DaemonSetSpec spec = 2; // The current status of this daemon set. This data may be @@ -86,9 +89,11 @@ message DaemonSet { // DaemonSetCondition describes the state of a DaemonSet at a certain point. message DaemonSetCondition { // Type of DaemonSet condition. + // +optional optional string type = 1; // Status of the condition, one of True, False, Unknown. + // +optional optional string status = 2; // Last time the condition transitioned from one status to another. @@ -121,6 +126,7 @@ message DaemonSetSpec { // Must match in order to be controlled. // It must match the pod template's labels. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors + // +required optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; // An object that describes the pod that will be created. @@ -129,6 +135,7 @@ message DaemonSetSpec { // selector is specified). // The only allowed template.spec.restartPolicy value is "Always". // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template + // +required optional .k8s.io.api.core.v1.PodTemplateSpec template = 2; // An update strategy to replace existing DaemonSet pods with new pods. @@ -221,6 +228,8 @@ message DaemonSetUpdateStrategy { } // Deployment enables declarative updates for Pods and ReplicaSets. +// +k8s:supportsSubresource="/scale" +// +k8s:supportsSubresource="/status" message Deployment { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -228,7 +237,7 @@ message Deployment { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Specification of the desired behavior of the Deployment. - // +optional + // +required optional DeploymentSpec spec = 2; // Most recently observed status of the Deployment. @@ -239,21 +248,27 @@ message Deployment { // DeploymentCondition describes the state of a deployment at a certain point. message DeploymentCondition { // Type of deployment condition. + // +optional optional string type = 1; // Status of the condition, one of True, False, Unknown. + // +optional optional string status = 2; // The last time this condition was updated. + // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 6; // Last time the condition transitioned from one status to another. + // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 7; // The reason for the condition's last transition. + // +optional optional string reason = 4; // A human readable message indicating details about the transition. + // +optional optional string message = 5; } @@ -277,10 +292,12 @@ message DeploymentSpec { // Label selector for pods. Existing ReplicaSets whose pods are // selected by this will be the ones affected by this deployment. // It must match the pod template's labels. + // +required optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; // Template describes the pods that will be created. // The only allowed template.spec.restartPolicy value is "Always". + // +required optional .k8s.io.api.core.v1.PodTemplateSpec template = 3; // The deployment strategy to use to replace existing pods with new ones. @@ -309,6 +326,7 @@ message DeploymentSpec { // process failed deployments and a condition with a ProgressDeadlineExceeded // reason will be surfaced in the deployment status. Note that progress will // not be estimated during the time a deployment is paused. Defaults to 600s. + // +optional optional int32 progressDeadlineSeconds = 9; } @@ -377,6 +395,8 @@ message DeploymentStrategy { } // ReplicaSet ensures that a specified number of pod replicas are running at any given time. +// +k8s:supportsSubresource="/scale" +// +k8s:supportsSubresource="/status" message ReplicaSet { // If the Labels of a ReplicaSet are empty, they are defaulted to // be the same as the Pod(s) that the ReplicaSet manages. @@ -387,7 +407,7 @@ message ReplicaSet { // Spec defines the specification of the desired behavior of the ReplicaSet. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required optional ReplicaSetSpec spec = 2; // Status is the most recently observed status of the ReplicaSet. @@ -402,9 +422,11 @@ message ReplicaSet { // ReplicaSetCondition describes the state of a replica set at a certain point. message ReplicaSetCondition { // Type of replica set condition. + // +optional optional string type = 1; // Status of the condition, one of True, False, Unknown. + // +optional optional string status = 2; // The last time the condition transitioned from one status to another. @@ -451,6 +473,7 @@ message ReplicaSetSpec { // Label keys and values that must match in order to be controlled by this replica set. // It must match the pod template's labels. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors + // +required optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; // Template is the object that describes the pod that will be created if @@ -598,6 +621,8 @@ message RollingUpdateStatefulSetStrategy { // // The StatefulSet guarantees that a given network identity will always // map to the same storage identity. +// +k8s:supportsSubresource="/scale" +// +k8s:supportsSubresource="/status" message StatefulSet { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -605,7 +630,7 @@ message StatefulSet { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Spec defines the desired identities of pods in this set. - // +optional + // +required optional StatefulSetSpec spec = 2; // Status is the current status of Pods in this StatefulSet. This data @@ -617,9 +642,11 @@ message StatefulSet { // StatefulSetCondition describes the state of a statefulset at a certain point. message StatefulSetCondition { // Type of statefulset condition. + // +optional optional string type = 1; // Status of the condition, one of True, False, Unknown. + // +optional optional string status = 2; // Last time the condition transitioned from one status to another. @@ -668,6 +695,7 @@ message StatefulSetPersistentVolumeClaimRetentionPolicy { // VolumeClaimTemplates when the StatefulSet is deleted. The default policy // of `Retain` causes PVCs to not be affected by StatefulSet deletion. The // `Delete` policy causes those PVCs to be deleted. + // +optional optional string whenDeleted = 1; // WhenScaled specifies what happens to PVCs created from StatefulSet @@ -675,6 +703,7 @@ message StatefulSetPersistentVolumeClaimRetentionPolicy { // policy of `Retain` causes PVCs to not be affected by a scaledown. The // `Delete` policy causes the associated PVCs for any excess pods above // the replica count to be deleted. + // +optional optional string whenScaled = 2; } @@ -691,6 +720,9 @@ message StatefulSetSpec { // selector is a label query over pods that should match the replica count. // It must match the pod template's labels. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors + // +required + // +k8s:alpha(since: "1.37")=+k8s:required + // +k8s:alpha(since: "1.37")=+k8s:immutable optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; // template is the object that describes the pod that will be created if @@ -700,6 +732,7 @@ message StatefulSetSpec { // -. For example, a pod in a StatefulSet named // "web" with index number "3" would be named "web-3". // The only allowed template.spec.restartPolicy value is "Always". + // +required optional .k8s.io.api.core.v1.PodTemplateSpec template = 3; // volumeClaimTemplates is a list of claims that pods are allowed to reference. @@ -710,6 +743,9 @@ message StatefulSetSpec { // any volumes in the template, with the same name. // TODO: Define the behavior if a claim already exists with the same name. // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:eachVal=+k8s:opaqueType // +listType=atomic repeated .k8s.io.api.core.v1.PersistentVolumeClaim volumeClaimTemplates = 4; @@ -719,6 +755,8 @@ message StatefulSetSpec { // pattern: pod-specific-string.serviceName.default.svc.cluster.local // where "pod-specific-string" is managed by the StatefulSet controller. // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable + // +k8s:alpha(since: "1.37")=+k8s:optional optional string serviceName = 5; // podManagementPolicy controls how pods are created during initial scale up, @@ -730,17 +768,21 @@ message StatefulSetSpec { // to match the desired scale without waiting, and on scale down will delete // all pods at once. // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable + // +k8s:alpha(since: "1.37")=+k8s:optional optional string podManagementPolicy = 6; // updateStrategy indicates the StatefulSetUpdateStrategy that will be // employed to update Pods in the StatefulSet when a revision is made to // Template. + // +optional optional StatefulSetUpdateStrategy updateStrategy = 7; // revisionHistoryLimit is the maximum number of revisions that will // be maintained in the StatefulSet's revision history. The revision history // consists of all revisions not represented by a currently applied // StatefulSetSpec version. The default value is 10. + // +optional optional int32 revisionHistoryLimit = 8; // Minimum number of seconds for which a newly created pod should be ready diff --git a/vendor/k8s.io/api/apps/v1/types.go b/vendor/k8s.io/api/apps/v1/types.go index b8989c1406..c43afb8819 100644 --- a/vendor/k8s.io/api/apps/v1/types.go +++ b/vendor/k8s.io/api/apps/v1/types.go @@ -46,15 +46,17 @@ const ( // // The StatefulSet guarantees that a given network identity will always // map to the same storage identity. +// +k8s:supportsSubresource="/scale" +// +k8s:supportsSubresource="/status" type StatefulSet struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec defines the desired identities of pods in this set. - // +optional + // +required Spec StatefulSetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Status is the current status of Pods in this StatefulSet. This data @@ -104,12 +106,22 @@ const ( // strategy, new Pods will be created from the specification version indicated // by the StatefulSet's updateRevision. RollingUpdateStatefulSetStrategyType StatefulSetUpdateStrategyType = "RollingUpdate" - // OnDeleteStatefulSetStrategyType triggers the legacy behavior. Version - // tracking and ordered rolling restarts are disabled. Pods are recreated - // from the StatefulSetSpec when they are manually deleted. When a scale - // operation is performed with this strategy,specification version indicated - // by the StatefulSet's currentRevision. + // OnDeleteStatefulSetStrategyType disables ordered rolling restarts. Version + // tracking is done on a best-effort basis - the controller will try to + // eventually converge StatefulSet's currentRevision with updateRevision. + // Pods are recreated from the StatefulSetSpec when they are manually deleted. + // When a scale operation is performed with this strategy, new Pods will be + // created from the specification version indicated by the StatefulSet's updateRevision. OnDeleteStatefulSetStrategyType StatefulSetUpdateStrategyType = "OnDelete" + // RecreateStatefulSetStrategyType indicates that all existing pods will be + // deleted and fully terminated before any new-revision pods are created. + // This ensures that old and new revision Pods never run at the same time. + // This is an alpha type and requires enabling StatefulSetRecreateStrategy feature gate. + // Switching to the Recreate strategy is allowed when the feature gate is enabled, + // and switching away from it to a different update strategy is also allowed. + // + // +featureGate=StatefulSetRecreateStrategy + RecreateStatefulSetStrategyType StatefulSetUpdateStrategyType = "Recreate" ) // RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType. @@ -158,12 +170,14 @@ type StatefulSetPersistentVolumeClaimRetentionPolicy struct { // VolumeClaimTemplates when the StatefulSet is deleted. The default policy // of `Retain` causes PVCs to not be affected by StatefulSet deletion. The // `Delete` policy causes those PVCs to be deleted. + // +optional WhenDeleted PersistentVolumeClaimRetentionPolicyType `json:"whenDeleted,omitempty" protobuf:"bytes,1,opt,name=whenDeleted,casttype=PersistentVolumeClaimRetentionPolicyType"` // WhenScaled specifies what happens to PVCs created from StatefulSet // VolumeClaimTemplates when the StatefulSet is scaled down. The default // policy of `Retain` causes PVCs to not be affected by a scaledown. The // `Delete` policy causes the associated PVCs for any excess pods above // the replica count to be deleted. + // +optional WhenScaled PersistentVolumeClaimRetentionPolicyType `json:"whenScaled,omitempty" protobuf:"bytes,2,opt,name=whenScaled,casttype=PersistentVolumeClaimRetentionPolicyType"` } @@ -195,6 +209,9 @@ type StatefulSetSpec struct { // selector is a label query over pods that should match the replica count. // It must match the pod template's labels. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors + // +required + // +k8s:alpha(since: "1.37")=+k8s:required + // +k8s:alpha(since: "1.37")=+k8s:immutable Selector *metav1.LabelSelector `json:"selector" protobuf:"bytes,2,opt,name=selector"` // template is the object that describes the pod that will be created if @@ -204,6 +221,7 @@ type StatefulSetSpec struct { // -. For example, a pod in a StatefulSet named // "web" with index number "3" would be named "web-3". // The only allowed template.spec.restartPolicy value is "Always". + // +required Template v1.PodTemplateSpec `json:"template" protobuf:"bytes,3,opt,name=template"` // volumeClaimTemplates is a list of claims that pods are allowed to reference. @@ -214,6 +232,9 @@ type StatefulSetSpec struct { // any volumes in the template, with the same name. // TODO: Define the behavior if a claim already exists with the same name. // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:eachVal=+k8s:opaqueType // +listType=atomic VolumeClaimTemplates []v1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty" protobuf:"bytes,4,rep,name=volumeClaimTemplates"` @@ -223,6 +244,8 @@ type StatefulSetSpec struct { // pattern: pod-specific-string.serviceName.default.svc.cluster.local // where "pod-specific-string" is managed by the StatefulSet controller. // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable + // +k8s:alpha(since: "1.37")=+k8s:optional ServiceName string `json:"serviceName" protobuf:"bytes,5,opt,name=serviceName"` // podManagementPolicy controls how pods are created during initial scale up, @@ -234,17 +257,21 @@ type StatefulSetSpec struct { // to match the desired scale without waiting, and on scale down will delete // all pods at once. // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable + // +k8s:alpha(since: "1.37")=+k8s:optional PodManagementPolicy PodManagementPolicyType `json:"podManagementPolicy,omitempty" protobuf:"bytes,6,opt,name=podManagementPolicy,casttype=PodManagementPolicyType"` // updateStrategy indicates the StatefulSetUpdateStrategy that will be // employed to update Pods in the StatefulSet when a revision is made to // Template. + // +optional UpdateStrategy StatefulSetUpdateStrategy `json:"updateStrategy,omitempty" protobuf:"bytes,7,opt,name=updateStrategy"` // revisionHistoryLimit is the maximum number of revisions that will // be maintained in the StatefulSet's revision history. The revision history // consists of all revisions not represented by a currently applied // StatefulSetSpec version. The default value is 10. + // +optional RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty" protobuf:"varint,8,opt,name=revisionHistoryLimit"` // Minimum number of seconds for which a newly created pod should be ready @@ -319,11 +346,19 @@ type StatefulSetStatus struct { type StatefulSetConditionType string +const ( + // StatefulSetProgressing means the StatefulSet is progressing through an update. + // This condition is an alpha type and requires enabling StatefulSetRecreateStrategy feature gate. + StatefulSetProgressing StatefulSetConditionType = "Progressing" +) + // StatefulSetCondition describes the state of a statefulset at a certain point. type StatefulSetCondition struct { // Type of statefulset condition. + // +optional Type StatefulSetConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=StatefulSetConditionType"` // Status of the condition, one of True, False, Unknown. + // +optional Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"` // Last time the condition transitioned from one status to another. // +optional @@ -341,7 +376,7 @@ type StatefulSetCondition struct { // StatefulSetList is a collection of StatefulSets. type StatefulSetList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -359,15 +394,17 @@ type StatefulSetList struct { // +k8s:prerelease-lifecycle-gen:introduced=1.9 // Deployment enables declarative updates for Pods and ReplicaSets. +// +k8s:supportsSubresource="/scale" +// +k8s:supportsSubresource="/status" type Deployment struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Specification of the desired behavior of the Deployment. - // +optional + // +required Spec DeploymentSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Most recently observed status of the Deployment. @@ -385,10 +422,12 @@ type DeploymentSpec struct { // Label selector for pods. Existing ReplicaSets whose pods are // selected by this will be the ones affected by this deployment. // It must match the pod template's labels. + // +required Selector *metav1.LabelSelector `json:"selector" protobuf:"bytes,2,opt,name=selector"` // Template describes the pods that will be created. // The only allowed template.spec.restartPolicy value is "Always". + // +required Template v1.PodTemplateSpec `json:"template" protobuf:"bytes,3,opt,name=template"` // The deployment strategy to use to replace existing pods with new ones. @@ -417,6 +456,7 @@ type DeploymentSpec struct { // process failed deployments and a condition with a ProgressDeadlineExceeded // reason will be surfaced in the deployment status. Note that progress will // not be estimated during the time a deployment is paused. Defaults to 600s. + // +optional ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty" protobuf:"varint,9,opt,name=progressDeadlineSeconds"` } @@ -552,16 +592,22 @@ const ( // DeploymentCondition describes the state of a deployment at a certain point. type DeploymentCondition struct { // Type of deployment condition. + // +optional Type DeploymentConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=DeploymentConditionType"` // Status of the condition, one of True, False, Unknown. + // +optional Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"` // The last time this condition was updated. + // +optional LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty" protobuf:"bytes,6,opt,name=lastUpdateTime"` // Last time the condition transitioned from one status to another. + // +optional LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,7,opt,name=lastTransitionTime"` // The reason for the condition's last transition. + // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` // A human readable message indicating details about the transition. + // +optional Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` } @@ -570,7 +616,7 @@ type DeploymentCondition struct { // DeploymentList is a list of Deployments. type DeploymentList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -652,6 +698,7 @@ type DaemonSetSpec struct { // Must match in order to be controlled. // It must match the pod template's labels. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors + // +required Selector *metav1.LabelSelector `json:"selector" protobuf:"bytes,1,opt,name=selector"` // An object that describes the pod that will be created. @@ -660,6 +707,7 @@ type DaemonSetSpec struct { // selector is specified). // The only allowed template.spec.restartPolicy value is "Always". // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template + // +required Template v1.PodTemplateSpec `json:"template" protobuf:"bytes,2,opt,name=template"` // An update strategy to replace existing DaemonSet pods with new pods. @@ -743,8 +791,10 @@ type DaemonSetConditionType string // DaemonSetCondition describes the state of a DaemonSet at a certain point. type DaemonSetCondition struct { // Type of DaemonSet condition. + // +optional Type DaemonSetConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=DaemonSetConditionType"` // Status of the condition, one of True, False, Unknown. + // +optional Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"` // Last time the condition transitioned from one status to another. // +optional @@ -762,8 +812,9 @@ type DaemonSetCondition struct { // +k8s:prerelease-lifecycle-gen:introduced=1.9 // DaemonSet represents the configuration of a daemon set. +// +k8s:supportsSubresource="/status" type DaemonSet struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -771,7 +822,7 @@ type DaemonSet struct { // The desired behavior of this daemon set. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required Spec DaemonSetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // The current status of this daemon set. This data may be @@ -795,7 +846,7 @@ const ( // DaemonSetList is a collection of daemon sets. type DaemonSetList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -813,8 +864,10 @@ type DaemonSetList struct { // +k8s:prerelease-lifecycle-gen:introduced=1.9 // ReplicaSet ensures that a specified number of pod replicas are running at any given time. +// +k8s:supportsSubresource="/scale" +// +k8s:supportsSubresource="/status" type ReplicaSet struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // If the Labels of a ReplicaSet are empty, they are defaulted to // be the same as the Pod(s) that the ReplicaSet manages. @@ -825,7 +878,7 @@ type ReplicaSet struct { // Spec defines the specification of the desired behavior of the ReplicaSet. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required Spec ReplicaSetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Status is the most recently observed status of the ReplicaSet. @@ -842,7 +895,7 @@ type ReplicaSet struct { // ReplicaSetList is a collection of ReplicaSets. type ReplicaSetList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -872,6 +925,7 @@ type ReplicaSetSpec struct { // Label keys and values that must match in order to be controlled by this replica set. // It must match the pod template's labels. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors + // +required Selector *metav1.LabelSelector `json:"selector" protobuf:"bytes,2,opt,name=selector"` // Template is the object that describes the pod that will be created if @@ -932,8 +986,10 @@ const ( // ReplicaSetCondition describes the state of a replica set at a certain point. type ReplicaSetCondition struct { // Type of replica set condition. + // +optional Type ReplicaSetConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ReplicaSetConditionType"` // Status of the condition, one of True, False, Unknown. + // +optional Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"` // The last time the condition transitioned from one status to another. // +optional @@ -960,16 +1016,18 @@ type ReplicaSetCondition struct { // it may be subject to name and representation changes in future releases, and clients should not // depend on its stability. It is primarily for internal use by controllers. type ControllerRevision struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Data is the serialized representation of the state. - Data runtime.RawExtension `json:"data,omitempty" protobuf:"bytes,2,opt,name=data"` + // +required + Data runtime.RawExtension `json:"data" protobuf:"bytes,2,opt,name=data"` // Revision indicates the revision of the state represented by Data. + // +optional Revision int64 `json:"revision" protobuf:"varint,3,opt,name=revision"` } @@ -978,7 +1036,7 @@ type ControllerRevision struct { // ControllerRevisionList is a resource containing a list of ControllerRevision objects. type ControllerRevisionList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional diff --git a/vendor/k8s.io/api/apps/v1beta1/generated.proto b/vendor/k8s.io/api/apps/v1beta1/generated.proto index c6f0628e0c..9d23883347 100644 --- a/vendor/k8s.io/api/apps/v1beta1/generated.proto +++ b/vendor/k8s.io/api/apps/v1beta1/generated.proto @@ -48,9 +48,11 @@ message ControllerRevision { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // data is the serialized representation of the state. + // +required optional .k8s.io.apimachinery.pkg.runtime.RawExtension data = 2; // revision indicates the revision of the state represented by Data. + // +optional optional int64 revision = 3; } @@ -67,13 +69,15 @@ message ControllerRevisionList { // DEPRECATED - This group version of Deployment is deprecated by apps/v1beta2/Deployment. See the release notes for // more information. // Deployment enables declarative updates for Pods and ReplicaSets. +// +k8s:supportsSubresource="/scale" +// +k8s:supportsSubresource="/status" message Deployment { // Standard object metadata. // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Specification of the desired behavior of the Deployment. - // +optional + // +required optional DeploymentSpec spec = 2; // Most recently observed status of the Deployment. @@ -84,21 +88,27 @@ message Deployment { // DeploymentCondition describes the state of a deployment at a certain point. message DeploymentCondition { // Type of deployment condition. + // +optional optional string type = 1; // Status of the condition, one of True, False, Unknown. + // +optional optional string status = 2; // The last time this condition was updated. + // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 6; // Last time the condition transitioned from one status to another. + // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 7; // The reason for the condition's last transition. + // +optional optional string reason = 4; // A human readable message indicating details about the transition. + // +optional optional string message = 5; } @@ -116,6 +126,7 @@ message DeploymentList { // DeploymentRollback stores the information required to rollback a deployment. message DeploymentRollback { // Required: This must match the Name of a deployment. + // +required optional string name = 1; // The annotations to be updated to a deployment @@ -123,6 +134,7 @@ message DeploymentRollback { map updatedAnnotations = 2; // The config of this deployment rollback. + // +optional optional RollbackConfig rollbackTo = 3; } @@ -140,6 +152,7 @@ message DeploymentSpec { // Template describes the pods that will be created. // The only allowed template.spec.restartPolicy value is "Always". + // +required optional .k8s.io.api.core.v1.PodTemplateSpec template = 3; // The deployment strategy to use to replace existing pods with new ones. @@ -284,6 +297,7 @@ message RollingUpdateStatefulSetStrategy { // for updates. During a rolling update, all pods from ordinal Replicas-1 to // Partition are updated. All pods from ordinal Partition-1 to 0 remain untouched. // This is helpful in being able to do a canary based deployment. The default value is 0. + // +optional optional int32 partition = 1; // maxUnavailable is the maximum number of pods that can be unavailable during the update. @@ -303,6 +317,7 @@ message RollingUpdateStatefulSetStrategy { message Scale { // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. @@ -318,15 +333,16 @@ message Scale { message ScaleSpec { // replicas is the number of observed instances of the scaled object. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +default=0 - // +k8s:alpha(since: "1.36")=+k8s:minimum=0 + // +k8s:beta(since: "1.37")=+k8s:minimum=0 optional int32 replicas = 1; } // ScaleStatus represents the current status of a scale subresource. message ScaleStatus { // replias is the actual number of observed instances of the scaled object. + // +optional optional int32 replicas = 1; // selector is a label query over pods that should match the replicas count. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ @@ -352,12 +368,14 @@ message ScaleStatus { // // The StatefulSet guarantees that a given network identity will always // map to the same storage identity. +// +k8s:supportsSubresource="/scale" +// +k8s:supportsSubresource="/status" message StatefulSet { // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Spec defines the desired identities of pods in this set. - // +optional + // +required optional StatefulSetSpec spec = 2; // Status is the current status of Pods in this StatefulSet. This data @@ -369,9 +387,11 @@ message StatefulSet { // StatefulSetCondition describes the state of a statefulset at a certain point. message StatefulSetCondition { // Type of statefulset condition. + // +optional optional string type = 1; // Status of the condition, one of True, False, Unknown. + // +optional optional string status = 2; // Last time the condition transitioned from one status to another. @@ -417,6 +437,7 @@ message StatefulSetPersistentVolumeClaimRetentionPolicy { // VolumeClaimTemplates when the StatefulSet is deleted. The default policy // of `Retain` causes PVCs to not be affected by StatefulSet deletion. The // `Delete` policy causes those PVCs to be deleted. + // +optional optional string whenDeleted = 1; // whenScaled specifies what happens to PVCs created from StatefulSet @@ -424,6 +445,7 @@ message StatefulSetPersistentVolumeClaimRetentionPolicy { // policy of `Retain` causes PVCs to not be affected by a scaledown. The // `Delete` policy causes the associated PVCs for any excess pods above // the replica count to be deleted. + // +optional optional string whenScaled = 2; } @@ -438,9 +460,11 @@ message StatefulSetSpec { optional int32 replicas = 1; // selector is a label query over pods that should match the replica count. - // If empty, defaulted to labels on the pod template. + // It must match the pod template's labels. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - // +optional + // +required + // +k8s:alpha(since: "1.37")=+k8s:required + // +k8s:alpha(since: "1.37")=+k8s:immutable optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; // template is the object that describes the pod that will be created if @@ -449,6 +473,7 @@ message StatefulSetSpec { // of the StatefulSet. Each pod will be named with the format // -. For example, a pod in a StatefulSet named // "web" with index number "3" would be named "web-3". + // +required optional .k8s.io.api.core.v1.PodTemplateSpec template = 3; // volumeClaimTemplates is a list of claims that pods are allowed to reference. @@ -459,7 +484,10 @@ message StatefulSetSpec { // any volumes in the template, with the same name. // TODO: Define the behavior if a claim already exists with the same name. // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable + // +k8s:alpha(since: "1.37")=+k8s:optional // +listType=atomic + // +k8s:alpha(since: "1.37")=+k8s:eachVal=+k8s:opaqueType repeated .k8s.io.api.core.v1.PersistentVolumeClaim volumeClaimTemplates = 4; // serviceName is the name of the service that governs this StatefulSet. @@ -468,6 +496,8 @@ message StatefulSetSpec { // pattern: pod-specific-string.serviceName.default.svc.cluster.local // where "pod-specific-string" is managed by the StatefulSet controller. // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable + // +k8s:alpha(since: "1.37")=+k8s:optional optional string serviceName = 5; // podManagementPolicy controls how pods are created during initial scale up, @@ -479,17 +509,21 @@ message StatefulSetSpec { // to match the desired scale without waiting, and on scale down will delete // all pods at once. // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable + // +k8s:alpha(since: "1.37")=+k8s:optional optional string podManagementPolicy = 6; // updateStrategy indicates the StatefulSetUpdateStrategy that will be // employed to update Pods in the StatefulSet when a revision is made to // Template. + // +optional optional StatefulSetUpdateStrategy updateStrategy = 7; // revisionHistoryLimit is the maximum number of revisions that will // be maintained in the StatefulSet's revision history. The revision history // consists of all revisions not represented by a currently applied // StatefulSetSpec version. The default value is 10. + // +optional optional int32 revisionHistoryLimit = 8; // minReadySeconds is the minimum number of seconds for which a newly created pod should be ready @@ -567,9 +601,11 @@ message StatefulSetStatus { // necessary to perform the update for the indicated strategy. message StatefulSetUpdateStrategy { // Type indicates the type of the StatefulSetUpdateStrategy. + // +optional optional string type = 1; // RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType. + // +optional optional RollingUpdateStatefulSetStrategy rollingUpdate = 2; } diff --git a/vendor/k8s.io/api/apps/v1beta1/types.go b/vendor/k8s.io/api/apps/v1beta1/types.go index 4e67338e36..9960ac0b39 100644 --- a/vendor/k8s.io/api/apps/v1beta1/types.go +++ b/vendor/k8s.io/api/apps/v1beta1/types.go @@ -33,15 +33,16 @@ const ( type ScaleSpec struct { // replicas is the number of observed instances of the scaled object. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +default=0 - // +k8s:alpha(since: "1.36")=+k8s:minimum=0 + // +k8s:beta(since: "1.37")=+k8s:minimum=0 Replicas int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"` } // ScaleStatus represents the current status of a scale subresource. type ScaleStatus struct { // replias is the actual number of observed instances of the scaled object. + // +optional Replicas int32 `json:"replicas" protobuf:"varint,1,opt,name=replicas"` // selector is a label query over pods that should match the replicas count. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ @@ -67,9 +68,10 @@ type ScaleStatus struct { // Scale represents a scaling request for a resource. type Scale struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. @@ -97,13 +99,15 @@ type Scale struct { // // The StatefulSet guarantees that a given network identity will always // map to the same storage identity. +// +k8s:supportsSubresource="/scale" +// +k8s:supportsSubresource="/status" type StatefulSet struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec defines the desired identities of pods in this set. - // +optional + // +required Spec StatefulSetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Status is the current status of Pods in this StatefulSet. This data @@ -132,8 +136,10 @@ const ( // necessary to perform the update for the indicated strategy. type StatefulSetUpdateStrategy struct { // Type indicates the type of the StatefulSetUpdateStrategy. + // +optional Type StatefulSetUpdateStrategyType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type,casttype=StatefulSetStrategyType"` // RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType. + // +optional RollingUpdate *RollingUpdateStatefulSetStrategy `json:"rollingUpdate,omitempty" protobuf:"bytes,2,opt,name=rollingUpdate"` } @@ -148,11 +154,12 @@ const ( // strategy, new Pods will be created from the specification version indicated // by the StatefulSet's updateRevision. RollingUpdateStatefulSetStrategyType StatefulSetUpdateStrategyType = "RollingUpdate" - // OnDeleteStatefulSetStrategyType triggers the legacy behavior. Version - // tracking and ordered rolling restarts are disabled. Pods are recreated - // from the StatefulSetSpec when they are manually deleted. When a scale - // operation is performed with this strategy,specification version indicated - // by the StatefulSet's currentRevision. + // OnDeleteStatefulSetStrategyType disables ordered rolling restarts. Version + // tracking is done on a best-effort basis - the controller will try to + // eventually converge StatefulSet's currentRevision with updateRevision. + // Pods are recreated from the StatefulSetSpec when they are manually deleted. + // When a scale operation is performed with this strategy, new Pods will be + // created from the specification version indicated by the StatefulSet's updateRevision. OnDeleteStatefulSetStrategyType StatefulSetUpdateStrategyType = "OnDelete" ) @@ -162,6 +169,7 @@ type RollingUpdateStatefulSetStrategy struct { // for updates. During a rolling update, all pods from ordinal Replicas-1 to // Partition are updated. All pods from ordinal Partition-1 to 0 remain untouched. // This is helpful in being able to do a canary based deployment. The default value is 0. + // +optional Partition *int32 `json:"partition,omitempty" protobuf:"varint,1,opt,name=partition"` // maxUnavailable is the maximum number of pods that can be unavailable during the update. // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). @@ -201,12 +209,14 @@ type StatefulSetPersistentVolumeClaimRetentionPolicy struct { // VolumeClaimTemplates when the StatefulSet is deleted. The default policy // of `Retain` causes PVCs to not be affected by StatefulSet deletion. The // `Delete` policy causes those PVCs to be deleted. + // +optional WhenDeleted PersistentVolumeClaimRetentionPolicyType `json:"whenDeleted,omitempty" protobuf:"bytes,1,opt,name=whenDeleted,casttype=PersistentVolumeClaimRetentionPolicyType"` // whenScaled specifies what happens to PVCs created from StatefulSet // VolumeClaimTemplates when the StatefulSet is scaled down. The default // policy of `Retain` causes PVCs to not be affected by a scaledown. The // `Delete` policy causes the associated PVCs for any excess pods above // the replica count to be deleted. + // +optional WhenScaled PersistentVolumeClaimRetentionPolicyType `json:"whenScaled,omitempty" protobuf:"bytes,2,opt,name=whenScaled,casttype=PersistentVolumeClaimRetentionPolicyType"` } @@ -236,9 +246,11 @@ type StatefulSetSpec struct { Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"` // selector is a label query over pods that should match the replica count. - // If empty, defaulted to labels on the pod template. + // It must match the pod template's labels. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - // +optional + // +required + // +k8s:alpha(since: "1.37")=+k8s:required + // +k8s:alpha(since: "1.37")=+k8s:immutable Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"` // template is the object that describes the pod that will be created if @@ -247,6 +259,7 @@ type StatefulSetSpec struct { // of the StatefulSet. Each pod will be named with the format // -. For example, a pod in a StatefulSet named // "web" with index number "3" would be named "web-3". + // +required Template v1.PodTemplateSpec `json:"template" protobuf:"bytes,3,opt,name=template"` // volumeClaimTemplates is a list of claims that pods are allowed to reference. @@ -257,7 +270,10 @@ type StatefulSetSpec struct { // any volumes in the template, with the same name. // TODO: Define the behavior if a claim already exists with the same name. // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable + // +k8s:alpha(since: "1.37")=+k8s:optional // +listType=atomic + // +k8s:alpha(since: "1.37")=+k8s:eachVal=+k8s:opaqueType VolumeClaimTemplates []v1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty" protobuf:"bytes,4,rep,name=volumeClaimTemplates"` // serviceName is the name of the service that governs this StatefulSet. @@ -266,6 +282,8 @@ type StatefulSetSpec struct { // pattern: pod-specific-string.serviceName.default.svc.cluster.local // where "pod-specific-string" is managed by the StatefulSet controller. // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable + // +k8s:alpha(since: "1.37")=+k8s:optional ServiceName string `json:"serviceName" protobuf:"bytes,5,opt,name=serviceName"` // podManagementPolicy controls how pods are created during initial scale up, @@ -277,17 +295,21 @@ type StatefulSetSpec struct { // to match the desired scale without waiting, and on scale down will delete // all pods at once. // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable + // +k8s:alpha(since: "1.37")=+k8s:optional PodManagementPolicy PodManagementPolicyType `json:"podManagementPolicy,omitempty" protobuf:"bytes,6,opt,name=podManagementPolicy,casttype=PodManagementPolicyType"` // updateStrategy indicates the StatefulSetUpdateStrategy that will be // employed to update Pods in the StatefulSet when a revision is made to // Template. + // +optional UpdateStrategy StatefulSetUpdateStrategy `json:"updateStrategy,omitempty" protobuf:"bytes,7,opt,name=updateStrategy"` // revisionHistoryLimit is the maximum number of revisions that will // be maintained in the StatefulSet's revision history. The revision history // consists of all revisions not represented by a currently applied // StatefulSetSpec version. The default value is 10. + // +optional RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty" protobuf:"varint,8,opt,name=revisionHistoryLimit"` // minReadySeconds is the minimum number of seconds for which a newly created pod should be ready @@ -365,8 +387,10 @@ type StatefulSetConditionType string // StatefulSetCondition describes the state of a statefulset at a certain point. type StatefulSetCondition struct { // Type of statefulset condition. + // +optional Type StatefulSetConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=StatefulSetConditionType"` // Status of the condition, one of True, False, Unknown. + // +optional Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"` // Last time the condition transitioned from one status to another. // +optional @@ -387,7 +411,7 @@ type StatefulSetCondition struct { // StatefulSetList is a collection of StatefulSets. type StatefulSetList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` Items []StatefulSet `json:"items" protobuf:"bytes,2,rep,name=items"` @@ -403,14 +427,16 @@ type StatefulSetList struct { // DEPRECATED - This group version of Deployment is deprecated by apps/v1beta2/Deployment. See the release notes for // more information. // Deployment enables declarative updates for Pods and ReplicaSets. +// +k8s:supportsSubresource="/scale" +// +k8s:supportsSubresource="/status" type Deployment struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Specification of the desired behavior of the Deployment. - // +optional + // +required Spec DeploymentSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Most recently observed status of the Deployment. @@ -432,6 +458,7 @@ type DeploymentSpec struct { // Template describes the pods that will be created. // The only allowed template.spec.restartPolicy value is "Always". + // +required Template v1.PodTemplateSpec `json:"template" protobuf:"bytes,3,opt,name=template"` // The deployment strategy to use to replace existing pods with new ones. @@ -478,13 +505,15 @@ type DeploymentSpec struct { // DEPRECATED. // DeploymentRollback stores the information required to rollback a deployment. type DeploymentRollback struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Required: This must match the Name of a deployment. + // +required Name string `json:"name" protobuf:"bytes,1,opt,name=name"` // The annotations to be updated to a deployment // +optional UpdatedAnnotations map[string]string `json:"updatedAnnotations,omitempty" protobuf:"bytes,2,rep,name=updatedAnnotations"` // The config of this deployment rollback. + // +optional RollbackTo RollbackConfig `json:"rollbackTo" protobuf:"bytes,3,opt,name=rollbackTo"` } @@ -626,16 +655,22 @@ const ( // DeploymentCondition describes the state of a deployment at a certain point. type DeploymentCondition struct { // Type of deployment condition. + // +optional Type DeploymentConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=DeploymentConditionType"` // Status of the condition, one of True, False, Unknown. + // +optional Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"` // The last time this condition was updated. + // +optional LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty" protobuf:"bytes,6,opt,name=lastUpdateTime"` // Last time the condition transitioned from one status to another. + // +optional LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,7,opt,name=lastTransitionTime"` // The reason for the condition's last transition. + // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` // A human readable message indicating details about the transition. + // +optional Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` } @@ -647,7 +682,7 @@ type DeploymentCondition struct { // DeploymentList is a list of Deployments. type DeploymentList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -675,16 +710,18 @@ type DeploymentList struct { // it may be subject to name and representation changes in future releases, and clients should not // depend on its stability. It is primarily for internal use by controllers. type ControllerRevision struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // data is the serialized representation of the state. - Data runtime.RawExtension `json:"data,omitempty" protobuf:"bytes,2,opt,name=data"` + // +required + Data runtime.RawExtension `json:"data" protobuf:"bytes,2,opt,name=data"` // revision indicates the revision of the state represented by Data. + // +optional Revision int64 `json:"revision" protobuf:"varint,3,opt,name=revision"` } @@ -696,7 +733,7 @@ type ControllerRevision struct { // ControllerRevisionList is a resource containing a list of ControllerRevision objects. type ControllerRevisionList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional diff --git a/vendor/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go index a6f7a11927..e0efc96cd2 100644 --- a/vendor/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go @@ -251,7 +251,7 @@ func (StatefulSetPersistentVolumeClaimRetentionPolicy) SwaggerDoc() map[string]s var map_StatefulSetSpec = map[string]string{ "": "A StatefulSetSpec is the specification of a StatefulSet.", "replicas": "replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity. If unspecified, defaults to 1.", - "selector": "selector is a label query over pods that should match the replica count. If empty, defaulted to labels on the pod template. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors", + "selector": "selector is a label query over pods that should match the replica count. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors", "template": "template is the object that describes the pod that will be created if insufficient replicas are detected. Each pod stamped out by the StatefulSet will fulfill this Template, but have a unique identity from the rest of the StatefulSet. Each pod will be named with the format -. For example, a pod in a StatefulSet named \"web\" with index number \"3\" would be named \"web-3\".", "volumeClaimTemplates": "volumeClaimTemplates is a list of claims that pods are allowed to reference. The StatefulSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pod. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name.", "serviceName": "serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where \"pod-specific-string\" is managed by the StatefulSet controller.", diff --git a/vendor/k8s.io/api/apps/v1beta2/generated.proto b/vendor/k8s.io/api/apps/v1beta2/generated.proto index d680c9663e..738b1236e2 100644 --- a/vendor/k8s.io/api/apps/v1beta2/generated.proto +++ b/vendor/k8s.io/api/apps/v1beta2/generated.proto @@ -48,9 +48,11 @@ message ControllerRevision { optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Data is the serialized representation of the state. + // +required optional .k8s.io.apimachinery.pkg.runtime.RawExtension data = 2; // Revision indicates the revision of the state represented by Data. + // +optional optional int64 revision = 3; } @@ -67,6 +69,7 @@ message ControllerRevisionList { // DEPRECATED - This group version of DaemonSet is deprecated by apps/v1/DaemonSet. See the release notes for // more information. // DaemonSet represents the configuration of a daemon set. +// +k8s:supportsSubresource="/status" message DaemonSet { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -75,7 +78,7 @@ message DaemonSet { // The desired behavior of this daemon set. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required optional DaemonSetSpec spec = 2; // The current status of this daemon set. This data may be @@ -90,9 +93,11 @@ message DaemonSet { // DaemonSetCondition describes the state of a DaemonSet at a certain point. message DaemonSetCondition { // Type of DaemonSet condition. + // +optional optional string type = 1; // Status of the condition, one of True, False, Unknown. + // +optional optional string status = 2; // Last time the condition transitioned from one status to another. @@ -125,6 +130,7 @@ message DaemonSetSpec { // Must match in order to be controlled. // It must match the pod template's labels. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors + // +required optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1; // An object that describes the pod that will be created. @@ -133,6 +139,7 @@ message DaemonSetSpec { // selector is specified). // The only allowed template.spec.restartPolicy value is "Always". // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template + // +required optional .k8s.io.api.core.v1.PodTemplateSpec template = 2; // An update strategy to replace existing DaemonSet pods with new pods. @@ -227,13 +234,15 @@ message DaemonSetUpdateStrategy { // DEPRECATED - This group version of Deployment is deprecated by apps/v1/Deployment. See the release notes for // more information. // Deployment enables declarative updates for Pods and ReplicaSets. +// +k8s:supportsSubresource="/scale" +// +k8s:supportsSubresource="/status" message Deployment { // Standard object metadata. // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Specification of the desired behavior of the Deployment. - // +optional + // +required optional DeploymentSpec spec = 2; // Most recently observed status of the Deployment. @@ -244,21 +253,27 @@ message Deployment { // DeploymentCondition describes the state of a deployment at a certain point. message DeploymentCondition { // Type of deployment condition. + // +optional optional string type = 1; // Status of the condition, one of True, False, Unknown. + // +optional optional string status = 2; // The last time this condition was updated. + // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 6; // Last time the condition transitioned from one status to another. + // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 7; // The reason for the condition's last transition. + // +optional optional string reason = 4; // A human readable message indicating details about the transition. + // +optional optional string message = 5; } @@ -282,10 +297,12 @@ message DeploymentSpec { // Label selector for pods. Existing ReplicaSets whose pods are // selected by this will be the ones affected by this deployment. // It must match the pod template's labels. + // +required optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; // Template describes the pods that will be created. // The only allowed template.spec.restartPolicy value is "Always". + // +required optional .k8s.io.api.core.v1.PodTemplateSpec template = 3; // The deployment strategy to use to replace existing pods with new ones. @@ -314,6 +331,7 @@ message DeploymentSpec { // process failed deployments and a condition with a ProgressDeadlineExceeded // reason will be surfaced in the deployment status. Note that progress will // not be estimated during the time a deployment is paused. Defaults to 600s. + // +optional optional int32 progressDeadlineSeconds = 9; } @@ -384,6 +402,8 @@ message DeploymentStrategy { // DEPRECATED - This group version of ReplicaSet is deprecated by apps/v1/ReplicaSet. See the release notes for // more information. // ReplicaSet ensures that a specified number of pod replicas are running at any given time. +// +k8s:supportsSubresource="/scale" +// +k8s:supportsSubresource="/status" message ReplicaSet { // If the Labels of a ReplicaSet are empty, they are defaulted to // be the same as the Pod(s) that the ReplicaSet manages. @@ -393,7 +413,7 @@ message ReplicaSet { // Spec defines the specification of the desired behavior of the ReplicaSet. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required optional ReplicaSetSpec spec = 2; // Status is the most recently observed status of the ReplicaSet. @@ -408,9 +428,11 @@ message ReplicaSet { // ReplicaSetCondition describes the state of a replica set at a certain point. message ReplicaSetCondition { // Type of replica set condition. + // +optional optional string type = 1; // Status of the condition, one of True, False, Unknown. + // +optional optional string status = 2; // The last time the condition transitioned from one status to another. @@ -457,6 +479,7 @@ message ReplicaSetSpec { // Label keys and values that must match in order to be controlled by this replica set. // It must match the pod template's labels. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors + // +required optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; // Template is the object that describes the pod that will be created if @@ -601,6 +624,7 @@ message RollingUpdateStatefulSetStrategy { message Scale { // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. @@ -616,15 +640,16 @@ message Scale { message ScaleSpec { // desired number of instances for the scaled object. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +default=0 - // +k8s:alpha(since: "1.36")=+k8s:minimum=0 + // +k8s:beta(since: "1.37")=+k8s:minimum=0 optional int32 replicas = 1; } // ScaleStatus represents the current status of a scale subresource. message ScaleStatus { // actual number of observed instances of the scaled object. + // +optional optional int32 replicas = 1; // selector is a label query over pods that should match the replicas count. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ @@ -651,12 +676,14 @@ message ScaleStatus { // // The StatefulSet guarantees that a given network identity will always // map to the same storage identity. +// +k8s:supportsSubresource="/scale" +// +k8s:supportsSubresource="/status" message StatefulSet { // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Spec defines the desired identities of pods in this set. - // +optional + // +required optional StatefulSetSpec spec = 2; // Status is the current status of Pods in this StatefulSet. This data @@ -668,9 +695,11 @@ message StatefulSet { // StatefulSetCondition describes the state of a statefulset at a certain point. message StatefulSetCondition { // Type of statefulset condition. + // +optional optional string type = 1; // Status of the condition, one of True, False, Unknown. + // +optional optional string status = 2; // Last time the condition transitioned from one status to another. @@ -716,6 +745,7 @@ message StatefulSetPersistentVolumeClaimRetentionPolicy { // VolumeClaimTemplates when the StatefulSet is deleted. The default policy // of `Retain` causes PVCs to not be affected by StatefulSet deletion. The // `Delete` policy causes those PVCs to be deleted. + // +optional optional string whenDeleted = 1; // WhenScaled specifies what happens to PVCs created from StatefulSet @@ -723,6 +753,7 @@ message StatefulSetPersistentVolumeClaimRetentionPolicy { // policy of `Retain` causes PVCs to not be affected by a scaledown. The // `Delete` policy causes the associated PVCs for any excess pods above // the replica count to be deleted. + // +optional optional string whenScaled = 2; } @@ -739,6 +770,9 @@ message StatefulSetSpec { // selector is a label query over pods that should match the replica count. // It must match the pod template's labels. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors + // +required + // +k8s:alpha(since: "1.37")=+k8s:required + // +k8s:alpha(since: "1.37")=+k8s:immutable optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; // template is the object that describes the pod that will be created if @@ -748,6 +782,7 @@ message StatefulSetSpec { // -. For example, a pod in a StatefulSet named // "web" with index number "3" would be named "web-3". // The only allowed template.spec.restartPolicy value is "Always". + // +required optional .k8s.io.api.core.v1.PodTemplateSpec template = 3; // volumeClaimTemplates is a list of claims that pods are allowed to reference. @@ -758,7 +793,10 @@ message StatefulSetSpec { // any volumes in the template, with the same name. // TODO: Define the behavior if a claim already exists with the same name. // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable + // +k8s:alpha(since: "1.37")=+k8s:optional // +listType=atomic + // +k8s:alpha(since: "1.37")=+k8s:eachVal=+k8s:opaqueType repeated .k8s.io.api.core.v1.PersistentVolumeClaim volumeClaimTemplates = 4; // serviceName is the name of the service that governs this StatefulSet. @@ -767,6 +805,8 @@ message StatefulSetSpec { // pattern: pod-specific-string.serviceName.default.svc.cluster.local // where "pod-specific-string" is managed by the StatefulSet controller. // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable + // +k8s:alpha(since: "1.37")=+k8s:optional optional string serviceName = 5; // podManagementPolicy controls how pods are created during initial scale up, @@ -778,17 +818,21 @@ message StatefulSetSpec { // to match the desired scale without waiting, and on scale down will delete // all pods at once. // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable + // +k8s:alpha(since: "1.37")=+k8s:optional optional string podManagementPolicy = 6; // updateStrategy indicates the StatefulSetUpdateStrategy that will be // employed to update Pods in the StatefulSet when a revision is made to // Template. + // +optional optional StatefulSetUpdateStrategy updateStrategy = 7; // revisionHistoryLimit is the maximum number of revisions that will // be maintained in the StatefulSet's revision history. The revision history // consists of all revisions not represented by a currently applied // StatefulSetSpec version. The default value is 10. + // +optional optional int32 revisionHistoryLimit = 8; // Minimum number of seconds for which a newly created pod should be ready diff --git a/vendor/k8s.io/api/apps/v1beta2/types.go b/vendor/k8s.io/api/apps/v1beta2/types.go index d4d4a7e0dc..138039f025 100644 --- a/vendor/k8s.io/api/apps/v1beta2/types.go +++ b/vendor/k8s.io/api/apps/v1beta2/types.go @@ -35,15 +35,16 @@ const ( type ScaleSpec struct { // desired number of instances for the scaled object. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +default=0 - // +k8s:alpha(since: "1.36")=+k8s:minimum=0 + // +k8s:beta(since: "1.37")=+k8s:minimum=0 Replicas int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"` } // ScaleStatus represents the current status of a scale subresource. type ScaleStatus struct { // actual number of observed instances of the scaled object. + // +optional Replicas int32 `json:"replicas" protobuf:"varint,1,opt,name=replicas"` // selector is a label query over pods that should match the replicas count. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ @@ -70,9 +71,10 @@ type ScaleStatus struct { // Scale represents a scaling request for a resource. type Scale struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. @@ -103,13 +105,15 @@ type Scale struct { // // The StatefulSet guarantees that a given network identity will always // map to the same storage identity. +// +k8s:supportsSubresource="/scale" +// +k8s:supportsSubresource="/status" type StatefulSet struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec defines the desired identities of pods in this set. - // +optional + // +required Spec StatefulSetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Status is the current status of Pods in this StatefulSet. This data @@ -157,11 +161,12 @@ const ( // strategy, new Pods will be created from the specification version indicated // by the StatefulSet's updateRevision. RollingUpdateStatefulSetStrategyType StatefulSetUpdateStrategyType = "RollingUpdate" - // OnDeleteStatefulSetStrategyType triggers the legacy behavior. Version - // tracking and ordered rolling restarts are disabled. Pods are recreated - // from the StatefulSetSpec when they are manually deleted. When a scale - // operation is performed with this strategy,specification version indicated - // by the StatefulSet's currentRevision. + // OnDeleteStatefulSetStrategyType disables ordered rolling restarts. Version + // tracking is done on a best-effort basis - the controller will try to + // eventually converge StatefulSet's currentRevision with updateRevision. + // Pods are recreated from the StatefulSetSpec when they are manually deleted. + // When a scale operation is performed with this strategy, new Pods will be + // created from the specification version indicated by the StatefulSet's updateRevision. OnDeleteStatefulSetStrategyType StatefulSetUpdateStrategyType = "OnDelete" ) @@ -211,12 +216,14 @@ type StatefulSetPersistentVolumeClaimRetentionPolicy struct { // VolumeClaimTemplates when the StatefulSet is deleted. The default policy // of `Retain` causes PVCs to not be affected by StatefulSet deletion. The // `Delete` policy causes those PVCs to be deleted. + // +optional WhenDeleted PersistentVolumeClaimRetentionPolicyType `json:"whenDeleted,omitempty" protobuf:"bytes,1,opt,name=whenDeleted,casttype=PersistentVolumeClaimRetentionPolicyType"` // WhenScaled specifies what happens to PVCs created from StatefulSet // VolumeClaimTemplates when the StatefulSet is scaled down. The default // policy of `Retain` causes PVCs to not be affected by a scaledown. The // `Delete` policy causes the associated PVCs for any excess pods above // the replica count to be deleted. + // +optional WhenScaled PersistentVolumeClaimRetentionPolicyType `json:"whenScaled,omitempty" protobuf:"bytes,2,opt,name=whenScaled,casttype=PersistentVolumeClaimRetentionPolicyType"` } @@ -248,6 +255,9 @@ type StatefulSetSpec struct { // selector is a label query over pods that should match the replica count. // It must match the pod template's labels. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors + // +required + // +k8s:alpha(since: "1.37")=+k8s:required + // +k8s:alpha(since: "1.37")=+k8s:immutable Selector *metav1.LabelSelector `json:"selector" protobuf:"bytes,2,opt,name=selector"` // template is the object that describes the pod that will be created if @@ -257,6 +267,7 @@ type StatefulSetSpec struct { // -. For example, a pod in a StatefulSet named // "web" with index number "3" would be named "web-3". // The only allowed template.spec.restartPolicy value is "Always". + // +required Template v1.PodTemplateSpec `json:"template" protobuf:"bytes,3,opt,name=template"` // volumeClaimTemplates is a list of claims that pods are allowed to reference. @@ -267,7 +278,10 @@ type StatefulSetSpec struct { // any volumes in the template, with the same name. // TODO: Define the behavior if a claim already exists with the same name. // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable + // +k8s:alpha(since: "1.37")=+k8s:optional // +listType=atomic + // +k8s:alpha(since: "1.37")=+k8s:eachVal=+k8s:opaqueType VolumeClaimTemplates []v1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty" protobuf:"bytes,4,rep,name=volumeClaimTemplates"` // serviceName is the name of the service that governs this StatefulSet. @@ -276,6 +290,8 @@ type StatefulSetSpec struct { // pattern: pod-specific-string.serviceName.default.svc.cluster.local // where "pod-specific-string" is managed by the StatefulSet controller. // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable + // +k8s:alpha(since: "1.37")=+k8s:optional ServiceName string `json:"serviceName" protobuf:"bytes,5,opt,name=serviceName"` // podManagementPolicy controls how pods are created during initial scale up, @@ -287,17 +303,21 @@ type StatefulSetSpec struct { // to match the desired scale without waiting, and on scale down will delete // all pods at once. // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable + // +k8s:alpha(since: "1.37")=+k8s:optional PodManagementPolicy PodManagementPolicyType `json:"podManagementPolicy,omitempty" protobuf:"bytes,6,opt,name=podManagementPolicy,casttype=PodManagementPolicyType"` // updateStrategy indicates the StatefulSetUpdateStrategy that will be // employed to update Pods in the StatefulSet when a revision is made to // Template. + // +optional UpdateStrategy StatefulSetUpdateStrategy `json:"updateStrategy,omitempty" protobuf:"bytes,7,opt,name=updateStrategy"` // revisionHistoryLimit is the maximum number of revisions that will // be maintained in the StatefulSet's revision history. The revision history // consists of all revisions not represented by a currently applied // StatefulSetSpec version. The default value is 10. + // +optional RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty" protobuf:"varint,8,opt,name=revisionHistoryLimit"` // Minimum number of seconds for which a newly created pod should be ready @@ -375,8 +395,10 @@ type StatefulSetConditionType string // StatefulSetCondition describes the state of a statefulset at a certain point. type StatefulSetCondition struct { // Type of statefulset condition. + // +optional Type StatefulSetConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=StatefulSetConditionType"` // Status of the condition, one of True, False, Unknown. + // +optional Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"` // Last time the condition transitioned from one status to another. // +optional @@ -397,7 +419,7 @@ type StatefulSetCondition struct { // StatefulSetList is a collection of StatefulSets. type StatefulSetList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` Items []StatefulSet `json:"items" protobuf:"bytes,2,rep,name=items"` @@ -413,14 +435,16 @@ type StatefulSetList struct { // DEPRECATED - This group version of Deployment is deprecated by apps/v1/Deployment. See the release notes for // more information. // Deployment enables declarative updates for Pods and ReplicaSets. +// +k8s:supportsSubresource="/scale" +// +k8s:supportsSubresource="/status" type Deployment struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Specification of the desired behavior of the Deployment. - // +optional + // +required Spec DeploymentSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Most recently observed status of the Deployment. @@ -438,10 +462,12 @@ type DeploymentSpec struct { // Label selector for pods. Existing ReplicaSets whose pods are // selected by this will be the ones affected by this deployment. // It must match the pod template's labels. + // +required Selector *metav1.LabelSelector `json:"selector" protobuf:"bytes,2,opt,name=selector"` // Template describes the pods that will be created. // The only allowed template.spec.restartPolicy value is "Always". + // +required Template v1.PodTemplateSpec `json:"template" protobuf:"bytes,3,opt,name=template"` // The deployment strategy to use to replace existing pods with new ones. @@ -470,6 +496,7 @@ type DeploymentSpec struct { // process failed deployments and a condition with a ProgressDeadlineExceeded // reason will be surfaced in the deployment status. Note that progress will // not be estimated during the time a deployment is paused. Defaults to 600s. + // +optional ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty" protobuf:"varint,9,opt,name=progressDeadlineSeconds"` } @@ -604,16 +631,22 @@ const ( // DeploymentCondition describes the state of a deployment at a certain point. type DeploymentCondition struct { // Type of deployment condition. + // +optional Type DeploymentConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=DeploymentConditionType"` // Status of the condition, one of True, False, Unknown. + // +optional Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"` // The last time this condition was updated. + // +optional LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty" protobuf:"bytes,6,opt,name=lastUpdateTime"` // Last time the condition transitioned from one status to another. + // +optional LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,7,opt,name=lastTransitionTime"` // The reason for the condition's last transition. + // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` // A human readable message indicating details about the transition. + // +optional Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` } @@ -625,7 +658,7 @@ type DeploymentCondition struct { // DeploymentList is a list of Deployments. type DeploymentList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -706,6 +739,7 @@ type DaemonSetSpec struct { // Must match in order to be controlled. // It must match the pod template's labels. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors + // +required Selector *metav1.LabelSelector `json:"selector" protobuf:"bytes,1,opt,name=selector"` // An object that describes the pod that will be created. @@ -714,6 +748,7 @@ type DaemonSetSpec struct { // selector is specified). // The only allowed template.spec.restartPolicy value is "Always". // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template + // +required Template v1.PodTemplateSpec `json:"template" protobuf:"bytes,2,opt,name=template"` // An update strategy to replace existing DaemonSet pods with new pods. @@ -797,8 +832,10 @@ type DaemonSetConditionType string // DaemonSetCondition describes the state of a DaemonSet at a certain point. type DaemonSetCondition struct { // Type of DaemonSet condition. + // +optional Type DaemonSetConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=DaemonSetConditionType"` // Status of the condition, one of True, False, Unknown. + // +optional Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"` // Last time the condition transitioned from one status to another. // +optional @@ -821,8 +858,9 @@ type DaemonSetCondition struct { // DEPRECATED - This group version of DaemonSet is deprecated by apps/v1/DaemonSet. See the release notes for // more information. // DaemonSet represents the configuration of a daemon set. +// +k8s:supportsSubresource="/status" type DaemonSet struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -830,7 +868,7 @@ type DaemonSet struct { // The desired behavior of this daemon set. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required Spec DaemonSetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // The current status of this daemon set. This data may be @@ -857,7 +895,7 @@ const ( // DaemonSetList is a collection of daemon sets. type DaemonSetList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -877,8 +915,10 @@ type DaemonSetList struct { // DEPRECATED - This group version of ReplicaSet is deprecated by apps/v1/ReplicaSet. See the release notes for // more information. // ReplicaSet ensures that a specified number of pod replicas are running at any given time. +// +k8s:supportsSubresource="/scale" +// +k8s:supportsSubresource="/status" type ReplicaSet struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // If the Labels of a ReplicaSet are empty, they are defaulted to // be the same as the Pod(s) that the ReplicaSet manages. @@ -888,7 +928,7 @@ type ReplicaSet struct { // Spec defines the specification of the desired behavior of the ReplicaSet. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required Spec ReplicaSetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // Status is the most recently observed status of the ReplicaSet. @@ -908,7 +948,7 @@ type ReplicaSet struct { // ReplicaSetList is a collection of ReplicaSets. type ReplicaSetList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -938,6 +978,7 @@ type ReplicaSetSpec struct { // Label keys and values that must match in order to be controlled by this replica set. // It must match the pod template's labels. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors + // +required Selector *metav1.LabelSelector `json:"selector" protobuf:"bytes,2,opt,name=selector"` // Template is the object that describes the pod that will be created if @@ -998,8 +1039,10 @@ const ( // ReplicaSetCondition describes the state of a replica set at a certain point. type ReplicaSetCondition struct { // Type of replica set condition. + // +optional Type ReplicaSetConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ReplicaSetConditionType"` // Status of the condition, one of True, False, Unknown. + // +optional Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"` // The last time the condition transitioned from one status to another. // +optional @@ -1031,16 +1074,18 @@ type ReplicaSetCondition struct { // it may be subject to name and representation changes in future releases, and clients should not // depend on its stability. It is primarily for internal use by controllers. type ControllerRevision struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Data is the serialized representation of the state. - Data runtime.RawExtension `json:"data,omitempty" protobuf:"bytes,2,opt,name=data"` + // +required + Data runtime.RawExtension `json:"data" protobuf:"bytes,2,opt,name=data"` // Revision indicates the revision of the state represented by Data. + // +optional Revision int64 `json:"revision" protobuf:"varint,3,opt,name=revision"` } @@ -1052,7 +1097,7 @@ type ControllerRevision struct { // ControllerRevisionList is a resource containing a list of ControllerRevision objects. type ControllerRevisionList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional diff --git a/vendor/k8s.io/api/authentication/v1/generated.pb.go b/vendor/k8s.io/api/authentication/v1/generated.pb.go index 2b872c453e..8547b769fd 100644 --- a/vendor/k8s.io/api/authentication/v1/generated.pb.go +++ b/vendor/k8s.io/api/authentication/v1/generated.pb.go @@ -32,6 +32,8 @@ import ( k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types" ) +func (m *AttestationValue) Reset() { *m = AttestationValue{} } + func (m *BoundObjectReference) Reset() { *m = BoundObjectReference{} } func (m *ExtraValue) Reset() { *m = ExtraValue{} } @@ -54,6 +56,38 @@ func (m *TokenReviewStatus) Reset() { *m = TokenReviewStatus{} } func (m *UserInfo) Reset() { *m = UserInfo{} } +func (m AttestationValue) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m AttestationValue) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m AttestationValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m) > 0 { + for iNdEx := len(m) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m[iNdEx]) + copy(dAtA[i:], m[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *BoundObjectReference) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -278,6 +312,35 @@ func (m *TokenRequestSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Attestations) > 0 { + keysForAttestations := make([]string, 0, len(m.Attestations)) + for k := range m.Attestations { + keysForAttestations = append(keysForAttestations, string(k)) + } + sort.Strings(keysForAttestations) + for iNdEx := len(keysForAttestations) - 1; iNdEx >= 0; iNdEx-- { + v := m.Attestations[string(keysForAttestations[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForAttestations[iNdEx]) + copy(dAtA[i:], keysForAttestations[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAttestations[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } if m.ExpirationSeconds != nil { i = encodeVarintGenerated(dAtA, i, uint64(*m.ExpirationSeconds)) i-- @@ -572,6 +635,21 @@ func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m AttestationValue) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m) > 0 { + for _, s := range m { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + func (m *BoundObjectReference) Size() (n int) { if m == nil { return 0 @@ -662,6 +740,15 @@ func (m *TokenRequestSpec) Size() (n int) { if m.ExpirationSeconds != nil { n += 1 + sovGenerated(uint64(*m.ExpirationSeconds)) } + if len(m.Attestations) > 0 { + for k, v := range m.Attestations { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } return n } @@ -814,10 +901,21 @@ func (this *TokenRequestSpec) String() string { if this == nil { return "nil" } + keysForAttestations := make([]string, 0, len(this.Attestations)) + for k := range this.Attestations { + keysForAttestations = append(keysForAttestations, k) + } + sort.Strings(keysForAttestations) + mapStringForAttestations := "map[string]AttestationValue{" + for _, k := range keysForAttestations { + mapStringForAttestations += fmt.Sprintf("%v: %v,", k, this.Attestations[k]) + } + mapStringForAttestations += "}" s := strings.Join([]string{`&TokenRequestSpec{`, `Audiences:` + fmt.Sprintf("%v", this.Audiences) + `,`, `BoundObjectRef:` + strings.Replace(this.BoundObjectRef.String(), "BoundObjectReference", "BoundObjectReference", 1) + `,`, `ExpirationSeconds:` + valueToStringGenerated(this.ExpirationSeconds) + `,`, + `Attestations:` + mapStringForAttestations + `,`, `}`, }, "") return s @@ -900,6 +998,88 @@ func valueToStringGenerated(v interface{}) string { pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } +func (m *AttestationValue) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AttestationValue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AttestationValue: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + *m = append(*m, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *BoundObjectReference) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1625,6 +1805,135 @@ func (m *TokenRequestSpec) Unmarshal(dAtA []byte) error { } } m.ExpirationSeconds = &v + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attestations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Attestations == nil { + m.Attestations = make(map[string]AttestationValue) + } + var mapkey string + mapvalue := &AttestationValue{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &AttestationValue{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Attestations[mapkey] = *mapvalue + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/vendor/k8s.io/api/authentication/v1/generated.proto b/vendor/k8s.io/api/authentication/v1/generated.proto index 82ff7c3c51..c7b99158a0 100644 --- a/vendor/k8s.io/api/authentication/v1/generated.proto +++ b/vendor/k8s.io/api/authentication/v1/generated.proto @@ -28,9 +28,19 @@ import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; // Package-wide variables from generator "generated". option go_package = "k8s.io/api/authentication/v1"; +// AttestationValue masks the value so protobuf can generate +// +protobuf.nullable=true +// +protobuf.options.(gogoproto.goproto_stringer)=false +message AttestationValue { + // items, if empty, will result in an empty slice + + repeated string items = 1; +} + // BoundObjectReference is a reference to an object that a token is bound to. message BoundObjectReference { - // kind of the referent. Valid kinds are 'Pod' and 'Secret'. + // kind of the referent. Valid kinds are 'Pod', 'Secret', 'Node', + // 'ValidatingWebhookConfiguration', and 'MutatingWebhookConfiguration'. // +optional optional string kind = 1; @@ -59,10 +69,12 @@ message ExtraValue { // SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request. // When using impersonation, users will receive the user info of the user being impersonated. If impersonation or // request header authentication is used, any extra keys will have their case ignored and returned as lowercase. +// +k8s:supportsSubresource="/status" message SelfSubjectReview { // metadata is standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // status is filled in by the server with the user attributes. @@ -82,6 +94,7 @@ message TokenRequest { // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec holds information about the request being evaluated @@ -118,6 +131,14 @@ message TokenRequestSpec { // small if you want prompt revocation. // +optional optional BoundObjectReference boundObjectRef = 3; + + // attestations is a map of well-known keys to string-slice values. + // The values for each key have a specific semantic meaning, which is + // documented on the key definition. Requesters of tokens may ask + // the Kubernetes API Server to attest to certain claims. The API Server + // may perform authorization checks depending on the key of this map. + // +optional + map attestations = 5; } // TokenRequestStatus is the result of a token request. @@ -134,10 +155,12 @@ message TokenRequestStatus { // TokenReview attempts to authenticate a token to a known user. // Note: TokenReview requests may be cached by the webhook token authenticator // plugin in the kube-apiserver. +// +k8s:supportsSubresource="/status" message TokenReview { // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec holds information about the request being evaluated diff --git a/vendor/k8s.io/api/authentication/v1/types.go b/vendor/k8s.io/api/authentication/v1/types.go index c28bded50a..1eee2b5049 100644 --- a/vendor/k8s.io/api/authentication/v1/types.go +++ b/vendor/k8s.io/api/authentication/v1/types.go @@ -39,6 +39,33 @@ const ( // It can be repeated multiplied times for multiple map keys and the same key can be repeated multiple // times to have multiple elements in the slice under a single key ImpersonateUserExtraHeaderPrefix = "Impersonate-Extra-" + + // AttestationAdmissionReviewAPIGroups is the map key for the + // admissionReviewAPIGroups claim. It represents the APIGroup that a token + // authorizes its bearer to query admission webhooks about. The value + // corresponding to this key must be a slice of length 1, and the first and + // only element of this slice must match the APIGroup of the AdmissionReview + // request being made of the webhook. The empty string is invalid as the + // first and only element of the value slice. The special value "*" means + // "all api groups", and requires matching permissions (described below). + // + // For this claim to be considered valid, the TokenRequest must meet two + // conditions. First, the BoundObjectRef must be one of + // ValidatingWebhookConfiguration or MutatingWebhookConfiguration; the + // Webhook Configuration in question must have a Rule governing a resource + // under the APIGroup named in the value to this key. Second, the requested + // audience must match one of the following patterns: + // 1. When the webhook is configured with a URL, the audience must match + // the URL field exactly. + // 2. When the webhook is configured with a service, the audience must + // match the pattern `https://$name.$namespace.svc:$port[/$path]`, where + // `/$path` is optional. + // + // The service account for which the TokenRequest is being made must have + // "attest" permissions on group "authentication.k8s.io", resource + // "admissionReviewAPIGroups", and a resource name matching exactly either + // "*", or the API group named in the value to this key. + AttestationAdmissionReviewAPIGroups = "admissionReviewAPIGroups" ) // +genclient @@ -50,11 +77,13 @@ const ( // TokenReview attempts to authenticate a token to a known user. // Note: TokenReview requests may be cached by the webhook token authenticator // plugin in the kube-apiserver. +// +k8s:supportsSubresource="/status" type TokenReview struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec holds information about the request being evaluated @@ -135,15 +164,25 @@ func (t ExtraValue) String() string { return fmt.Sprintf("%v", []string(t)) } +// AttestationValue masks the value so protobuf can generate +// +protobuf.nullable=true +// +protobuf.options.(gogoproto.goproto_stringer)=false +type AttestationValue []string + +func (a AttestationValue) String() string { + return fmt.Sprintf("%v", []string(a)) +} + // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.10 // TokenRequest requests a token for a given service account. type TokenRequest struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec holds information about the request being evaluated @@ -180,6 +219,14 @@ type TokenRequestSpec struct { // small if you want prompt revocation. // +optional BoundObjectRef *BoundObjectReference `json:"boundObjectRef" protobuf:"bytes,3,opt,name=boundObjectRef"` + + // attestations is a map of well-known keys to string-slice values. + // The values for each key have a specific semantic meaning, which is + // documented on the key definition. Requesters of tokens may ask + // the Kubernetes API Server to attest to certain claims. The API Server + // may perform authorization checks depending on the key of this map. + // +optional + Attestations map[string]AttestationValue `json:"attestations,omitempty" protobuf:"bytes,5,rep,name=attestations"` } // TokenRequestStatus is the result of a token request. @@ -194,7 +241,8 @@ type TokenRequestStatus struct { // BoundObjectReference is a reference to an object that a token is bound to. type BoundObjectReference struct { - // kind of the referent. Valid kinds are 'Pod' and 'Secret'. + // kind of the referent. Valid kinds are 'Pod', 'Secret', 'Node', + // 'ValidatingWebhookConfiguration', and 'MutatingWebhookConfiguration'. // +optional Kind string `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"` // apiVersion is API version of the referent. @@ -218,11 +266,13 @@ type BoundObjectReference struct { // SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request. // When using impersonation, users will receive the user info of the user being impersonated. If impersonation or // request header authentication is used, any extra keys will have their case ignored and returned as lowercase. +// +k8s:supportsSubresource="/status" type SelfSubjectReview struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // status is filled in by the server with the user attributes. // +optional diff --git a/vendor/k8s.io/api/authentication/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/authentication/v1/types_swagger_doc_generated.go index ea3acbb681..eb50e71546 100644 --- a/vendor/k8s.io/api/authentication/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/authentication/v1/types_swagger_doc_generated.go @@ -29,7 +29,7 @@ package v1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_BoundObjectReference = map[string]string{ "": "BoundObjectReference is a reference to an object that a token is bound to.", - "kind": "kind of the referent. Valid kinds are 'Pod' and 'Secret'.", + "kind": "kind of the referent. Valid kinds are 'Pod', 'Secret', 'Node', 'ValidatingWebhookConfiguration', and 'MutatingWebhookConfiguration'.", "apiVersion": "apiVersion is API version of the referent.", "name": "name of the referent.", "uid": "uid of the referent.", @@ -74,6 +74,7 @@ var map_TokenRequestSpec = map[string]string{ "audiences": "audiences are the intendend audiences of the token. A recipient of a token must identify themself with an identifier in the list of audiences of the token, and otherwise should reject the token. A token issued for multiple audiences may be used to authenticate against any of the audiences listed but implies a high degree of trust between the target audiences.", "expirationSeconds": "expirationSeconds is the requested duration of validity of the request. The token issuer may return a token with a different validity duration so a client needs to check the 'expiration' field in a response.", "boundObjectRef": "boundObjectRef is a reference to an object that the token will be bound to. The token will only be valid for as long as the bound object exists. NOTE: The API server's TokenReview endpoint will validate the BoundObjectRef, but other audiences may not. Keep ExpirationSeconds small if you want prompt revocation.", + "attestations": "attestations is a map of well-known keys to string-slice values. The values for each key have a specific semantic meaning, which is documented on the key definition. Requesters of tokens may ask the Kubernetes API Server to attest to certain claims. The API Server may perform authorization checks depending on the key of this map.", } func (TokenRequestSpec) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/authentication/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/authentication/v1/zz_generated.deepcopy.go index 369c89b863..6bc649268d 100644 --- a/vendor/k8s.io/api/authentication/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/authentication/v1/zz_generated.deepcopy.go @@ -25,6 +25,26 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in AttestationValue) DeepCopyInto(out *AttestationValue) { + { + in := &in + *out = make(AttestationValue, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttestationValue. +func (in AttestationValue) DeepCopy() AttestationValue { + if in == nil { + return nil + } + out := new(AttestationValue) + in.DeepCopyInto(out) + return *out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BoundObjectReference) DeepCopyInto(out *BoundObjectReference) { *out = *in @@ -151,6 +171,21 @@ func (in *TokenRequestSpec) DeepCopyInto(out *TokenRequestSpec) { *out = new(BoundObjectReference) **out = **in } + if in.Attestations != nil { + in, out := &in.Attestations, &out.Attestations + *out = make(map[string]AttestationValue, len(*in)) + for key, val := range *in { + var outVal []string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = make(AttestationValue, len(*in)) + copy(*out, *in) + } + (*out)[key] = outVal + } + } return } diff --git a/vendor/k8s.io/api/authentication/v1alpha1/generated.proto b/vendor/k8s.io/api/authentication/v1alpha1/generated.proto index 2bf836d730..cd806bb8aa 100644 --- a/vendor/k8s.io/api/authentication/v1alpha1/generated.proto +++ b/vendor/k8s.io/api/authentication/v1alpha1/generated.proto @@ -32,10 +32,12 @@ option go_package = "k8s.io/api/authentication/v1alpha1"; // SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request. // When using impersonation, users will receive the user info of the user being impersonated. If impersonation or // request header authentication is used, any extra keys will have their case ignored and returned as lowercase. +// +k8s:supportsSubresource="/status" message SelfSubjectReview { // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // status is filled in by the server with the user attributes. diff --git a/vendor/k8s.io/api/authentication/v1alpha1/types.go b/vendor/k8s.io/api/authentication/v1alpha1/types.go index 7e02470c96..5a76a91a37 100644 --- a/vendor/k8s.io/api/authentication/v1alpha1/types.go +++ b/vendor/k8s.io/api/authentication/v1alpha1/types.go @@ -30,11 +30,13 @@ import ( // SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request. // When using impersonation, users will receive the user info of the user being impersonated. If impersonation or // request header authentication is used, any extra keys will have their case ignored and returned as lowercase. +// +k8s:supportsSubresource="/status" type SelfSubjectReview struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // status is filled in by the server with the user attributes. // +optional diff --git a/vendor/k8s.io/api/authentication/v1beta1/generated.proto b/vendor/k8s.io/api/authentication/v1beta1/generated.proto index 999c65156d..e5992bcaa2 100644 --- a/vendor/k8s.io/api/authentication/v1beta1/generated.proto +++ b/vendor/k8s.io/api/authentication/v1beta1/generated.proto @@ -41,10 +41,12 @@ message ExtraValue { // SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request. // When using impersonation, users will receive the user info of the user being impersonated. If impersonation or // request header authentication is used, any extra keys will have their case ignored and returned as lowercase. +// +k8s:supportsSubresource="/status" message SelfSubjectReview { // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // status is filled in by the server with the user attributes. @@ -62,10 +64,12 @@ message SelfSubjectReviewStatus { // TokenReview attempts to authenticate a token to a known user. // Note: TokenReview requests may be cached by the webhook token authenticator // plugin in the kube-apiserver. +// +k8s:supportsSubresource="/status" message TokenReview { // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec holds information about the request being evaluated diff --git a/vendor/k8s.io/api/authentication/v1beta1/types.go b/vendor/k8s.io/api/authentication/v1beta1/types.go index 33dacdb723..8873d5d2a7 100644 --- a/vendor/k8s.io/api/authentication/v1beta1/types.go +++ b/vendor/k8s.io/api/authentication/v1beta1/types.go @@ -34,11 +34,13 @@ import ( // TokenReview attempts to authenticate a token to a known user. // Note: TokenReview requests may be cached by the webhook token authenticator // plugin in the kube-apiserver. +// +k8s:supportsSubresource="/status" type TokenReview struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec holds information about the request being evaluated @@ -128,11 +130,13 @@ func (t ExtraValue) String() string { // SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request. // When using impersonation, users will receive the user info of the user being impersonated. If impersonation or // request header authentication is used, any extra keys will have their case ignored and returned as lowercase. +// +k8s:supportsSubresource="/status" type SelfSubjectReview struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // status is filled in by the server with the user attributes. // +optional diff --git a/vendor/k8s.io/api/authorization/v1/generated.proto b/vendor/k8s.io/api/authorization/v1/generated.proto index c47449f911..40753aa434 100644 --- a/vendor/k8s.io/api/authorization/v1/generated.proto +++ b/vendor/k8s.io/api/authorization/v1/generated.proto @@ -94,10 +94,12 @@ message LabelSelectorAttributes { // LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. // Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions // checking. +// +k8s:supportsSubresource="/status" message LocalSubjectAccessReview { // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec holds information about the request being evaluated. spec.namespace must be equal to the namespace @@ -203,10 +205,12 @@ message ResourceRule { // SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a // spec.namespace means "in all namespaces". Self is a special case, because users should always be able // to check whether they can perform an action +// +k8s:supportsSubresource="/status" message SelfSubjectAccessReview { // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec holds information about the request being evaluated. user and groups must be empty @@ -222,10 +226,14 @@ message SelfSubjectAccessReview { message SelfSubjectAccessReviewSpec { // resourceAttributes describes information for a resource access request // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:unionMember optional ResourceAttributes resourceAttributes = 1; // nonResourceAttributes describes information for a non-resource access request // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:unionMember optional NonResourceAttributes nonResourceAttributes = 2; } @@ -235,10 +243,12 @@ message SelfSubjectAccessReviewSpec { // or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to // drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. // SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. +// +k8s:supportsSubresource="/status" message SelfSubjectRulesReview { // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec holds information about the request being evaluated. @@ -256,10 +266,12 @@ message SelfSubjectRulesReviewSpec { } // SubjectAccessReview checks whether or not a user or group can perform an action. +// +k8s:supportsSubresource="/status" message SubjectAccessReview { // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec holds information about the request being evaluated @@ -275,10 +287,14 @@ message SubjectAccessReview { message SubjectAccessReviewSpec { // resourceAttributes describes information for a resource access request // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:unionMember optional ResourceAttributes resourceAttributes = 1; // nonResourceAttributes describes information for a non-resource access request // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:unionMember optional NonResourceAttributes nonResourceAttributes = 2; // user is the user you're testing for. diff --git a/vendor/k8s.io/api/authorization/v1/types.go b/vendor/k8s.io/api/authorization/v1/types.go index dcc9b0f853..eb9f808cf7 100644 --- a/vendor/k8s.io/api/authorization/v1/types.go +++ b/vendor/k8s.io/api/authorization/v1/types.go @@ -29,11 +29,13 @@ import ( // +k8s:prerelease-lifecycle-gen:introduced=1.6 // SubjectAccessReview checks whether or not a user or group can perform an action. +// +k8s:supportsSubresource="/status" type SubjectAccessReview struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec holds information about the request being evaluated @@ -53,11 +55,13 @@ type SubjectAccessReview struct { // SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a // spec.namespace means "in all namespaces". Self is a special case, because users should always be able // to check whether they can perform an action +// +k8s:supportsSubresource="/status" type SelfSubjectAccessReview struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec holds information about the request being evaluated. user and groups must be empty @@ -76,11 +80,13 @@ type SelfSubjectAccessReview struct { // LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. // Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions // checking. +// +k8s:supportsSubresource="/status" type LocalSubjectAccessReview struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec holds information about the request being evaluated. spec.namespace must be equal to the namespace @@ -195,9 +201,13 @@ type NonResourceAttributes struct { type SubjectAccessReviewSpec struct { // resourceAttributes describes information for a resource access request // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:unionMember ResourceAttributes *ResourceAttributes `json:"resourceAttributes,omitempty" protobuf:"bytes,1,opt,name=resourceAttributes"` // nonResourceAttributes describes information for a non-resource access request // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:unionMember NonResourceAttributes *NonResourceAttributes `json:"nonResourceAttributes,omitempty" protobuf:"bytes,2,opt,name=nonResourceAttributes"` // user is the user you're testing for. @@ -231,9 +241,13 @@ func (t ExtraValue) String() string { type SelfSubjectAccessReviewSpec struct { // resourceAttributes describes information for a resource access request // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:unionMember ResourceAttributes *ResourceAttributes `json:"resourceAttributes,omitempty" protobuf:"bytes,1,opt,name=resourceAttributes"` // nonResourceAttributes describes information for a non-resource access request // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:unionMember NonResourceAttributes *NonResourceAttributes `json:"nonResourceAttributes,omitempty" protobuf:"bytes,2,opt,name=nonResourceAttributes"` } @@ -269,11 +283,13 @@ type SubjectAccessReviewStatus struct { // or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to // drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. // SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. +// +k8s:supportsSubresource="/status" type SelfSubjectRulesReview struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec holds information about the request being evaluated. diff --git a/vendor/k8s.io/api/authorization/v1beta1/generated.proto b/vendor/k8s.io/api/authorization/v1beta1/generated.proto index 8095ab4dbb..37618f077f 100644 --- a/vendor/k8s.io/api/authorization/v1beta1/generated.proto +++ b/vendor/k8s.io/api/authorization/v1beta1/generated.proto @@ -41,10 +41,12 @@ message ExtraValue { // LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. // Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions // checking. +// +k8s:supportsSubresource="/status" message LocalSubjectAccessReview { // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec holds information about the request being evaluated. spec.namespace must be equal to the namespace @@ -150,10 +152,12 @@ message ResourceRule { // SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a // spec.namespace means "in all namespaces". Self is a special case, because users should always be able // to check whether they can perform an action +// +k8s:supportsSubresource="/status" message SelfSubjectAccessReview { // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec holds information about the request being evaluated. user and groups must be empty @@ -169,10 +173,14 @@ message SelfSubjectAccessReview { message SelfSubjectAccessReviewSpec { // resourceAttributes describes information for a resource access request // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:unionMember optional ResourceAttributes resourceAttributes = 1; // nonResourceAttributes describes information for a non-resource access request // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:unionMember optional NonResourceAttributes nonResourceAttributes = 2; } @@ -182,10 +190,12 @@ message SelfSubjectAccessReviewSpec { // or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to // drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. // SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. +// +k8s:supportsSubresource="/status" message SelfSubjectRulesReview { // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec holds information about the request being evaluated. @@ -203,10 +213,12 @@ message SelfSubjectRulesReviewSpec { } // SubjectAccessReview checks whether or not a user or group can perform an action. +// +k8s:supportsSubresource="/status" message SubjectAccessReview { // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec holds information about the request being evaluated @@ -222,10 +234,14 @@ message SubjectAccessReview { message SubjectAccessReviewSpec { // resourceAttributes describes information for a resource access request // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:unionMember optional ResourceAttributes resourceAttributes = 1; // nonResourceAttributes describes information for a non-resource access request // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:unionMember optional NonResourceAttributes nonResourceAttributes = 2; // user is the user you're testing for. diff --git a/vendor/k8s.io/api/authorization/v1beta1/types.go b/vendor/k8s.io/api/authorization/v1beta1/types.go index 204559fd20..7dc8409af6 100644 --- a/vendor/k8s.io/api/authorization/v1beta1/types.go +++ b/vendor/k8s.io/api/authorization/v1beta1/types.go @@ -32,11 +32,13 @@ import ( // +k8s:prerelease-lifecycle-gen:replacement=authorization.k8s.io,v1,SubjectAccessReview // SubjectAccessReview checks whether or not a user or group can perform an action. +// +k8s:supportsSubresource="/status" type SubjectAccessReview struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec holds information about the request being evaluated @@ -58,11 +60,13 @@ type SubjectAccessReview struct { // SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a // spec.namespace means "in all namespaces". Self is a special case, because users should always be able // to check whether they can perform an action +// +k8s:supportsSubresource="/status" type SelfSubjectAccessReview struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec holds information about the request being evaluated. user and groups must be empty @@ -83,11 +87,13 @@ type SelfSubjectAccessReview struct { // LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. // Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions // checking. +// +k8s:supportsSubresource="/status" type LocalSubjectAccessReview struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec holds information about the request being evaluated. spec.namespace must be equal to the namespace @@ -148,9 +154,13 @@ type NonResourceAttributes struct { type SubjectAccessReviewSpec struct { // resourceAttributes describes information for a resource access request // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:unionMember ResourceAttributes *ResourceAttributes `json:"resourceAttributes,omitempty" protobuf:"bytes,1,opt,name=resourceAttributes"` // nonResourceAttributes describes information for a non-resource access request // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:unionMember NonResourceAttributes *NonResourceAttributes `json:"nonResourceAttributes,omitempty" protobuf:"bytes,2,opt,name=nonResourceAttributes"` // user is the user you're testing for. @@ -184,9 +194,13 @@ func (t ExtraValue) String() string { type SelfSubjectAccessReviewSpec struct { // resourceAttributes describes information for a resource access request // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:unionMember ResourceAttributes *ResourceAttributes `json:"resourceAttributes,omitempty" protobuf:"bytes,1,opt,name=resourceAttributes"` // nonResourceAttributes describes information for a non-resource access request // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:unionMember NonResourceAttributes *NonResourceAttributes `json:"nonResourceAttributes,omitempty" protobuf:"bytes,2,opt,name=nonResourceAttributes"` } @@ -224,11 +238,13 @@ type SubjectAccessReviewStatus struct { // or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to // drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. // SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. +// +k8s:supportsSubresource="/status" type SelfSubjectRulesReview struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec holds information about the request being evaluated. diff --git a/vendor/k8s.io/api/autoscaling/v1/generated.pb.go b/vendor/k8s.io/api/autoscaling/v1/generated.pb.go index 6028054aef..681c0c44c7 100644 --- a/vendor/k8s.io/api/autoscaling/v1/generated.pb.go +++ b/vendor/k8s.io/api/autoscaling/v1/generated.pb.go @@ -410,6 +410,11 @@ func (m *HorizontalPodAutoscalerCondition) MarshalToSizedBuffer(dAtA []byte) (in _ = i var l int _ = l + if m.ObservedGeneration != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.ObservedGeneration)) + i-- + dAtA[i] = 0x30 + } i -= len(m.Message) copy(dAtA[i:], m.Message) i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) @@ -1344,6 +1349,9 @@ func (m *HorizontalPodAutoscalerCondition) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = len(m.Message) n += 1 + l + sovGenerated(uint64(l)) + if m.ObservedGeneration != nil { + n += 1 + sovGenerated(uint64(*m.ObservedGeneration)) + } return n } @@ -1708,6 +1716,7 @@ func (this *HorizontalPodAutoscalerCondition) String() string { `LastTransitionTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastTransitionTime), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + `ObservedGeneration:` + valueToStringGenerated(this.ObservedGeneration) + `,`, `}`, }, "") return s @@ -3101,6 +3110,26 @@ func (m *HorizontalPodAutoscalerCondition) Unmarshal(dAtA []byte) error { } m.Message = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ObservedGeneration", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ObservedGeneration = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/vendor/k8s.io/api/autoscaling/v1/generated.proto b/vendor/k8s.io/api/autoscaling/v1/generated.proto index 6ef1facb6a..a20b92a793 100644 --- a/vendor/k8s.io/api/autoscaling/v1/generated.proto +++ b/vendor/k8s.io/api/autoscaling/v1/generated.proto @@ -88,9 +88,11 @@ message ContainerResourceMetricStatus { // +structType=atomic message CrossVersionObjectReference { // kind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + // +k8s:alpha(since: "1.37")=+k8s:required optional string kind = 1; // name is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + // +k8s:alpha(since: "1.37")=+k8s:required optional string name = 2; // apiVersion is the API version of the referent @@ -142,8 +144,9 @@ message ExternalMetricStatus { } // configuration of a horizontal pod autoscaler. +// +k8s:supportsSubresource="/status" message HorizontalPodAutoscaler { - // Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -178,6 +181,12 @@ message HorizontalPodAutoscalerCondition { // the transition // +optional optional string message = 5; + + // observedGeneration represents the .metadata.generation that the condition was set based upon. + // For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + // with respect to the current state of the instance. + // +optional + optional int64 observedGeneration = 6; } // list of horizontal pod autoscaler objects. @@ -192,7 +201,7 @@ message HorizontalPodAutoscalerList { // specification of a horizontal pod autoscaler. message HorizontalPodAutoscalerSpec { - // reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption + // scaleTargetRef is the reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption // and will set the desired number of pods by using its Scale subresource. optional CrossVersionObjectReference scaleTargetRef = 1; @@ -202,15 +211,15 @@ message HorizontalPodAutoscalerSpec { // metric is configured. Scaling is active as long as at least one metric value is // available. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:ifEnabled(HPAScaleToZero)=+k8s:minimum=0 - // +k8s:alpha(since: "1.36")=+k8s:ifDisabled(HPAScaleToZero)=+k8s:minimum=1 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifEnabled(HPAScaleToZero)=+k8s:minimum=0 + // +k8s:beta(since: "1.37")=+k8s:ifDisabled(HPAScaleToZero)=+k8s:minimum=1 optional int32 minReplicas = 2; // maxReplicas is the upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas. // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:minimum=1 + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:minimum=1 optional int32 maxReplicas = 3; // targetCPUUtilizationPercentage is the target average CPU utilization (represented as a percentage of requested CPU) over all the pods; @@ -461,8 +470,9 @@ message ResourceMetricStatus { // Scale represents a scaling request for a resource. message Scale { - // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. + // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. @@ -478,9 +488,9 @@ message Scale { message ScaleSpec { // replicas is the desired number of instances for the scaled object. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +default=0 - // +k8s:alpha(since: "1.36")=+k8s:minimum=0 + // +k8s:beta(since: "1.37")=+k8s:minimum=0 optional int32 replicas = 1; } diff --git a/vendor/k8s.io/api/autoscaling/v1/types.go b/vendor/k8s.io/api/autoscaling/v1/types.go index 97222afc08..5554e62713 100644 --- a/vendor/k8s.io/api/autoscaling/v1/types.go +++ b/vendor/k8s.io/api/autoscaling/v1/types.go @@ -26,9 +26,11 @@ import ( // +structType=atomic type CrossVersionObjectReference struct { // kind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + // +k8s:alpha(since: "1.37")=+k8s:required Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` // name is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + // +k8s:alpha(since: "1.37")=+k8s:required Name string `json:"name" protobuf:"bytes,2,opt,name=name"` // apiVersion is the API version of the referent @@ -38,7 +40,7 @@ type CrossVersionObjectReference struct { // specification of a horizontal pod autoscaler. type HorizontalPodAutoscalerSpec struct { - // reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption + // scaleTargetRef is the reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption // and will set the desired number of pods by using its Scale subresource. ScaleTargetRef CrossVersionObjectReference `json:"scaleTargetRef" protobuf:"bytes,1,opt,name=scaleTargetRef"` // minReplicas is the lower limit for the number of replicas to which the autoscaler @@ -47,15 +49,15 @@ type HorizontalPodAutoscalerSpec struct { // metric is configured. Scaling is active as long as at least one metric value is // available. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:ifEnabled(HPAScaleToZero)=+k8s:minimum=0 - // +k8s:alpha(since: "1.36")=+k8s:ifDisabled(HPAScaleToZero)=+k8s:minimum=1 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifEnabled(HPAScaleToZero)=+k8s:minimum=0 + // +k8s:beta(since: "1.37")=+k8s:ifDisabled(HPAScaleToZero)=+k8s:minimum=1 MinReplicas *int32 `json:"minReplicas,omitempty" protobuf:"varint,2,opt,name=minReplicas"` // maxReplicas is the upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas. // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:minimum=1 + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:minimum=1 MaxReplicas int32 `json:"maxReplicas" protobuf:"varint,3,opt,name=maxReplicas"` // targetCPUUtilizationPercentage is the target average CPU utilization (represented as a percentage of requested CPU) over all the pods; @@ -92,9 +94,10 @@ type HorizontalPodAutoscalerStatus struct { // +k8s:prerelease-lifecycle-gen:introduced=1.2 // configuration of a horizontal pod autoscaler. +// +k8s:supportsSubresource="/status" type HorizontalPodAutoscaler struct { - metav1.TypeMeta `json:",inline"` - // Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -112,7 +115,7 @@ type HorizontalPodAutoscaler struct { // list of horizontal pod autoscaler objects. type HorizontalPodAutoscalerList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -127,9 +130,10 @@ type HorizontalPodAutoscalerList struct { // Scale represents a scaling request for a resource. type Scale struct { - metav1.TypeMeta `json:",inline"` - // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. @@ -145,9 +149,9 @@ type Scale struct { type ScaleSpec struct { // replicas is the desired number of instances for the scaled object. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +default=0 - // +k8s:alpha(since: "1.36")=+k8s:minimum=0 + // +k8s:beta(since: "1.37")=+k8s:minimum=0 Replicas int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"` } @@ -440,6 +444,12 @@ type HorizontalPodAutoscalerCondition struct { // the transition // +optional Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` + + // observedGeneration represents the .metadata.generation that the condition was set based upon. + // For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + // with respect to the current state of the instance. + // +optional + ObservedGeneration *int64 `json:"observedGeneration,omitempty" protobuf:"varint,6,opt,name=observedGeneration"` } // ObjectMetricStatus indicates the current value of a metric describing a diff --git a/vendor/k8s.io/api/autoscaling/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/autoscaling/v1/types_swagger_doc_generated.go index ba43d06c10..4132f42d68 100644 --- a/vendor/k8s.io/api/autoscaling/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/autoscaling/v1/types_swagger_doc_generated.go @@ -88,7 +88,7 @@ func (ExternalMetricStatus) SwaggerDoc() map[string]string { var map_HorizontalPodAutoscaler = map[string]string{ "": "configuration of a horizontal pod autoscaler.", - "metadata": "Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec defines the behaviour of autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.", "status": "status is the current information about the autoscaler.", } @@ -104,6 +104,7 @@ var map_HorizontalPodAutoscalerCondition = map[string]string{ "lastTransitionTime": "lastTransitionTime is the last time the condition transitioned from one status to another", "reason": "reason is the reason for the condition's last transition.", "message": "message is a human-readable explanation containing details about the transition", + "observedGeneration": "observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.", } func (HorizontalPodAutoscalerCondition) SwaggerDoc() map[string]string { @@ -122,7 +123,7 @@ func (HorizontalPodAutoscalerList) SwaggerDoc() map[string]string { var map_HorizontalPodAutoscalerSpec = map[string]string{ "": "specification of a horizontal pod autoscaler.", - "scaleTargetRef": "reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption and will set the desired number of pods by using its Scale subresource.", + "scaleTargetRef": "scaleTargetRef is the reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption and will set the desired number of pods by using its Scale subresource.", "minReplicas": "minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the alpha feature gate HPAScaleToZero is enabled and at least one Object or External metric is configured. Scaling is active as long as at least one metric value is available.", "maxReplicas": "maxReplicas is the upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.", "targetCPUUtilizationPercentage": "targetCPUUtilizationPercentage is the target average CPU utilization (represented as a percentage of requested CPU) over all the pods; if not specified the default autoscaling policy will be used.", @@ -245,7 +246,7 @@ func (ResourceMetricStatus) SwaggerDoc() map[string]string { var map_Scale = map[string]string{ "": "Scale represents a scaling request for a resource.", - "metadata": "Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.", + "metadata": "metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.", "spec": "spec defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.", "status": "status is the current status of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. Read-only.", } diff --git a/vendor/k8s.io/api/autoscaling/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/autoscaling/v1/zz_generated.deepcopy.go index 603e6aa8cb..e0ad1668ce 100644 --- a/vendor/k8s.io/api/autoscaling/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/autoscaling/v1/zz_generated.deepcopy.go @@ -180,6 +180,11 @@ func (in *HorizontalPodAutoscaler) DeepCopyObject() runtime.Object { func (in *HorizontalPodAutoscalerCondition) DeepCopyInto(out *HorizontalPodAutoscalerCondition) { *out = *in in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) + if in.ObservedGeneration != nil { + in, out := &in.ObservedGeneration, &out.ObservedGeneration + *out = new(int64) + **out = **in + } return } diff --git a/vendor/k8s.io/api/autoscaling/v2/generated.pb.go b/vendor/k8s.io/api/autoscaling/v2/generated.pb.go index 7505c7592f..0f663d46e3 100644 --- a/vendor/k8s.io/api/autoscaling/v2/generated.pb.go +++ b/vendor/k8s.io/api/autoscaling/v2/generated.pb.go @@ -506,6 +506,11 @@ func (m *HorizontalPodAutoscalerCondition) MarshalToSizedBuffer(dAtA []byte) (in _ = i var l int _ = l + if m.ObservedGeneration != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.ObservedGeneration)) + i-- + dAtA[i] = 0x30 + } i -= len(m.Message) copy(dAtA[i:], m.Message) i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) @@ -1489,6 +1494,9 @@ func (m *HorizontalPodAutoscalerCondition) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = len(m.Message) n += 1 + l + sovGenerated(uint64(l)) + if m.ObservedGeneration != nil { + n += 1 + sovGenerated(uint64(*m.ObservedGeneration)) + } return n } @@ -1892,6 +1900,7 @@ func (this *HorizontalPodAutoscalerCondition) String() string { `LastTransitionTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastTransitionTime), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + `ObservedGeneration:` + valueToStringGenerated(this.ObservedGeneration) + `,`, `}`, }, "") return s @@ -3524,6 +3533,26 @@ func (m *HorizontalPodAutoscalerCondition) Unmarshal(dAtA []byte) error { } m.Message = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ObservedGeneration", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ObservedGeneration = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/vendor/k8s.io/api/autoscaling/v2/generated.proto b/vendor/k8s.io/api/autoscaling/v2/generated.proto index f56b8c749d..d9a31f941a 100644 --- a/vendor/k8s.io/api/autoscaling/v2/generated.proto +++ b/vendor/k8s.io/api/autoscaling/v2/generated.proto @@ -67,9 +67,11 @@ message ContainerResourceMetricStatus { // CrossVersionObjectReference contains enough information to let you identify the referred resource. message CrossVersionObjectReference { // kind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + // +k8s:alpha(since: "1.37")=+k8s:required optional string kind = 1; // name is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + // +k8s:alpha(since: "1.37")=+k8s:required optional string name = 2; // apiVersion is the API version of the referent @@ -122,8 +124,7 @@ message HPAScalingPolicy { // window is chosen. // // The tolerance is applied to the metric values and prevents scaling too -// eagerly for small metric variations. (Note that setting a tolerance requires -// the beta HPAConfigurableTolerance feature gate to be enabled.) +// eagerly for small metric variations. message HPAScalingRules { // stabilizationWindowSeconds is the number of seconds for which past recommendations should be // considered while scaling up or scaling down. @@ -156,9 +157,6 @@ message HPAScalingRules { // and scale-down and scale-up tolerances of 5% and 1% respectively, scaling will be // triggered when the actual consumption falls below 95Mi or exceeds 101Mi. // - // This is an beta field and requires the HPAConfigurableTolerance feature - // gate to be enabled. - // // +featureGate=HPAConfigurableTolerance // +optional optional .k8s.io.apimachinery.pkg.api.resource.Quantity tolerance = 4; @@ -167,6 +165,7 @@ message HPAScalingRules { // HorizontalPodAutoscaler is the configuration for a horizontal pod // autoscaler, which automatically manages the replica count of any resource // implementing the scale subresource based on the metrics specified. +// +k8s:supportsSubresource="/status" message HorizontalPodAutoscaler { // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -224,6 +223,12 @@ message HorizontalPodAutoscalerCondition { // the transition // +optional optional string message = 5; + + // observedGeneration represents the .metadata.generation that the condition was set based upon. + // For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + // with respect to the current state of the instance. + // +optional + optional int64 observedGeneration = 6; } // HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects. @@ -248,16 +253,16 @@ message HorizontalPodAutoscalerSpec { // metric is configured. Scaling is active as long as at least one metric value is // available. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:ifEnabled(HPAScaleToZero)=+k8s:minimum=0 - // +k8s:alpha(since: "1.36")=+k8s:ifDisabled(HPAScaleToZero)=+k8s:minimum=1 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifEnabled(HPAScaleToZero)=+k8s:minimum=0 + // +k8s:beta(since: "1.37")=+k8s:ifDisabled(HPAScaleToZero)=+k8s:minimum=1 optional int32 minReplicas = 2; // maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. // It cannot be less that minReplicas. // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:minimum=1 + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:minimum=1 optional int32 maxReplicas = 3; // metrics contains the specifications for which to use to calculate the @@ -270,6 +275,7 @@ message HorizontalPodAutoscalerSpec { // If not set, the default metric will be set to 80% average CPU utilization. // +listType=atomic // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional repeated MetricSpec metrics = 4; // behavior configures the scaling behavior of the target @@ -302,6 +308,7 @@ message HorizontalPodAutoscalerStatus { // currentMetrics is the last read state of the metrics used by this autoscaler. // +listType=atomic // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional repeated MetricStatus currentMetrics = 5; // conditions is the set of conditions required for this autoscaler to scale its target, @@ -336,6 +343,8 @@ message MetricSpec { // object refers to a metric describing a single kubernetes object // (for example, hits-per-second on an Ingress object). // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:opaqueType optional ObjectMetricSource object = 2; // pods refers to a metric describing each pod in the current scale target @@ -378,6 +387,8 @@ message MetricStatus { // object refers to a metric describing a single kubernetes object // (for example, hits-per-second on an Ingress object). // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:opaqueType optional ObjectMetricStatus object = 2; // pods refers to a metric describing each pod in the current scale target @@ -394,7 +405,7 @@ message MetricStatus { // +optional optional ResourceMetricStatus resource = 4; - // container resource refers to a resource metric (such as those specified in + // containerResource refers to a resource metric (such as those specified in // requests and limits) known to Kubernetes describing a single container in each pod in the // current scale target (e.g. CPU or memory). Such metrics are built in to // Kubernetes, and have special scaling options on top of those available @@ -444,7 +455,7 @@ message MetricValueStatus { // +optional optional .k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 2; - // currentAverageUtilization is the current value of the average of the + // averageUtilization is the current value of the average of the // resource metric across all relevant pods, represented as a percentage of // the requested value of the resource for the pods. // +optional @@ -473,7 +484,7 @@ message ObjectMetricStatus { // current contains the current value for the given metric optional MetricValueStatus current = 2; - // DescribedObject specifies the descriptions of a object,such as kind,name apiVersion + // describedObject specifies the descriptions of a object,such as kind,name apiVersion optional CrossVersionObjectReference describedObject = 3; } diff --git a/vendor/k8s.io/api/autoscaling/v2/types.go b/vendor/k8s.io/api/autoscaling/v2/types.go index ad10169a01..49c9e751c2 100644 --- a/vendor/k8s.io/api/autoscaling/v2/types.go +++ b/vendor/k8s.io/api/autoscaling/v2/types.go @@ -31,8 +31,9 @@ import ( // HorizontalPodAutoscaler is the configuration for a horizontal pod // autoscaler, which automatically manages the replica count of any resource // implementing the scale subresource based on the metrics specified. +// +k8s:supportsSubresource="/status" type HorizontalPodAutoscaler struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -59,16 +60,16 @@ type HorizontalPodAutoscalerSpec struct { // metric is configured. Scaling is active as long as at least one metric value is // available. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:ifEnabled(HPAScaleToZero)=+k8s:minimum=0 - // +k8s:alpha(since: "1.36")=+k8s:ifDisabled(HPAScaleToZero)=+k8s:minimum=1 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifEnabled(HPAScaleToZero)=+k8s:minimum=0 + // +k8s:beta(since: "1.37")=+k8s:ifDisabled(HPAScaleToZero)=+k8s:minimum=1 MinReplicas *int32 `json:"minReplicas,omitempty" protobuf:"varint,2,opt,name=minReplicas"` // maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. // It cannot be less that minReplicas. // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:minimum=1 + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:minimum=1 MaxReplicas int32 `json:"maxReplicas" protobuf:"varint,3,opt,name=maxReplicas"` // metrics contains the specifications for which to use to calculate the @@ -81,6 +82,7 @@ type HorizontalPodAutoscalerSpec struct { // If not set, the default metric will be set to 80% average CPU utilization. // +listType=atomic // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional Metrics []MetricSpec `json:"metrics,omitempty" protobuf:"bytes,4,rep,name=metrics"` // behavior configures the scaling behavior of the target @@ -93,9 +95,11 @@ type HorizontalPodAutoscalerSpec struct { // CrossVersionObjectReference contains enough information to let you identify the referred resource. type CrossVersionObjectReference struct { // kind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + // +k8s:alpha(since: "1.37")=+k8s:required Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` // name is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + // +k8s:alpha(since: "1.37")=+k8s:required Name string `json:"name" protobuf:"bytes,2,opt,name=name"` // apiVersion is the API version of the referent @@ -113,6 +117,8 @@ type MetricSpec struct { // object refers to a metric describing a single kubernetes object // (for example, hits-per-second on an Ingress object). // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:opaqueType Object *ObjectMetricSource `json:"object,omitempty" protobuf:"bytes,2,opt,name=object"` // pods refers to a metric describing each pod in the current scale target @@ -187,8 +193,7 @@ const ( // window is chosen. // // The tolerance is applied to the metric values and prevents scaling too -// eagerly for small metric variations. (Note that setting a tolerance requires -// the beta HPAConfigurableTolerance feature gate to be enabled.) +// eagerly for small metric variations. type HPAScalingRules struct { // stabilizationWindowSeconds is the number of seconds for which past recommendations should be // considered while scaling up or scaling down. @@ -221,9 +226,6 @@ type HPAScalingRules struct { // and scale-down and scale-up tolerances of 5% and 1% respectively, scaling will be // triggered when the actual consumption falls below 95Mi or exceeds 101Mi. // - // This is an beta field and requires the HPAConfigurableTolerance feature - // gate to be enabled. - // // +featureGate=HPAConfigurableTolerance // +optional Tolerance *resource.Quantity `json:"tolerance,omitempty" protobuf:"bytes,4,opt,name=tolerance"` @@ -424,6 +426,7 @@ type HorizontalPodAutoscalerStatus struct { // currentMetrics is the last read state of the metrics used by this autoscaler. // +listType=atomic // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional CurrentMetrics []MetricStatus `json:"currentMetrics" protobuf:"bytes,5,rep,name=currentMetrics"` // conditions is the set of conditions required for this autoscaler to scale its target, @@ -476,6 +479,12 @@ type HorizontalPodAutoscalerCondition struct { // the transition // +optional Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` + + // observedGeneration represents the .metadata.generation that the condition was set based upon. + // For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + // with respect to the current state of the instance. + // +optional + ObservedGeneration *int64 `json:"observedGeneration,omitempty" protobuf:"varint,6,opt,name=observedGeneration"` } // MetricStatus describes the last-read state of a single metric. @@ -487,6 +496,8 @@ type MetricStatus struct { // object refers to a metric describing a single kubernetes object // (for example, hits-per-second on an Ingress object). // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:opaqueType Object *ObjectMetricStatus `json:"object,omitempty" protobuf:"bytes,2,opt,name=object"` // pods refers to a metric describing each pod in the current scale target @@ -503,7 +514,7 @@ type MetricStatus struct { // +optional Resource *ResourceMetricStatus `json:"resource,omitempty" protobuf:"bytes,4,opt,name=resource"` - // container resource refers to a resource metric (such as those specified in + // containerResource refers to a resource metric (such as those specified in // requests and limits) known to Kubernetes describing a single container in each pod in the // current scale target (e.g. CPU or memory). Such metrics are built in to // Kubernetes, and have special scaling options on top of those available @@ -529,7 +540,7 @@ type ObjectMetricStatus struct { // current contains the current value for the given metric Current MetricValueStatus `json:"current" protobuf:"bytes,2,name=current"` - // DescribedObject specifies the descriptions of a object,such as kind,name apiVersion + // describedObject specifies the descriptions of a object,such as kind,name apiVersion DescribedObject CrossVersionObjectReference `json:"describedObject" protobuf:"bytes,3,name=describedObject"` } @@ -593,7 +604,7 @@ type MetricValueStatus struct { // +optional AverageValue *resource.Quantity `json:"averageValue,omitempty" protobuf:"bytes,2,opt,name=averageValue"` - // currentAverageUtilization is the current value of the average of the + // averageUtilization is the current value of the average of the // resource metric across all relevant pods, represented as a percentage of // the requested value of the resource for the pods. // +optional @@ -605,7 +616,7 @@ type MetricValueStatus struct { // HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects. type HorizontalPodAutoscalerList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata is the standard list metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` diff --git a/vendor/k8s.io/api/autoscaling/v2/types_swagger_doc_generated.go b/vendor/k8s.io/api/autoscaling/v2/types_swagger_doc_generated.go index af3f3022da..de5a6b3897 100644 --- a/vendor/k8s.io/api/autoscaling/v2/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/autoscaling/v2/types_swagger_doc_generated.go @@ -92,11 +92,11 @@ func (HPAScalingPolicy) SwaggerDoc() map[string]string { } var map_HPAScalingRules = map[string]string{ - "": "HPAScalingRules configures the scaling behavior for one direction via scaling Policy Rules and a configurable metric tolerance.\n\nScaling Policy Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen.\n\nThe tolerance is applied to the metric values and prevents scaling too eagerly for small metric variations. (Note that setting a tolerance requires the beta HPAConfigurableTolerance feature gate to be enabled.)", + "": "HPAScalingRules configures the scaling behavior for one direction via scaling Policy Rules and a configurable metric tolerance.\n\nScaling Policy Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen.\n\nThe tolerance is applied to the metric values and prevents scaling too eagerly for small metric variations.", "stabilizationWindowSeconds": "stabilizationWindowSeconds is the number of seconds for which past recommendations should be considered while scaling up or scaling down. StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long).", "selectPolicy": "selectPolicy is used to specify which policy should be used. If not set, the default value Max is used.", "policies": "policies is a list of potential scaling polices which can be used during scaling. If not set, use the default values: - For scale up: allow doubling the number of pods, or an absolute change of 4 pods in a 15s window. - For scale down: allow all pods to be removed in a 15s window.", - "tolerance": "tolerance is the tolerance on the ratio between the current and desired metric value under which no updates are made to the desired number of replicas (e.g. 0.01 for 1%). Must be greater than or equal to zero. If not set, the default cluster-wide tolerance is applied (by default 10%).\n\nFor example, if autoscaling is configured with a memory consumption target of 100Mi, and scale-down and scale-up tolerances of 5% and 1% respectively, scaling will be triggered when the actual consumption falls below 95Mi or exceeds 101Mi.\n\nThis is an beta field and requires the HPAConfigurableTolerance feature gate to be enabled.", + "tolerance": "tolerance is the tolerance on the ratio between the current and desired metric value under which no updates are made to the desired number of replicas (e.g. 0.01 for 1%). Must be greater than or equal to zero. If not set, the default cluster-wide tolerance is applied (by default 10%).\n\nFor example, if autoscaling is configured with a memory consumption target of 100Mi, and scale-down and scale-up tolerances of 5% and 1% respectively, scaling will be triggered when the actual consumption falls below 95Mi or exceeds 101Mi.", } func (HPAScalingRules) SwaggerDoc() map[string]string { @@ -131,6 +131,7 @@ var map_HorizontalPodAutoscalerCondition = map[string]string{ "lastTransitionTime": "lastTransitionTime is the last time the condition transitioned from one status to another", "reason": "reason is the reason for the condition's last transition.", "message": "message is a human-readable explanation containing details about the transition", + "observedGeneration": "observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.", } func (HorizontalPodAutoscalerCondition) SwaggerDoc() map[string]string { @@ -204,7 +205,7 @@ var map_MetricStatus = map[string]string{ "object": "object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object).", "pods": "pods refers to a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.", "resource": "resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.", - "containerResource": "container resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing a single container in each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.", + "containerResource": "containerResource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing a single container in each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \"pods\" source.", "external": "external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).", } @@ -228,7 +229,7 @@ var map_MetricValueStatus = map[string]string{ "": "MetricValueStatus holds the current value for a metric", "value": "value is the current value of the metric (as a quantity).", "averageValue": "averageValue is the current value of the average of the metric across all relevant pods (as a quantity)", - "averageUtilization": "currentAverageUtilization is the current value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods.", + "averageUtilization": "averageUtilization is the current value of the average of the resource metric across all relevant pods, represented as a percentage of the requested value of the resource for the pods.", } func (MetricValueStatus) SwaggerDoc() map[string]string { @@ -250,7 +251,7 @@ var map_ObjectMetricStatus = map[string]string{ "": "ObjectMetricStatus indicates the current value of a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).", "metric": "metric identifies the target metric by name and selector", "current": "current contains the current value for the given metric", - "describedObject": "DescribedObject specifies the descriptions of a object,such as kind,name apiVersion", + "describedObject": "describedObject specifies the descriptions of a object,such as kind,name apiVersion", } func (ObjectMetricStatus) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/autoscaling/v2/zz_generated.deepcopy.go b/vendor/k8s.io/api/autoscaling/v2/zz_generated.deepcopy.go index 5fbcf9f807..ace4fa2fd3 100644 --- a/vendor/k8s.io/api/autoscaling/v2/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/autoscaling/v2/zz_generated.deepcopy.go @@ -222,6 +222,11 @@ func (in *HorizontalPodAutoscalerBehavior) DeepCopy() *HorizontalPodAutoscalerBe func (in *HorizontalPodAutoscalerCondition) DeepCopyInto(out *HorizontalPodAutoscalerCondition) { *out = *in in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) + if in.ObservedGeneration != nil { + in, out := &in.ObservedGeneration, &out.ObservedGeneration + *out = new(int64) + **out = **in + } return } diff --git a/vendor/k8s.io/api/batch/v1/generated.pb.go b/vendor/k8s.io/api/batch/v1/generated.pb.go index 099350e734..7c086a41c2 100644 --- a/vendor/k8s.io/api/batch/v1/generated.pb.go +++ b/vendor/k8s.io/api/batch/v1/generated.pb.go @@ -26,6 +26,7 @@ import ( k8s_io_api_core_v1 "k8s.io/api/core/v1" v11 "k8s.io/api/core/v1" + v1alpha3 "k8s.io/api/scheduling/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" math_bits "math/bits" @@ -49,6 +50,8 @@ func (m *JobCondition) Reset() { *m = JobCondition{} } func (m *JobList) Reset() { *m = JobList{} } +func (m *JobSchedulingConfiguration) Reset() { *m = JobSchedulingConfiguration{} } + func (m *JobSpec) Reset() { *m = JobSpec{} } func (m *JobStatus) Reset() { *m = JobStatus{} } @@ -472,6 +475,79 @@ func (m *JobList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *JobSchedulingConfiguration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *JobSchedulingConfiguration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *JobSchedulingConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ResourceClaims) > 0 { + for iNdEx := len(m.ResourceClaims) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResourceClaims[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.DisruptionMode != nil { + { + size, err := m.DisruptionMode.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.SchedulingConstraints != nil { + { + size, err := m.SchedulingConstraints.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.SchedulingPolicy != nil { + { + size, err := m.SchedulingPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *JobSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -492,6 +568,20 @@ func (m *JobSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Scheduling != nil { + { + size, err := m.Scheduling.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } if m.SuccessPolicy != nil { { size, err := m.SuccessPolicy.MarshalToSizedBuffer(dAtA[:i]) @@ -1195,6 +1285,33 @@ func (m *JobList) Size() (n int) { return n } +func (m *JobSchedulingConfiguration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SchedulingPolicy != nil { + l = m.SchedulingPolicy.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.SchedulingConstraints != nil { + l = m.SchedulingConstraints.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.DisruptionMode != nil { + l = m.DisruptionMode.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.ResourceClaims) > 0 { + for _, e := range m.ResourceClaims { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + func (m *JobSpec) Size() (n int) { if m == nil { return 0 @@ -1254,6 +1371,10 @@ func (m *JobSpec) Size() (n int) { l = m.SuccessPolicy.Size() n += 2 + l + sovGenerated(uint64(l)) } + if m.Scheduling != nil { + l = m.Scheduling.Size() + n += 2 + l + sovGenerated(uint64(l)) + } return n } @@ -1544,6 +1665,24 @@ func (this *JobList) String() string { }, "") return s } +func (this *JobSchedulingConfiguration) String() string { + if this == nil { + return "nil" + } + repeatedStringForResourceClaims := "[]WorkloadPodGroupResourceClaim{" + for _, f := range this.ResourceClaims { + repeatedStringForResourceClaims += fmt.Sprintf("%v", f) + "," + } + repeatedStringForResourceClaims += "}" + s := strings.Join([]string{`&JobSchedulingConfiguration{`, + `SchedulingPolicy:` + strings.Replace(fmt.Sprintf("%v", this.SchedulingPolicy), "WorkloadPodGroupSchedulingPolicy", "v1alpha3.WorkloadPodGroupSchedulingPolicy", 1) + `,`, + `SchedulingConstraints:` + strings.Replace(fmt.Sprintf("%v", this.SchedulingConstraints), "WorkloadPodGroupSchedulingConstraints", "v1alpha3.WorkloadPodGroupSchedulingConstraints", 1) + `,`, + `DisruptionMode:` + strings.Replace(fmt.Sprintf("%v", this.DisruptionMode), "WorkloadPodGroupDisruptionMode", "v1alpha3.WorkloadPodGroupDisruptionMode", 1) + `,`, + `ResourceClaims:` + repeatedStringForResourceClaims + `,`, + `}`, + }, "") + return s +} func (this *JobSpec) String() string { if this == nil { return "nil" @@ -1565,6 +1704,7 @@ func (this *JobSpec) String() string { `PodReplacementPolicy:` + valueToStringGenerated(this.PodReplacementPolicy) + `,`, `ManagedBy:` + valueToStringGenerated(this.ManagedBy) + `,`, `SuccessPolicy:` + strings.Replace(this.SuccessPolicy.String(), "SuccessPolicy", "SuccessPolicy", 1) + `,`, + `Scheduling:` + strings.Replace(this.Scheduling.String(), "JobSchedulingConfiguration", "JobSchedulingConfiguration", 1) + `,`, `}`, }, "") return s @@ -2898,6 +3038,198 @@ func (m *JobList) Unmarshal(dAtA []byte) error { } return nil } +func (m *JobSchedulingConfiguration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: JobSchedulingConfiguration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: JobSchedulingConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchedulingPolicy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SchedulingPolicy == nil { + m.SchedulingPolicy = &v1alpha3.WorkloadPodGroupSchedulingPolicy{} + } + if err := m.SchedulingPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchedulingConstraints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SchedulingConstraints == nil { + m.SchedulingConstraints = &v1alpha3.WorkloadPodGroupSchedulingConstraints{} + } + if err := m.SchedulingConstraints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisruptionMode", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DisruptionMode == nil { + m.DisruptionMode = &v1alpha3.WorkloadPodGroupDisruptionMode{} + } + if err := m.DisruptionMode.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaims", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResourceClaims = append(m.ResourceClaims, v1alpha3.WorkloadPodGroupResourceClaim{}) + if err := m.ResourceClaims[len(m.ResourceClaims)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *JobSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3349,6 +3681,42 @@ func (m *JobSpec) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Scheduling", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Scheduling == nil { + m.Scheduling = &JobSchedulingConfiguration{} + } + if err := m.Scheduling.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/vendor/k8s.io/api/batch/v1/generated.proto b/vendor/k8s.io/api/batch/v1/generated.proto index 5c35012852..da24d6d939 100644 --- a/vendor/k8s.io/api/batch/v1/generated.proto +++ b/vendor/k8s.io/api/batch/v1/generated.proto @@ -22,6 +22,7 @@ syntax = "proto2"; package k8s.io.api.batch.v1; import "k8s.io/api/core/v1/generated.proto"; +import "k8s.io/api/scheduling/v1alpha3/generated.proto"; import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; import "k8s.io/apimachinery/pkg/runtime/generated.proto"; import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; @@ -30,6 +31,7 @@ import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; option go_package = "k8s.io/api/batch/v1"; // CronJob represents the configuration of a single cron job. +// +k8s:supportsSubresource="/status" message CronJob { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -62,7 +64,7 @@ message CronJobList { message CronJobSpec { // The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string schedule = 1; // The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. @@ -127,6 +129,7 @@ message CronJobStatus { } // Job represents the configuration of a single job. +// +k8s:supportsSubresource="/status" message Job { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -180,6 +183,62 @@ message JobList { repeated Job items = 2; } +// JobSchedulingConfiguration composes the reusable workload-aware +// scheduling building blocks. +message JobSchedulingConfiguration { + // SchedulingPolicy defines the scheduling policy for this Job. + // Exactly one of Basic or Gang must be set. + // This field is immutable after creation: the policy may not be added or + // removed. The policy variant (basic/gang) is frozen by hand-written + // validation; only schedulingPolicy.gang.minCount may be changed. + // + // +optional + // +k8s:optional + // +k8s:update=NoSet + // +k8s:update=NoUnset + optional .k8s.io.api.scheduling.v1alpha3.WorkloadPodGroupSchedulingPolicy schedulingPolicy = 1; + + // SchedulingConstraints defines scheduling constraints (e.g. topology) + // for the Job's pods. + // This field is immutable after creation. + // + // +optional + // +k8s:optional + // +k8s:immutable + optional .k8s.io.api.scheduling.v1alpha3.WorkloadPodGroupSchedulingConstraints schedulingConstraints = 2; + + // DisruptionMode defines the mode in which the Job's pods can be disrupted. + // One of Single, All. + // This field is immutable after creation: it may not be added or removed, + // and the selected mode may not be changed. + // + // +optional + // +k8s:optional + // +k8s:immutable + optional .k8s.io.api.scheduling.v1alpha3.WorkloadPodGroupDisruptionMode disruptionMode = 3; + + // ResourceClaims defines which ResourceClaims may be shared among Pods in + // the Job. Pods consume the devices allocated to a PodGroup's claim by + // defining a claim in its own Spec.ResourceClaims that matches the + // PodGroup's claim exactly. The claim must have the same name and refer to + // the same ResourceClaim or ResourceClaimTemplate. + // At most 4 claims may be set, matching the limit on the resulting PodGroup. + // This list is immutable after creation: entries may neither be added, + // removed, nor modified. + // + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=4 + // +k8s:immutable + repeated .k8s.io.api.scheduling.v1alpha3.WorkloadPodGroupResourceClaim resourceClaims = 4; +} + // JobSpec describes how the job execution will look like. message JobSpec { // Specifies the maximum desired number of pods the job should @@ -251,6 +310,8 @@ message JobSpec { // It can be null or up to completions. It is required and must be // less than or equal to 10^4 when is completions greater than 10^5. // +optional + // +k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:dependentRequired("backoffLimitPerIndex") optional int32 maxFailedIndexes = 13; // A label query over pods that should match the pod count. @@ -346,6 +407,23 @@ message JobSpec { // This field is immutable. // +optional optional string managedBy = 15; + + // scheduling defines the Workload-aware Scheduling configuration for this Job. + // When set, it specifies the scheduling policy (basic or gang), topology + // constraints, disruption mode, and shared resource claims. + // When omitted, the Job defaults to the basic scheduling policy, which behaves + // as standard pod-by-pod scheduling. + // This field is alpha-level and requires the WorkloadWithJob feature gate. + // This field is immutable, including whether it is set at all, only + // policy.gang.minCount may be changed after creation. + // + // +featureGate=WorkloadWithJob + // +optional + // +k8s:ifDisabled(WorkloadWithJob)=+k8s:forbidden + // +k8s:optional + // +k8s:update=NoSet + // +k8s:update=NoUnset + optional JobSchedulingConfiguration scheduling = 17; } // JobStatus represents the current state of a Job. @@ -408,9 +486,6 @@ message JobStatus { // The number of pods which are terminating (in phase Pending or Running // and have a deletionTimestamp). - // - // This field is beta-level. The job controller populates the field when - // the feature gate JobPodReplacementPolicy is enabled (enabled by default). // +optional optional int32 terminating = 11; @@ -465,6 +540,7 @@ message JobTemplateSpec { // Standard object's metadata of the jobs created from this template. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Specification of the desired behavior of the job. diff --git a/vendor/k8s.io/api/batch/v1/types.go b/vendor/k8s.io/api/batch/v1/types.go index d4894e2ef6..8e35cb228f 100644 --- a/vendor/k8s.io/api/batch/v1/types.go +++ b/vendor/k8s.io/api/batch/v1/types.go @@ -18,6 +18,7 @@ package v1 import ( corev1 "k8s.io/api/core/v1" + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" ) @@ -66,8 +67,9 @@ const ( // +k8s:prerelease-lifecycle-gen:introduced=1.2 // Job represents the configuration of a single job. +// +k8s:supportsSubresource="/status" type Job struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -89,7 +91,7 @@ type Job struct { // JobList is a collection of jobs. type JobList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -371,6 +373,8 @@ type JobSpec struct { // It can be null or up to completions. It is required and must be // less than or equal to 10^4 when is completions greater than 10^5. // +optional + // +k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:dependentRequired("backoffLimitPerIndex") MaxFailedIndexes *int32 `json:"maxFailedIndexes,omitempty" protobuf:"varint,13,opt,name=maxFailedIndexes"` // TODO enabled it when https://github.com/kubernetes/kubernetes/issues/28486 has been fixed @@ -471,6 +475,79 @@ type JobSpec struct { // This field is immutable. // +optional ManagedBy *string `json:"managedBy,omitempty" protobuf:"bytes,15,opt,name=managedBy"` + + // scheduling defines the Workload-aware Scheduling configuration for this Job. + // When set, it specifies the scheduling policy (basic or gang), topology + // constraints, disruption mode, and shared resource claims. + // When omitted, the Job defaults to the basic scheduling policy, which behaves + // as standard pod-by-pod scheduling. + // This field is alpha-level and requires the WorkloadWithJob feature gate. + // This field is immutable, including whether it is set at all, only + // policy.gang.minCount may be changed after creation. + // + // +featureGate=WorkloadWithJob + // +optional + // +k8s:ifDisabled(WorkloadWithJob)=+k8s:forbidden + // +k8s:optional + // +k8s:update=NoSet + // +k8s:update=NoUnset + Scheduling *JobSchedulingConfiguration `json:"scheduling,omitempty" protobuf:"bytes,17,opt,name=scheduling"` +} + +// JobSchedulingConfiguration composes the reusable workload-aware +// scheduling building blocks. +type JobSchedulingConfiguration struct { + // SchedulingPolicy defines the scheduling policy for this Job. + // Exactly one of Basic or Gang must be set. + // This field is immutable after creation: the policy may not be added or + // removed. The policy variant (basic/gang) is frozen by hand-written + // validation; only schedulingPolicy.gang.minCount may be changed. + // + // +optional + // +k8s:optional + // +k8s:update=NoSet + // +k8s:update=NoUnset + SchedulingPolicy *schedulingv1alpha3.WorkloadPodGroupSchedulingPolicy `json:"schedulingPolicy,omitempty" protobuf:"bytes,1,opt,name=schedulingPolicy"` + + // SchedulingConstraints defines scheduling constraints (e.g. topology) + // for the Job's pods. + // This field is immutable after creation. + // + // +optional + // +k8s:optional + // +k8s:immutable + SchedulingConstraints *schedulingv1alpha3.WorkloadPodGroupSchedulingConstraints `json:"schedulingConstraints,omitempty" protobuf:"bytes,2,opt,name=schedulingConstraints"` + + // DisruptionMode defines the mode in which the Job's pods can be disrupted. + // One of Single, All. + // This field is immutable after creation: it may not be added or removed, + // and the selected mode may not be changed. + // + // +optional + // +k8s:optional + // +k8s:immutable + DisruptionMode *schedulingv1alpha3.WorkloadPodGroupDisruptionMode `json:"disruptionMode,omitempty" protobuf:"bytes,3,opt,name=disruptionMode"` + + // ResourceClaims defines which ResourceClaims may be shared among Pods in + // the Job. Pods consume the devices allocated to a PodGroup's claim by + // defining a claim in its own Spec.ResourceClaims that matches the + // PodGroup's claim exactly. The claim must have the same name and refer to + // the same ResourceClaim or ResourceClaimTemplate. + // At most 4 claims may be set, matching the limit on the resulting PodGroup. + // This list is immutable after creation: entries may neither be added, + // removed, nor modified. + // + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=4 + // +k8s:immutable + ResourceClaims []schedulingv1alpha3.WorkloadPodGroupResourceClaim `json:"resourceClaims,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,4,rep,name=resourceClaims"` } // JobStatus represents the current state of a Job. @@ -533,9 +610,6 @@ type JobStatus struct { // The number of pods which are terminating (in phase Pending or Running // and have a deletionTimestamp). - // - // This field is beta-level. The job controller populates the field when - // the feature gate JobPodReplacementPolicy is enabled (enabled by default). // +optional Terminating *int32 `json:"terminating,omitempty" protobuf:"varint,11,opt,name=terminating"` @@ -626,10 +700,8 @@ const ( // JobReasponDeadlineExceeded means job duration is past ActiveDeadline JobReasonDeadlineExceeded string = "DeadlineExceeded" // JobReasonMaxFailedIndexesExceeded indicates that an indexed of a job failed - // This const is used in beta-level feature: https://kep.k8s.io/3850. JobReasonMaxFailedIndexesExceeded string = "MaxFailedIndexesExceeded" // JobReasonFailedIndexes means Job has failed indexes. - // This const is used in beta-level feature: https://kep.k8s.io/3850. JobReasonFailedIndexes string = "FailedIndexes" // JobReasonSuccessPolicy reason indicates a SuccessCriteriaMet condition is added due to // a Job met successPolicy. @@ -664,6 +736,7 @@ type JobTemplateSpec struct { // Standard object's metadata of the jobs created from this template. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Specification of the desired behavior of the job. @@ -677,8 +750,9 @@ type JobTemplateSpec struct { // +k8s:prerelease-lifecycle-gen:introduced=1.21 // CronJob represents the configuration of a single cron job. +// +k8s:supportsSubresource="/status" type CronJob struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -700,7 +774,7 @@ type CronJob struct { // CronJobList is a collection of cron jobs. type CronJobList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -716,7 +790,7 @@ type CronJobSpec struct { // The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Schedule string `json:"schedule" protobuf:"bytes,1,opt,name=schedule"` // The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. diff --git a/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go index 267df42926..ddf64555a4 100644 --- a/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/batch/v1/types_swagger_doc_generated.go @@ -110,6 +110,18 @@ func (JobList) SwaggerDoc() map[string]string { return map_JobList } +var map_JobSchedulingConfiguration = map[string]string{ + "": "JobSchedulingConfiguration composes the reusable workload-aware scheduling building blocks.", + "schedulingPolicy": "SchedulingPolicy defines the scheduling policy for this Job. Exactly one of Basic or Gang must be set. This field is immutable after creation: the policy may not be added or removed. The policy variant (basic/gang) is frozen by hand-written validation; only schedulingPolicy.gang.minCount may be changed.", + "schedulingConstraints": "SchedulingConstraints defines scheduling constraints (e.g. topology) for the Job's pods. This field is immutable after creation.", + "disruptionMode": "DisruptionMode defines the mode in which the Job's pods can be disrupted. One of Single, All. This field is immutable after creation: it may not be added or removed, and the selected mode may not be changed.", + "resourceClaims": "ResourceClaims defines which ResourceClaims may be shared among Pods in the Job. Pods consume the devices allocated to a PodGroup's claim by defining a claim in its own Spec.ResourceClaims that matches the PodGroup's claim exactly. The claim must have the same name and refer to the same ResourceClaim or ResourceClaimTemplate. At most 4 claims may be set, matching the limit on the resulting PodGroup. This list is immutable after creation: entries may neither be added, removed, nor modified.", +} + +func (JobSchedulingConfiguration) SwaggerDoc() map[string]string { + return map_JobSchedulingConfiguration +} + var map_JobSpec = map[string]string{ "": "JobSpec describes how the job execution will look like.", "parallelism": "Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", @@ -128,6 +140,7 @@ var map_JobSpec = map[string]string{ "suspend": "suspend specifies whether the Job controller should create Pods or not. If a Job is created with suspend set to true, no Pods are created by the Job controller. If a Job is suspended after creation (i.e. the flag goes from false to true), the Job controller will delete all active Pods associated with this Job. Users must design their workload to gracefully handle this. Suspending a Job will reset the StartTime field of the Job, effectively resetting the ActiveDeadlineSeconds timer too. Defaults to false.", "podReplacementPolicy": "podReplacementPolicy specifies when to create replacement Pods. Possible values are: - TerminatingOrFailed means that we recreate pods\n when they are terminating (has a metadata.deletionTimestamp) or failed.\n- Failed means to wait until a previously created Pod is fully terminated (has phase\n Failed or Succeeded) before creating a replacement Pod.\n\nWhen using podFailurePolicy, Failed is the the only allowed value. TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use.", "managedBy": "ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first \"/\" must be a valid subdomain as defined by RFC 1123. All characters trailing the first \"/\" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 63 characters. This field is immutable.", + "scheduling": "scheduling defines the Workload-aware Scheduling configuration for this Job. When set, it specifies the scheduling policy (basic or gang), topology constraints, disruption mode, and shared resource claims. When omitted, the Job defaults to the basic scheduling policy, which behaves as standard pod-by-pod scheduling. This field is alpha-level and requires the WorkloadWithJob feature gate. This field is immutable, including whether it is set at all, only policy.gang.minCount may be changed after creation.", } func (JobSpec) SwaggerDoc() map[string]string { @@ -142,7 +155,7 @@ var map_JobStatus = map[string]string{ "active": "The number of pending and running pods which are not terminating (without a deletionTimestamp). The value is zero for finished jobs.", "succeeded": "The number of pods which reached phase Succeeded. The value increases monotonically for a given spec. However, it may decrease in reaction to scale down of elastic indexed jobs.", "failed": "The number of pods which reached phase Failed. The value increases monotonically.", - "terminating": "The number of pods which are terminating (in phase Pending or Running and have a deletionTimestamp).\n\nThis field is beta-level. The job controller populates the field when the feature gate JobPodReplacementPolicy is enabled (enabled by default).", + "terminating": "The number of pods which are terminating (in phase Pending or Running and have a deletionTimestamp).", "completedIndexes": "completedIndexes holds the completed indexes when .spec.completionMode = \"Indexed\" in a text format. The indexes are represented as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the completed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\".", "failedIndexes": "FailedIndexes holds the failed indexes when spec.backoffLimitPerIndex is set. The indexes are represented in the text format analogous as for the `completedIndexes` field, ie. they are kept as decimal integers separated by commas. The numbers are listed in increasing order. Three or more consecutive numbers are compressed and represented by the first and last element of the series, separated by a hyphen. For example, if the failed indexes are 1, 3, 4, 5 and 7, they are represented as \"1,3-5,7\". The set of failed indexes cannot overlap with the set of completed indexes.", "uncountedTerminatedPods": "uncountedTerminatedPods holds the UIDs of Pods that have terminated but the job controller hasn't yet accounted for in the status counters.\n\nThe job controller creates pods with a finalizer. When a pod terminates (succeeded or failed), the controller does three steps to account for it in the job status:\n\n1. Add the pod UID to the arrays in this field. 2. Remove the pod finalizer. 3. Remove the pod UID from the arrays while increasing the corresponding\n counter.\n\nOld jobs might not be tracked using this field, in which case the field remains null. The structure is empty for finished jobs.", diff --git a/vendor/k8s.io/api/batch/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/batch/v1/zz_generated.deepcopy.go index 88c58b3d11..50d47596f4 100644 --- a/vendor/k8s.io/api/batch/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/batch/v1/zz_generated.deepcopy.go @@ -23,6 +23,7 @@ package v1 import ( corev1 "k8s.io/api/core/v1" + v1alpha3 "k8s.io/api/scheduling/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" types "k8s.io/apimachinery/pkg/types" @@ -239,6 +240,44 @@ func (in *JobList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobSchedulingConfiguration) DeepCopyInto(out *JobSchedulingConfiguration) { + *out = *in + if in.SchedulingPolicy != nil { + in, out := &in.SchedulingPolicy, &out.SchedulingPolicy + *out = new(v1alpha3.WorkloadPodGroupSchedulingPolicy) + (*in).DeepCopyInto(*out) + } + if in.SchedulingConstraints != nil { + in, out := &in.SchedulingConstraints, &out.SchedulingConstraints + *out = new(v1alpha3.WorkloadPodGroupSchedulingConstraints) + (*in).DeepCopyInto(*out) + } + if in.DisruptionMode != nil { + in, out := &in.DisruptionMode, &out.DisruptionMode + *out = new(v1alpha3.WorkloadPodGroupDisruptionMode) + (*in).DeepCopyInto(*out) + } + if in.ResourceClaims != nil { + in, out := &in.ResourceClaims, &out.ResourceClaims + *out = make([]v1alpha3.WorkloadPodGroupResourceClaim, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSchedulingConfiguration. +func (in *JobSchedulingConfiguration) DeepCopy() *JobSchedulingConfiguration { + if in == nil { + return nil + } + out := new(JobSchedulingConfiguration) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *JobSpec) DeepCopyInto(out *JobSpec) { *out = *in @@ -318,6 +357,11 @@ func (in *JobSpec) DeepCopyInto(out *JobSpec) { *out = new(string) **out = **in } + if in.Scheduling != nil { + in, out := &in.Scheduling, &out.Scheduling + *out = new(JobSchedulingConfiguration) + (*in).DeepCopyInto(*out) + } return } diff --git a/vendor/k8s.io/api/batch/v1/zz_generated.model_name.go b/vendor/k8s.io/api/batch/v1/zz_generated.model_name.go index c5b86f29cd..d7305143a7 100644 --- a/vendor/k8s.io/api/batch/v1/zz_generated.model_name.go +++ b/vendor/k8s.io/api/batch/v1/zz_generated.model_name.go @@ -56,6 +56,11 @@ func (in JobList) OpenAPIModelName() string { return "io.k8s.api.batch.v1.JobList" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in JobSchedulingConfiguration) OpenAPIModelName() string { + return "io.k8s.api.batch.v1.JobSchedulingConfiguration" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in JobSpec) OpenAPIModelName() string { return "io.k8s.api.batch.v1.JobSpec" diff --git a/vendor/k8s.io/api/batch/v1beta1/generated.proto b/vendor/k8s.io/api/batch/v1beta1/generated.proto index 47000470c6..411d681d0a 100644 --- a/vendor/k8s.io/api/batch/v1beta1/generated.proto +++ b/vendor/k8s.io/api/batch/v1beta1/generated.proto @@ -31,6 +31,7 @@ import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; option go_package = "k8s.io/api/batch/v1beta1"; // CronJob represents the configuration of a single cron job. +// +k8s:supportsSubresource="/status" message CronJob { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -63,7 +64,7 @@ message CronJobList { message CronJobSpec { // The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string schedule = 1; // The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. @@ -134,6 +135,7 @@ message JobTemplateSpec { // Standard object's metadata of the jobs created from this template. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Specification of the desired behavior of the job. diff --git a/vendor/k8s.io/api/batch/v1beta1/types.go b/vendor/k8s.io/api/batch/v1beta1/types.go index 9e1a1b4704..dea910b828 100644 --- a/vendor/k8s.io/api/batch/v1beta1/types.go +++ b/vendor/k8s.io/api/batch/v1beta1/types.go @@ -27,6 +27,7 @@ type JobTemplateSpec struct { // Standard object's metadata of the jobs created from this template. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Specification of the desired behavior of the job. @@ -43,8 +44,9 @@ type JobTemplateSpec struct { // +k8s:prerelease-lifecycle-gen:replacement=batch,v1,CronJob // CronJob represents the configuration of a single cron job. +// +k8s:supportsSubresource="/status" type CronJob struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -69,7 +71,7 @@ type CronJob struct { // CronJobList is a collection of cron jobs. type CronJobList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -85,7 +87,7 @@ type CronJobSpec struct { // The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Schedule string `json:"schedule" protobuf:"bytes,1,opt,name=schedule"` // The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. diff --git a/vendor/k8s.io/api/certificates/v1/generated.pb.go b/vendor/k8s.io/api/certificates/v1/generated.pb.go index e47a42e62e..5b103ff8d5 100644 --- a/vendor/k8s.io/api/certificates/v1/generated.pb.go +++ b/vendor/k8s.io/api/certificates/v1/generated.pb.go @@ -26,10 +26,13 @@ import ( "sort" k8s_io_api_core_v1 "k8s.io/api/core/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" math_bits "math/bits" reflect "reflect" strings "strings" + + k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types" ) func (m *CertificateSigningRequest) Reset() { *m = CertificateSigningRequest{} } @@ -42,8 +45,22 @@ func (m *CertificateSigningRequestSpec) Reset() { *m = CertificateSigningRequest func (m *CertificateSigningRequestStatus) Reset() { *m = CertificateSigningRequestStatus{} } +func (m *ClusterTrustBundle) Reset() { *m = ClusterTrustBundle{} } + +func (m *ClusterTrustBundleList) Reset() { *m = ClusterTrustBundleList{} } + +func (m *ClusterTrustBundleSpec) Reset() { *m = ClusterTrustBundleSpec{} } + func (m *ExtraValue) Reset() { *m = ExtraValue{} } +func (m *PodCertificateRequest) Reset() { *m = PodCertificateRequest{} } + +func (m *PodCertificateRequestList) Reset() { *m = PodCertificateRequestList{} } + +func (m *PodCertificateRequestSpec) Reset() { *m = PodCertificateRequestSpec{} } + +func (m *PodCertificateRequestStatus) Reset() { *m = PodCertificateRequestStatus{} } + func (m *CertificateSigningRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -348,7 +365,7 @@ func (m *CertificateSigningRequestStatus) MarshalToSizedBuffer(dAtA []byte) (int return len(dAtA) - i, nil } -func (m ExtraValue) Marshal() (dAtA []byte, err error) { +func (m *ClusterTrustBundle) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -358,270 +375,2058 @@ func (m ExtraValue) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m ExtraValue) MarshalTo(dAtA []byte) (int, error) { +func (m *ClusterTrustBundle) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m ExtraValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ClusterTrustBundle) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m) > 0 { - for iNdEx := len(m) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m[iNdEx]) - copy(dAtA[i:], m[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m[iNdEx]))) - i-- - dAtA[i] = 0xa + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } -func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { - offset -= sovGenerated(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *ClusterTrustBundleList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *CertificateSigningRequest) Size() (n int) { - if m == nil { - return 0 - } + +func (m *ClusterTrustBundleList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClusterTrustBundleList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Status.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *CertificateSigningRequestCondition) Size() (n int) { - if m == nil { - return 0 +func (m *ClusterTrustBundleSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *ClusterTrustBundleSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClusterTrustBundleSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Type) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Reason) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Message) - n += 1 + l + sovGenerated(uint64(l)) - l = m.LastUpdateTime.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.LastTransitionTime.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Status) - n += 1 + l + sovGenerated(uint64(l)) - return n + i -= len(m.TrustBundle) + copy(dAtA[i:], m.TrustBundle) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.TrustBundle))) + i-- + dAtA[i] = 0x12 + i -= len(m.SignerName) + copy(dAtA[i:], m.SignerName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SignerName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *CertificateSigningRequestList) Size() (n int) { - if m == nil { - return 0 +func (m ExtraValue) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m ExtraValue) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m ExtraValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) + if len(m) > 0 { + for iNdEx := len(m) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m[iNdEx]) + copy(dAtA[i:], m[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m[iNdEx]))) + i-- + dAtA[i] = 0xa } } - return n + return len(dAtA) - i, nil } -func (m *CertificateSigningRequestSpec) Size() (n int) { - if m == nil { - return 0 +func (m *PodCertificateRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *PodCertificateRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodCertificateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.Request != nil { - l = len(m.Request) - n += 1 + l + sovGenerated(uint64(l)) - } - l = len(m.Username) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.UID) - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Groups) > 0 { - for _, s := range m.Groups { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - if len(m.Usages) > 0 { - for _, s := range m.Usages { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) + i-- + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - if len(m.Extra) > 0 { - for k, v := range m.Extra { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - l = len(m.SignerName) - n += 1 + l + sovGenerated(uint64(l)) - if m.ExpirationSeconds != nil { - n += 1 + sovGenerated(uint64(*m.ExpirationSeconds)) - } - return n + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *CertificateSigningRequestStatus) Size() (n int) { - if m == nil { - return 0 +func (m *PodCertificateRequestList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *PodCertificateRequestList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodCertificateRequestList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.Conditions) > 0 { - for _, e := range m.Conditions { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } } - if m.Certificate != nil { - l = len(m.Certificate) - n += 1 + l + sovGenerated(uint64(l)) + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - return n + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m ExtraValue) Size() (n int) { - if m == nil { - return 0 +func (m *PodCertificateRequestSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *PodCertificateRequestSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodCertificateRequestSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m) > 0 { - for _, s := range m { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) + if m.StubPKCS10Request != nil { + i -= len(m.StubPKCS10Request) + copy(dAtA[i:], m.StubPKCS10Request) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.StubPKCS10Request))) + i-- + dAtA[i] = 0x62 + } + if len(m.UnverifiedUserAnnotations) > 0 { + keysForUnverifiedUserAnnotations := make([]string, 0, len(m.UnverifiedUserAnnotations)) + for k := range m.UnverifiedUserAnnotations { + keysForUnverifiedUserAnnotations = append(keysForUnverifiedUserAnnotations, string(k)) + } + sort.Strings(keysForUnverifiedUserAnnotations) + for iNdEx := len(keysForUnverifiedUserAnnotations) - 1; iNdEx >= 0; iNdEx-- { + v := m.UnverifiedUserAnnotations[string(keysForUnverifiedUserAnnotations[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForUnverifiedUserAnnotations[iNdEx]) + copy(dAtA[i:], keysForUnverifiedUserAnnotations[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForUnverifiedUserAnnotations[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x5a } } - return n + if m.MaxExpirationSeconds != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.MaxExpirationSeconds)) + i-- + dAtA[i] = 0x40 + } + i -= len(m.NodeUID) + copy(dAtA[i:], m.NodeUID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.NodeUID))) + i-- + dAtA[i] = 0x3a + i -= len(m.NodeName) + copy(dAtA[i:], m.NodeName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.NodeName))) + i-- + dAtA[i] = 0x32 + i -= len(m.ServiceAccountUID) + copy(dAtA[i:], m.ServiceAccountUID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ServiceAccountUID))) + i-- + dAtA[i] = 0x2a + i -= len(m.ServiceAccountName) + copy(dAtA[i:], m.ServiceAccountName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ServiceAccountName))) + i-- + dAtA[i] = 0x22 + i -= len(m.PodUID) + copy(dAtA[i:], m.PodUID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PodUID))) + i-- + dAtA[i] = 0x1a + i -= len(m.PodName) + copy(dAtA[i:], m.PodName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PodName))) + i-- + dAtA[i] = 0x12 + i -= len(m.SignerName) + copy(dAtA[i:], m.SignerName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SignerName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func sovGenerated(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenerated(x uint64) (n int) { - return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *CertificateSigningRequest) String() string { - if this == nil { - return "nil" +func (m *PodCertificateRequestStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - s := strings.Join([]string{`&CertificateSigningRequest{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "CertificateSigningRequestSpec", "CertificateSigningRequestSpec", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "CertificateSigningRequestStatus", "CertificateSigningRequestStatus", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s + return dAtA[:n], nil } -func (this *CertificateSigningRequestCondition) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CertificateSigningRequestCondition{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, - `Message:` + fmt.Sprintf("%v", this.Message) + `,`, - `LastUpdateTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastUpdateTime), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, - `LastTransitionTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastTransitionTime), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, - `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `}`, - }, "") - return s + +func (m *PodCertificateRequestStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (this *CertificateSigningRequestList) String() string { - if this == nil { - return "nil" + +func (m *PodCertificateRequestStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NotAfter != nil { + { + size, err := m.NotAfter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 } - repeatedStringForItems := "[]CertificateSigningRequest{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "CertificateSigningRequest", "CertificateSigningRequest", 1), `&`, ``, 1) + "," + if m.BeginRefreshAt != nil { + { + size, err := m.BeginRefreshAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a } - repeatedStringForItems += "}" - s := strings.Join([]string{`&CertificateSigningRequestList{`, - `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `}`, - }, "") - return s -} -func (this *CertificateSigningRequestSpec) String() string { - if this == nil { - return "nil" + if m.NotBefore != nil { + { + size, err := m.NotBefore.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } - keysForExtra := make([]string, 0, len(this.Extra)) - for k := range this.Extra { - keysForExtra = append(keysForExtra, k) + i -= len(m.CertificateChain) + copy(dAtA[i:], m.CertificateChain) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.CertificateChain))) + i-- + dAtA[i] = 0x12 + if len(m.Conditions) > 0 { + for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - sort.Strings(keysForExtra) - mapStringForExtra := "map[string]ExtraValue{" - for _, k := range keysForExtra { - mapStringForExtra += fmt.Sprintf("%v: %v,", k, this.Extra[k]) + return len(dAtA) - i, nil +} + +func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { + offset -= sovGenerated(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - mapStringForExtra += "}" - s := strings.Join([]string{`&CertificateSigningRequestSpec{`, - `Request:` + valueToStringGenerated(this.Request) + `,`, - `Username:` + fmt.Sprintf("%v", this.Username) + `,`, - `UID:` + fmt.Sprintf("%v", this.UID) + `,`, - `Groups:` + fmt.Sprintf("%v", this.Groups) + `,`, - `Usages:` + fmt.Sprintf("%v", this.Usages) + `,`, - `Extra:` + mapStringForExtra + `,`, - `SignerName:` + fmt.Sprintf("%v", this.SignerName) + `,`, - `ExpirationSeconds:` + valueToStringGenerated(this.ExpirationSeconds) + `,`, - `}`, - }, "") - return s + dAtA[offset] = uint8(v) + return base } -func (this *CertificateSigningRequestStatus) String() string { - if this == nil { - return "nil" +func (m *CertificateSigningRequest) Size() (n int) { + if m == nil { + return 0 } - repeatedStringForConditions := "[]CertificateSigningRequestCondition{" - for _, f := range this.Conditions { - repeatedStringForConditions += strings.Replace(strings.Replace(f.String(), "CertificateSigningRequestCondition", "CertificateSigningRequestCondition", 1), `&`, ``, 1) + "," + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *CertificateSigningRequestCondition) Size() (n int) { + if m == nil { + return 0 } - repeatedStringForConditions += "}" - s := strings.Join([]string{`&CertificateSigningRequestStatus{`, - `Conditions:` + repeatedStringForConditions + `,`, - `Certificate:` + valueToStringGenerated(this.Certificate) + `,`, - `}`, - }, "") - return s + var l int + _ = l + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Reason) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Message) + n += 1 + l + sovGenerated(uint64(l)) + l = m.LastUpdateTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.LastTransitionTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Status) + n += 1 + l + sovGenerated(uint64(l)) + return n } -func valueToStringGenerated(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" + +func (m *CertificateSigningRequestList) Size() (n int) { + if m == nil { + return 0 } - pv := reflect.Indirect(rv).Interface() + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *CertificateSigningRequestSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Request != nil { + l = len(m.Request) + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.Username) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.UID) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Groups) > 0 { + for _, s := range m.Groups { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Usages) > 0 { + for _, s := range m.Usages { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Extra) > 0 { + for k, v := range m.Extra { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + l = len(m.SignerName) + n += 1 + l + sovGenerated(uint64(l)) + if m.ExpirationSeconds != nil { + n += 1 + sovGenerated(uint64(*m.ExpirationSeconds)) + } + return n +} + +func (m *CertificateSigningRequestStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.Certificate != nil { + l = len(m.Certificate) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *ClusterTrustBundle) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *ClusterTrustBundleList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *ClusterTrustBundleSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SignerName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.TrustBundle) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m ExtraValue) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m) > 0 { + for _, s := range m { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PodCertificateRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *PodCertificateRequestList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PodCertificateRequestSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SignerName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.PodName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.PodUID) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ServiceAccountName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.ServiceAccountUID) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.NodeName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.NodeUID) + n += 1 + l + sovGenerated(uint64(l)) + if m.MaxExpirationSeconds != nil { + n += 1 + sovGenerated(uint64(*m.MaxExpirationSeconds)) + } + if len(m.UnverifiedUserAnnotations) > 0 { + for k, v := range m.UnverifiedUserAnnotations { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if m.StubPKCS10Request != nil { + l = len(m.StubPKCS10Request) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PodCertificateRequestStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.CertificateChain) + n += 1 + l + sovGenerated(uint64(l)) + if m.NotBefore != nil { + l = m.NotBefore.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.BeginRefreshAt != nil { + l = m.BeginRefreshAt.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.NotAfter != nil { + l = m.NotAfter.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func sovGenerated(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenerated(x uint64) (n int) { + return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *CertificateSigningRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CertificateSigningRequest{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "CertificateSigningRequestSpec", "CertificateSigningRequestSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "CertificateSigningRequestStatus", "CertificateSigningRequestStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *CertificateSigningRequestCondition) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CertificateSigningRequestCondition{`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, + `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + `LastUpdateTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastUpdateTime), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, + `LastTransitionTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastTransitionTime), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, + `Status:` + fmt.Sprintf("%v", this.Status) + `,`, + `}`, + }, "") + return s +} +func (this *CertificateSigningRequestList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]CertificateSigningRequest{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "CertificateSigningRequest", "CertificateSigningRequest", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&CertificateSigningRequestList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *CertificateSigningRequestSpec) String() string { + if this == nil { + return "nil" + } + keysForExtra := make([]string, 0, len(this.Extra)) + for k := range this.Extra { + keysForExtra = append(keysForExtra, k) + } + sort.Strings(keysForExtra) + mapStringForExtra := "map[string]ExtraValue{" + for _, k := range keysForExtra { + mapStringForExtra += fmt.Sprintf("%v: %v,", k, this.Extra[k]) + } + mapStringForExtra += "}" + s := strings.Join([]string{`&CertificateSigningRequestSpec{`, + `Request:` + valueToStringGenerated(this.Request) + `,`, + `Username:` + fmt.Sprintf("%v", this.Username) + `,`, + `UID:` + fmt.Sprintf("%v", this.UID) + `,`, + `Groups:` + fmt.Sprintf("%v", this.Groups) + `,`, + `Usages:` + fmt.Sprintf("%v", this.Usages) + `,`, + `Extra:` + mapStringForExtra + `,`, + `SignerName:` + fmt.Sprintf("%v", this.SignerName) + `,`, + `ExpirationSeconds:` + valueToStringGenerated(this.ExpirationSeconds) + `,`, + `}`, + }, "") + return s +} +func (this *CertificateSigningRequestStatus) String() string { + if this == nil { + return "nil" + } + repeatedStringForConditions := "[]CertificateSigningRequestCondition{" + for _, f := range this.Conditions { + repeatedStringForConditions += strings.Replace(strings.Replace(f.String(), "CertificateSigningRequestCondition", "CertificateSigningRequestCondition", 1), `&`, ``, 1) + "," + } + repeatedStringForConditions += "}" + s := strings.Join([]string{`&CertificateSigningRequestStatus{`, + `Conditions:` + repeatedStringForConditions + `,`, + `Certificate:` + valueToStringGenerated(this.Certificate) + `,`, + `}`, + }, "") + return s +} +func (this *ClusterTrustBundle) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ClusterTrustBundle{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ClusterTrustBundleSpec", "ClusterTrustBundleSpec", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *ClusterTrustBundleList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]ClusterTrustBundle{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "ClusterTrustBundle", "ClusterTrustBundle", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&ClusterTrustBundleList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *ClusterTrustBundleSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ClusterTrustBundleSpec{`, + `SignerName:` + fmt.Sprintf("%v", this.SignerName) + `,`, + `TrustBundle:` + fmt.Sprintf("%v", this.TrustBundle) + `,`, + `}`, + }, "") + return s +} +func (this *PodCertificateRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodCertificateRequest{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "PodCertificateRequestSpec", "PodCertificateRequestSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "PodCertificateRequestStatus", "PodCertificateRequestStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *PodCertificateRequestList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]PodCertificateRequest{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "PodCertificateRequest", "PodCertificateRequest", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&PodCertificateRequestList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *PodCertificateRequestSpec) String() string { + if this == nil { + return "nil" + } + keysForUnverifiedUserAnnotations := make([]string, 0, len(this.UnverifiedUserAnnotations)) + for k := range this.UnverifiedUserAnnotations { + keysForUnverifiedUserAnnotations = append(keysForUnverifiedUserAnnotations, k) + } + sort.Strings(keysForUnverifiedUserAnnotations) + mapStringForUnverifiedUserAnnotations := "map[string]string{" + for _, k := range keysForUnverifiedUserAnnotations { + mapStringForUnverifiedUserAnnotations += fmt.Sprintf("%v: %v,", k, this.UnverifiedUserAnnotations[k]) + } + mapStringForUnverifiedUserAnnotations += "}" + s := strings.Join([]string{`&PodCertificateRequestSpec{`, + `SignerName:` + fmt.Sprintf("%v", this.SignerName) + `,`, + `PodName:` + fmt.Sprintf("%v", this.PodName) + `,`, + `PodUID:` + fmt.Sprintf("%v", this.PodUID) + `,`, + `ServiceAccountName:` + fmt.Sprintf("%v", this.ServiceAccountName) + `,`, + `ServiceAccountUID:` + fmt.Sprintf("%v", this.ServiceAccountUID) + `,`, + `NodeName:` + fmt.Sprintf("%v", this.NodeName) + `,`, + `NodeUID:` + fmt.Sprintf("%v", this.NodeUID) + `,`, + `MaxExpirationSeconds:` + valueToStringGenerated(this.MaxExpirationSeconds) + `,`, + `UnverifiedUserAnnotations:` + mapStringForUnverifiedUserAnnotations + `,`, + `StubPKCS10Request:` + valueToStringGenerated(this.StubPKCS10Request) + `,`, + `}`, + }, "") + return s +} +func (this *PodCertificateRequestStatus) String() string { + if this == nil { + return "nil" + } + repeatedStringForConditions := "[]Condition{" + for _, f := range this.Conditions { + repeatedStringForConditions += fmt.Sprintf("%v", f) + "," + } + repeatedStringForConditions += "}" + s := strings.Join([]string{`&PodCertificateRequestStatus{`, + `Conditions:` + repeatedStringForConditions + `,`, + `CertificateChain:` + fmt.Sprintf("%v", this.CertificateChain) + `,`, + `NotBefore:` + strings.Replace(fmt.Sprintf("%v", this.NotBefore), "Time", "v1.Time", 1) + `,`, + `BeginRefreshAt:` + strings.Replace(fmt.Sprintf("%v", this.BeginRefreshAt), "Time", "v1.Time", 1) + `,`, + `NotAfter:` + strings.Replace(fmt.Sprintf("%v", this.NotAfter), "Time", "v1.Time", 1) + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } -func (m *CertificateSigningRequest) Unmarshal(dAtA []byte) error { +func (m *CertificateSigningRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CertificateSigningRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CertificateSigningRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CertificateSigningRequestCondition) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CertificateSigningRequestCondition: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CertificateSigningRequestCondition: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = RequestConditionType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastUpdateTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LastUpdateTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = k8s_io_api_core_v1.ConditionStatus(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CertificateSigningRequestList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CertificateSigningRequestList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CertificateSigningRequestList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, CertificateSigningRequest{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CertificateSigningRequestSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CertificateSigningRequestSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CertificateSigningRequestSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Request = append(m.Request[:0], dAtA[iNdEx:postIndex]...) + if m.Request == nil { + m.Request = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Groups", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Groups = append(m.Groups, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Usages", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Usages = append(m.Usages, KeyUsage(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Extra", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Extra == nil { + m.Extra = make(map[string]ExtraValue) + } + var mapkey string + mapvalue := &ExtraValue{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &ExtraValue{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Extra[mapkey] = *mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SignerName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SignerName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationSeconds", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ExpirationSeconds = &v + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CertificateSigningRequestStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CertificateSigningRequestStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CertificateSigningRequestStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Conditions = append(m.Conditions, CertificateSigningRequestCondition{}) + if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Certificate", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Certificate = append(m.Certificate[:0], dAtA[iNdEx:postIndex]...) + if m.Certificate == nil { + m.Certificate = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClusterTrustBundle) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClusterTrustBundle: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClusterTrustBundle: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClusterTrustBundleList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -644,15 +2449,15 @@ func (m *CertificateSigningRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CertificateSigningRequest: wiretype end group for non-group") + return fmt.Errorf("proto: ClusterTrustBundleList: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CertificateSigningRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ClusterTrustBundleList: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -679,46 +2484,13 @@ func (m *CertificateSigningRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -745,7 +2517,8 @@ func (m *CertificateSigningRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Items = append(m.Items, ClusterTrustBundle{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -770,7 +2543,7 @@ func (m *CertificateSigningRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *CertificateSigningRequestCondition) Unmarshal(dAtA []byte) error { +func (m *ClusterTrustBundleSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -793,15 +2566,15 @@ func (m *CertificateSigningRequestCondition) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CertificateSigningRequestCondition: wiretype end group for non-group") + return fmt.Errorf("proto: ClusterTrustBundleSpec: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CertificateSigningRequestCondition: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ClusterTrustBundleSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SignerName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -829,11 +2602,11 @@ func (m *CertificateSigningRequestCondition) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Type = RequestConditionType(dAtA[iNdEx:postIndex]) + m.SignerName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TrustBundle", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -861,11 +2634,61 @@ func (m *CertificateSigningRequestCondition) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Reason = string(dAtA[iNdEx:postIndex]) + m.TrustBundle = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExtraValue) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExtraValue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExtraValue: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -893,11 +2716,61 @@ func (m *CertificateSigningRequestCondition) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Message = string(dAtA[iNdEx:postIndex]) + *m = append(*m, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 4: + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodCertificateRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodCertificateRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodCertificateRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastUpdateTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -924,13 +2797,13 @@ func (m *CertificateSigningRequestCondition) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.LastUpdateTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -957,15 +2830,15 @@ func (m *CertificateSigningRequestCondition) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 6: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -975,23 +2848,24 @@ func (m *CertificateSigningRequestCondition) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Status = k8s_io_api_core_v1.ConditionStatus(dAtA[iNdEx:postIndex]) + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -1014,7 +2888,7 @@ func (m *CertificateSigningRequestCondition) Unmarshal(dAtA []byte) error { } return nil } -func (m *CertificateSigningRequestList) Unmarshal(dAtA []byte) error { +func (m *PodCertificateRequestList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1037,10 +2911,10 @@ func (m *CertificateSigningRequestList) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CertificateSigningRequestList: wiretype end group for non-group") + return fmt.Errorf("proto: PodCertificateRequestList: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CertificateSigningRequestList: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodCertificateRequestList: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1105,7 +2979,7 @@ func (m *CertificateSigningRequestList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, CertificateSigningRequest{}) + m.Items = append(m.Items, PodCertificateRequest{}) if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1131,7 +3005,7 @@ func (m *CertificateSigningRequestList) Unmarshal(dAtA []byte) error { } return nil } -func (m *CertificateSigningRequestSpec) Unmarshal(dAtA []byte) error { +func (m *PodCertificateRequestSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1141,30 +3015,94 @@ func (m *CertificateSigningRequestSpec) Unmarshal(dAtA []byte) error { if shift >= 64 { return ErrIntOverflowGenerated } - if iNdEx >= l { - return io.ErrUnexpectedEOF + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodCertificateRequestSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodCertificateRequestSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SignerName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SignerName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PodName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if postIndex > l { + return io.ErrUnexpectedEOF } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CertificateSigningRequestSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CertificateSigningRequestSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.PodName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PodUID", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1174,29 +3112,27 @@ func (m *CertificateSigningRequestSpec) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Request = append(m.Request[:0], dAtA[iNdEx:postIndex]...) - if m.Request == nil { - m.Request = []byte{} - } + m.PodUID = k8s_io_apimachinery_pkg_types.UID(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ServiceAccountName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1224,11 +3160,11 @@ func (m *CertificateSigningRequestSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Username = string(dAtA[iNdEx:postIndex]) + m.ServiceAccountName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ServiceAccountUID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1256,11 +3192,11 @@ func (m *CertificateSigningRequestSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.UID = string(dAtA[iNdEx:postIndex]) + m.ServiceAccountUID = k8s_io_apimachinery_pkg_types.UID(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Groups", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1288,11 +3224,11 @@ func (m *CertificateSigningRequestSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Groups = append(m.Groups, string(dAtA[iNdEx:postIndex])) + m.NodeName = k8s_io_apimachinery_pkg_types.NodeName(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Usages", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NodeUID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1320,11 +3256,31 @@ func (m *CertificateSigningRequestSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Usages = append(m.Usages, KeyUsage(dAtA[iNdEx:postIndex])) + m.NodeUID = k8s_io_apimachinery_pkg_types.UID(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxExpirationSeconds", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.MaxExpirationSeconds = &v + case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Extra", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UnverifiedUserAnnotations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1351,11 +3307,11 @@ func (m *CertificateSigningRequestSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Extra == nil { - m.Extra = make(map[string]ExtraValue) + if m.UnverifiedUserAnnotations == nil { + m.UnverifiedUserAnnotations = make(map[string]string) } var mapkey string - mapvalue := &ExtraValue{} + var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 @@ -1404,7 +3360,7 @@ func (m *CertificateSigningRequestSpec) Unmarshal(dAtA []byte) error { mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { - var mapmsglen int + var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1414,26 +3370,24 @@ func (m *CertificateSigningRequestSpec) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - mapmsglen |= int(b&0x7F) << shift + stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if mapmsglen < 0 { + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { return ErrInvalidLengthGenerated } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { return ErrInvalidLengthGenerated } - if postmsgIndex > l { + if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } - mapvalue = &ExtraValue{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -1449,13 +3403,13 @@ func (m *CertificateSigningRequestSpec) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - m.Extra[mapkey] = *mapvalue + m.UnverifiedUserAnnotations[mapkey] = mapvalue iNdEx = postIndex - case 7: + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SignerName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StubPKCS10Request", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1465,44 +3419,26 @@ func (m *CertificateSigningRequestSpec) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.SignerName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpirationSeconds", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } + m.StubPKCS10Request = append(m.StubPKCS10Request[:0], dAtA[iNdEx:postIndex]...) + if m.StubPKCS10Request == nil { + m.StubPKCS10Request = []byte{} } - m.ExpirationSeconds = &v + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -1524,7 +3460,7 @@ func (m *CertificateSigningRequestSpec) Unmarshal(dAtA []byte) error { } return nil } -func (m *CertificateSigningRequestStatus) Unmarshal(dAtA []byte) error { +func (m *PodCertificateRequestStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1547,10 +3483,10 @@ func (m *CertificateSigningRequestStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CertificateSigningRequestStatus: wiretype end group for non-group") + return fmt.Errorf("proto: PodCertificateRequestStatus: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CertificateSigningRequestStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodCertificateRequestStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1582,16 +3518,16 @@ func (m *CertificateSigningRequestStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Conditions = append(m.Conditions, CertificateSigningRequestCondition{}) + m.Conditions = append(m.Conditions, v1.Condition{}) if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Certificate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CertificateChain", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1601,81 +3537,101 @@ func (m *CertificateSigningRequestStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Certificate = append(m.Certificate[:0], dAtA[iNdEx:postIndex]...) - if m.Certificate == nil { - m.Certificate = []byte{} - } + m.CertificateChain = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NotBefore", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { return ErrInvalidLengthGenerated } - if (iNdEx + skippy) > l { + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { return io.ErrUnexpectedEOF } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ExtraValue) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated + if m.NotBefore == nil { + m.NotBefore = &v1.Time{} } - if iNdEx >= l { + if err := m.NotBefore.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BeginRefreshAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if m.BeginRefreshAt == nil { + m.BeginRefreshAt = &v1.Time{} } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ExtraValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ExtraValue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + if err := m.BeginRefreshAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NotAfter", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -1685,23 +3641,27 @@ func (m *ExtraValue) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - *m = append(*m, string(dAtA[iNdEx:postIndex])) + if m.NotAfter == nil { + m.NotAfter = &v1.Time{} + } + if err := m.NotAfter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex diff --git a/vendor/k8s.io/api/certificates/v1/generated.proto b/vendor/k8s.io/api/certificates/v1/generated.proto index a334db4e18..8c97f12395 100644 --- a/vendor/k8s.io/api/certificates/v1/generated.proto +++ b/vendor/k8s.io/api/certificates/v1/generated.proto @@ -204,12 +204,12 @@ message CertificateSigningRequestStatus { // +listType=map // +listMapKey=type // +optional - // +k8s:alpha(since: "1.36")=+k8s:listType=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=type - // +k8s:alpha(since: "1.36")=+k8s:customUnique - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:item(type: "Approved")=+k8s:zeroOrOneOfMember - // +k8s:alpha(since: "1.36")=+k8s:item(type: "Denied")=+k8s:zeroOrOneOfMember + // +k8s:beta(since: "1.37")=+k8s:listType=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=type + // +k8s:beta(since: "1.37")=+k8s:customUnique + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:item(type: "Approved")=+k8s:zeroOrOneOfMember + // +k8s:beta(since: "1.37")=+k8s:item(type: "Denied")=+k8s:zeroOrOneOfMember repeated CertificateSigningRequestCondition conditions = 1; // certificate is populated with an issued certificate by the signer after an Approved condition is present. @@ -243,6 +243,81 @@ message CertificateSigningRequestStatus { optional bytes certificate = 2; } +// ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors +// (root certificates). +// +// ClusterTrustBundle objects are considered to be readable by any authenticated +// user in the cluster, because they can be mounted by pods using the +// `clusterTrustBundle` projection. All service accounts have read access to +// ClusterTrustBundles by default. Users who only have namespace-level access +// to a cluster can read ClusterTrustBundles by impersonating a serviceaccount +// that they have access to. +// +// It can be optionally associated with a particular signer, in which case it +// contains one valid set of trust anchors for that signer. Signers may have +// multiple associated ClusterTrustBundles; each is an independent set of trust +// anchors for that signer. Admission control is used to enforce that only users +// with permissions on the signer can create or modify the corresponding bundle. +message ClusterTrustBundle { + // metadata contains the object metadata. + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // spec contains the signer (if any) and trust anchors. + optional ClusterTrustBundleSpec spec = 2; +} + +// ClusterTrustBundleList is a collection of ClusterTrustBundle objects +message ClusterTrustBundleList { + // metadata contains the list metadata. + // + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // items is a collection of ClusterTrustBundle objects + repeated ClusterTrustBundle items = 2; +} + +// ClusterTrustBundleSpec contains the signer and trust anchors. +message ClusterTrustBundleSpec { + // signerName indicates the associated signer, if any. + // + // In order to create or update a ClusterTrustBundle that sets signerName, + // you must have the following cluster-scoped permission: + // group=certificates.k8s.io resource=signers resourceName= + // verb=attest. + // + // If signerName is not empty, then the ClusterTrustBundle object must be + // named with the signer name as a prefix (translating slashes to colons). + // For example, for the signer name `example.com/foo`, valid + // ClusterTrustBundle object names include `example.com:foo:abc` and + // `example.com:foo:v1`. + // + // If signerName is empty, then the ClusterTrustBundle object's name must + // not have such a prefix. + // + // List/watch requests for ClusterTrustBundles can filter on this field + // using a `spec.signerName=NAME` field selector. + // + // +optional + // +k8s:alpha(since:"1.37")=+k8s:optional + // +k8s:alpha(since:"1.37")=+k8s:immutable + optional string signerName = 1; + + // trustBundle contains the individual X.509 trust anchors for this + // bundle, as PEM bundle of PEM-wrapped, DER-formatted X.509 certificates. + // + // The data must consist only of PEM certificate blocks that parse as valid + // X.509 certificates. Each certificate must include a basic constraints + // extension with the CA bit set. The API server will reject objects that + // contain duplicate certificates, or that use PEM block headers. + // + // Users of ClusterTrustBundles, including Kubelet, are free to reorder and + // deduplicate certificate blocks in this file according to their own logic, + // as well as to drop PEM block headers and inter-block data. + optional string trustBundle = 2; +} + // ExtraValue masks the value so protobuf can generate // +protobuf.nullable=true // +protobuf.options.(gogoproto.goproto_stringer)=false @@ -252,3 +327,209 @@ message ExtraValue { repeated string items = 1; } +// PodCertificateRequest encodes a pod requesting a certificate from a given +// signer. +// +// Kubelets use this API to implement podCertificate projected volumes +// +k8s:supportsSubresource="/status" +message PodCertificateRequest { + // metadata contains the object metadata. + // + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // spec contains the details about the certificate being requested. + // +required + optional PodCertificateRequestSpec spec = 2; + + // status contains the issued certificate, and a standard set of conditions. + // +optional + optional PodCertificateRequestStatus status = 3; +} + +// PodCertificateRequestList is a collection of PodCertificateRequest objects +message PodCertificateRequestList { + // metadata contains the list metadata. + // + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // items is a collection of PodCertificateRequest objects + repeated PodCertificateRequest items = 2; +} + +// PodCertificateRequestSpec describes the certificate request. All fields are +// immutable after creation. +message PodCertificateRequestSpec { + // signerName indicates the requested signer. + // + // All signer names beginning with `kubernetes.io` are reserved for use by + // the Kubernetes project. There is currently one well-known signer + // documented by the Kubernetes project, + // `kubernetes.io/kube-apiserver-client-pod`, which will issue client + // certificates understood by kube-apiserver. It is currently + // unimplemented. + // + // +required + optional string signerName = 1; + + // podName is the name of the pod into which the certificate will be mounted. + // + // +required + optional string podName = 2; + + // podUID is the UID of the pod into which the certificate will be mounted. + // + // +required + optional string podUID = 3; + + // serviceAccountName is the name of the service account the pod is running as. + // + // +required + optional string serviceAccountName = 4; + + // serviceAccountUID is the UID of the service account the pod is running as. + // + // +required + optional string serviceAccountUID = 5; + + // nodeName is the name of the node the pod is assigned to. + // + // +required + optional string nodeName = 6; + + // nodeUID is the UID of the node the pod is assigned to. + // + // +required + optional string nodeUID = 7; + + // maxExpirationSeconds is the maximum lifetime permitted for the + // certificate. + // + // If omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver + // will reject values shorter than 3600 (1 hour). The maximum allowable + // value is 7862400 (91 days). + // + // The signer implementation is then free to issue a certificate with any + // lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600 + // seconds (1 hour). This constraint is enforced by kube-apiserver. + // `kubernetes.io` signers will never issue certificates with a lifetime + // longer than 24 hours. + // + // +optional + // +default=86400 + optional int32 maxExpirationSeconds = 8; + + // A PKCS#10 certificate signing request (DER-serialized) generated by + // Kubelet using the subject private key. + // + // Most signer implementations will ignore the contents of the CSR except to + // extract the subject public key. The API server automatically verifies the + // CSR signature during admission, so the signer does not need to repeat the + // verification. CSRs generated by kubelet are completely empty. + // + // The subject public key must be one of RSA3072, RSA4096, ECDSAP256, + // ECDSAP384, ECDSAP521, or ED25519. Note that this list may be expanded in + // the future. + // + // Signer implementations do not need to support all key types supported by + // kube-apiserver and kubelet. If a signer does not support the key type + // used for a given PodCertificateRequest, it must deny the request by + // setting a status.conditions entry with a type of "Denied" and a reason of + // "UnsupportedKeyType". It may also suggest a key type that it does support + // in the message field. + // + // +required + optional bytes stubPKCS10Request = 12; + + // unverifiedUserAnnotations allow pod authors to pass additional information to + // the signer implementation. Kubernetes does not restrict or validate this + // metadata in any way. + // + // Entries are subject to the same validation as object metadata annotations, + // with the addition that all keys must be domain-prefixed. No restrictions + // are placed on values, except an overall size limitation on the entire field. + // + // Signers should document the keys and values they support. Signers should + // deny requests that contain keys they do not recognize. + // + // +optional + map unverifiedUserAnnotations = 11; +} + +// PodCertificateRequestStatus describes the status of the request, and holds +// the certificate data if the request is issued. +message PodCertificateRequestStatus { + // conditions applied to the request. + // + // The types "Issued", "Denied", and "Failed" have special handling. At + // most one of these conditions may be present, and they must have status + // "True". + // + // If the request is denied with `Reason=UnsupportedKeyType`, the signer may + // suggest a key type that will work in the message field. + // + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + // +optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1; + + // certificateChain is populated with an issued certificate by the signer. + // This field is set via the /status subresource. Once populated, this field + // is immutable. + // + // If the certificate signing request is denied, a condition of type + // "Denied" is added and this field remains empty. If the signer cannot + // issue the certificate, a condition of type "Failed" is added and this + // field remains empty. + // + // Validation requirements: + // 1. certificateChain must consist of one or more PEM-formatted certificates. + // 2. Each entry must be a valid PEM-wrapped, DER-encoded ASN.1 Certificate as + // described in section 4 of RFC5280. + // + // If more than one block is present, and the definition of the requested + // spec.signerName does not indicate otherwise, the first block is the + // issued certificate, and subsequent blocks should be treated as + // intermediate certificates and presented in TLS handshakes. When + // projecting the chain into a pod volume, kubelet will drop any data + // in-between the PEM blocks, as well as any PEM block headers. + // + // +optional + optional string certificateChain = 2; + + // notBefore is the time at which the certificate becomes valid. The value + // must be the same as the notBefore value in the leaf certificate in + // certificateChain. This field is set via the /status subresource. Once + // populated, it is immutable. The signer must set this field at the same + // time it sets certificateChain. + // + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time notBefore = 4; + + // beginRefreshAt is the time at which the kubelet should begin trying to + // refresh the certificate. This field is set via the /status subresource, + // and must be set at the same time as certificateChain. Once populated, + // this field is immutable. + // + // This field is only a hint. Kubelet may start refreshing before or after + // this time if necessary. + // + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time beginRefreshAt = 5; + + // notAfter is the time at which the certificate expires. The value must be + // the same as the notAfter value in the leaf certificate in + // certificateChain. This field is set via the /status subresource. Once + // populated, it is immutable. The signer must set this field at the same + // time it sets certificateChain. + // + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time notAfter = 6; +} + diff --git a/vendor/k8s.io/api/certificates/v1/register.go b/vendor/k8s.io/api/certificates/v1/register.go index 2dac94ada0..474b8b032c 100644 --- a/vendor/k8s.io/api/certificates/v1/register.go +++ b/vendor/k8s.io/api/certificates/v1/register.go @@ -53,6 +53,10 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &CertificateSigningRequest{}, &CertificateSigningRequestList{}, + &ClusterTrustBundle{}, + &ClusterTrustBundleList{}, + &PodCertificateRequest{}, + &PodCertificateRequestList{}, ) // Add the watch version that applies diff --git a/vendor/k8s.io/api/certificates/v1/types.go b/vendor/k8s.io/api/certificates/v1/types.go index 9a86af13a8..b90179ea4c 100644 --- a/vendor/k8s.io/api/certificates/v1/types.go +++ b/vendor/k8s.io/api/certificates/v1/types.go @@ -21,6 +21,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" ) // +genclient @@ -42,7 +43,7 @@ import ( // +k8s:supportsSubresource="/status" // +k8s:supportsSubresource="/approval" type CertificateSigningRequest struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -179,12 +180,12 @@ type CertificateSigningRequestStatus struct { // +listType=map // +listMapKey=type // +optional - // +k8s:alpha(since: "1.36")=+k8s:listType=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=type - // +k8s:alpha(since: "1.36")=+k8s:customUnique - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:item(type: "Approved")=+k8s:zeroOrOneOfMember - // +k8s:alpha(since: "1.36")=+k8s:item(type: "Denied")=+k8s:zeroOrOneOfMember + // +k8s:beta(since: "1.37")=+k8s:listType=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=type + // +k8s:beta(since: "1.37")=+k8s:customUnique + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:item(type: "Approved")=+k8s:zeroOrOneOfMember + // +k8s:beta(since: "1.37")=+k8s:item(type: "Denied")=+k8s:zeroOrOneOfMember Conditions []CertificateSigningRequestCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"` // certificate is populated with an issued certificate by the signer after an Approved condition is present. @@ -273,7 +274,7 @@ type CertificateSigningRequestCondition struct { // CertificateSigningRequestList is a collection of CertificateSigningRequest objects type CertificateSigningRequestList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -316,3 +317,326 @@ const ( UsageMicrosoftSGC KeyUsage = "microsoft sgc" UsageNetscapeSGC KeyUsage = "netscape sgc" ) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.37 + +// ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors +// (root certificates). +// +// ClusterTrustBundle objects are considered to be readable by any authenticated +// user in the cluster, because they can be mounted by pods using the +// `clusterTrustBundle` projection. All service accounts have read access to +// ClusterTrustBundles by default. Users who only have namespace-level access +// to a cluster can read ClusterTrustBundles by impersonating a serviceaccount +// that they have access to. +// +// It can be optionally associated with a particular signer, in which case it +// contains one valid set of trust anchors for that signer. Signers may have +// multiple associated ClusterTrustBundles; each is an independent set of trust +// anchors for that signer. Admission control is used to enforce that only users +// with permissions on the signer can create or modify the corresponding bundle. +type ClusterTrustBundle struct { + metav1.TypeMeta `json:""` + + // metadata contains the object metadata. + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // spec contains the signer (if any) and trust anchors. + Spec ClusterTrustBundleSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` +} + +// ClusterTrustBundleSpec contains the signer and trust anchors. +type ClusterTrustBundleSpec struct { + // signerName indicates the associated signer, if any. + // + // In order to create or update a ClusterTrustBundle that sets signerName, + // you must have the following cluster-scoped permission: + // group=certificates.k8s.io resource=signers resourceName= + // verb=attest. + // + // If signerName is not empty, then the ClusterTrustBundle object must be + // named with the signer name as a prefix (translating slashes to colons). + // For example, for the signer name `example.com/foo`, valid + // ClusterTrustBundle object names include `example.com:foo:abc` and + // `example.com:foo:v1`. + // + // If signerName is empty, then the ClusterTrustBundle object's name must + // not have such a prefix. + // + // List/watch requests for ClusterTrustBundles can filter on this field + // using a `spec.signerName=NAME` field selector. + // + // +optional + // +k8s:alpha(since:"1.37")=+k8s:optional + // +k8s:alpha(since:"1.37")=+k8s:immutable + SignerName string `json:"signerName,omitempty" protobuf:"bytes,1,opt,name=signerName"` + + // trustBundle contains the individual X.509 trust anchors for this + // bundle, as PEM bundle of PEM-wrapped, DER-formatted X.509 certificates. + // + // The data must consist only of PEM certificate blocks that parse as valid + // X.509 certificates. Each certificate must include a basic constraints + // extension with the CA bit set. The API server will reject objects that + // contain duplicate certificates, or that use PEM block headers. + // + // Users of ClusterTrustBundles, including Kubelet, are free to reorder and + // deduplicate certificate blocks in this file according to their own logic, + // as well as to drop PEM block headers and inter-block data. + TrustBundle string `json:"trustBundle" protobuf:"bytes,2,opt,name=trustBundle"` +} + +// +k8s:prerelease-lifecycle-gen:introduced=1.37 +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ClusterTrustBundleList is a collection of ClusterTrustBundle objects +type ClusterTrustBundleList struct { + metav1.TypeMeta `json:""` + + // metadata contains the list metadata. + // + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // items is a collection of ClusterTrustBundle objects + Items []ClusterTrustBundle `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// +genclient +// +k8s:prerelease-lifecycle-gen:introduced=1.37 +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// PodCertificateRequest encodes a pod requesting a certificate from a given +// signer. +// +// Kubelets use this API to implement podCertificate projected volumes +// +k8s:supportsSubresource="/status" +type PodCertificateRequest struct { + metav1.TypeMeta `json:""` + + // metadata contains the object metadata. + // + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // spec contains the details about the certificate being requested. + // +required + Spec PodCertificateRequestSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` + + // status contains the issued certificate, and a standard set of conditions. + // +optional + Status PodCertificateRequestStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// PodCertificateRequestSpec describes the certificate request. All fields are +// immutable after creation. +type PodCertificateRequestSpec struct { + // signerName indicates the requested signer. + // + // All signer names beginning with `kubernetes.io` are reserved for use by + // the Kubernetes project. There is currently one well-known signer + // documented by the Kubernetes project, + // `kubernetes.io/kube-apiserver-client-pod`, which will issue client + // certificates understood by kube-apiserver. It is currently + // unimplemented. + // + // +required + SignerName string `json:"signerName" protobuf:"bytes,1,opt,name=signerName"` + + // podName is the name of the pod into which the certificate will be mounted. + // + // +required + PodName string `json:"podName" protobuf:"bytes,2,opt,name=podName"` + // podUID is the UID of the pod into which the certificate will be mounted. + // + // +required + PodUID types.UID `json:"podUID" protobuf:"bytes,3,opt,name=podUID"` + + // serviceAccountName is the name of the service account the pod is running as. + // + // +required + ServiceAccountName string `json:"serviceAccountName" protobuf:"bytes,4,opt,name=serviceAccountName"` + // serviceAccountUID is the UID of the service account the pod is running as. + // + // +required + ServiceAccountUID types.UID `json:"serviceAccountUID" protobuf:"bytes,5,opt,name=serviceAccountUID"` + + // nodeName is the name of the node the pod is assigned to. + // + // +required + NodeName types.NodeName `json:"nodeName" protobuf:"bytes,6,opt,name=nodeName"` + // nodeUID is the UID of the node the pod is assigned to. + // + // +required + NodeUID types.UID `json:"nodeUID" protobuf:"bytes,7,opt,name=nodeUID"` + + // maxExpirationSeconds is the maximum lifetime permitted for the + // certificate. + // + // If omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver + // will reject values shorter than 3600 (1 hour). The maximum allowable + // value is 7862400 (91 days). + // + // The signer implementation is then free to issue a certificate with any + // lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600 + // seconds (1 hour). This constraint is enforced by kube-apiserver. + // `kubernetes.io` signers will never issue certificates with a lifetime + // longer than 24 hours. + // + // +optional + // +default=86400 + MaxExpirationSeconds *int32 `json:"maxExpirationSeconds,omitempty" protobuf:"varint,8,opt,name=maxExpirationSeconds"` + + // A PKCS#10 certificate signing request (DER-serialized) generated by + // Kubelet using the subject private key. + // + // Most signer implementations will ignore the contents of the CSR except to + // extract the subject public key. The API server automatically verifies the + // CSR signature during admission, so the signer does not need to repeat the + // verification. CSRs generated by kubelet are completely empty. + // + // The subject public key must be one of RSA3072, RSA4096, ECDSAP256, + // ECDSAP384, ECDSAP521, or ED25519. Note that this list may be expanded in + // the future. + // + // Signer implementations do not need to support all key types supported by + // kube-apiserver and kubelet. If a signer does not support the key type + // used for a given PodCertificateRequest, it must deny the request by + // setting a status.conditions entry with a type of "Denied" and a reason of + // "UnsupportedKeyType". It may also suggest a key type that it does support + // in the message field. + // + // +required + StubPKCS10Request []byte `json:"stubPKCS10Request" protobuf:"bytes,12,opt,name=stubPKCS10Request"` + + // unverifiedUserAnnotations allow pod authors to pass additional information to + // the signer implementation. Kubernetes does not restrict or validate this + // metadata in any way. + // + // Entries are subject to the same validation as object metadata annotations, + // with the addition that all keys must be domain-prefixed. No restrictions + // are placed on values, except an overall size limitation on the entire field. + // + // Signers should document the keys and values they support. Signers should + // deny requests that contain keys they do not recognize. + // + // +optional + UnverifiedUserAnnotations map[string]string `json:"unverifiedUserAnnotations,omitempty" protobuf:"bytes,11,opt,name=unverifiedUserAnnotations"` +} + +// PodCertificateRequestStatus describes the status of the request, and holds +// the certificate data if the request is issued. +type PodCertificateRequestStatus struct { + // conditions applied to the request. + // + // The types "Issued", "Denied", and "Failed" have special handling. At + // most one of these conditions may be present, and they must have status + // "True". + // + // If the request is denied with `Reason=UnsupportedKeyType`, the signer may + // suggest a key type that will work in the message field. + // + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + // +optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` + + // certificateChain is populated with an issued certificate by the signer. + // This field is set via the /status subresource. Once populated, this field + // is immutable. + // + // If the certificate signing request is denied, a condition of type + // "Denied" is added and this field remains empty. If the signer cannot + // issue the certificate, a condition of type "Failed" is added and this + // field remains empty. + // + // Validation requirements: + // 1. certificateChain must consist of one or more PEM-formatted certificates. + // 2. Each entry must be a valid PEM-wrapped, DER-encoded ASN.1 Certificate as + // described in section 4 of RFC5280. + // + // If more than one block is present, and the definition of the requested + // spec.signerName does not indicate otherwise, the first block is the + // issued certificate, and subsequent blocks should be treated as + // intermediate certificates and presented in TLS handshakes. When + // projecting the chain into a pod volume, kubelet will drop any data + // in-between the PEM blocks, as well as any PEM block headers. + // + // +optional + CertificateChain string `json:"certificateChain,omitempty" protobuf:"bytes,2,opt,name=certificateChain"` + + // notBefore is the time at which the certificate becomes valid. The value + // must be the same as the notBefore value in the leaf certificate in + // certificateChain. This field is set via the /status subresource. Once + // populated, it is immutable. The signer must set this field at the same + // time it sets certificateChain. + // + // +optional + NotBefore *metav1.Time `json:"notBefore,omitempty" protobuf:"bytes,4,opt,name=notBefore"` + + // beginRefreshAt is the time at which the kubelet should begin trying to + // refresh the certificate. This field is set via the /status subresource, + // and must be set at the same time as certificateChain. Once populated, + // this field is immutable. + // + // This field is only a hint. Kubelet may start refreshing before or after + // this time if necessary. + // + // +optional + BeginRefreshAt *metav1.Time `json:"beginRefreshAt,omitempty" protobuf:"bytes,5,opt,name=beginRefreshAt"` + + // notAfter is the time at which the certificate expires. The value must be + // the same as the notAfter value in the leaf certificate in + // certificateChain. This field is set via the /status subresource. Once + // populated, it is immutable. The signer must set this field at the same + // time it sets certificateChain. + // + // +optional + NotAfter *metav1.Time `json:"notAfter,omitempty" protobuf:"bytes,6,opt,name=notAfter"` +} + +// Well-known condition types for PodCertificateRequests +const ( + // Denied indicates the request was denied by the signer. + PodCertificateRequestConditionTypeDenied string = "Denied" + // Failed indicates the signer failed to issue the certificate. + PodCertificateRequestConditionTypeFailed string = "Failed" + // Issued indicates the certificate has been issued. + PodCertificateRequestConditionTypeIssued string = "Issued" +) + +// Well-known condition reasons for PodCertificateRequests +const ( + // UnsupportedKeyType should be set on "Denied" conditions when the signer + // doesn't support the key type of publicKey. + PodCertificateRequestConditionUnsupportedKeyType string = "UnsupportedKeyType" + + // InvalidUnverifiedUserAnnotations should be set on "Denied" conditions when the signer + // does not recognize one of the keys passed in userConfig, or if the signer + // otherwise considers the userConfig of the request to be invalid. + PodCertificateRequestConditionInvalidUserConfig string = "InvalidUnverifiedUserAnnotations" +) + +// +k8s:prerelease-lifecycle-gen:introduced=1.37 +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// PodCertificateRequestList is a collection of PodCertificateRequest objects +type PodCertificateRequestList struct { + metav1.TypeMeta `json:""` + + // metadata contains the list metadata. + // + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // items is a collection of PodCertificateRequest objects + Items []PodCertificateRequest `json:"items" protobuf:"bytes,2,rep,name=items"` +} diff --git a/vendor/k8s.io/api/certificates/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/certificates/v1/types_swagger_doc_generated.go index 4bdf39ebb3..503de052a7 100644 --- a/vendor/k8s.io/api/certificates/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/certificates/v1/types_swagger_doc_generated.go @@ -86,4 +86,86 @@ func (CertificateSigningRequestStatus) SwaggerDoc() map[string]string { return map_CertificateSigningRequestStatus } +var map_ClusterTrustBundle = map[string]string{ + "": "ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors (root certificates).\n\nClusterTrustBundle objects are considered to be readable by any authenticated user in the cluster, because they can be mounted by pods using the `clusterTrustBundle` projection. All service accounts have read access to ClusterTrustBundles by default. Users who only have namespace-level access to a cluster can read ClusterTrustBundles by impersonating a serviceaccount that they have access to.\n\nIt can be optionally associated with a particular signer, in which case it contains one valid set of trust anchors for that signer. Signers may have multiple associated ClusterTrustBundles; each is an independent set of trust anchors for that signer. Admission control is used to enforce that only users with permissions on the signer can create or modify the corresponding bundle.", + "metadata": "metadata contains the object metadata.", + "spec": "spec contains the signer (if any) and trust anchors.", +} + +func (ClusterTrustBundle) SwaggerDoc() map[string]string { + return map_ClusterTrustBundle +} + +var map_ClusterTrustBundleList = map[string]string{ + "": "ClusterTrustBundleList is a collection of ClusterTrustBundle objects", + "metadata": "metadata contains the list metadata.", + "items": "items is a collection of ClusterTrustBundle objects", +} + +func (ClusterTrustBundleList) SwaggerDoc() map[string]string { + return map_ClusterTrustBundleList +} + +var map_ClusterTrustBundleSpec = map[string]string{ + "": "ClusterTrustBundleSpec contains the signer and trust anchors.", + "signerName": "signerName indicates the associated signer, if any.\n\nIn order to create or update a ClusterTrustBundle that sets signerName, you must have the following cluster-scoped permission: group=certificates.k8s.io resource=signers resourceName= verb=attest.\n\nIf signerName is not empty, then the ClusterTrustBundle object must be named with the signer name as a prefix (translating slashes to colons). For example, for the signer name `example.com/foo`, valid ClusterTrustBundle object names include `example.com:foo:abc` and `example.com:foo:v1`.\n\nIf signerName is empty, then the ClusterTrustBundle object's name must not have such a prefix.\n\nList/watch requests for ClusterTrustBundles can filter on this field using a `spec.signerName=NAME` field selector.", + "trustBundle": "trustBundle contains the individual X.509 trust anchors for this bundle, as PEM bundle of PEM-wrapped, DER-formatted X.509 certificates.\n\nThe data must consist only of PEM certificate blocks that parse as valid X.509 certificates. Each certificate must include a basic constraints extension with the CA bit set. The API server will reject objects that contain duplicate certificates, or that use PEM block headers.\n\nUsers of ClusterTrustBundles, including Kubelet, are free to reorder and deduplicate certificate blocks in this file according to their own logic, as well as to drop PEM block headers and inter-block data.", +} + +func (ClusterTrustBundleSpec) SwaggerDoc() map[string]string { + return map_ClusterTrustBundleSpec +} + +var map_PodCertificateRequest = map[string]string{ + "": "PodCertificateRequest encodes a pod requesting a certificate from a given signer.\n\nKubelets use this API to implement podCertificate projected volumes", + "metadata": "metadata contains the object metadata.", + "spec": "spec contains the details about the certificate being requested.", + "status": "status contains the issued certificate, and a standard set of conditions.", +} + +func (PodCertificateRequest) SwaggerDoc() map[string]string { + return map_PodCertificateRequest +} + +var map_PodCertificateRequestList = map[string]string{ + "": "PodCertificateRequestList is a collection of PodCertificateRequest objects", + "metadata": "metadata contains the list metadata.", + "items": "items is a collection of PodCertificateRequest objects", +} + +func (PodCertificateRequestList) SwaggerDoc() map[string]string { + return map_PodCertificateRequestList +} + +var map_PodCertificateRequestSpec = map[string]string{ + "": "PodCertificateRequestSpec describes the certificate request. All fields are immutable after creation.", + "signerName": "signerName indicates the requested signer.\n\nAll signer names beginning with `kubernetes.io` are reserved for use by the Kubernetes project. There is currently one well-known signer documented by the Kubernetes project, `kubernetes.io/kube-apiserver-client-pod`, which will issue client certificates understood by kube-apiserver. It is currently unimplemented.", + "podName": "podName is the name of the pod into which the certificate will be mounted.", + "podUID": "podUID is the UID of the pod into which the certificate will be mounted.", + "serviceAccountName": "serviceAccountName is the name of the service account the pod is running as.", + "serviceAccountUID": "serviceAccountUID is the UID of the service account the pod is running as.", + "nodeName": "nodeName is the name of the node the pod is assigned to.", + "nodeUID": "nodeUID is the UID of the node the pod is assigned to.", + "maxExpirationSeconds": "maxExpirationSeconds is the maximum lifetime permitted for the certificate.\n\nIf omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver will reject values shorter than 3600 (1 hour). The maximum allowable value is 7862400 (91 days).\n\nThe signer implementation is then free to issue a certificate with any lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600 seconds (1 hour). This constraint is enforced by kube-apiserver. `kubernetes.io` signers will never issue certificates with a lifetime longer than 24 hours.", + "stubPKCS10Request": "A PKCS#10 certificate signing request (DER-serialized) generated by Kubelet using the subject private key.\n\nMost signer implementations will ignore the contents of the CSR except to extract the subject public key. The API server automatically verifies the CSR signature during admission, so the signer does not need to repeat the verification. CSRs generated by kubelet are completely empty.\n\nThe subject public key must be one of RSA3072, RSA4096, ECDSAP256, ECDSAP384, ECDSAP521, or ED25519. Note that this list may be expanded in the future.\n\nSigner implementations do not need to support all key types supported by kube-apiserver and kubelet. If a signer does not support the key type used for a given PodCertificateRequest, it must deny the request by setting a status.conditions entry with a type of \"Denied\" and a reason of \"UnsupportedKeyType\". It may also suggest a key type that it does support in the message field.", + "unverifiedUserAnnotations": "unverifiedUserAnnotations allow pod authors to pass additional information to the signer implementation. Kubernetes does not restrict or validate this metadata in any way.\n\nEntries are subject to the same validation as object metadata annotations, with the addition that all keys must be domain-prefixed. No restrictions are placed on values, except an overall size limitation on the entire field.\n\nSigners should document the keys and values they support. Signers should deny requests that contain keys they do not recognize.", +} + +func (PodCertificateRequestSpec) SwaggerDoc() map[string]string { + return map_PodCertificateRequestSpec +} + +var map_PodCertificateRequestStatus = map[string]string{ + "": "PodCertificateRequestStatus describes the status of the request, and holds the certificate data if the request is issued.", + "conditions": "conditions applied to the request.\n\nThe types \"Issued\", \"Denied\", and \"Failed\" have special handling. At most one of these conditions may be present, and they must have status \"True\".\n\nIf the request is denied with `Reason=UnsupportedKeyType`, the signer may suggest a key type that will work in the message field.", + "certificateChain": "certificateChain is populated with an issued certificate by the signer. This field is set via the /status subresource. Once populated, this field is immutable.\n\nIf the certificate signing request is denied, a condition of type \"Denied\" is added and this field remains empty. If the signer cannot issue the certificate, a condition of type \"Failed\" is added and this field remains empty.\n\nValidation requirements:\n 1. certificateChain must consist of one or more PEM-formatted certificates.\n 2. Each entry must be a valid PEM-wrapped, DER-encoded ASN.1 Certificate as\n described in section 4 of RFC5280.\n\nIf more than one block is present, and the definition of the requested spec.signerName does not indicate otherwise, the first block is the issued certificate, and subsequent blocks should be treated as intermediate certificates and presented in TLS handshakes. When projecting the chain into a pod volume, kubelet will drop any data in-between the PEM blocks, as well as any PEM block headers.", + "notBefore": "notBefore is the time at which the certificate becomes valid. The value must be the same as the notBefore value in the leaf certificate in certificateChain. This field is set via the /status subresource. Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain.", + "beginRefreshAt": "beginRefreshAt is the time at which the kubelet should begin trying to refresh the certificate. This field is set via the /status subresource, and must be set at the same time as certificateChain. Once populated, this field is immutable.\n\nThis field is only a hint. Kubelet may start refreshing before or after this time if necessary.", + "notAfter": "notAfter is the time at which the certificate expires. The value must be the same as the notAfter value in the leaf certificate in certificateChain. This field is set via the /status subresource. Once populated, it is immutable. The signer must set this field at the same time it sets certificateChain.", +} + +func (PodCertificateRequestStatus) SwaggerDoc() map[string]string { + return map_PodCertificateRequestStatus +} + // AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/k8s.io/api/certificates/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/certificates/v1/zz_generated.deepcopy.go index aefa604117..b25937758d 100644 --- a/vendor/k8s.io/api/certificates/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/certificates/v1/zz_generated.deepcopy.go @@ -22,6 +22,7 @@ limitations under the License. package v1 import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -183,6 +184,82 @@ func (in *CertificateSigningRequestStatus) DeepCopy() *CertificateSigningRequest return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterTrustBundle) DeepCopyInto(out *ClusterTrustBundle) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTrustBundle. +func (in *ClusterTrustBundle) DeepCopy() *ClusterTrustBundle { + if in == nil { + return nil + } + out := new(ClusterTrustBundle) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterTrustBundle) 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 *ClusterTrustBundleList) DeepCopyInto(out *ClusterTrustBundleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterTrustBundle, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTrustBundleList. +func (in *ClusterTrustBundleList) DeepCopy() *ClusterTrustBundleList { + if in == nil { + return nil + } + out := new(ClusterTrustBundleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterTrustBundleList) 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 *ClusterTrustBundleSpec) DeepCopyInto(out *ClusterTrustBundleSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTrustBundleSpec. +func (in *ClusterTrustBundleSpec) DeepCopy() *ClusterTrustBundleSpec { + if in == nil { + return nil + } + out := new(ClusterTrustBundleSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in ExtraValue) DeepCopyInto(out *ExtraValue) { { @@ -202,3 +279,132 @@ func (in ExtraValue) DeepCopy() ExtraValue { in.DeepCopyInto(out) return *out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodCertificateRequest) DeepCopyInto(out *PodCertificateRequest) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodCertificateRequest. +func (in *PodCertificateRequest) DeepCopy() *PodCertificateRequest { + if in == nil { + return nil + } + out := new(PodCertificateRequest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PodCertificateRequest) 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 *PodCertificateRequestList) DeepCopyInto(out *PodCertificateRequestList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PodCertificateRequest, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodCertificateRequestList. +func (in *PodCertificateRequestList) DeepCopy() *PodCertificateRequestList { + if in == nil { + return nil + } + out := new(PodCertificateRequestList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PodCertificateRequestList) 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 *PodCertificateRequestSpec) DeepCopyInto(out *PodCertificateRequestSpec) { + *out = *in + if in.MaxExpirationSeconds != nil { + in, out := &in.MaxExpirationSeconds, &out.MaxExpirationSeconds + *out = new(int32) + **out = **in + } + if in.StubPKCS10Request != nil { + in, out := &in.StubPKCS10Request, &out.StubPKCS10Request + *out = make([]byte, len(*in)) + copy(*out, *in) + } + if in.UnverifiedUserAnnotations != nil { + in, out := &in.UnverifiedUserAnnotations, &out.UnverifiedUserAnnotations + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodCertificateRequestSpec. +func (in *PodCertificateRequestSpec) DeepCopy() *PodCertificateRequestSpec { + if in == nil { + return nil + } + out := new(PodCertificateRequestSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodCertificateRequestStatus) DeepCopyInto(out *PodCertificateRequestStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.NotBefore != nil { + in, out := &in.NotBefore, &out.NotBefore + *out = (*in).DeepCopy() + } + if in.BeginRefreshAt != nil { + in, out := &in.BeginRefreshAt, &out.BeginRefreshAt + *out = (*in).DeepCopy() + } + if in.NotAfter != nil { + in, out := &in.NotAfter, &out.NotAfter + *out = (*in).DeepCopy() + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodCertificateRequestStatus. +func (in *PodCertificateRequestStatus) DeepCopy() *PodCertificateRequestStatus { + if in == nil { + return nil + } + out := new(PodCertificateRequestStatus) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/k8s.io/api/certificates/v1/zz_generated.model_name.go b/vendor/k8s.io/api/certificates/v1/zz_generated.model_name.go index 9c7ad07a2c..73457044cc 100644 --- a/vendor/k8s.io/api/certificates/v1/zz_generated.model_name.go +++ b/vendor/k8s.io/api/certificates/v1/zz_generated.model_name.go @@ -45,3 +45,38 @@ func (in CertificateSigningRequestSpec) OpenAPIModelName() string { func (in CertificateSigningRequestStatus) OpenAPIModelName() string { return "io.k8s.api.certificates.v1.CertificateSigningRequestStatus" } + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterTrustBundle) OpenAPIModelName() string { + return "io.k8s.api.certificates.v1.ClusterTrustBundle" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterTrustBundleList) OpenAPIModelName() string { + return "io.k8s.api.certificates.v1.ClusterTrustBundleList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterTrustBundleSpec) OpenAPIModelName() string { + return "io.k8s.api.certificates.v1.ClusterTrustBundleSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodCertificateRequest) OpenAPIModelName() string { + return "io.k8s.api.certificates.v1.PodCertificateRequest" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodCertificateRequestList) OpenAPIModelName() string { + return "io.k8s.api.certificates.v1.PodCertificateRequestList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodCertificateRequestSpec) OpenAPIModelName() string { + return "io.k8s.api.certificates.v1.PodCertificateRequestSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodCertificateRequestStatus) OpenAPIModelName() string { + return "io.k8s.api.certificates.v1.PodCertificateRequestStatus" +} diff --git a/vendor/k8s.io/api/certificates/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/certificates/v1/zz_generated.prerelease-lifecycle.go index 3a2b274030..522a9bee5d 100644 --- a/vendor/k8s.io/api/certificates/v1/zz_generated.prerelease-lifecycle.go +++ b/vendor/k8s.io/api/certificates/v1/zz_generated.prerelease-lifecycle.go @@ -32,3 +32,27 @@ func (in *CertificateSigningRequest) APILifecycleIntroduced() (major, minor int) func (in *CertificateSigningRequestList) APILifecycleIntroduced() (major, minor int) { return 1, 19 } + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *ClusterTrustBundle) APILifecycleIntroduced() (major, minor int) { + return 1, 37 +} + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *ClusterTrustBundleList) APILifecycleIntroduced() (major, minor int) { + return 1, 37 +} + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *PodCertificateRequest) APILifecycleIntroduced() (major, minor int) { + return 1, 37 +} + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *PodCertificateRequestList) APILifecycleIntroduced() (major, minor int) { + return 1, 37 +} diff --git a/vendor/k8s.io/api/certificates/v1alpha1/generated.proto b/vendor/k8s.io/api/certificates/v1alpha1/generated.proto index 7155f778cf..914d8e269d 100644 --- a/vendor/k8s.io/api/certificates/v1alpha1/generated.proto +++ b/vendor/k8s.io/api/certificates/v1alpha1/generated.proto @@ -38,7 +38,7 @@ option go_package = "k8s.io/api/certificates/v1alpha1"; // to a cluster can read ClusterTrustBundles by impersonating a serviceaccount // that they have access to. // -// It can be optionally associated with a particular assigner, in which case it +// It can be optionally associated with a particular signer, in which case it // contains one valid set of trust anchors for that signer. Signers may have // multiple associated ClusterTrustBundles; each is an independent set of trust // anchors for that signer. Admission control is used to enforce that only users @@ -85,6 +85,8 @@ message ClusterTrustBundleSpec { // using a `spec.signerName=NAME` field selector. // // +optional + // +k8s:alpha(since:"1.37")=+k8s:optional + // +k8s:alpha(since:"1.37")=+k8s:immutable optional string signerName = 1; // trustBundle contains the individual X.509 trust anchors for this diff --git a/vendor/k8s.io/api/certificates/v1alpha1/types.go b/vendor/k8s.io/api/certificates/v1alpha1/types.go index beef02599d..bdac6657cc 100644 --- a/vendor/k8s.io/api/certificates/v1alpha1/types.go +++ b/vendor/k8s.io/api/certificates/v1alpha1/types.go @@ -36,13 +36,13 @@ import ( // to a cluster can read ClusterTrustBundles by impersonating a serviceaccount // that they have access to. // -// It can be optionally associated with a particular assigner, in which case it +// It can be optionally associated with a particular signer, in which case it // contains one valid set of trust anchors for that signer. Signers may have // multiple associated ClusterTrustBundles; each is an independent set of trust // anchors for that signer. Admission control is used to enforce that only users // with permissions on the signer can create or modify the corresponding bundle. type ClusterTrustBundle struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata contains the object metadata. // +optional @@ -74,6 +74,8 @@ type ClusterTrustBundleSpec struct { // using a `spec.signerName=NAME` field selector. // // +optional + // +k8s:alpha(since:"1.37")=+k8s:optional + // +k8s:alpha(since:"1.37")=+k8s:immutable SignerName string `json:"signerName,omitempty" protobuf:"bytes,1,opt,name=signerName"` // trustBundle contains the individual X.509 trust anchors for this @@ -96,7 +98,7 @@ type ClusterTrustBundleSpec struct { // ClusterTrustBundleList is a collection of ClusterTrustBundle objects type ClusterTrustBundleList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata contains the list metadata. // diff --git a/vendor/k8s.io/api/certificates/v1alpha1/types_swagger_doc_generated.go b/vendor/k8s.io/api/certificates/v1alpha1/types_swagger_doc_generated.go index bff649e3cb..862897e97b 100644 --- a/vendor/k8s.io/api/certificates/v1alpha1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/certificates/v1alpha1/types_swagger_doc_generated.go @@ -28,7 +28,7 @@ package v1alpha1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_ClusterTrustBundle = map[string]string{ - "": "ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors (root certificates).\n\nClusterTrustBundle objects are considered to be readable by any authenticated user in the cluster, because they can be mounted by pods using the `clusterTrustBundle` projection. All service accounts have read access to ClusterTrustBundles by default. Users who only have namespace-level access to a cluster can read ClusterTrustBundles by impersonating a serviceaccount that they have access to.\n\nIt can be optionally associated with a particular assigner, in which case it contains one valid set of trust anchors for that signer. Signers may have multiple associated ClusterTrustBundles; each is an independent set of trust anchors for that signer. Admission control is used to enforce that only users with permissions on the signer can create or modify the corresponding bundle.", + "": "ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors (root certificates).\n\nClusterTrustBundle objects are considered to be readable by any authenticated user in the cluster, because they can be mounted by pods using the `clusterTrustBundle` projection. All service accounts have read access to ClusterTrustBundles by default. Users who only have namespace-level access to a cluster can read ClusterTrustBundles by impersonating a serviceaccount that they have access to.\n\nIt can be optionally associated with a particular signer, in which case it contains one valid set of trust anchors for that signer. Signers may have multiple associated ClusterTrustBundles; each is an independent set of trust anchors for that signer. Admission control is used to enforce that only users with permissions on the signer can create or modify the corresponding bundle.", "metadata": "metadata contains the object metadata.", "spec": "spec contains the signer (if any) and trust anchors.", } diff --git a/vendor/k8s.io/api/certificates/v1beta1/generated.proto b/vendor/k8s.io/api/certificates/v1beta1/generated.proto index cc46dee16d..25561abbc3 100644 --- a/vendor/k8s.io/api/certificates/v1beta1/generated.proto +++ b/vendor/k8s.io/api/certificates/v1beta1/generated.proto @@ -183,12 +183,12 @@ message CertificateSigningRequestStatus { // +listType=map // +listMapKey=type // +optional - // +k8s:alpha(since: "1.36")=+k8s:listType=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=type - // +k8s:alpha(since: "1.36")=+k8s:customUnique - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:item(type: "Approved")=+k8s:zeroOrOneOfMember - // +k8s:alpha(since: "1.36")=+k8s:item(type: "Denied")=+k8s:zeroOrOneOfMember + // +k8s:beta(since: "1.37")=+k8s:listType=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=type + // +k8s:beta(since: "1.37")=+k8s:customUnique + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:item(type: "Approved")=+k8s:zeroOrOneOfMember + // +k8s:beta(since: "1.37")=+k8s:item(type: "Denied")=+k8s:zeroOrOneOfMember repeated CertificateSigningRequestCondition conditions = 1; // If request was approved, the controller will place the issued certificate here. @@ -206,7 +206,7 @@ message CertificateSigningRequestStatus { // to a cluster can read ClusterTrustBundles by impersonating a serviceaccount // that they have access to. // -// It can be optionally associated with a particular assigner, in which case it +// It can be optionally associated with a particular signer, in which case it // contains one valid set of trust anchors for that signer. Signers may have // multiple associated ClusterTrustBundles; each is an independent set of trust // anchors for that signer. Admission control is used to enforce that only users @@ -253,6 +253,8 @@ message ClusterTrustBundleSpec { // using a `spec.signerName=NAME` field selector. // // +optional + // +k8s:alpha(since:"1.37")=+k8s:optional + // +k8s:alpha(since:"1.37")=+k8s:immutable optional string signerName = 1; // trustBundle contains the individual X.509 trust anchors for this @@ -282,6 +284,7 @@ message ExtraValue { // signer. // // Kubelets use this API to implement podCertificate projected volumes +// +k8s:supportsSubresource="/status" message PodCertificateRequest { // metadata contains the object metadata. // @@ -467,6 +470,9 @@ message PodCertificateRequestStatus { // +listType=map // +listMapKey=type // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1; // certificateChain is populated with an issued certificate by the signer. diff --git a/vendor/k8s.io/api/certificates/v1beta1/types.go b/vendor/k8s.io/api/certificates/v1beta1/types.go index e8ffa41e6d..eaa77c194d 100644 --- a/vendor/k8s.io/api/certificates/v1beta1/types.go +++ b/vendor/k8s.io/api/certificates/v1beta1/types.go @@ -35,7 +35,7 @@ import ( // +k8s:supportsSubresource="/status" // +k8s:supportsSubresource="/approval" type CertificateSigningRequest struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -177,12 +177,12 @@ type CertificateSigningRequestStatus struct { // +listType=map // +listMapKey=type // +optional - // +k8s:alpha(since: "1.36")=+k8s:listType=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=type - // +k8s:alpha(since: "1.36")=+k8s:customUnique - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:item(type: "Approved")=+k8s:zeroOrOneOfMember - // +k8s:alpha(since: "1.36")=+k8s:item(type: "Denied")=+k8s:zeroOrOneOfMember + // +k8s:beta(since: "1.37")=+k8s:listType=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=type + // +k8s:beta(since: "1.37")=+k8s:customUnique + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:item(type: "Approved")=+k8s:zeroOrOneOfMember + // +k8s:beta(since: "1.37")=+k8s:item(type: "Denied")=+k8s:zeroOrOneOfMember Conditions []CertificateSigningRequestCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"` // If request was approved, the controller will place the issued certificate here. @@ -230,7 +230,7 @@ type CertificateSigningRequestCondition struct { // +k8s:prerelease-lifecycle-gen:replacement=certificates.k8s.io,v1,CertificateSigningRequestList type CertificateSigningRequestList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -274,6 +274,7 @@ const ( // +genclient:nonNamespaced // +k8s:prerelease-lifecycle-gen:introduced=1.33 // +k8s:prerelease-lifecycle-gen:deprecated=1.37 +// +k8s:prerelease-lifecycle-gen:replacement=certificates.k8s.io,v1,ClusterTrustBundle // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors @@ -286,13 +287,13 @@ const ( // to a cluster can read ClusterTrustBundles by impersonating a serviceaccount // that they have access to. // -// It can be optionally associated with a particular assigner, in which case it +// It can be optionally associated with a particular signer, in which case it // contains one valid set of trust anchors for that signer. Signers may have // multiple associated ClusterTrustBundles; each is an independent set of trust // anchors for that signer. Admission control is used to enforce that only users // with permissions on the signer can create or modify the corresponding bundle. type ClusterTrustBundle struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata contains the object metadata. // +optional @@ -324,6 +325,8 @@ type ClusterTrustBundleSpec struct { // using a `spec.signerName=NAME` field selector. // // +optional + // +k8s:alpha(since:"1.37")=+k8s:optional + // +k8s:alpha(since:"1.37")=+k8s:immutable SignerName string `json:"signerName,omitempty" protobuf:"bytes,1,opt,name=signerName"` // trustBundle contains the individual X.509 trust anchors for this @@ -342,11 +345,12 @@ type ClusterTrustBundleSpec struct { // +k8s:prerelease-lifecycle-gen:introduced=1.33 // +k8s:prerelease-lifecycle-gen:deprecated=1.37 +// +k8s:prerelease-lifecycle-gen:replacement=certificates.k8s.io,v1,ClusterTrustBundleList // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ClusterTrustBundleList is a collection of ClusterTrustBundle objects type ClusterTrustBundleList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata contains the list metadata. // @@ -359,14 +363,17 @@ type ClusterTrustBundleList struct { // +genclient // +k8s:prerelease-lifecycle-gen:introduced=1.35 +// +k8s:prerelease-lifecycle-gen:deprecated=1.37 +// +k8s:prerelease-lifecycle-gen:replacement=certificates.k8s.io,v1,PodCertificateRequest // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // PodCertificateRequest encodes a pod requesting a certificate from a given // signer. // // Kubelets use this API to implement podCertificate projected volumes +// +k8s:supportsSubresource="/status" type PodCertificateRequest struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata contains the object metadata. // @@ -538,6 +545,9 @@ type PodCertificateRequestStatus struct { // +listType=map // +listMapKey=type // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` // certificateChain is populated with an issued certificate by the signer. @@ -618,10 +628,12 @@ const ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.35 +// +k8s:prerelease-lifecycle-gen:deprecated=1.37 +// +k8s:prerelease-lifecycle-gen:replacement=certificates.k8s.io,v1,PodCertificateRequestList // PodCertificateRequestList is a collection of PodCertificateRequest objects type PodCertificateRequestList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // metadata contains the list metadata. // diff --git a/vendor/k8s.io/api/certificates/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/certificates/v1beta1/types_swagger_doc_generated.go index cad8768a59..c5352a7aca 100644 --- a/vendor/k8s.io/api/certificates/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/certificates/v1beta1/types_swagger_doc_generated.go @@ -76,7 +76,7 @@ func (CertificateSigningRequestStatus) SwaggerDoc() map[string]string { } var map_ClusterTrustBundle = map[string]string{ - "": "ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors (root certificates).\n\nClusterTrustBundle objects are considered to be readable by any authenticated user in the cluster, because they can be mounted by pods using the `clusterTrustBundle` projection. All service accounts have read access to ClusterTrustBundles by default. Users who only have namespace-level access to a cluster can read ClusterTrustBundles by impersonating a serviceaccount that they have access to.\n\nIt can be optionally associated with a particular assigner, in which case it contains one valid set of trust anchors for that signer. Signers may have multiple associated ClusterTrustBundles; each is an independent set of trust anchors for that signer. Admission control is used to enforce that only users with permissions on the signer can create or modify the corresponding bundle.", + "": "ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors (root certificates).\n\nClusterTrustBundle objects are considered to be readable by any authenticated user in the cluster, because they can be mounted by pods using the `clusterTrustBundle` projection. All service accounts have read access to ClusterTrustBundles by default. Users who only have namespace-level access to a cluster can read ClusterTrustBundles by impersonating a serviceaccount that they have access to.\n\nIt can be optionally associated with a particular signer, in which case it contains one valid set of trust anchors for that signer. Signers may have multiple associated ClusterTrustBundles; each is an independent set of trust anchors for that signer. Admission control is used to enforce that only users with permissions on the signer can create or modify the corresponding bundle.", "metadata": "metadata contains the object metadata.", "spec": "spec contains the signer (if any) and trust anchors.", } diff --git a/vendor/k8s.io/api/certificates/v1beta1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/certificates/v1beta1/zz_generated.prerelease-lifecycle.go index d541ffb005..3b6f17e3e5 100644 --- a/vendor/k8s.io/api/certificates/v1beta1/zz_generated.prerelease-lifecycle.go +++ b/vendor/k8s.io/api/certificates/v1beta1/zz_generated.prerelease-lifecycle.go @@ -85,6 +85,12 @@ func (in *ClusterTrustBundle) APILifecycleDeprecated() (major, minor int) { return 1, 37 } +// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. +// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=,," tags in types.go. +func (in *ClusterTrustBundle) APILifecycleReplacement() schema.GroupVersionKind { + return schema.GroupVersionKind{Group: "certificates.k8s.io", Version: "v1", Kind: "ClusterTrustBundle"} +} + // APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. func (in *ClusterTrustBundle) APILifecycleRemoved() (major, minor int) { @@ -103,6 +109,12 @@ func (in *ClusterTrustBundleList) APILifecycleDeprecated() (major, minor int) { return 1, 37 } +// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. +// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=,," tags in types.go. +func (in *ClusterTrustBundleList) APILifecycleReplacement() schema.GroupVersionKind { + return schema.GroupVersionKind{Group: "certificates.k8s.io", Version: "v1", Kind: "ClusterTrustBundleList"} +} + // APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. func (in *ClusterTrustBundleList) APILifecycleRemoved() (major, minor int) { @@ -118,13 +130,19 @@ func (in *PodCertificateRequest) APILifecycleIntroduced() (major, minor int) { // APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. func (in *PodCertificateRequest) APILifecycleDeprecated() (major, minor int) { - return 1, 38 + return 1, 37 +} + +// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. +// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=,," tags in types.go. +func (in *PodCertificateRequest) APILifecycleReplacement() schema.GroupVersionKind { + return schema.GroupVersionKind{Group: "certificates.k8s.io", Version: "v1", Kind: "PodCertificateRequest"} } // APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. func (in *PodCertificateRequest) APILifecycleRemoved() (major, minor int) { - return 1, 41 + return 1, 40 } // APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. @@ -136,11 +154,17 @@ func (in *PodCertificateRequestList) APILifecycleIntroduced() (major, minor int) // APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. func (in *PodCertificateRequestList) APILifecycleDeprecated() (major, minor int) { - return 1, 38 + return 1, 37 +} + +// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. +// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=,," tags in types.go. +func (in *PodCertificateRequestList) APILifecycleReplacement() schema.GroupVersionKind { + return schema.GroupVersionKind{Group: "certificates.k8s.io", Version: "v1", Kind: "PodCertificateRequestList"} } // APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. func (in *PodCertificateRequestList) APILifecycleRemoved() (major, minor int) { - return 1, 41 + return 1, 40 } diff --git a/vendor/k8s.io/api/coordination/v1/generated.proto b/vendor/k8s.io/api/coordination/v1/generated.proto index 4d4f7e08f4..75f1c9acff 100644 --- a/vendor/k8s.io/api/coordination/v1/generated.proto +++ b/vendor/k8s.io/api/coordination/v1/generated.proto @@ -30,6 +30,7 @@ option go_package = "k8s.io/api/coordination/v1"; // Lease defines a lease concept. message Lease { + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -79,14 +80,14 @@ message LeaseSpec { // +optional optional int32 leaseTransitions = 5; - // Strategy indicates the strategy for picking the leader for coordinated leader election. + // strategy indicates the strategy for picking the leader for coordinated leader election. // If the field is not specified, there is no active coordination for this lease. // (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled. // +featureGate=CoordinatedLeaderElection // +optional optional string strategy = 6; - // PreferredHolder signals to a lease holder that the lease has a + // preferredHolder signals to a lease holder that the lease has a // more optimal holder and should be given up. // This field can only be set if Strategy is also set. // +featureGate=CoordinatedLeaderElection diff --git a/vendor/k8s.io/api/coordination/v1/types.go b/vendor/k8s.io/api/coordination/v1/types.go index 5307cea88f..297ec32cb9 100644 --- a/vendor/k8s.io/api/coordination/v1/types.go +++ b/vendor/k8s.io/api/coordination/v1/types.go @@ -38,7 +38,8 @@ const ( // Lease defines a lease concept. type Lease struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -72,13 +73,13 @@ type LeaseSpec struct { // holders. // +optional LeaseTransitions *int32 `json:"leaseTransitions,omitempty" protobuf:"varint,5,opt,name=leaseTransitions"` - // Strategy indicates the strategy for picking the leader for coordinated leader election. + // strategy indicates the strategy for picking the leader for coordinated leader election. // If the field is not specified, there is no active coordination for this lease. // (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled. // +featureGate=CoordinatedLeaderElection // +optional Strategy *CoordinatedLeaseStrategy `json:"strategy,omitempty" protobuf:"bytes,6,opt,name=strategy"` - // PreferredHolder signals to a lease holder that the lease has a + // preferredHolder signals to a lease holder that the lease has a // more optimal holder and should be given up. // This field can only be set if Strategy is also set. // +featureGate=CoordinatedLeaderElection @@ -91,7 +92,7 @@ type LeaseSpec struct { // LeaseList is a list of Lease objects. type LeaseList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional diff --git a/vendor/k8s.io/api/coordination/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/coordination/v1/types_swagger_doc_generated.go index 6c1a7ea8b9..c8bdb1e42e 100644 --- a/vendor/k8s.io/api/coordination/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/coordination/v1/types_swagger_doc_generated.go @@ -29,7 +29,7 @@ package v1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_Lease = map[string]string{ "": "Lease defines a lease concept.", - "metadata": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec contains the specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", } @@ -54,8 +54,8 @@ var map_LeaseSpec = map[string]string{ "acquireTime": "acquireTime is a time when the current lease was acquired.", "renewTime": "renewTime is a time when the current holder of a lease has last updated the lease.", "leaseTransitions": "leaseTransitions is the number of transitions of a lease between holders.", - "strategy": "Strategy indicates the strategy for picking the leader for coordinated leader election. If the field is not specified, there is no active coordination for this lease. (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.", - "preferredHolder": "PreferredHolder signals to a lease holder that the lease has a more optimal holder and should be given up. This field can only be set if Strategy is also set.", + "strategy": "strategy indicates the strategy for picking the leader for coordinated leader election. If the field is not specified, there is no active coordination for this lease. (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.", + "preferredHolder": "preferredHolder signals to a lease holder that the lease has a more optimal holder and should be given up. This field can only be set if Strategy is also set.", } func (LeaseSpec) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/coordination/v1alpha2/generated.proto b/vendor/k8s.io/api/coordination/v1alpha2/generated.proto index 379fcf0d5d..7e1c0e0efa 100644 --- a/vendor/k8s.io/api/coordination/v1alpha2/generated.proto +++ b/vendor/k8s.io/api/coordination/v1alpha2/generated.proto @@ -32,6 +32,7 @@ option go_package = "k8s.io/api/coordination/v1alpha2"; // LeaseCandidate defines a candidate for a Lease object. // Candidates are created such that coordinated leader election will pick the best leader from the list of candidates. message LeaseCandidate { + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -55,19 +56,19 @@ message LeaseCandidateList { // LeaseCandidateSpec is a specification of a Lease. message LeaseCandidateSpec { - // LeaseName is the name of the lease for which this candidate is contending. + // leaseName is the name of the lease for which this candidate is contending. // This field is immutable. // +required optional string leaseName = 1; - // PingTime is the last time that the server has requested the LeaseCandidate + // pingTime is the last time that the server has requested the LeaseCandidate // to renew. It is only done during leader election to check if any // LeaseCandidates have become ineligible. When PingTime is updated, the // LeaseCandidate will respond by updating RenewTime. // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime pingTime = 2; - // RenewTime is the time that the LeaseCandidate was last updated. + // renewTime is the time that the LeaseCandidate was last updated. // Any time a Lease needs to do leader election, the PingTime field // is updated to signal to the LeaseCandidate that they should update // the RenewTime. @@ -77,18 +78,18 @@ message LeaseCandidateSpec { // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime renewTime = 3; - // BinaryVersion is the binary version. It must be in a semver format without leading `v`. + // binaryVersion is the binary version. It must be in a semver format without leading `v`. // This field is required. // +required optional string binaryVersion = 4; - // EmulationVersion is the emulation version. It must be in a semver format without leading `v`. + // emulationVersion is the emulation version. It must be in a semver format without leading `v`. // EmulationVersion must be less than or equal to BinaryVersion. // This field is required when strategy is "OldestEmulationVersion" // +optional optional string emulationVersion = 5; - // Strategy is the strategy that coordinated leader election will use for picking the leader. + // strategy is the strategy that coordinated leader election will use for picking the leader. // If multiple candidates for the same Lease return different strategies, the strategy provided // by the candidate with the latest BinaryVersion will be used. If there is still conflict, // this is a user error and coordinated leader election will not operate the Lease until resolved. diff --git a/vendor/k8s.io/api/coordination/v1alpha2/types.go b/vendor/k8s.io/api/coordination/v1alpha2/types.go index f8a6d33af1..ff32ee16fb 100644 --- a/vendor/k8s.io/api/coordination/v1alpha2/types.go +++ b/vendor/k8s.io/api/coordination/v1alpha2/types.go @@ -28,7 +28,8 @@ import ( // LeaseCandidate defines a candidate for a Lease object. // Candidates are created such that coordinated leader election will pick the best leader from the list of candidates. type LeaseCandidate struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -41,17 +42,17 @@ type LeaseCandidate struct { // LeaseCandidateSpec is a specification of a Lease. type LeaseCandidateSpec struct { - // LeaseName is the name of the lease for which this candidate is contending. + // leaseName is the name of the lease for which this candidate is contending. // This field is immutable. // +required LeaseName string `json:"leaseName" protobuf:"bytes,1,name=leaseName"` - // PingTime is the last time that the server has requested the LeaseCandidate + // pingTime is the last time that the server has requested the LeaseCandidate // to renew. It is only done during leader election to check if any // LeaseCandidates have become ineligible. When PingTime is updated, the // LeaseCandidate will respond by updating RenewTime. // +optional PingTime *metav1.MicroTime `json:"pingTime,omitempty" protobuf:"bytes,2,opt,name=pingTime"` - // RenewTime is the time that the LeaseCandidate was last updated. + // renewTime is the time that the LeaseCandidate was last updated. // Any time a Lease needs to do leader election, the PingTime field // is updated to signal to the LeaseCandidate that they should update // the RenewTime. @@ -60,16 +61,16 @@ type LeaseCandidateSpec struct { // garbage collection for still active LeaseCandidates. // +optional RenewTime *metav1.MicroTime `json:"renewTime,omitempty" protobuf:"bytes,3,opt,name=renewTime"` - // BinaryVersion is the binary version. It must be in a semver format without leading `v`. + // binaryVersion is the binary version. It must be in a semver format without leading `v`. // This field is required. // +required BinaryVersion string `json:"binaryVersion" protobuf:"bytes,4,name=binaryVersion"` - // EmulationVersion is the emulation version. It must be in a semver format without leading `v`. + // emulationVersion is the emulation version. It must be in a semver format without leading `v`. // EmulationVersion must be less than or equal to BinaryVersion. // This field is required when strategy is "OldestEmulationVersion" // +optional EmulationVersion string `json:"emulationVersion,omitempty" protobuf:"bytes,5,opt,name=emulationVersion"` - // Strategy is the strategy that coordinated leader election will use for picking the leader. + // strategy is the strategy that coordinated leader election will use for picking the leader. // If multiple candidates for the same Lease return different strategies, the strategy provided // by the candidate with the latest BinaryVersion will be used. If there is still conflict, // this is a user error and coordinated leader election will not operate the Lease until resolved. @@ -82,7 +83,7 @@ type LeaseCandidateSpec struct { // LeaseCandidateList is a list of Lease objects. type LeaseCandidateList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional diff --git a/vendor/k8s.io/api/coordination/v1alpha2/types_swagger_doc_generated.go b/vendor/k8s.io/api/coordination/v1alpha2/types_swagger_doc_generated.go index f7e29849e4..2ab18a6f6b 100644 --- a/vendor/k8s.io/api/coordination/v1alpha2/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/coordination/v1alpha2/types_swagger_doc_generated.go @@ -29,7 +29,7 @@ package v1alpha2 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_LeaseCandidate = map[string]string{ "": "LeaseCandidate defines a candidate for a Lease object. Candidates are created such that coordinated leader election will pick the best leader from the list of candidates.", - "metadata": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec contains the specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", } @@ -49,12 +49,12 @@ func (LeaseCandidateList) SwaggerDoc() map[string]string { var map_LeaseCandidateSpec = map[string]string{ "": "LeaseCandidateSpec is a specification of a Lease.", - "leaseName": "LeaseName is the name of the lease for which this candidate is contending. This field is immutable.", - "pingTime": "PingTime is the last time that the server has requested the LeaseCandidate to renew. It is only done during leader election to check if any LeaseCandidates have become ineligible. When PingTime is updated, the LeaseCandidate will respond by updating RenewTime.", - "renewTime": "RenewTime is the time that the LeaseCandidate was last updated. Any time a Lease needs to do leader election, the PingTime field is updated to signal to the LeaseCandidate that they should update the RenewTime. Old LeaseCandidate objects are also garbage collected if it has been hours since the last renew. The PingTime field is updated regularly to prevent garbage collection for still active LeaseCandidates.", - "binaryVersion": "BinaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required.", - "emulationVersion": "EmulationVersion is the emulation version. It must be in a semver format without leading `v`. EmulationVersion must be less than or equal to BinaryVersion. This field is required when strategy is \"OldestEmulationVersion\"", - "strategy": "Strategy is the strategy that coordinated leader election will use for picking the leader. If multiple candidates for the same Lease return different strategies, the strategy provided by the candidate with the latest BinaryVersion will be used. If there is still conflict, this is a user error and coordinated leader election will not operate the Lease until resolved.", + "leaseName": "leaseName is the name of the lease for which this candidate is contending. This field is immutable.", + "pingTime": "pingTime is the last time that the server has requested the LeaseCandidate to renew. It is only done during leader election to check if any LeaseCandidates have become ineligible. When PingTime is updated, the LeaseCandidate will respond by updating RenewTime.", + "renewTime": "renewTime is the time that the LeaseCandidate was last updated. Any time a Lease needs to do leader election, the PingTime field is updated to signal to the LeaseCandidate that they should update the RenewTime. Old LeaseCandidate objects are also garbage collected if it has been hours since the last renew. The PingTime field is updated regularly to prevent garbage collection for still active LeaseCandidates.", + "binaryVersion": "binaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required.", + "emulationVersion": "emulationVersion is the emulation version. It must be in a semver format without leading `v`. EmulationVersion must be less than or equal to BinaryVersion. This field is required when strategy is \"OldestEmulationVersion\"", + "strategy": "strategy is the strategy that coordinated leader election will use for picking the leader. If multiple candidates for the same Lease return different strategies, the strategy provided by the candidate with the latest BinaryVersion will be used. If there is still conflict, this is a user error and coordinated leader election will not operate the Lease until resolved.", } func (LeaseCandidateSpec) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/coordination/v1beta1/generated.proto b/vendor/k8s.io/api/coordination/v1beta1/generated.proto index 74df40c64f..510b230f79 100644 --- a/vendor/k8s.io/api/coordination/v1beta1/generated.proto +++ b/vendor/k8s.io/api/coordination/v1beta1/generated.proto @@ -31,6 +31,7 @@ option go_package = "k8s.io/api/coordination/v1beta1"; // Lease defines a lease concept. message Lease { + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -44,6 +45,7 @@ message Lease { // LeaseCandidate defines a candidate for a Lease object. // Candidates are created such that coordinated leader election will pick the best leader from the list of candidates. message LeaseCandidate { + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -67,21 +69,21 @@ message LeaseCandidateList { // LeaseCandidateSpec is a specification of a Lease. message LeaseCandidateSpec { - // LeaseName is the name of the lease for which this candidate is contending. + // leaseName is the name of the lease for which this candidate is contending. // The limits on this field are the same as on Lease.name. Multiple lease candidates // may reference the same Lease.name. // This field is immutable. // +required optional string leaseName = 1; - // PingTime is the last time that the server has requested the LeaseCandidate + // pingTime is the last time that the server has requested the LeaseCandidate // to renew. It is only done during leader election to check if any // LeaseCandidates have become ineligible. When PingTime is updated, the // LeaseCandidate will respond by updating RenewTime. // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime pingTime = 2; - // RenewTime is the time that the LeaseCandidate was last updated. + // renewTime is the time that the LeaseCandidate was last updated. // Any time a Lease needs to do leader election, the PingTime field // is updated to signal to the LeaseCandidate that they should update // the RenewTime. @@ -91,18 +93,18 @@ message LeaseCandidateSpec { // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime renewTime = 3; - // BinaryVersion is the binary version. It must be in a semver format without leading `v`. + // binaryVersion is the binary version. It must be in a semver format without leading `v`. // This field is required. // +required optional string binaryVersion = 4; - // EmulationVersion is the emulation version. It must be in a semver format without leading `v`. + // emulationVersion is the emulation version. It must be in a semver format without leading `v`. // EmulationVersion must be less than or equal to BinaryVersion. // This field is required when strategy is "OldestEmulationVersion" // +optional optional string emulationVersion = 5; - // Strategy is the strategy that coordinated leader election will use for picking the leader. + // strategy is the strategy that coordinated leader election will use for picking the leader. // If multiple candidates for the same Lease return different strategies, the strategy provided // by the candidate with the latest BinaryVersion will be used. If there is still conflict, // this is a user error and coordinated leader election will not operate the Lease until resolved. @@ -149,13 +151,13 @@ message LeaseSpec { // +optional optional int32 leaseTransitions = 5; - // Strategy indicates the strategy for picking the leader for coordinated leader election + // strategy indicates the strategy for picking the leader for coordinated leader election. // (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled. // +featureGate=CoordinatedLeaderElection // +optional optional string strategy = 6; - // PreferredHolder signals to a lease holder that the lease has a + // preferredHolder signals to a lease holder that the lease has a // more optimal holder and should be given up. // +featureGate=CoordinatedLeaderElection // +optional diff --git a/vendor/k8s.io/api/coordination/v1beta1/types.go b/vendor/k8s.io/api/coordination/v1beta1/types.go index ba6d6aa095..3141d7062a 100644 --- a/vendor/k8s.io/api/coordination/v1beta1/types.go +++ b/vendor/k8s.io/api/coordination/v1beta1/types.go @@ -29,7 +29,8 @@ import ( // Lease defines a lease concept. type Lease struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -63,12 +64,12 @@ type LeaseSpec struct { // holders. // +optional LeaseTransitions *int32 `json:"leaseTransitions,omitempty" protobuf:"varint,5,opt,name=leaseTransitions"` - // Strategy indicates the strategy for picking the leader for coordinated leader election + // strategy indicates the strategy for picking the leader for coordinated leader election. // (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled. // +featureGate=CoordinatedLeaderElection // +optional Strategy *v1.CoordinatedLeaseStrategy `json:"strategy,omitempty" protobuf:"bytes,6,opt,name=strategy"` - // PreferredHolder signals to a lease holder that the lease has a + // preferredHolder signals to a lease holder that the lease has a // more optimal holder and should be given up. // +featureGate=CoordinatedLeaderElection // +optional @@ -82,7 +83,7 @@ type LeaseSpec struct { // LeaseList is a list of Lease objects. type LeaseList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -99,7 +100,8 @@ type LeaseList struct { // LeaseCandidate defines a candidate for a Lease object. // Candidates are created such that coordinated leader election will pick the best leader from the list of candidates. type LeaseCandidate struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -112,19 +114,19 @@ type LeaseCandidate struct { // LeaseCandidateSpec is a specification of a Lease. type LeaseCandidateSpec struct { - // LeaseName is the name of the lease for which this candidate is contending. + // leaseName is the name of the lease for which this candidate is contending. // The limits on this field are the same as on Lease.name. Multiple lease candidates // may reference the same Lease.name. // This field is immutable. // +required LeaseName string `json:"leaseName" protobuf:"bytes,1,name=leaseName"` - // PingTime is the last time that the server has requested the LeaseCandidate + // pingTime is the last time that the server has requested the LeaseCandidate // to renew. It is only done during leader election to check if any // LeaseCandidates have become ineligible. When PingTime is updated, the // LeaseCandidate will respond by updating RenewTime. // +optional PingTime *metav1.MicroTime `json:"pingTime,omitempty" protobuf:"bytes,2,opt,name=pingTime"` - // RenewTime is the time that the LeaseCandidate was last updated. + // renewTime is the time that the LeaseCandidate was last updated. // Any time a Lease needs to do leader election, the PingTime field // is updated to signal to the LeaseCandidate that they should update // the RenewTime. @@ -133,16 +135,16 @@ type LeaseCandidateSpec struct { // garbage collection for still active LeaseCandidates. // +optional RenewTime *metav1.MicroTime `json:"renewTime,omitempty" protobuf:"bytes,3,opt,name=renewTime"` - // BinaryVersion is the binary version. It must be in a semver format without leading `v`. + // binaryVersion is the binary version. It must be in a semver format without leading `v`. // This field is required. // +required BinaryVersion string `json:"binaryVersion" protobuf:"bytes,4,name=binaryVersion"` - // EmulationVersion is the emulation version. It must be in a semver format without leading `v`. + // emulationVersion is the emulation version. It must be in a semver format without leading `v`. // EmulationVersion must be less than or equal to BinaryVersion. // This field is required when strategy is "OldestEmulationVersion" // +optional EmulationVersion string `json:"emulationVersion,omitempty" protobuf:"bytes,5,opt,name=emulationVersion"` - // Strategy is the strategy that coordinated leader election will use for picking the leader. + // strategy is the strategy that coordinated leader election will use for picking the leader. // If multiple candidates for the same Lease return different strategies, the strategy provided // by the candidate with the latest BinaryVersion will be used. If there is still conflict, // this is a user error and coordinated leader election will not operate the Lease until resolved. @@ -155,7 +157,7 @@ type LeaseCandidateSpec struct { // LeaseCandidateList is a list of Lease objects. type LeaseCandidateList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional diff --git a/vendor/k8s.io/api/coordination/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/coordination/v1beta1/types_swagger_doc_generated.go index 35812b77f3..c4297c5698 100644 --- a/vendor/k8s.io/api/coordination/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/coordination/v1beta1/types_swagger_doc_generated.go @@ -29,7 +29,7 @@ package v1beta1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_Lease = map[string]string{ "": "Lease defines a lease concept.", - "metadata": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec contains the specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", } @@ -39,7 +39,7 @@ func (Lease) SwaggerDoc() map[string]string { var map_LeaseCandidate = map[string]string{ "": "LeaseCandidate defines a candidate for a Lease object. Candidates are created such that coordinated leader election will pick the best leader from the list of candidates.", - "metadata": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec contains the specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", } @@ -59,12 +59,12 @@ func (LeaseCandidateList) SwaggerDoc() map[string]string { var map_LeaseCandidateSpec = map[string]string{ "": "LeaseCandidateSpec is a specification of a Lease.", - "leaseName": "LeaseName is the name of the lease for which this candidate is contending. The limits on this field are the same as on Lease.name. Multiple lease candidates may reference the same Lease.name. This field is immutable.", - "pingTime": "PingTime is the last time that the server has requested the LeaseCandidate to renew. It is only done during leader election to check if any LeaseCandidates have become ineligible. When PingTime is updated, the LeaseCandidate will respond by updating RenewTime.", - "renewTime": "RenewTime is the time that the LeaseCandidate was last updated. Any time a Lease needs to do leader election, the PingTime field is updated to signal to the LeaseCandidate that they should update the RenewTime. Old LeaseCandidate objects are also garbage collected if it has been hours since the last renew. The PingTime field is updated regularly to prevent garbage collection for still active LeaseCandidates.", - "binaryVersion": "BinaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required.", - "emulationVersion": "EmulationVersion is the emulation version. It must be in a semver format without leading `v`. EmulationVersion must be less than or equal to BinaryVersion. This field is required when strategy is \"OldestEmulationVersion\"", - "strategy": "Strategy is the strategy that coordinated leader election will use for picking the leader. If multiple candidates for the same Lease return different strategies, the strategy provided by the candidate with the latest BinaryVersion will be used. If there is still conflict, this is a user error and coordinated leader election will not operate the Lease until resolved.", + "leaseName": "leaseName is the name of the lease for which this candidate is contending. The limits on this field are the same as on Lease.name. Multiple lease candidates may reference the same Lease.name. This field is immutable.", + "pingTime": "pingTime is the last time that the server has requested the LeaseCandidate to renew. It is only done during leader election to check if any LeaseCandidates have become ineligible. When PingTime is updated, the LeaseCandidate will respond by updating RenewTime.", + "renewTime": "renewTime is the time that the LeaseCandidate was last updated. Any time a Lease needs to do leader election, the PingTime field is updated to signal to the LeaseCandidate that they should update the RenewTime. Old LeaseCandidate objects are also garbage collected if it has been hours since the last renew. The PingTime field is updated regularly to prevent garbage collection for still active LeaseCandidates.", + "binaryVersion": "binaryVersion is the binary version. It must be in a semver format without leading `v`. This field is required.", + "emulationVersion": "emulationVersion is the emulation version. It must be in a semver format without leading `v`. EmulationVersion must be less than or equal to BinaryVersion. This field is required when strategy is \"OldestEmulationVersion\"", + "strategy": "strategy is the strategy that coordinated leader election will use for picking the leader. If multiple candidates for the same Lease return different strategies, the strategy provided by the candidate with the latest BinaryVersion will be used. If there is still conflict, this is a user error and coordinated leader election will not operate the Lease until resolved.", } func (LeaseCandidateSpec) SwaggerDoc() map[string]string { @@ -88,8 +88,8 @@ var map_LeaseSpec = map[string]string{ "acquireTime": "acquireTime is a time when the current lease was acquired.", "renewTime": "renewTime is a time when the current holder of a lease has last updated the lease.", "leaseTransitions": "leaseTransitions is the number of transitions of a lease between holders.", - "strategy": "Strategy indicates the strategy for picking the leader for coordinated leader election (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.", - "preferredHolder": "PreferredHolder signals to a lease holder that the lease has a more optimal holder and should be given up.", + "strategy": "strategy indicates the strategy for picking the leader for coordinated leader election. (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.", + "preferredHolder": "preferredHolder signals to a lease holder that the lease has a more optimal holder and should be given up.", } func (LeaseSpec) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/core/v1/generated.pb.go b/vendor/k8s.io/api/core/v1/generated.pb.go index 0fcbd5edf7..41bf20df28 100644 --- a/vendor/k8s.io/api/core/v1/generated.pb.go +++ b/vendor/k8s.io/api/core/v1/generated.pb.go @@ -158,6 +158,8 @@ func (m *EventSeries) Reset() { *m = EventSeries{} } func (m *EventSource) Reset() { *m = EventSource{} } +func (m *EvictionResponder) Reset() { *m = EvictionResponder{} } + func (m *ExecAction) Reset() { *m = ExecAction{} } func (m *FCVolumeSource) Reset() { *m = FCVolumeSource{} } @@ -244,6 +246,10 @@ func (m *NodeAddress) Reset() { *m = NodeAddress{} } func (m *NodeAffinity) Reset() { *m = NodeAffinity{} } +func (m *NodeAllocatableMappedResources) Reset() { *m = NodeAllocatableMappedResources{} } + +func (m *NodeAllocatableOverheadResources) Reset() { *m = NodeAllocatableOverheadResources{} } + func (m *NodeAllocatableResourceClaimStatus) Reset() { *m = NodeAllocatableResourceClaimStatus{} } func (m *NodeCondition) Reset() { *m = NodeCondition{} } @@ -258,6 +264,8 @@ func (m *NodeFeatures) Reset() { *m = NodeFeatures{} } func (m *NodeList) Reset() { *m = NodeList{} } +func (m *NodePodPreemptionPolicy) Reset() { *m = NodePodPreemptionPolicy{} } + func (m *NodeProxyOptions) Reset() { *m = NodeProxyOptions{} } func (m *NodeRuntimeHandler) Reset() { *m = NodeRuntimeHandler{} } @@ -360,14 +368,14 @@ func (m *PodSpec) Reset() { *m = PodSpec{} } func (m *PodStatus) Reset() { *m = PodStatus{} } -func (m *PodStatusResult) Reset() { *m = PodStatusResult{} } - func (m *PodTemplate) Reset() { *m = PodTemplate{} } func (m *PodTemplateList) Reset() { *m = PodTemplateList{} } func (m *PodTemplateSpec) Reset() { *m = PodTemplateSpec{} } +func (m *PodVolumeHealth) Reset() { *m = PodVolumeHealth{} } + func (m *PortStatus) Reset() { *m = PortStatus{} } func (m *PortworxVolumeSource) Reset() { *m = PortworxVolumeSource{} } @@ -498,6 +506,10 @@ func (m *Volume) Reset() { *m = Volume{} } func (m *VolumeDevice) Reset() { *m = VolumeDevice{} } +func (m *VolumeHealthCondition) Reset() { *m = VolumeHealthCondition{} } + +func (m *VolumeHealthStatus) Reset() { *m = VolumeHealthStatus{} } + func (m *VolumeMount) Reset() { *m = VolumeMount{} } func (m *VolumeMountStatus) Reset() { *m = VolumeMountStatus{} } @@ -1462,6 +1474,11 @@ func (m *ClusterTrustBundleProjection) MarshalToSizedBuffer(dAtA []byte) (int, e _ = i var l int _ = l + if m.User != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.User)) + i-- + dAtA[i] = 0x30 + } if m.Optional != nil { i-- if *m.Optional { @@ -1999,6 +2016,11 @@ func (m *ConfigMapVolumeSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.DefaultUser != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.DefaultUser)) + i-- + dAtA[i] = 0x28 + } if m.Optional != nil { i-- if *m.Optional { @@ -3035,6 +3057,11 @@ func (m *DownwardAPIVolumeFile) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.User != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.User)) + i-- + dAtA[i] = 0x28 + } if m.Mode != nil { i = encodeVarintGenerated(dAtA, i, uint64(*m.Mode)) i-- @@ -3092,6 +3119,11 @@ func (m *DownwardAPIVolumeSource) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + if m.DefaultUser != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.DefaultUser)) + i-- + dAtA[i] = 0x18 + } if m.DefaultMode != nil { i = encodeVarintGenerated(dAtA, i, uint64(*m.DefaultMode)) i-- @@ -3134,6 +3166,11 @@ func (m *EmptyDirVolumeSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Mode != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Mode)) + i-- + dAtA[i] = 0x18 + } if m.SizeLimit != nil { { size, err := m.SizeLimit.MarshalToSizedBuffer(dAtA[:i]) @@ -4207,6 +4244,39 @@ func (m *EventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *EvictionResponder) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EvictionResponder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EvictionResponder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Priority != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Priority)) + i-- + dAtA[i] = 0x10 + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *ExecAction) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -4597,6 +4667,13 @@ func (m *GRPCAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Mode != nil { + i -= len(*m.Mode) + copy(dAtA[i:], *m.Mode) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Mode))) + i-- + dAtA[i] = 0x1a + } if m.Service != nil { i -= len(*m.Service) copy(dAtA[i:], *m.Service) @@ -4757,6 +4834,13 @@ func (m *HTTPGetAction) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Protocol != nil { + i -= len(*m.Protocol) + copy(dAtA[i:], *m.Protocol) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Protocol))) + i-- + dAtA[i] = 0x32 + } if len(m.HTTPHeaders) > 0 { for iNdEx := len(m.HTTPHeaders) - 1; iNdEx >= 0; iNdEx-- { { @@ -5209,6 +5293,11 @@ func (m *KeyToPath) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.User != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.User)) + i-- + dAtA[i] = 0x20 + } if m.Mode != nil { i = encodeVarintGenerated(dAtA, i, uint64(*m.Mode)) i-- @@ -6325,6 +6414,98 @@ func (m *NodeAffinity) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *NodeAllocatableMappedResources) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NodeAllocatableMappedResources) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeAllocatableMappedResources) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Quantity != nil { + { + size, err := m.Quantity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *NodeAllocatableOverheadResources) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NodeAllocatableOverheadResources) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeAllocatableOverheadResources) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PerContainer != nil { + { + size, err := m.PerContainer.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.PerPod != nil { + { + size, err := m.PerPod.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *NodeAllocatableResourceClaimStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -6345,17 +6526,10 @@ func (m *NodeAllocatableResourceClaimStatus) MarshalToSizedBuffer(dAtA []byte) ( _ = i var l int _ = l - if len(m.Resources) > 0 { - keysForResources := make([]string, 0, len(m.Resources)) - for k := range m.Resources { - keysForResources = append(keysForResources, string(k)) - } - sort.Strings(keysForResources) - for iNdEx := len(keysForResources) - 1; iNdEx >= 0; iNdEx-- { - v := m.Resources[ResourceName(keysForResources[iNdEx])] - baseI := i + if len(m.Overhead) > 0 { + for iNdEx := len(m.Overhead) - 1; iNdEx >= 0; iNdEx-- { { - size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Overhead[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -6363,15 +6537,21 @@ func (m *NodeAllocatableResourceClaimStatus) MarshalToSizedBuffer(dAtA []byte) ( i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 - i -= len(keysForResources[iNdEx]) - copy(dAtA[i:], keysForResources[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(keysForResources[iNdEx]))) - i-- - dAtA[i] = 0xa - i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + dAtA[i] = 0x2a + } + } + if len(m.Mapping) > 0 { + for iNdEx := len(m.Mapping) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Mapping[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } } if len(m.Containers) > 0 { @@ -6666,6 +6846,38 @@ func (m *NodeList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *NodePodPreemptionPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NodePodPreemptionPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodePodPreemptionPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DisableResizePreemption) > 0 { + for iNdEx := len(m.DisableResizePreemption) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DisableResizePreemption[iNdEx]) + copy(dAtA[i:], m.DisableResizePreemption[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DisableResizePreemption[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *NodeProxyOptions) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -6927,6 +7139,18 @@ func (m *NodeSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.PodPreemptionPolicy != nil { + { + size, err := m.PodPreemptionPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } if len(m.PodCIDRs) > 0 { for iNdEx := len(m.PodCIDRs) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.PodCIDRs[iNdEx]) @@ -7254,6 +7478,16 @@ func (m *NodeSystemInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.RunningInUserNamespace != nil { + i-- + if *m.RunningInUserNamespace { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } if m.Swap != nil { { size, err := m.Swap.MarshalToSizedBuffer(dAtA[:i]) @@ -7750,6 +7984,18 @@ func (m *PersistentVolumeClaimStatus) MarshalToSizedBuffer(dAtA []byte) (int, er _ = i var l int _ = l + if m.HealthStatus != nil { + { + size, err := m.HealthStatus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } if m.ModifyVolumeStatus != nil { { size, err := m.ModifyVolumeStatus.MarshalToSizedBuffer(dAtA[:i]) @@ -8834,6 +9080,11 @@ func (m *PodCertificateProjection) MarshalToSizedBuffer(dAtA []byte) (int, error _ = i var l int _ = l + if m.User != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.User)) + i-- + dAtA[i] = 0x40 + } if len(m.UserAnnotations) > 0 { keysForUserAnnotations := make([]string, 0, len(m.UserAnnotations)) for k := range m.UserAnnotations { @@ -9769,6 +10020,22 @@ func (m *PodSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.EvictionResponders) > 0 { + for iNdEx := len(m.EvictionResponders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.EvictionResponders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xe2 + } + } if m.SchedulingGroup != nil { { size, err := m.SchedulingGroup.MarshalToSizedBuffer(dAtA[:i]) @@ -10280,6 +10547,22 @@ func (m *PodStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.VolumeHealth) > 0 { + for iNdEx := len(m.VolumeHealth) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.VolumeHealth[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + } if len(m.NodeAllocatableResourceClaimStatuses) > 0 { for iNdEx := len(m.NodeAllocatableResourceClaimStatuses) - 1; iNdEx >= 0; iNdEx-- { { @@ -10515,49 +10798,6 @@ func (m *PodStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *PodStatusResult) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PodStatusResult) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PodStatusResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func (m *PodTemplate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -10691,6 +10931,58 @@ func (m *PodTemplateSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *PodVolumeHealth) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodVolumeHealth) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodVolumeHealth) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.LastTransitionTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.HealthConditions) > 0 { + for iNdEx := len(m.HealthConditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.HealthConditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *PortStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -11033,6 +11325,11 @@ func (m *ProjectedVolumeSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.DefaultUser != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.DefaultUser)) + i-- + dAtA[i] = 0x18 + } if m.DefaultMode != nil { i = encodeVarintGenerated(dAtA, i, uint64(*m.DefaultMode)) i-- @@ -12764,6 +13061,11 @@ func (m *SecretVolumeSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.DefaultUser != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.DefaultUser)) + i-- + dAtA[i] = 0x28 + } if m.Optional != nil { i-- if *m.Optional { @@ -13165,6 +13467,11 @@ func (m *ServiceAccountTokenProjection) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l + if m.User != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.User)) + i-- + dAtA[i] = 0x20 + } i -= len(m.Path) copy(dAtA[i:], m.Path) i = encodeVarintGenerated(dAtA, i, uint64(len(m.Path))) @@ -14217,6 +14524,91 @@ func (m *VolumeDevice) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *VolumeHealthCondition) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VolumeHealthCondition) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VolumeHealthCondition) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x1a + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0x12 + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *VolumeHealthStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VolumeHealthStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VolumeHealthStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.LastTransitionTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.HealthConditions) > 0 { + for iNdEx := len(m.HealthConditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.HealthConditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *VolumeMount) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -14237,6 +14629,15 @@ func (m *VolumeMount) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.BindMountOptions) > 0 { + for iNdEx := len(m.BindMountOptions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.BindMountOptions[iNdEx]) + copy(dAtA[i:], m.BindMountOptions[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.BindMountOptions[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } if m.RecursiveReadOnly != nil { i -= len(*m.RecursiveReadOnly) copy(dAtA[i:], *m.RecursiveReadOnly) @@ -15515,6 +15916,9 @@ func (m *ClusterTrustBundleProjection) Size() (n int) { if m.Optional != nil { n += 2 } + if m.User != nil { + n += 1 + sovGenerated(uint64(*m.User)) + } return n } @@ -15709,6 +16113,9 @@ func (m *ConfigMapVolumeSource) Size() (n int) { if m.Optional != nil { n += 2 } + if m.DefaultUser != nil { + n += 1 + sovGenerated(uint64(*m.DefaultUser)) + } return n } @@ -16090,6 +16497,9 @@ func (m *DownwardAPIVolumeFile) Size() (n int) { if m.Mode != nil { n += 1 + sovGenerated(uint64(*m.Mode)) } + if m.User != nil { + n += 1 + sovGenerated(uint64(*m.User)) + } return n } @@ -16108,6 +16518,9 @@ func (m *DownwardAPIVolumeSource) Size() (n int) { if m.DefaultMode != nil { n += 1 + sovGenerated(uint64(*m.DefaultMode)) } + if m.DefaultUser != nil { + n += 1 + sovGenerated(uint64(*m.DefaultUser)) + } return n } @@ -16123,6 +16536,9 @@ func (m *EmptyDirVolumeSource) Size() (n int) { l = m.SizeLimit.Size() n += 1 + l + sovGenerated(uint64(l)) } + if m.Mode != nil { + n += 1 + sovGenerated(uint64(*m.Mode)) + } return n } @@ -16505,6 +16921,20 @@ func (m *EventSource) Size() (n int) { return n } +func (m *EvictionResponder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if m.Priority != nil { + n += 1 + sovGenerated(uint64(*m.Priority)) + } + return n +} + func (m *ExecAction) Size() (n int) { if m == nil { return 0 @@ -16656,6 +17086,10 @@ func (m *GRPCAction) Size() (n int) { l = len(*m.Service) n += 1 + l + sovGenerated(uint64(l)) } + if m.Mode != nil { + l = len(*m.Mode) + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -16726,6 +17160,10 @@ func (m *HTTPGetAction) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } + if m.Protocol != nil { + l = len(*m.Protocol) + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -16892,6 +17330,9 @@ func (m *KeyToPath) Size() (n int) { if m.Mode != nil { n += 1 + sovGenerated(uint64(*m.Mode)) } + if m.User != nil { + n += 1 + sovGenerated(uint64(*m.User)) + } return n } @@ -17296,6 +17737,40 @@ func (m *NodeAffinity) Size() (n int) { return n } +func (m *NodeAllocatableMappedResources) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if m.Quantity != nil { + l = m.Quantity.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NodeAllocatableOverheadResources) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if m.PerPod != nil { + l = m.PerPod.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.PerContainer != nil { + l = m.PerContainer.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + func (m *NodeAllocatableResourceClaimStatus) Size() (n int) { if m == nil { return 0 @@ -17310,13 +17785,16 @@ func (m *NodeAllocatableResourceClaimStatus) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } - if len(m.Resources) > 0 { - for k, v := range m.Resources { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + if len(m.Mapping) > 0 { + for _, e := range m.Mapping { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Overhead) > 0 { + for _, e := range m.Overhead { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) } } return n @@ -17419,6 +17897,21 @@ func (m *NodeList) Size() (n int) { return n } +func (m *NodePodPreemptionPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.DisableResizePreemption) > 0 { + for _, s := range m.DisableResizePreemption { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + func (m *NodeProxyOptions) Size() (n int) { if m == nil { return 0 @@ -17544,6 +18037,10 @@ func (m *NodeSpec) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } + if m.PodPreemptionPolicy != nil { + l = m.PodPreemptionPolicy.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -17672,6 +18169,9 @@ func (m *NodeSystemInfo) Size() (n int) { l = m.Swap.Size() n += 1 + l + sovGenerated(uint64(l)) } + if m.RunningInUserNamespace != nil { + n += 2 + } return n } @@ -17876,6 +18376,10 @@ func (m *PersistentVolumeClaimStatus) Size() (n int) { l = m.ModifyVolumeStatus.Size() n += 1 + l + sovGenerated(uint64(l)) } + if m.HealthStatus != nil { + l = m.HealthStatus.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -18238,6 +18742,9 @@ func (m *PodCertificateProjection) Size() (n int) { n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) } } + if m.User != nil { + n += 1 + sovGenerated(uint64(*m.User)) + } return n } @@ -18751,6 +19258,12 @@ func (m *PodSpec) Size() (n int) { l = m.SchedulingGroup.Size() n += 2 + l + sovGenerated(uint64(l)) } + if len(m.EvictionResponders) > 0 { + for _, e := range m.EvictionResponders { + l = e.Size() + n += 2 + l + sovGenerated(uint64(l)) + } + } return n } @@ -18846,19 +19359,12 @@ func (m *PodStatus) Size() (n int) { n += 2 + l + sovGenerated(uint64(l)) } } - return n -} - -func (m *PodStatusResult) Size() (n int) { - if m == nil { - return 0 + if len(m.VolumeHealth) > 0 { + for _, e := range m.VolumeHealth { + l = e.Size() + n += 2 + l + sovGenerated(uint64(l)) + } } - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Status.Size() - n += 1 + l + sovGenerated(uint64(l)) return n } @@ -18905,6 +19411,25 @@ func (m *PodTemplateSpec) Size() (n int) { return n } +func (m *PodVolumeHealth) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.HealthConditions) > 0 { + for _, e := range m.HealthConditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = m.LastTransitionTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m *PortStatus) Size() (n int) { if m == nil { return 0 @@ -19036,6 +19561,9 @@ func (m *ProjectedVolumeSource) Size() (n int) { if m.DefaultMode != nil { n += 1 + sovGenerated(uint64(*m.DefaultMode)) } + if m.DefaultUser != nil { + n += 1 + sovGenerated(uint64(*m.DefaultUser)) + } return n } @@ -19674,6 +20202,9 @@ func (m *SecretVolumeSource) Size() (n int) { if m.Optional != nil { n += 2 } + if m.DefaultUser != nil { + n += 1 + sovGenerated(uint64(*m.DefaultUser)) + } return n } @@ -19810,6 +20341,9 @@ func (m *ServiceAccountTokenProjection) Size() (n int) { } l = len(m.Path) n += 1 + l + sovGenerated(uint64(l)) + if m.User != nil { + n += 1 + sovGenerated(uint64(*m.User)) + } return n } @@ -20222,6 +20756,38 @@ func (m *VolumeDevice) Size() (n int) { return n } +func (m *VolumeHealthCondition) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Status) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Reason) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Message) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *VolumeHealthStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.HealthConditions) > 0 { + for _, e := range m.HealthConditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = m.LastTransitionTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m *VolumeMount) Size() (n int) { if m == nil { return 0 @@ -20245,6 +20811,12 @@ func (m *VolumeMount) Size() (n int) { l = len(*m.RecursiveReadOnly) n += 1 + l + sovGenerated(uint64(l)) } + if len(m.BindMountOptions) > 0 { + for _, s := range m.BindMountOptions { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -20797,6 +21369,7 @@ func (this *ClusterTrustBundleProjection) String() string { `LabelSelector:` + strings.Replace(fmt.Sprintf("%v", this.LabelSelector), "LabelSelector", "v1.LabelSelector", 1) + `,`, `Path:` + fmt.Sprintf("%v", this.Path) + `,`, `Optional:` + valueToStringGenerated(this.Optional) + `,`, + `User:` + valueToStringGenerated(this.User) + `,`, `}`, }, "") return s @@ -20963,6 +21536,7 @@ func (this *ConfigMapVolumeSource) String() string { `Items:` + repeatedStringForItems + `,`, `DefaultMode:` + valueToStringGenerated(this.DefaultMode) + `,`, `Optional:` + valueToStringGenerated(this.Optional) + `,`, + `DefaultUser:` + valueToStringGenerated(this.DefaultUser) + `,`, `}`, }, "") return s @@ -21243,6 +21817,7 @@ func (this *DownwardAPIVolumeFile) String() string { `FieldRef:` + strings.Replace(this.FieldRef.String(), "ObjectFieldSelector", "ObjectFieldSelector", 1) + `,`, `ResourceFieldRef:` + strings.Replace(this.ResourceFieldRef.String(), "ResourceFieldSelector", "ResourceFieldSelector", 1) + `,`, `Mode:` + valueToStringGenerated(this.Mode) + `,`, + `User:` + valueToStringGenerated(this.User) + `,`, `}`, }, "") return s @@ -21259,6 +21834,7 @@ func (this *DownwardAPIVolumeSource) String() string { s := strings.Join([]string{`&DownwardAPIVolumeSource{`, `Items:` + repeatedStringForItems + `,`, `DefaultMode:` + valueToStringGenerated(this.DefaultMode) + `,`, + `DefaultUser:` + valueToStringGenerated(this.DefaultUser) + `,`, `}`, }, "") return s @@ -21270,6 +21846,7 @@ func (this *EmptyDirVolumeSource) String() string { s := strings.Join([]string{`&EmptyDirVolumeSource{`, `Medium:` + fmt.Sprintf("%v", this.Medium) + `,`, `SizeLimit:` + strings.Replace(fmt.Sprintf("%v", this.SizeLimit), "Quantity", "resource.Quantity", 1) + `,`, + `Mode:` + valueToStringGenerated(this.Mode) + `,`, `}`, }, "") return s @@ -21549,6 +22126,17 @@ func (this *EventSource) String() string { }, "") return s } +func (this *EvictionResponder) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EvictionResponder{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Priority:` + valueToStringGenerated(this.Priority) + `,`, + `}`, + }, "") + return s +} func (this *ExecAction) String() string { if this == nil { return "nil" @@ -21665,6 +22253,7 @@ func (this *GRPCAction) String() string { s := strings.Join([]string{`&GRPCAction{`, `Port:` + fmt.Sprintf("%v", this.Port) + `,`, `Service:` + valueToStringGenerated(this.Service) + `,`, + `Mode:` + valueToStringGenerated(this.Mode) + `,`, `}`, }, "") return s @@ -21721,6 +22310,7 @@ func (this *HTTPGetAction) String() string { `Host:` + fmt.Sprintf("%v", this.Host) + `,`, `Scheme:` + fmt.Sprintf("%v", this.Scheme) + `,`, `HTTPHeaders:` + repeatedStringForHTTPHeaders + `,`, + `Protocol:` + valueToStringGenerated(this.Protocol) + `,`, `}`, }, "") return s @@ -21837,6 +22427,7 @@ func (this *KeyToPath) String() string { `Key:` + fmt.Sprintf("%v", this.Key) + `,`, `Path:` + fmt.Sprintf("%v", this.Path) + `,`, `Mode:` + valueToStringGenerated(this.Mode) + `,`, + `User:` + valueToStringGenerated(this.User) + `,`, `}`, }, "") return s @@ -22185,24 +22776,48 @@ func (this *NodeAffinity) String() string { }, "") return s } +func (this *NodeAllocatableMappedResources) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NodeAllocatableMappedResources{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Quantity:` + strings.Replace(fmt.Sprintf("%v", this.Quantity), "Quantity", "resource.Quantity", 1) + `,`, + `}`, + }, "") + return s +} +func (this *NodeAllocatableOverheadResources) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NodeAllocatableOverheadResources{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `PerPod:` + strings.Replace(fmt.Sprintf("%v", this.PerPod), "Quantity", "resource.Quantity", 1) + `,`, + `PerContainer:` + strings.Replace(fmt.Sprintf("%v", this.PerContainer), "Quantity", "resource.Quantity", 1) + `,`, + `}`, + }, "") + return s +} func (this *NodeAllocatableResourceClaimStatus) String() string { if this == nil { return "nil" } - keysForResources := make([]string, 0, len(this.Resources)) - for k := range this.Resources { - keysForResources = append(keysForResources, string(k)) + repeatedStringForMapping := "[]NodeAllocatableMappedResources{" + for _, f := range this.Mapping { + repeatedStringForMapping += strings.Replace(strings.Replace(f.String(), "NodeAllocatableMappedResources", "NodeAllocatableMappedResources", 1), `&`, ``, 1) + "," } - sort.Strings(keysForResources) - mapStringForResources := "map[ResourceName]resource.Quantity{" - for _, k := range keysForResources { - mapStringForResources += fmt.Sprintf("%v: %v,", k, this.Resources[ResourceName(k)]) + repeatedStringForMapping += "}" + repeatedStringForOverhead := "[]NodeAllocatableOverheadResources{" + for _, f := range this.Overhead { + repeatedStringForOverhead += strings.Replace(strings.Replace(f.String(), "NodeAllocatableOverheadResources", "NodeAllocatableOverheadResources", 1), `&`, ``, 1) + "," } - mapStringForResources += "}" + repeatedStringForOverhead += "}" s := strings.Join([]string{`&NodeAllocatableResourceClaimStatus{`, `ResourceClaimName:` + fmt.Sprintf("%v", this.ResourceClaimName) + `,`, `Containers:` + fmt.Sprintf("%v", this.Containers) + `,`, - `Resources:` + mapStringForResources + `,`, + `Mapping:` + repeatedStringForMapping + `,`, + `Overhead:` + repeatedStringForOverhead + `,`, `}`, }, "") return s @@ -22281,6 +22896,16 @@ func (this *NodeList) String() string { }, "") return s } +func (this *NodePodPreemptionPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NodePodPreemptionPolicy{`, + `DisableResizePreemption:` + fmt.Sprintf("%v", this.DisableResizePreemption) + `,`, + `}`, + }, "") + return s +} func (this *NodeProxyOptions) String() string { if this == nil { return "nil" @@ -22378,6 +23003,7 @@ func (this *NodeSpec) String() string { `Taints:` + repeatedStringForTaints + `,`, `ConfigSource:` + strings.Replace(this.ConfigSource.String(), "NodeConfigSource", "NodeConfigSource", 1) + `,`, `PodCIDRs:` + fmt.Sprintf("%v", this.PodCIDRs) + `,`, + `PodPreemptionPolicy:` + strings.Replace(this.PodPreemptionPolicy.String(), "NodePodPreemptionPolicy", "NodePodPreemptionPolicy", 1) + `,`, `}`, }, "") return s @@ -22476,6 +23102,7 @@ func (this *NodeSystemInfo) String() string { `OperatingSystem:` + fmt.Sprintf("%v", this.OperatingSystem) + `,`, `Architecture:` + fmt.Sprintf("%v", this.Architecture) + `,`, `Swap:` + strings.Replace(this.Swap.String(), "NodeSwapStatus", "NodeSwapStatus", 1) + `,`, + `RunningInUserNamespace:` + valueToStringGenerated(this.RunningInUserNamespace) + `,`, `}`, }, "") return s @@ -22628,6 +23255,7 @@ func (this *PersistentVolumeClaimStatus) String() string { `AllocatedResourceStatuses:` + mapStringForAllocatedResourceStatuses + `,`, `CurrentVolumeAttributesClassName:` + valueToStringGenerated(this.CurrentVolumeAttributesClassName) + `,`, `ModifyVolumeStatus:` + strings.Replace(this.ModifyVolumeStatus.String(), "ModifyVolumeStatus", "ModifyVolumeStatus", 1) + `,`, + `HealthStatus:` + strings.Replace(this.HealthStatus.String(), "VolumeHealthStatus", "VolumeHealthStatus", 1) + `,`, `}`, }, "") return s @@ -22859,6 +23487,7 @@ func (this *PodCertificateProjection) String() string { `KeyPath:` + fmt.Sprintf("%v", this.KeyPath) + `,`, `CertificateChainPath:` + fmt.Sprintf("%v", this.CertificateChainPath) + `,`, `UserAnnotations:` + mapStringForUserAnnotations + `,`, + `User:` + valueToStringGenerated(this.User) + `,`, `}`, }, "") return s @@ -23162,6 +23791,11 @@ func (this *PodSpec) String() string { repeatedStringForResourceClaims += strings.Replace(strings.Replace(f.String(), "PodResourceClaim", "PodResourceClaim", 1), `&`, ``, 1) + "," } repeatedStringForResourceClaims += "}" + repeatedStringForEvictionResponders := "[]EvictionResponder{" + for _, f := range this.EvictionResponders { + repeatedStringForEvictionResponders += strings.Replace(strings.Replace(f.String(), "EvictionResponder", "EvictionResponder", 1), `&`, ``, 1) + "," + } + repeatedStringForEvictionResponders += "}" keysForNodeSelector := make([]string, 0, len(this.NodeSelector)) for k := range this.NodeSelector { keysForNodeSelector = append(keysForNodeSelector, k) @@ -23225,6 +23859,7 @@ func (this *PodSpec) String() string { `Resources:` + strings.Replace(this.Resources.String(), "ResourceRequirements", "ResourceRequirements", 1) + `,`, `HostnameOverride:` + valueToStringGenerated(this.HostnameOverride) + `,`, `SchedulingGroup:` + strings.Replace(this.SchedulingGroup.String(), "PodSchedulingGroup", "PodSchedulingGroup", 1) + `,`, + `EvictionResponders:` + repeatedStringForEvictionResponders + `,`, `}`, }, "") return s @@ -23273,6 +23908,11 @@ func (this *PodStatus) String() string { repeatedStringForNodeAllocatableResourceClaimStatuses += strings.Replace(strings.Replace(f.String(), "NodeAllocatableResourceClaimStatus", "NodeAllocatableResourceClaimStatus", 1), `&`, ``, 1) + "," } repeatedStringForNodeAllocatableResourceClaimStatuses += "}" + repeatedStringForVolumeHealth := "[]PodVolumeHealth{" + for _, f := range this.VolumeHealth { + repeatedStringForVolumeHealth += strings.Replace(strings.Replace(f.String(), "PodVolumeHealth", "PodVolumeHealth", 1), `&`, ``, 1) + "," + } + repeatedStringForVolumeHealth += "}" keysForAllocatedResources := make([]string, 0, len(this.AllocatedResources)) for k := range this.AllocatedResources { keysForAllocatedResources = append(keysForAllocatedResources, string(k)) @@ -23305,17 +23945,7 @@ func (this *PodStatus) String() string { `AllocatedResources:` + mapStringForAllocatedResources + `,`, `Resources:` + strings.Replace(this.Resources.String(), "ResourceRequirements", "ResourceRequirements", 1) + `,`, `NodeAllocatableResourceClaimStatuses:` + repeatedStringForNodeAllocatableResourceClaimStatuses + `,`, - `}`, - }, "") - return s -} -func (this *PodStatusResult) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PodStatusResult{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "PodStatus", "PodStatus", 1), `&`, ``, 1) + `,`, + `VolumeHealth:` + repeatedStringForVolumeHealth + `,`, `}`, }, "") return s @@ -23358,6 +23988,23 @@ func (this *PodTemplateSpec) String() string { }, "") return s } +func (this *PodVolumeHealth) String() string { + if this == nil { + return "nil" + } + repeatedStringForHealthConditions := "[]VolumeHealthCondition{" + for _, f := range this.HealthConditions { + repeatedStringForHealthConditions += strings.Replace(strings.Replace(f.String(), "VolumeHealthCondition", "VolumeHealthCondition", 1), `&`, ``, 1) + "," + } + repeatedStringForHealthConditions += "}" + s := strings.Join([]string{`&PodVolumeHealth{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `HealthConditions:` + repeatedStringForHealthConditions + `,`, + `LastTransitionTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastTransitionTime), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} func (this *PortStatus) String() string { if this == nil { return "nil" @@ -23457,6 +24104,7 @@ func (this *ProjectedVolumeSource) String() string { s := strings.Join([]string{`&ProjectedVolumeSource{`, `Sources:` + repeatedStringForSources + `,`, `DefaultMode:` + valueToStringGenerated(this.DefaultMode) + `,`, + `DefaultUser:` + valueToStringGenerated(this.DefaultUser) + `,`, `}`, }, "") return s @@ -23980,6 +24628,7 @@ func (this *SecretVolumeSource) String() string { `Items:` + repeatedStringForItems + `,`, `DefaultMode:` + valueToStringGenerated(this.DefaultMode) + `,`, `Optional:` + valueToStringGenerated(this.Optional) + `,`, + `DefaultUser:` + valueToStringGenerated(this.DefaultUser) + `,`, `}`, }, "") return s @@ -24074,6 +24723,7 @@ func (this *ServiceAccountTokenProjection) String() string { `Audience:` + fmt.Sprintf("%v", this.Audience) + `,`, `ExpirationSeconds:` + valueToStringGenerated(this.ExpirationSeconds) + `,`, `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `User:` + valueToStringGenerated(this.User) + `,`, `}`, }, "") return s @@ -24366,6 +25016,34 @@ func (this *VolumeDevice) String() string { }, "") return s } +func (this *VolumeHealthCondition) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&VolumeHealthCondition{`, + `Status:` + fmt.Sprintf("%v", this.Status) + `,`, + `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, + `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + `}`, + }, "") + return s +} +func (this *VolumeHealthStatus) String() string { + if this == nil { + return "nil" + } + repeatedStringForHealthConditions := "[]VolumeHealthCondition{" + for _, f := range this.HealthConditions { + repeatedStringForHealthConditions += strings.Replace(strings.Replace(f.String(), "VolumeHealthCondition", "VolumeHealthCondition", 1), `&`, ``, 1) + "," + } + repeatedStringForHealthConditions += "}" + s := strings.Join([]string{`&VolumeHealthStatus{`, + `HealthConditions:` + repeatedStringForHealthConditions + `,`, + `LastTransitionTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastTransitionTime), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} func (this *VolumeMount) String() string { if this == nil { return "nil" @@ -24378,6 +25056,7 @@ func (this *VolumeMount) String() string { `MountPropagation:` + valueToStringGenerated(this.MountPropagation) + `,`, `SubPathExpr:` + fmt.Sprintf("%v", this.SubPathExpr) + `,`, `RecursiveReadOnly:` + valueToStringGenerated(this.RecursiveReadOnly) + `,`, + `BindMountOptions:` + fmt.Sprintf("%v", this.BindMountOptions) + `,`, `}`, }, "") return s @@ -27769,6 +28448,26 @@ func (m *ClusterTrustBundleProjection) Unmarshal(dAtA []byte) error { } b := bool(v != 0) m.Optional = &b + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.User = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -29403,6 +30102,26 @@ func (m *ConfigMapVolumeSource) Unmarshal(dAtA []byte) error { } b := bool(v != 0) m.Optional = &b + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultUser", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DefaultUser = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -32698,6 +33417,26 @@ func (m *DownwardAPIVolumeFile) Unmarshal(dAtA []byte) error { } } m.Mode = &v + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.User = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -32802,6 +33541,26 @@ func (m *DownwardAPIVolumeSource) Unmarshal(dAtA []byte) error { } } m.DefaultMode = &v + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultUser", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DefaultUser = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -32920,6 +33679,26 @@ func (m *EmptyDirVolumeSource) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Mode = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -36125,6 +36904,108 @@ func (m *EventSource) Unmarshal(dAtA []byte) error { } return nil } +func (m *EvictionResponder) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EvictionResponder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EvictionResponder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Priority = &v + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ExecAction) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -37502,6 +38383,39 @@ func (m *GRPCAction) Unmarshal(dAtA []byte) error { s := string(dAtA[iNdEx:postIndex]) m.Service = &s iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := GRPCProbeMode(dAtA[iNdEx:postIndex]) + m.Mode = &s + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -38162,6 +39076,39 @@ func (m *HTTPGetAction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := HTTPProtocol(dAtA[iNdEx:postIndex]) + m.Protocol = &s + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -39633,6 +40580,26 @@ func (m *KeyToPath) Unmarshal(dAtA []byte) error { } } m.Mode = &v + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.User = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -42489,8 +43456,206 @@ func (m *NamespaceList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, Namespace{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Items = append(m.Items, Namespace{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NamespaceSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NamespaceSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NamespaceSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Finalizers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Finalizers = append(m.Finalizers, FinalizerName(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NamespaceStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NamespaceStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NamespaceStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Phase", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Phase = NamespacePhase(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Conditions = append(m.Conditions, NamespaceCondition{}) + if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -42515,7 +43680,7 @@ func (m *NamespaceList) Unmarshal(dAtA []byte) error { } return nil } -func (m *NamespaceSpec) Unmarshal(dAtA []byte) error { +func (m *Node) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -42538,17 +43703,17 @@ func (m *NamespaceSpec) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: NamespaceSpec: wiretype end group for non-group") + return fmt.Errorf("proto: Node: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: NamespaceSpec: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Node: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Finalizers", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -42558,23 +43723,90 @@ func (m *NamespaceSpec) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Finalizers = append(m.Finalizers, FinalizerName(dAtA[iNdEx:postIndex])) + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -42597,7 +43829,7 @@ func (m *NamespaceSpec) Unmarshal(dAtA []byte) error { } return nil } -func (m *NamespaceStatus) Unmarshal(dAtA []byte) error { +func (m *NodeAddress) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -42620,15 +43852,15 @@ func (m *NamespaceStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: NamespaceStatus: wiretype end group for non-group") + return fmt.Errorf("proto: NodeAddress: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: NamespaceStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: NodeAddress: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Phase", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -42656,13 +43888,13 @@ func (m *NamespaceStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Phase = NamespacePhase(dAtA[iNdEx:postIndex]) + m.Type = NodeAddressType(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -42672,25 +43904,23 @@ func (m *NamespaceStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Conditions = append(m.Conditions, NamespaceCondition{}) - if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -42713,7 +43943,7 @@ func (m *NamespaceStatus) Unmarshal(dAtA []byte) error { } return nil } -func (m *Node) Unmarshal(dAtA []byte) error { +func (m *NodeAffinity) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -42736,15 +43966,15 @@ func (m *Node) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Node: wiretype end group for non-group") + return fmt.Errorf("proto: NodeAffinity: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Node: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: NodeAffinity: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RequiredDuringSchedulingIgnoredDuringExecution", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -42771,46 +44001,16 @@ func (m *Node) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF + if m.RequiredDuringSchedulingIgnoredDuringExecution == nil { + m.RequiredDuringSchedulingIgnoredDuringExecution = &NodeSelector{} } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.RequiredDuringSchedulingIgnoredDuringExecution.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PreferredDuringSchedulingIgnoredDuringExecution", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -42837,7 +44037,8 @@ func (m *Node) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.PreferredDuringSchedulingIgnoredDuringExecution = append(m.PreferredDuringSchedulingIgnoredDuringExecution, PreferredSchedulingTerm{}) + if err := m.PreferredDuringSchedulingIgnoredDuringExecution[len(m.PreferredDuringSchedulingIgnoredDuringExecution)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -42862,7 +44063,7 @@ func (m *Node) Unmarshal(dAtA []byte) error { } return nil } -func (m *NodeAddress) Unmarshal(dAtA []byte) error { +func (m *NodeAllocatableMappedResources) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -42885,15 +44086,15 @@ func (m *NodeAddress) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: NodeAddress: wiretype end group for non-group") + return fmt.Errorf("proto: NodeAllocatableMappedResources: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: NodeAddress: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: NodeAllocatableMappedResources: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -42921,13 +44122,13 @@ func (m *NodeAddress) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Type = NodeAddressType(dAtA[iNdEx:postIndex]) + m.Name = ResourceName(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -42937,23 +44138,27 @@ func (m *NodeAddress) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Address = string(dAtA[iNdEx:postIndex]) + if m.Quantity == nil { + m.Quantity = &resource.Quantity{} + } + if err := m.Quantity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -42976,7 +44181,7 @@ func (m *NodeAddress) Unmarshal(dAtA []byte) error { } return nil } -func (m *NodeAffinity) Unmarshal(dAtA []byte) error { +func (m *NodeAllocatableOverheadResources) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -42999,15 +44204,83 @@ func (m *NodeAffinity) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: NodeAffinity: wiretype end group for non-group") + return fmt.Errorf("proto: NodeAllocatableOverheadResources: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: NodeAffinity: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: NodeAllocatableOverheadResources: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequiredDuringSchedulingIgnoredDuringExecution", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = ResourceName(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PerPod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PerPod == nil { + m.PerPod = &resource.Quantity{} + } + if err := m.PerPod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PerContainer", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -43034,44 +44307,10 @@ func (m *NodeAffinity) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.RequiredDuringSchedulingIgnoredDuringExecution == nil { - m.RequiredDuringSchedulingIgnoredDuringExecution = &NodeSelector{} - } - if err := m.RequiredDuringSchedulingIgnoredDuringExecution.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PreferredDuringSchedulingIgnoredDuringExecution", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF + if m.PerContainer == nil { + m.PerContainer = &resource.Quantity{} } - m.PreferredDuringSchedulingIgnoredDuringExecution = append(m.PreferredDuringSchedulingIgnoredDuringExecution, PreferredSchedulingTerm{}) - if err := m.PreferredDuringSchedulingIgnoredDuringExecution[len(m.PreferredDuringSchedulingIgnoredDuringExecution)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.PerContainer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -43189,9 +44428,9 @@ func (m *NodeAllocatableResourceClaimStatus) Unmarshal(dAtA []byte) error { } m.Containers = append(m.Containers, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Mapping", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -43218,105 +44457,44 @@ func (m *NodeAllocatableResourceClaimStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Resources == nil { - m.Resources = make(map[ResourceName]resource.Quantity) + m.Mapping = append(m.Mapping, NodeAllocatableMappedResources{}) + if err := m.Mapping[len(m.Mapping)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - var mapkey ResourceName - mapvalue := &resource.Quantity{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Overhead", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthGenerated - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = ResourceName(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthGenerated - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &resource.Quantity{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + if iNdEx >= l { + return io.ErrUnexpectedEOF } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Overhead = append(m.Overhead, NodeAllocatableOverheadResources{}) + if err := m.Overhead[len(m.Overhead)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Resources[ResourceName(mapkey)] = *mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -44130,6 +45308,88 @@ func (m *NodeList) Unmarshal(dAtA []byte) error { } return nil } +func (m *NodePodPreemptionPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NodePodPreemptionPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NodePodPreemptionPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisableResizePreemption", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DisableResizePreemption = append(m.DisableResizePreemption, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *NodeProxyOptions) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -45017,6 +46277,42 @@ func (m *NodeSpec) Unmarshal(dAtA []byte) error { } m.PodCIDRs = append(m.PodCIDRs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PodPreemptionPolicy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PodPreemptionPolicy == nil { + m.PodPreemptionPolicy = &NodePodPreemptionPolicy{} + } + if err := m.PodPreemptionPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -46205,6 +47501,27 @@ func (m *NodeSystemInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RunningInUserNamespace", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.RunningInUserNamespace = &b default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -48208,6 +49525,42 @@ func (m *PersistentVolumeClaimStatus) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HealthStatus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.HealthStatus == nil { + m.HealthStatus = &VolumeHealthStatus{} + } + if err := m.HealthStatus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -51313,6 +52666,26 @@ func (m *PodCertificateProjection) Unmarshal(dAtA []byte) error { } m.UserAnnotations[mapkey] = mapvalue iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.User = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -55517,6 +56890,40 @@ func (m *PodSpec) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 44: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EvictionResponders", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EvictionResponders = append(m.EvictionResponders, EvictionResponder{}) + if err := m.EvictionResponders[len(m.EvictionResponders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -56351,6 +57758,40 @@ func (m *PodStatus) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VolumeHealth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VolumeHealth = append(m.VolumeHealth, PodVolumeHealth{}) + if err := m.VolumeHealth[len(m.VolumeHealth)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -56372,7 +57813,7 @@ func (m *PodStatus) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodStatusResult) Unmarshal(dAtA []byte) error { +func (m *PodTemplate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -56395,10 +57836,10 @@ func (m *PodStatusResult) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodStatusResult: wiretype end group for non-group") + return fmt.Errorf("proto: PodTemplate: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodStatusResult: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodTemplate: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -56436,7 +57877,7 @@ func (m *PodStatusResult) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Template", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -56463,7 +57904,7 @@ func (m *PodStatusResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Template.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -56488,7 +57929,7 @@ func (m *PodStatusResult) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodTemplate) Unmarshal(dAtA []byte) error { +func (m *PodTemplateList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -56511,10 +57952,127 @@ func (m *PodTemplate) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodTemplate: wiretype end group for non-group") + return fmt.Errorf("proto: PodTemplateList: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodTemplate: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodTemplateList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, PodTemplate{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodTemplateSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodTemplateSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodTemplateSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -56552,7 +58110,7 @@ func (m *PodTemplate) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Template", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -56579,7 +58137,7 @@ func (m *PodTemplate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Template.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -56604,7 +58162,7 @@ func (m *PodTemplate) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodTemplateList) Unmarshal(dAtA []byte) error { +func (m *PodVolumeHealth) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -56627,17 +58185,17 @@ func (m *PodTemplateList) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodTemplateList: wiretype end group for non-group") + return fmt.Errorf("proto: PodVolumeHealth: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodTemplateList: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodVolumeHealth: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -56647,28 +58205,27 @@ func (m *PodTemplateList) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HealthConditions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -56695,97 +58252,14 @@ func (m *PodTemplateList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, PodTemplate{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.HealthConditions = append(m.HealthConditions, VolumeHealthCondition{}) + if err := m.HealthConditions[len(m.HealthConditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PodTemplateSpec) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PodTemplateSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PodTemplateSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -56812,7 +58286,7 @@ func (m *PodTemplateSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -57945,6 +59419,26 @@ func (m *ProjectedVolumeSource) Unmarshal(dAtA []byte) error { } } m.DefaultMode = &v + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultUser", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DefaultUser = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -63895,6 +65389,26 @@ func (m *SecretVolumeSource) Unmarshal(dAtA []byte) error { } b := bool(v != 0) m.Optional = &b + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultUser", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DefaultUser = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -64937,6 +66451,26 @@ func (m *ServiceAccountTokenProjection) Unmarshal(dAtA []byte) error { } m.Path = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.User = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -68111,11 +69645,158 @@ func (m *TypedObjectReference) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } s := string(dAtA[iNdEx:postIndex]) - m.APIGroup = &s + m.APIGroup = &s + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Namespace = &s iNdEx = postIndex - case 2: + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Volume) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Volume: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Volume: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -68143,9 +69824,92 @@ func (m *TypedObjectReference) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Kind = string(dAtA[iNdEx:postIndex]) + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VolumeSource", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.VolumeSource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VolumeDevice) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VolumeDevice: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VolumeDevice: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } @@ -68177,9 +69941,9 @@ func (m *TypedObjectReference) Unmarshal(dAtA []byte) error { } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DevicePath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -68207,8 +69971,7 @@ func (m *TypedObjectReference) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.Namespace = &s + m.DevicePath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -68231,7 +69994,7 @@ func (m *TypedObjectReference) Unmarshal(dAtA []byte) error { } return nil } -func (m *Volume) Unmarshal(dAtA []byte) error { +func (m *VolumeHealthCondition) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -68254,15 +70017,15 @@ func (m *Volume) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Volume: wiretype end group for non-group") + return fmt.Errorf("proto: VolumeHealthCondition: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Volume: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: VolumeHealthCondition: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -68290,13 +70053,13 @@ func (m *Volume) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Status = VolumeHealthStatusType(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VolumeSource", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -68306,24 +70069,55 @@ func (m *Volume) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.VolumeSource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -68346,7 +70140,7 @@ func (m *Volume) Unmarshal(dAtA []byte) error { } return nil } -func (m *VolumeDevice) Unmarshal(dAtA []byte) error { +func (m *VolumeHealthStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -68369,17 +70163,17 @@ func (m *VolumeDevice) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: VolumeDevice: wiretype end group for non-group") + return fmt.Errorf("proto: VolumeHealthStatus: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: VolumeDevice: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: VolumeHealthStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HealthConditions", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -68389,29 +70183,31 @@ func (m *VolumeDevice) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.HealthConditions = append(m.HealthConditions, VolumeHealthCondition{}) + if err := m.HealthConditions[len(m.HealthConditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DevicePath", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -68421,23 +70217,24 @@ func (m *VolumeDevice) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.DevicePath = string(dAtA[iNdEx:postIndex]) + if err := m.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -68703,6 +70500,38 @@ func (m *VolumeMount) Unmarshal(dAtA []byte) error { s := RecursiveReadOnlyMode(dAtA[iNdEx:postIndex]) m.RecursiveReadOnly = &s iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BindMountOptions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BindMountOptions = append(m.BindMountOptions, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/vendor/k8s.io/api/core/v1/generated.proto b/vendor/k8s.io/api/core/v1/generated.proto index ba4f80e5ec..878555a6ec 100644 --- a/vendor/k8s.io/api/core/v1/generated.proto +++ b/vendor/k8s.io/api/core/v1/generated.proto @@ -185,6 +185,7 @@ message Binding { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // The target object that you want to bind to the standard object. @@ -466,6 +467,13 @@ message ClusterTrustBundleProjection { // Relative path from the volume root to write the bundle. optional string path = 4; + + // user is Optional: The owner UID of the created file. + // If specified, the item-level user field takes precedence over defaultUser. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + // +featureGate=AtomicWriteVolumeUserFields + // +optional + optional int64 user = 6; } // Information about the condition of a component. @@ -495,6 +503,7 @@ message ComponentStatus { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // List of component conditions observed @@ -547,6 +556,8 @@ message ConfigMap { // the Data field, this is enforced during validation process. // Using this field will require 1.10+ apiserver and // kubelet. + // Note: BinaryData keys are not currently propagated to container env vars + // via ConfigMapKeyRef or ConfigMapRef env sources; only Data keys are used. // +optional map binaryData = 3; } @@ -556,6 +567,7 @@ message ConfigMap { // // The contents of the target ConfigMap's Data field will represent the // key-value pairs as environment variables. +// Keys in the BinaryData field are not currently propagated to container env vars. message ConfigMapEnvSource { // The ConfigMap to select from. optional LocalObjectReference localObjectReference = 1; @@ -571,7 +583,8 @@ message ConfigMapKeySelector { // The ConfigMap to select from. optional LocalObjectReference localObjectReference = 1; - // The key to select. + // The key to select from the ConfigMap's Data field. + // Keys in the BinaryData field are not currently propagated to container env vars. optional string key = 2; // Specify whether the ConfigMap or its key must be defined @@ -674,6 +687,13 @@ message ConfigMapVolumeSource { // optional specify whether the ConfigMap or its keys must be defined // +optional optional bool optional = 4; + + // defaultUser is Optional: The owner UID of the created files by default. + // The defaultUser field is only used as a fallback when the item-level user field is unset. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + // +featureGate=AtomicWriteVolumeUserFields + // +optional + optional int64 defaultUser = 5; } // A single application container that you want to run within a pod. @@ -1216,6 +1236,13 @@ message DownwardAPIVolumeFile { // mode, like fsGroup, and the result can be other mode bits set. // +optional optional int32 mode = 4; + + // user is Optional: The owner UID of the created file. + // If specified, the item-level user field takes precedence over defaultUser. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + // +featureGate=AtomicWriteVolumeUserFields + // +optional + optional int64 user = 5; } // DownwardAPIVolumeSource represents a volume containing downward API info. @@ -1236,6 +1263,13 @@ message DownwardAPIVolumeSource { // mode, like fsGroup, and the result can be other mode bits set. // +optional optional int32 defaultMode = 2; + + // defaultUser is Optional: The owner UID of the created files by default. + // The defaultUser field is only used as a fallback when the item-level user field is unset. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + // +featureGate=AtomicWriteVolumeUserFields + // +optional + optional int64 defaultUser = 3; } // Represents an empty directory for a pod. @@ -1256,6 +1290,18 @@ message EmptyDirVolumeSource { // More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir // +optional optional .k8s.io.apimachinery.pkg.api.resource.Quantity sizeLimit = 2; + + // mode specifies the permission bits for the emptyDir directory, in numeric + // notation (e.g., 0755, 01777). Must be a value between 0000 and 01777. + // If not specified, defaults to 0777. + // This might be in conflict with other options that affect the file + // mode, like fsGroup. If fsGroup is specified, the fsGroup permissions + // will override the mode specified here. + // This field has no effect on Windows. + // This field is alpha and requires EmptyDirVolumeMode featuregate to be enabled. + // +featureGate=EmptyDirVolumeMode + // +optional + optional int32 mode = 3; } // EndpointAddress is a tuple that describes single IP address. @@ -1807,6 +1853,43 @@ message EventSource { optional string host = 2; } +// EvictionResponder allows you to specify the responder reacting to an Eviction. +// Responders should observe and communicate through the Eviction Resource API to help with +// the graceful eviction of a target (e.g. termination of a pod). +// +structType=atomic +message EvictionResponder { + // name allows you to identify the responder responding to the Eviction. + // + // It must be a valid domain-prefixed key (such as "acme.io/foo"). + // Domain names *.k8s.io and *.kubernetes.io are reserved. + // This field must be unique for each responder. + // This field is required. + // +required + // +k8s:required + // +k8s:format=k8s-prefixed-label-key + // +k8s:customValidation + optional string name = 1; + + // priority for this responder. Higher priorities are selected first by the evictionrequest-controller. + // If there are responders with the same priority, the responder whose domain name comes first in the + // alphabetical higher domain order, will be picked. This means that the top domain labels are compared + // alphabetically first, followed by the lower domain labels. The key is compared last. + // + // The responder that is the managing controller of the pod should set the value of + // this field to 10000 to allow both for preemption or fallback registration by other + // responders. + // + // The minimum value is 0 and the maximum value is 100000. + // The interval 0-999 is reserved for responders with *.k8s.io suffix. + // This field is required. + // +required + // +k8s:required + // +k8s:minimum=0 + // +k8s:maximum=100000 + // +k8s:customValidation + optional int32 priority = 2; +} + // ExecAction describes a "run in container" action. message ExecAction { // Command is the command line to execute inside the container, the working directory for the @@ -2001,6 +2084,14 @@ message GRPCAction { // +optional // +default="" optional string service = 2; + + // mode specifies the connection mode for the gRPC health probe. + // Set to "TLS" to use TLS without certificate verification. + // Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + // If not specified, the probe uses a plaintext (insecure) connection. + // +featureGate=GRPCContainerProbeTLS + // +optional + optional string mode = 3; } // Represents a volume that is populated with the contents of a git repository. @@ -2092,6 +2183,12 @@ message HTTPGetAction { // +optional // +listType=atomic repeated HTTPHeader httpHeaders = 5; + + // Protocol selects the wire protocol for the probe connection. + // Nil defaults to HTTP/1.1. + // +optional + // +featureGate=H2CContainerProbe + optional string protocol = 6; } // HTTPHeader describes a custom header to be used in HTTP probes @@ -2303,6 +2400,13 @@ message KeyToPath { // mode, like fsGroup, and the result can be other mode bits set. // +optional optional int32 mode = 3; + + // user is Optional: The owner UID of the created file. + // If specified, the item-level user field takes precedence over defaultUser. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + // +featureGate=AtomicWriteVolumeUserFields + // +optional + optional int64 user = 4; } // Lifecycle describes actions that the management system should take in response to container lifecycle @@ -2557,6 +2661,8 @@ message NFSVolumeSource { // Namespace provides a scope for Names. // Use of multiple namespaces is optional. +// +k8s:supportsSubresource="/status" +// +k8s:supportsSubresource="/finalize" message Namespace { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -2634,6 +2740,8 @@ message NamespaceStatus { // Node is a worker node in Kubernetes. // Each node will have a unique identifier in the cache (i.e. in etcd). +// +k8s:supportsSubresource="/status" +// +k8s:supportsSubresource="/proxy" message Node { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -2686,20 +2794,86 @@ message NodeAffinity { repeated PreferredSchedulingTerm preferredDuringSchedulingIgnoredDuringExecution = 2; } +// NodeAllocatableMappedResources describes mapped node allocatable resource allocations. +message NodeAllocatableMappedResources { + // Name is the name of the resource (e.g., cpu, memory). + // +required + // +k8s:required + optional string name = 1; + + // Quantity is the total node allocatable resource capacity allocated for the claim. + // This claim's allocated devices is shared by all the containers referencing the claim. + // Kubelet adds this value to both requests and limits at the pod-level cgroup, and to limits at the container-level cgroup for each container referencing the claim. + // +required + // +k8s:required + optional .k8s.io.apimachinery.pkg.api.resource.Quantity quantity = 2; +} + +// NodeAllocatableOverheadResources describes auxiliary overhead resource allocations. +message NodeAllocatableOverheadResources { + // Name is the name of the resource (e.g., cpu, memory). + // +required + // +k8s:required + optional string name = 1; + + // PerPod is the flat overhead quantity allocated per pod. + // Adding to each container limit allows individual containers to utilize the overhead, while the parent pod-level cgroup limit caps the total usage at the pod boundary where the overhead is accounted for exactly once. + // At least one of PerPod or PerContainer must be specified. Specifying neither is an invalid configuration. + // +optional + // +k8s:optional + optional .k8s.io.apimachinery.pkg.api.resource.Quantity perPod = 2; + + // PerContainer is the variable overhead quantity applied for each container referencing the claim. + // The container references are recorded in `nodeAllocatableResourceClaimStatuses.containers`. + // The total overhead quantity allocated for the claim is computed as: + // Quantity = PerPod + (PerContainer * NumReferences) + // Kubelet accounts for this overhead in cgroups: + // - Pod-level cgroup (requests and limits): Kubelet adds PerPod + (PerContainer * NumReferences). + // - Container-level cgroup (limits only): Kubelet adds PerPod + PerContainer for each referencing container. + // This allows any single container to access the pod-level overhead, while the parent cgroup caps the total usage to account for PerPod exactly once. + // At least one of PerPod or PerContainer must be specified. Specifying neither is an invalid configuration. + // +optional + // +k8s:optional + optional .k8s.io.apimachinery.pkg.api.resource.Quantity perContainer = 3; +} + // NodeAllocatableResourceClaimStatus describes the status of node allocatable resources allocated via DRA. message NodeAllocatableResourceClaimStatus { // ResourceClaimName is the resource claim referenced by the pod that resulted in this node allocatable resource allocation. // +required + // +k8s:required optional string resourceClaimName = 1; // Containers lists the names of all containers in this pod that reference the claim. // +optional // +listType=set + // +k8s:optional + // +k8s:listType=set repeated string containers = 2; - // Resources is a map of the node-allocatable resource name to the aggregate quantity allocated to the claim. - // +required - map resources = 3; + // Mapping contains allocations through devices mapped in the device spec's `nodeAllocatableResources[...].mapping` field. + // This is used by kubelet for pod level and container-level cgroup enforcement. + // +optional + // +patchStrategy=merge + // +patchMergeKey=name + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + repeated NodeAllocatableMappedResources mapping = 4; + + // Overhead contains allocations through devices mapped in the device spec's `nodeAllocatableResources[...].overhead` field. + // This is used by kubelet for pod level and container-level cgroup enforcement. + // +optional + // +patchStrategy=merge + // +patchMergeKey=name + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + repeated NodeAllocatableOverheadResources overhead = 5; } // NodeCondition contains condition information for a node. @@ -2811,6 +2985,21 @@ message NodeList { repeated Node items = 2; } +// NodePodPreemptionPolicy defines the node-level policies governing preemption for pods on this node. +message NodePodPreemptionPolicy { + // DisableResizePreemption lists the owners (e.g., autoscalers, operators, administrators) + // that have requested to disable scheduler and Kubelet preemption for in-place pod resize on this node. + // If this list is non-empty, resize-induced preemption is disabled on this node. + // This is an alpha field and requires enabling the InPlacePodVerticalScalingSchedulerPreemption feature gate. + // +listType=set + // +k8s:listType=set + // +optional + // +k8s:maxItems=20 + // +k8s:optional + // +k8s:eachVal=+k8s:format=k8s-label-key + repeated string disableResizePreemption = 1; +} + // NodeProxyOptions is the query options to a Node's proxy call. message NodeProxyOptions { // Path is the URL path to use for the current proxy request to node. @@ -2903,6 +3092,9 @@ message NodeSpec { // ID of the node assigned by the cloud provider in the format: :// // +optional + // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:alpha(since: "1.36")=+k8s:update=NoModify + // +k8s:alpha(since: "1.36")=+k8s:update=NoUnset optional string providerID = 3; // Unschedulable controls node schedulability of new pods. By default, node is schedulable. @@ -2923,6 +3115,14 @@ message NodeSpec { // see: https://issues.k8s.io/61966 // +optional optional string externalID = 2; + + // PodPreemptionPolicy controls the node-level preemption behaviors for pods on this node. + // This is an alpha field and requires enabling the InPlacePodVerticalScalingSchedulerPreemption feature gate. + // +featureGate=InPlacePodVerticalScalingSchedulerPreemption + // +optional + // +k8s:optional + // +k8s:ifDisabled(InPlacePodVerticalScalingSchedulerPreemption)=+k8s:forbidden + optional NodePodPreemptionPolicy podPreemptionPolicy = 8; } // NodeStatus is information about the current status of a node. @@ -3059,6 +3259,11 @@ message NodeSystemInfo { // Swap Info reported by the node. optional NodeSwapStatus swap = 11; + + // Whether the node is running in a user namespace. + // +featureGate=KubeletInUserNamespace + // +optional + optional bool runningInUserNamespace = 12; } // ObjectFieldSelector selects an APIVersioned field of an object. @@ -3135,6 +3340,7 @@ message ObjectReference { // PersistentVolume (PV) is a storage resource provisioned by an administrator. // It is analogous to a node. // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes +// +k8s:supportsSubresource="/status" message PersistentVolume { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -3156,6 +3362,7 @@ message PersistentVolume { } // PersistentVolumeClaim is a user's request for and claim to a persistent volume +// +k8s:supportsSubresource="/status" message PersistentVolumeClaim { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -3256,8 +3463,8 @@ message PersistentVolumeClaimSpec { // * An existing PVC (PersistentVolumeClaim) // If the provisioner or an external controller can support the specified data source, // it will create a new volume based on the contents of the specified data source. - // When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, - // and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + // dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be + // copied to dataSource when dataSourceRef.namespace is not specified. // If the namespace is specified, then dataSourceRef will not be copied to dataSource. // +optional optional TypedLocalObjectReference dataSource = 7; @@ -3283,7 +3490,6 @@ message PersistentVolumeClaimSpec { // specified. // * While dataSource only allows local objects, dataSourceRef allows objects // in any namespaces. - // (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. // (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. // +optional optional TypedObjectReference dataSourceRef = 8; @@ -3399,6 +3605,13 @@ message PersistentVolumeClaimStatus { // +featureGate=VolumeAttributesClass // +optional optional ModifyVolumeStatus modifyVolumeStatus = 9; + + // healthStatus contains the latest controller-reported health information + // for the volume bound to this claim. + // +featureGate=CSIVolumeHealth + // +optional + // +k8s:optional + optional VolumeHealthStatus healthStatus = 10; } // PersistentVolumeClaimTemplate is used to produce @@ -3409,6 +3622,7 @@ message PersistentVolumeClaimTemplate { // validation. // // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // The specification for the PersistentVolumeClaim. The entire content is @@ -3676,6 +3890,10 @@ message PhotonPersistentDiskVolumeSource { // Pod is a collection of containers that can run on a host. This resource is created // by clients and scheduled onto hosts. +// +k8s:supportsSubresource="/status" +// +k8s:supportsSubresource="/ephemeralcontainers" +// +k8s:supportsSubresource="/resize" +// +k8s:supportsSubresource="/eviction" message Pod { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -3931,6 +4149,13 @@ message PodCertificateProjection { // Signers should document the keys and values they support. Signers should // deny requests that contain keys they do not recognize. map userAnnotations = 7; + + // user is Optional: The owner UID of the created file. + // If specified, the item-level user field takes precedence over defaultUser. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + // +featureGate=AtomicWriteVolumeUserFields + // +optional + optional int64 user = 8; } // PodCondition contains details for the current condition of this pod. @@ -4390,11 +4615,8 @@ message PodSecurityContext { // Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes // whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their // CSIDriver instance. Other volumes are always re-labelled recursively. - // "MountOption" value is allowed only when SELinuxMount feature gate is enabled. // - // If not specified and SELinuxMount feature gate is enabled, "MountOption" is used. - // If not specified and SELinuxMount feature gate is disabled, "MountOption" is used for ReadWriteOncePod volumes - // and "Recursive" for all other volumes. + // If not specified, "MountOption" is used. // // This field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers. // @@ -4511,7 +4733,6 @@ message PodSpec { // DeprecatedServiceAccount is a deprecated alias for ServiceAccountName. // Deprecated: Use serviceAccountName instead. - // +k8s:conversion-gen=false // +optional optional string serviceAccount = 9; @@ -4532,19 +4753,16 @@ message PodSpec { // When `hostNetwork` is true, specified `hostPort` fields in port definitions must match `containerPort`, // and unspecified `hostPort` fields in port definitions are defaulted to match `containerPort`. // Default to false. - // +k8s:conversion-gen=false // +optional optional bool hostNetwork = 11; // Use the host's pid namespace. // Optional: Default to false. - // +k8s:conversion-gen=false // +optional optional bool hostPID = 12; // Use the host's ipc namespace. // Optional: Default to false. - // +k8s:conversion-gen=false // +optional optional bool hostIPC = 13; @@ -4553,7 +4771,6 @@ message PodSpec { // in the same pod, and the first process in each container will not be assigned PID 1. // HostPID and ShareProcessNamespace cannot both be set. // Optional: Default to false. - // +k8s:conversion-gen=false // +optional optional bool shareProcessNamespace = 27; @@ -4594,6 +4811,7 @@ message PodSpec { // If specified, the pod's tolerations. // +optional // +listType=atomic + // +k8s:alpha(since: "1.37")=+k8s:optional repeated Toleration tolerations = 22; // HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts @@ -4652,6 +4870,8 @@ message PodSpec { // PreemptionPolicy is the Policy for preempting pods with lower priority. // One of Never, PreemptLowerPriority. + // When Priority Admission Controller is enabled, it prevents users from setting + // this field. The admission controller populates this field from PriorityClassName. // Defaults to PreemptLowerPriority if unset. // +optional optional string preemptionPolicy = 31; @@ -4728,7 +4948,6 @@ message PodSpec { // When set to false, a new userns is created for the pod. Setting false is useful for // mitigating container breakout vulnerabilities even allowing users to run their // containers as root without actually having root privileges on the host. - // +k8s:conversion-gen=false // +optional optional bool hostUsers = 37; @@ -4787,7 +5006,6 @@ message PodSpec { // - `hostNetwork` must be set to false. // // This field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters. - // Requires the HostnameOverride feature gate to be enabled. // // +featureGate=HostnameOverride // +optional @@ -4809,6 +5027,34 @@ message PodSpec { // +featureGate=GenericWorkload // +optional optional PodSchedulingGroup schedulingGroup = 43; + + // evictionResponders reference responders that react to Evictions based on EvictionRequests. + // Responders should observe and communicate through the Eviction Resource API to help with + // the graceful termination of a pod. The responders are selected sequentially, according to + // their specified priority. + // + // Responders should periodically report on an eviction progress by updating the + // .status.responders[].heartbeatTime field of the Eviction object. If this field is not updated + // within the heartbeat deadline defined by the Eviction API (currently 20 minutes), the eviction + // is passed over to the next responder with a lower priority. If there is no other responder, + // the last default imperative-eviction.k8s.io/evictor responder with a priority of 100 will + // evict the pod using the imperative Eviction API (pods//eviction subresource). + // + // The maximum length of the responders list is 10. + // Responders are not supported when the pod is part of a PodGroup (.spec.schedulingGroup is set). + // This field can only be set on creation and is immutable afterwards. + // +featureGate=EvictionRequestAPI + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=10 + // +k8s:alpha(since: "1.37")=+k8s:dependentForbidden("schedulingGroup") + repeated EvictionResponder evictionResponders = 44; } // PodStatus represents information about the status of a pod. Status may trail the actual @@ -4993,24 +5239,25 @@ message PodStatus { // Examples include "cpu", "memory", "ephemeral-storage", and hugepages. // +featureGate=DRANodeAllocatableResources // +optional - // +listType=atomic + // +patchStrategy=merge + // +patchMergeKey=resourceClaimName + // +listType=map + // +listMapKey=resourceClaimName + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=resourceClaimName repeated NodeAllocatableResourceClaimStatus nodeAllocatableResourceClaimStatuses = 21; -} -// PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded -message PodStatusResult { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // volumeHealth contains node-reported health for each volume the pod is using. + // Populated by the kubelet on the pod's node. + // +featureGate=CSIVolumeHealth // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Most recently observed status of the pod. - // This data may not be up to date. - // Populated by the system. - // Read-only. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional PodStatus status = 2; + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + repeated PodVolumeHealth volumeHealth = 22; } // PodTemplate describes a template for creating copies of a predefined pod. @@ -5042,6 +5289,7 @@ message PodTemplateSpec { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Specification of the desired behavior of the pod. @@ -5050,6 +5298,35 @@ message PodTemplateSpec { optional PodSpec spec = 2; } +// PodVolumeHealth contains health information for a volume used by a pod, +// reported by the CSI node plugin via the kubelet. +message PodVolumeHealth { + // name matches an entry in pod.spec.volumes. + // +required + // +k8s:required + optional string name = 1; + + // conditions is the set of adverse conditions reported by + // the CSI node plugin for this volume on this node. + // At most 16 conditions may be reported. + // +optional + // +listType=map + // +listMapKey=status + // +patchMergeKey=status + // +patchStrategy=merge + // +listMapKey=reason + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=status + // +k8s:listMapKey=reason + // +k8s:maxItems=16 + repeated VolumeHealthCondition healthConditions = 2; + + // lastTransitionTime is when the current set of conditions first appeared. + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; +} + // PortStatus represents the error condition of a service port message PortStatus { // Port is the port number of the service port of which status is recorded here @@ -5208,6 +5485,13 @@ message ProjectedVolumeSource { // mode, like fsGroup, and the result can be other mode bits set. // +optional optional int32 defaultMode = 2; + + // defaultUser is Optional: The owner UID of the created files by default. + // The defaultUser field is only used as a fallback when the item-level user field is unset. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + // +featureGate=AtomicWriteVolumeUserFields + // +optional + optional int64 defaultUser = 3; } // Represents a Quobyte mount that lasts the lifetime of a pod. @@ -5357,6 +5641,7 @@ message RangeAllocation { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Range is string that identifies the range represented by 'data'. @@ -5372,8 +5657,8 @@ message ReplicationController { // be the same as the Pod(s) that the replication controller manages. // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional - // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:format=k8s-long-name optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Spec defines the specification of the desired behavior of the replication controller. @@ -5430,18 +5715,18 @@ message ReplicationControllerSpec { // Defaults to 1. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +default=1 - // +k8s:alpha(since: "1.36")=+k8s:minimum=0 + // +k8s:beta(since: "1.37")=+k8s:minimum=0 optional int32 replicas = 1; // Minimum number of seconds for which a newly created pod should be ready // without any of its container crashing, for it to be considered available. // Defaults to 0 (pod will be considered available as soon as it is ready) // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +default=0 - // +k8s:alpha(since: "1.36")=+k8s:minimum=0 + // +k8s:beta(since: "1.37")=+k8s:minimum=0 optional int32 minReadySeconds = 4; // Selector is a label query over pods that should match the Replicas count. @@ -5458,6 +5743,7 @@ message ReplicationControllerSpec { // The only allowed template.spec.restartPolicy value is "Always". // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional optional PodTemplateSpec template = 3; } @@ -5549,6 +5835,7 @@ message ResourceHealth { } // ResourceQuota sets aggregate quota restrictions enforced per namespace +// +k8s:supportsSubresource="/status" message ResourceQuota { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -5642,8 +5929,13 @@ message ResourceRequirements { // ResourceStatus represents the status of a single resource allocated to a Pod. message ResourceStatus { // Name of the resource. Must be unique within the pod and in case of non-DRA resource, match one of the resources from the pod spec. - // For DRA resources, the value must be "claim:/". - // When this status is reported about a container, the "claim_name" and "request" must match one of the claims of this container. + // For DRA resources, the value must be "claim:/" when + // container.resources.claims[*].request is set or "claim:" when + // container.resources.claims[*].request is empty. + // For DRA-backed extended resources, "claim:/" is used + // when the claim name and request name are recorded in pod.status.extendedResourceClaimStatus. + // When this status is reported about a container, the "claim_name" and "request" + // must match one of the claims of this container. // +required optional string name = 1; @@ -5854,6 +6146,8 @@ message Secret { // Used to facilitate programmatic handling of secret data. // More info: https://kubernetes.io/docs/concepts/configuration/secret/#secret-types // +optional + // +k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:immutable optional string type = 3; } @@ -5970,6 +6264,13 @@ message SecretVolumeSource { // optional field specify whether the Secret or its keys must be defined // +optional optional bool optional = 4; + + // defaultUser is Optional: The owner UID of the created files by default. + // The defaultUser field is only used as a fallback when the item-level user field is unset. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + // +featureGate=AtomicWriteVolumeUserFields + // +optional + optional int64 defaultUser = 5; } // SecurityContext holds security configuration that will be applied to a container. @@ -6076,6 +6377,8 @@ message SerializedReference { // Service is a named abstraction of software service (for example, mysql) consisting of local port // (for example 3306) that the proxy listens on, and the selector that determines which pods // will answer requests sent through the proxy. +// +k8s:supportsSubresource="/status" +// +k8s:supportsSubresource="/proxy" message Service { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -6169,6 +6472,13 @@ message ServiceAccountTokenProjection { // path is the path relative to the mount point of the file to project the // token into. optional string path = 3; + + // user is Optional: The owner UID of the created file. + // If specified, the item-level user field takes precedence over defaultUser. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + // +featureGate=AtomicWriteVolumeUserFields + // +optional + optional int64 user = 4; } // ServiceList holds a list of services. @@ -6511,6 +6821,7 @@ message ServiceStatus { // +patchStrategy=merge // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:eachVal=+k8s:opaqueType repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 2; } @@ -6638,6 +6949,8 @@ message Toleration { // Key is the taint key that the toleration applies to. Empty means match all taint keys. // If the key is empty, operator must be Exists; this combination means to match all values and all keys. // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:format=k8s-label-key optional string key = 1; // Operator represents a key's relationship to the value. @@ -6890,6 +7203,57 @@ message VolumeDevice { optional string devicePath = 2; } +// VolumeHealthCondition represents an adverse health condition reported for a volume. +message VolumeHealthCondition { + // status is the machine-parseable health category. + // Possible values: + // - "Inaccessible": the volume cannot be accessed. + // - "DataLoss": data loss has been detected on the volume. + // - "Degraded": the volume is functioning with reduced capability. + // +required + // +k8s:required + optional string status = 1; + + // reason is a brief CamelCase machine-parseable reason. + // Together with status it forms the unique identity of a condition entry. + // Maximum permitted length of a reason is 256 bytes. + // +required + // +k8s:required + // +k8s:maxBytes=256 + optional string reason = 2; + + // message is a human-readable description. + // Maximum permitted length of a message is 1024 bytes. + // +optional + // +k8s:optional + // +k8s:maxBytes=1024 + optional string message = 3; +} + +// VolumeHealthStatus contains health information for a volume reported +// by the CSI controller plugin. +message VolumeHealthStatus { + // conditions is the set of adverse conditions reported by + // the CSI controller plugin. An empty list means no adverse condition. + // At most 16 conditions may be reported. + // +optional + // +listType=map + // +listMapKey=status + // +patchMergeKey=status + // +patchStrategy=merge + // +listMapKey=reason + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=status + // +k8s:listMapKey=reason + // +k8s:maxItems=16 + repeated VolumeHealthCondition healthConditions = 1; + + // lastTransitionTime is when the current set of conditions first appeared. + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 2; +} + // VolumeMount describes a mounting of a Volume within a container. message VolumeMount { // This must match the Name of a Volume. @@ -6919,8 +7283,7 @@ message VolumeMount { // +optional optional string recursiveReadOnly = 7; - // Path within the container at which the volume should be mounted. Must - // not contain ':'. + // Path within the container at which the volume should be mounted. optional string mountPath = 3; // Path within the volume from which the container's volume should be mounted. @@ -6943,6 +7306,17 @@ message VolumeMount { // SubPathExpr and SubPath are mutually exclusive. // +optional optional string subPathExpr = 6; + + // bindMountOptions is the list of additional bind mount options to apply when + // mounting this volume into the container. Allowed values are noexec, + // nodev, and nosuid. These are Linux mount options and have no effect on + // Windows nodes. + // This field is not supported with image volumes. + // This is an alpha field and requires enabling the VolumeBindMountOptions feature gate. + // +featureGate=VolumeBindMountOptions + // +optional + // +listType=set + repeated string bindMountOptions = 8; } // VolumeMountStatus shows status of volume mounts. diff --git a/vendor/k8s.io/api/core/v1/register.go b/vendor/k8s.io/api/core/v1/register.go index 1aac0cb41e..0a42d182f4 100644 --- a/vendor/k8s.io/api/core/v1/register.go +++ b/vendor/k8s.io/api/core/v1/register.go @@ -46,7 +46,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &Pod{}, &PodList{}, - &PodStatusResult{}, &PodTemplate{}, &PodTemplateList{}, &ReplicationController{}, diff --git a/vendor/k8s.io/api/core/v1/types.go b/vendor/k8s.io/api/core/v1/types.go index ac0494f3c5..90b09fb9b2 100644 --- a/vendor/k8s.io/api/core/v1/types.go +++ b/vendor/k8s.io/api/core/v1/types.go @@ -41,7 +41,7 @@ type Volume struct { // volumeSource represents the location and type of the mounted volume. // If not specified, the Volume is implied to be an EmptyDir. // This implied behavior is deprecated and will be removed in a future version. - VolumeSource `json:",inline" protobuf:"bytes,2,opt,name=volumeSource"` + VolumeSource `json:"" protobuf:"bytes,2,opt,name=volumeSource"` } // Represents the source of a volume to mount. @@ -360,8 +360,9 @@ const ( // PersistentVolume (PV) is a storage resource provisioned by an administrator. // It is analogous to a node. // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes +// +k8s:supportsSubresource="/status" type PersistentVolume struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -388,7 +389,7 @@ type PersistentVolumeSpec struct { // +optional Capacity ResourceList `json:"capacity,omitempty" protobuf:"bytes,1,rep,name=capacity,casttype=ResourceList,castkey=ResourceName"` // persistentVolumeSource is the actual volume backing the persistent volume. - PersistentVolumeSource `json:",inline" protobuf:"bytes,2,opt,name=persistentVolumeSource"` + PersistentVolumeSource `json:"" protobuf:"bytes,2,opt,name=persistentVolumeSource"` // accessModes contains all ways the volume can be mounted. // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes // +optional @@ -495,7 +496,7 @@ type PersistentVolumeStatus struct { // PersistentVolumeList is a list of PersistentVolume items. type PersistentVolumeList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -510,8 +511,9 @@ type PersistentVolumeList struct { // +k8s:prerelease-lifecycle-gen:introduced=1.0 // PersistentVolumeClaim is a user's request for and claim to a persistent volume +// +k8s:supportsSubresource="/status" type PersistentVolumeClaim struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -534,7 +536,7 @@ type PersistentVolumeClaim struct { // PersistentVolumeClaimList is a list of PersistentVolumeClaim items. type PersistentVolumeClaimList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -578,8 +580,8 @@ type PersistentVolumeClaimSpec struct { // * An existing PVC (PersistentVolumeClaim) // If the provisioner or an external controller can support the specified data source, // it will create a new volume based on the contents of the specified data source. - // When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, - // and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + // dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be + // copied to dataSource when dataSourceRef.namespace is not specified. // If the namespace is specified, then dataSourceRef will not be copied to dataSource. // +optional DataSource *TypedLocalObjectReference `json:"dataSource,omitempty" protobuf:"bytes,7,opt,name=dataSource"` @@ -604,7 +606,6 @@ type PersistentVolumeClaimSpec struct { // specified. // * While dataSource only allows local objects, dataSourceRef allows objects // in any namespaces. - // (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. // (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. // +optional DataSourceRef *TypedObjectReference `json:"dataSourceRef,omitempty" protobuf:"bytes,8,opt,name=dataSourceRef"` @@ -678,7 +679,7 @@ const ( // slightly longer than actual in-use time or unused time because of processing delays or // when this feature was enabled in the cluster. // - // Requires PersistentVolumeClaimUnusedSinceTime alpha featuregate + // Requires PersistentVolumeClaimUnusedSinceTime beta featuregate PersistentVolumeClaimUnused PersistentVolumeClaimConditionType = "Unused" ) @@ -764,6 +765,95 @@ type PersistentVolumeClaimCondition struct { Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"` } +// VolumeHealthStatusType describes the health status category of a volume. +// +enum +// +k8s:enum +type VolumeHealthStatusType string + +const ( + // VolumeHealthInaccessible indicates the volume cannot be accessed. + VolumeHealthInaccessible VolumeHealthStatusType = "Inaccessible" + // VolumeHealthDataLoss indicates data loss has been detected on the volume. + VolumeHealthDataLoss VolumeHealthStatusType = "DataLoss" + // VolumeHealthDegraded indicates the volume is functioning but with reduced capability. + VolumeHealthDegraded VolumeHealthStatusType = "Degraded" +) + +// VolumeHealthCondition represents an adverse health condition reported for a volume. +type VolumeHealthCondition struct { + // status is the machine-parseable health category. + // Possible values: + // - "Inaccessible": the volume cannot be accessed. + // - "DataLoss": data loss has been detected on the volume. + // - "Degraded": the volume is functioning with reduced capability. + // +required + // +k8s:required + Status VolumeHealthStatusType `json:"status" protobuf:"bytes,1,opt,name=status,casttype=VolumeHealthStatusType"` + // reason is a brief CamelCase machine-parseable reason. + // Together with status it forms the unique identity of a condition entry. + // Maximum permitted length of a reason is 256 bytes. + // +required + // +k8s:required + // +k8s:maxBytes=256 + Reason string `json:"reason" protobuf:"bytes,2,opt,name=reason"` + // message is a human-readable description. + // Maximum permitted length of a message is 1024 bytes. + // +optional + // +k8s:optional + // +k8s:maxBytes=1024 + Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"` +} + +// VolumeHealthStatus contains health information for a volume reported +// by the CSI controller plugin. +type VolumeHealthStatus struct { + // conditions is the set of adverse conditions reported by + // the CSI controller plugin. An empty list means no adverse condition. + // At most 16 conditions may be reported. + // +optional + // +listType=map + // +listMapKey=status + // +patchMergeKey=status + // +patchStrategy=merge + // +listMapKey=reason + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=status + // +k8s:listMapKey=reason + // +k8s:maxItems=16 + HealthConditions []VolumeHealthCondition `json:"healthConditions,omitempty" patchStrategy:"merge" patchMergeKey:"status" protobuf:"bytes,1,rep,name=healthConditions"` + // lastTransitionTime is when the current set of conditions first appeared. + // +optional + LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,2,opt,name=lastTransitionTime"` +} + +// PodVolumeHealth contains health information for a volume used by a pod, +// reported by the CSI node plugin via the kubelet. +type PodVolumeHealth struct { + // name matches an entry in pod.spec.volumes. + // +required + // +k8s:required + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + // conditions is the set of adverse conditions reported by + // the CSI node plugin for this volume on this node. + // At most 16 conditions may be reported. + // +optional + // +listType=map + // +listMapKey=status + // +patchMergeKey=status + // +patchStrategy=merge + // +listMapKey=reason + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=status + // +k8s:listMapKey=reason + // +k8s:maxItems=16 + HealthConditions []VolumeHealthCondition `json:"healthConditions,omitempty" patchStrategy:"merge" patchMergeKey:"status" protobuf:"bytes,2,rep,name=healthConditions"` + // lastTransitionTime is when the current set of conditions first appeared. + // +optional + LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` +} + // PersistentVolumeClaimStatus is the current status of a persistent volume claim. type PersistentVolumeClaimStatus struct { // phase represents the current phase of PersistentVolumeClaim. @@ -857,6 +947,12 @@ type PersistentVolumeClaimStatus struct { // +featureGate=VolumeAttributesClass // +optional ModifyVolumeStatus *ModifyVolumeStatus `json:"modifyVolumeStatus,omitempty" protobuf:"bytes,9,opt,name=modifyVolumeStatus"` + // healthStatus contains the latest controller-reported health information + // for the volume bound to this claim. + // +featureGate=CSIVolumeHealth + // +optional + // +k8s:optional + HealthStatus *VolumeHealthStatus `json:"healthStatus,omitempty" protobuf:"bytes,10,opt,name=healthStatus"` } // +enum @@ -962,6 +1058,17 @@ type EmptyDirVolumeSource struct { // More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir // +optional SizeLimit *resource.Quantity `json:"sizeLimit,omitempty" protobuf:"bytes,2,opt,name=sizeLimit"` + // mode specifies the permission bits for the emptyDir directory, in numeric + // notation (e.g., 0755, 01777). Must be a value between 0000 and 01777. + // If not specified, defaults to 0777. + // This might be in conflict with other options that affect the file + // mode, like fsGroup. If fsGroup is specified, the fsGroup permissions + // will override the mode specified here. + // This field has no effect on Windows. + // This field is alpha and requires EmptyDirVolumeMode featuregate to be enabled. + // +featureGate=EmptyDirVolumeMode + // +optional + Mode *int32 `json:"mode,omitempty" protobuf:"varint,3,opt,name=mode"` } // Represents a Glusterfs mount that lasts the lifetime of a pod. @@ -1454,6 +1561,12 @@ type SecretVolumeSource struct { // optional field specify whether the Secret or its keys must be defined // +optional Optional *bool `json:"optional,omitempty" protobuf:"varint,4,opt,name=optional"` + // defaultUser is Optional: The owner UID of the created files by default. + // The defaultUser field is only used as a fallback when the item-level user field is unset. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + // +featureGate=AtomicWriteVolumeUserFields + // +optional + DefaultUser *int64 `json:"defaultUser,omitempty" protobuf:"varint,5,opt,name=defaultUser"` } const ( @@ -1467,7 +1580,7 @@ const ( // Note that this is identical to a secret volume source without the default // mode. type SecretProjection struct { - LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` + LocalObjectReference `json:"" protobuf:"bytes,1,opt,name=localObjectReference"` // items if unspecified, each key-value pair in the Data field of the referenced // Secret will be projected into the volume as a file whose name is the // key and content is the value. If specified, the listed keys will be @@ -1877,7 +1990,7 @@ type StorageOSPersistentVolumeSource struct { // the items element is populated with specific mappings of keys to paths. // ConfigMap volumes support ownership management and SELinux relabeling. type ConfigMapVolumeSource struct { - LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` + LocalObjectReference `json:"" protobuf:"bytes,1,opt,name=localObjectReference"` // items if unspecified, each key-value pair in the Data field of the referenced // ConfigMap will be projected into the volume as a file whose name is the // key and content is the value. If specified, the listed keys will be @@ -1900,6 +2013,12 @@ type ConfigMapVolumeSource struct { // optional specify whether the ConfigMap or its keys must be defined // +optional Optional *bool `json:"optional,omitempty" protobuf:"varint,4,opt,name=optional"` + // defaultUser is Optional: The owner UID of the created files by default. + // The defaultUser field is only used as a fallback when the item-level user field is unset. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + // +featureGate=AtomicWriteVolumeUserFields + // +optional + DefaultUser *int64 `json:"defaultUser,omitempty" protobuf:"varint,5,opt,name=defaultUser"` } const ( @@ -1914,7 +2033,7 @@ const ( // Note that this is identical to a configmap volume source without the default // mode. type ConfigMapProjection struct { - LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` + LocalObjectReference `json:"" protobuf:"bytes,1,opt,name=localObjectReference"` // items if unspecified, each key-value pair in the Data field of the referenced // ConfigMap will be projected into the volume as a file whose name is the // key and content is the value. If specified, the listed keys will be @@ -1952,6 +2071,12 @@ type ServiceAccountTokenProjection struct { // path is the path relative to the mount point of the file to project the // token into. Path string `json:"path" protobuf:"bytes,3,opt,name=path"` + // user is Optional: The owner UID of the created file. + // If specified, the item-level user field takes precedence over defaultUser. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + // +featureGate=AtomicWriteVolumeUserFields + // +optional + User *int64 `json:"user,omitempty" protobuf:"varint,4,opt,name=user"` } // ClusterTrustBundleProjection describes how to select a set of @@ -1986,6 +2111,13 @@ type ClusterTrustBundleProjection struct { // Relative path from the volume root to write the bundle. Path string `json:"path" protobuf:"bytes,4,rep,name=path"` + + // user is Optional: The owner UID of the created file. + // If specified, the item-level user field takes precedence over defaultUser. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + // +featureGate=AtomicWriteVolumeUserFields + // +optional + User *int64 `json:"user,omitempty" protobuf:"varint,6,opt,name=user"` } // PodCertificateProjection provides a private key and X.509 certificate in the @@ -2074,6 +2206,13 @@ type PodCertificateProjection struct { // Signers should document the keys and values they support. Signers should // deny requests that contain keys they do not recognize. UserAnnotations map[string]string `json:"userAnnotations,omitempty" protobuf:"bytes,7,rep,name=userAnnotations"` + + // user is Optional: The owner UID of the created file. + // If specified, the item-level user field takes precedence over defaultUser. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + // +featureGate=AtomicWriteVolumeUserFields + // +optional + User *int64 `json:"user,omitempty" protobuf:"varint,8,opt,name=user"` } // Represents a projected volume source @@ -2091,6 +2230,12 @@ type ProjectedVolumeSource struct { // mode, like fsGroup, and the result can be other mode bits set. // +optional DefaultMode *int32 `json:"defaultMode,omitempty" protobuf:"varint,2,opt,name=defaultMode"` + // defaultUser is Optional: The owner UID of the created files by default. + // The defaultUser field is only used as a fallback when the item-level user field is unset. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + // +featureGate=AtomicWriteVolumeUserFields + // +optional + DefaultUser *int64 `json:"defaultUser,omitempty" protobuf:"varint,3,opt,name=defaultUser"` } // Projection that may be projected along with other supported volume types. @@ -2189,6 +2334,12 @@ type KeyToPath struct { // mode, like fsGroup, and the result can be other mode bits set. // +optional Mode *int32 `json:"mode,omitempty" protobuf:"varint,3,opt,name=mode"` + // user is Optional: The owner UID of the created file. + // If specified, the item-level user field takes precedence over defaultUser. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + // +featureGate=AtomicWriteVolumeUserFields + // +optional + User *int64 `json:"user,omitempty" protobuf:"varint,4,opt,name=user"` } // Local represents directly-attached storage with node affinity @@ -2339,6 +2490,7 @@ type PersistentVolumeClaimTemplate struct { // validation. // // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // The specification for the PersistentVolumeClaim. The entire content is @@ -2400,8 +2552,7 @@ type VolumeMount struct { // If this field is not specified, it is treated as an equivalent of Disabled. // +optional RecursiveReadOnly *RecursiveReadOnlyMode `json:"recursiveReadOnly,omitempty" protobuf:"bytes,7,opt,name=recursiveReadOnly,casttype=RecursiveReadOnlyMode"` - // Path within the container at which the volume should be mounted. Must - // not contain ':'. + // Path within the container at which the volume should be mounted. MountPath string `json:"mountPath" protobuf:"bytes,3,opt,name=mountPath"` // Path within the volume from which the container's volume should be mounted. // Defaults to "" (volume's root). @@ -2421,8 +2572,30 @@ type VolumeMount struct { // SubPathExpr and SubPath are mutually exclusive. // +optional SubPathExpr string `json:"subPathExpr,omitempty" protobuf:"bytes,6,opt,name=subPathExpr"` + // bindMountOptions is the list of additional bind mount options to apply when + // mounting this volume into the container. Allowed values are noexec, + // nodev, and nosuid. These are Linux mount options and have no effect on + // Windows nodes. + // This field is not supported with image volumes. + // This is an alpha field and requires enabling the VolumeBindMountOptions feature gate. + // +featureGate=VolumeBindMountOptions + // +optional + // +listType=set + BindMountOptions []string `json:"bindMountOptions,omitempty" protobuf:"bytes,8,rep,name=bindMountOptions"` } +// BindMountOption defines the supported bind mount options. +type BindMountOption string + +const ( + // BindMountOptionNoExec prevents execution of binaries on the mounted volume. + BindMountOptionNoExec BindMountOption = "noexec" + // BindMountOptionNoDev ignores device special files on the mounted volume. + BindMountOptionNoDev BindMountOption = "nodev" + // BindMountOptionNoSUID ignores set-user-identifier or set-group-identifier bits on the mounted volume. + BindMountOptionNoSUID BindMountOption = "nosuid" +) + // MountPropagationMode describes mount propagation. // +enum type MountPropagationMode string @@ -2571,8 +2744,9 @@ type ResourceFieldSelector struct { // +structType=atomic type ConfigMapKeySelector struct { // The ConfigMap to select from. - LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` - // The key to select. + LocalObjectReference `json:"" protobuf:"bytes,1,opt,name=localObjectReference"` + // The key to select from the ConfigMap's Data field. + // Keys in the BinaryData field are not currently propagated to container env vars. Key string `json:"key" protobuf:"bytes,2,opt,name=key"` // Specify whether the ConfigMap or its key must be defined // +optional @@ -2583,7 +2757,7 @@ type ConfigMapKeySelector struct { // +structType=atomic type SecretKeySelector struct { // The name of the secret in the pod's namespace to select from. - LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` + LocalObjectReference `json:"" protobuf:"bytes,1,opt,name=localObjectReference"` // The key of the secret to select from. Must be a valid secret key. Key string `json:"key" protobuf:"bytes,2,opt,name=key"` // Specify whether the Secret or its key must be defined @@ -2610,9 +2784,10 @@ type EnvFromSource struct { // // The contents of the target ConfigMap's Data field will represent the // key-value pairs as environment variables. +// Keys in the BinaryData field are not currently propagated to container env vars. type ConfigMapEnvSource struct { // The ConfigMap to select from. - LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` + LocalObjectReference `json:"" protobuf:"bytes,1,opt,name=localObjectReference"` // Specify whether the ConfigMap must be defined // +optional Optional *bool `json:"optional,omitempty" protobuf:"varint,2,opt,name=optional"` @@ -2625,7 +2800,7 @@ type ConfigMapEnvSource struct { // key-value pairs as environment variables. type SecretEnvSource struct { // The Secret to select from. - LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` + LocalObjectReference `json:"" protobuf:"bytes,1,opt,name=localObjectReference"` // Specify whether the Secret must be defined // +optional Optional *bool `json:"optional,omitempty" protobuf:"varint,2,opt,name=optional"` @@ -2640,6 +2815,19 @@ type HTTPHeader struct { Value string `json:"value" protobuf:"bytes,2,opt,name=value"` } +// HTTPProtocol selects the wire protocol for the HTTP probe, +// independently of the URI scheme. +// +enum +type HTTPProtocol string + +const ( + // HTTPProtocolHTTP1 uses HTTP/1.1 (the existing default). + HTTPProtocolHTTP1 HTTPProtocol = "HTTP1" + // HTTPProtocolHTTP2 uses HTTP/2. + // Currently, only cleartext with prior knowledge (h2c) is supported, and must be used with scheme HTTP. + HTTPProtocolHTTP2 HTTPProtocol = "HTTP2" +) + // HTTPGetAction describes an action based on HTTP Get requests. type HTTPGetAction struct { // Path to access on the HTTP server. @@ -2661,6 +2849,11 @@ type HTTPGetAction struct { // +optional // +listType=atomic HTTPHeaders []HTTPHeader `json:"httpHeaders,omitempty" protobuf:"bytes,5,rep,name=httpHeaders"` + // Protocol selects the wire protocol for the probe connection. + // Nil defaults to HTTP/1.1. + // +optional + // +featureGate=H2CContainerProbe + Protocol *HTTPProtocol `json:"protocol,omitempty" protobuf:"bytes,6,opt,name=protocol,casttype=HTTPProtocol"` } // URIScheme identifies the scheme used for connection to a host for Get actions @@ -2697,8 +2890,29 @@ type GRPCAction struct { // +optional // +default="" Service *string `json:"service" protobuf:"bytes,2,opt,name=service"` + + // mode specifies the connection mode for the gRPC health probe. + // Set to "TLS" to use TLS without certificate verification. + // Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + // If not specified, the probe uses a plaintext (insecure) connection. + // +featureGate=GRPCContainerProbeTLS + // +optional + Mode *GRPCProbeMode `json:"mode,omitempty" protobuf:"bytes,3,opt,name=mode,casttype=GRPCProbeMode"` } +// GRPCProbeMode describes the connection mode for a gRPC probe. +// +enum +type GRPCProbeMode string + +const ( + // GRPCProbeModePlaintext indicates that the probe should use a plaintext + // (insecure) gRPC connection. + GRPCProbeModePlaintext GRPCProbeMode = "Plaintext" + // GRPCProbeModeTLS indicates that the probe should connect using TLS + // without certificate verification. + GRPCProbeModeTLS GRPCProbeMode = "TLS" +) + // ExecAction describes a "run in container" action. type ExecAction struct { // Command is the command line to execute inside the container, the working directory for the @@ -2721,7 +2935,7 @@ type SleepAction struct { // alive or ready to receive traffic. type Probe struct { // The action taken to determine the health of a container - ProbeHandler `json:",inline" protobuf:"bytes,1,opt,name=handler"` + ProbeHandler `json:"" protobuf:"bytes,1,opt,name=handler"` // Number of seconds after the container has started before liveness probes are initiated. // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes // +optional @@ -3407,8 +3621,13 @@ type ContainerStatus struct { // ResourceStatus represents the status of a single resource allocated to a Pod. type ResourceStatus struct { // Name of the resource. Must be unique within the pod and in case of non-DRA resource, match one of the resources from the pod spec. - // For DRA resources, the value must be "claim:/". - // When this status is reported about a container, the "claim_name" and "request" must match one of the claims of this container. + // For DRA resources, the value must be "claim:/" when + // container.resources.claims[*].request is set or "claim:" when + // container.resources.claims[*].request is empty. + // For DRA-backed extended resources, "claim:/" is used + // when the claim name and request name are recorded in pod.status.extendedResourceClaimStatus. + // When this status is reported about a container, the "claim_name" and "request" + // must match one of the claims of this container. // +required Name ResourceName `json:"name" protobuf:"bytes,1,opt,name=name"` // List of unique resources health. Each element in the list contains an unique resource ID and its health. @@ -4092,6 +4311,8 @@ type Toleration struct { // Key is the taint key that the toleration applies to. Empty means match all taint keys. // If the key is empty, operator must be Exists; this combination means to match all values and all keys. // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:format=k8s-label-key Key string `json:"key,omitempty" protobuf:"bytes,1,opt,name=key"` // Operator represents a key's relationship to the value. // Valid operators are Exists, Equal, Lt, and Gt. Defaults to Equal. @@ -4222,7 +4443,6 @@ type PodSpec struct { ServiceAccountName string `json:"serviceAccountName,omitempty" protobuf:"bytes,8,opt,name=serviceAccountName"` // DeprecatedServiceAccount is a deprecated alias for ServiceAccountName. // Deprecated: Use serviceAccountName instead. - // +k8s:conversion-gen=false // +optional DeprecatedServiceAccount string `json:"serviceAccount,omitempty" protobuf:"bytes,9,opt,name=serviceAccount"` // AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. @@ -4241,17 +4461,14 @@ type PodSpec struct { // When `hostNetwork` is true, specified `hostPort` fields in port definitions must match `containerPort`, // and unspecified `hostPort` fields in port definitions are defaulted to match `containerPort`. // Default to false. - // +k8s:conversion-gen=false // +optional HostNetwork bool `json:"hostNetwork,omitempty" protobuf:"varint,11,opt,name=hostNetwork"` // Use the host's pid namespace. // Optional: Default to false. - // +k8s:conversion-gen=false // +optional HostPID bool `json:"hostPID,omitempty" protobuf:"varint,12,opt,name=hostPID"` // Use the host's ipc namespace. // Optional: Default to false. - // +k8s:conversion-gen=false // +optional HostIPC bool `json:"hostIPC,omitempty" protobuf:"varint,13,opt,name=hostIPC"` // Share a single process namespace between all of the containers in a pod. @@ -4259,7 +4476,6 @@ type PodSpec struct { // in the same pod, and the first process in each container will not be assigned PID 1. // HostPID and ShareProcessNamespace cannot both be set. // Optional: Default to false. - // +k8s:conversion-gen=false // +optional ShareProcessNamespace *bool `json:"shareProcessNamespace,omitempty" protobuf:"varint,27,opt,name=shareProcessNamespace"` // SecurityContext holds pod-level security attributes and common container settings. @@ -4293,6 +4509,7 @@ type PodSpec struct { // If specified, the pod's tolerations. // +optional // +listType=atomic + // +k8s:alpha(since: "1.37")=+k8s:optional Tolerations []Toleration `json:"tolerations,omitempty" protobuf:"bytes,22,opt,name=tolerations"` // HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts // file if specified. @@ -4343,6 +4560,8 @@ type PodSpec struct { EnableServiceLinks *bool `json:"enableServiceLinks,omitempty" protobuf:"varint,30,opt,name=enableServiceLinks"` // PreemptionPolicy is the Policy for preempting pods with lower priority. // One of Never, PreemptLowerPriority. + // When Priority Admission Controller is enabled, it prevents users from setting + // this field. The admission controller populates this field from PriorityClassName. // Defaults to PreemptLowerPriority if unset. // +optional PreemptionPolicy *PreemptionPolicy `json:"preemptionPolicy,omitempty" protobuf:"bytes,31,opt,name=preemptionPolicy"` @@ -4415,7 +4634,6 @@ type PodSpec struct { // When set to false, a new userns is created for the pod. Setting false is useful for // mitigating container breakout vulnerabilities even allowing users to run their // containers as root without actually having root privileges on the host. - // +k8s:conversion-gen=false // +optional HostUsers *bool `json:"hostUsers,omitempty" protobuf:"bytes,37,opt,name=hostUsers"` @@ -4471,7 +4689,6 @@ type PodSpec struct { // - `hostNetwork` must be set to false. // // This field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters. - // Requires the HostnameOverride feature gate to be enabled. // // +featureGate=HostnameOverride // +optional @@ -4497,6 +4714,34 @@ type PodSpec struct { // +featureGate=GenericWorkload // +optional SchedulingGroup *PodSchedulingGroup `json:"schedulingGroup,omitempty" protobuf:"bytes,43,opt,name=schedulingGroup"` + + // evictionResponders reference responders that react to Evictions based on EvictionRequests. + // Responders should observe and communicate through the Eviction Resource API to help with + // the graceful termination of a pod. The responders are selected sequentially, according to + // their specified priority. + // + // Responders should periodically report on an eviction progress by updating the + // .status.responders[].heartbeatTime field of the Eviction object. If this field is not updated + // within the heartbeat deadline defined by the Eviction API (currently 20 minutes), the eviction + // is passed over to the next responder with a lower priority. If there is no other responder, + // the last default imperative-eviction.k8s.io/evictor responder with a priority of 100 will + // evict the pod using the imperative Eviction API (pods//eviction subresource). + // + // The maximum length of the responders list is 10. + // Responders are not supported when the pod is part of a PodGroup (.spec.schedulingGroup is set). + // This field can only be set on creation and is immutable afterwards. + // +featureGate=EvictionRequestAPI + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=10 + // +k8s:alpha(since: "1.37")=+k8s:dependentForbidden("schedulingGroup") + EvictionResponders []EvictionResponder `json:"evictionResponders,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,44,rep,name=evictionResponders"` } // PodResourceClaim references exactly one ResourceClaim, either directly @@ -4964,11 +5209,8 @@ type PodSecurityContext struct { // Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes // whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their // CSIDriver instance. Other volumes are always re-labelled recursively. - // "MountOption" value is allowed only when SELinuxMount feature gate is enabled. // - // If not specified and SELinuxMount feature gate is enabled, "MountOption" is used. - // If not specified and SELinuxMount feature gate is disabled, "MountOption" is used for ReadWriteOncePod volumes - // and "Recursive" for all other volumes. + // If not specified, "MountOption" is used. // // This field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers. // @@ -5288,7 +5530,7 @@ type EphemeralContainer struct { // specific to ephemeral containers. Fields in common with Container are in the // following inlined struct so than an EphemeralContainer may easily be converted // to a Container. - EphemeralContainerCommon `json:",inline" protobuf:"bytes,1,req"` + EphemeralContainerCommon `json:"" protobuf:"bytes,1,req"` // If set, the name of the container from PodSpec that this ephemeral container targets. // The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. @@ -5300,6 +5542,43 @@ type EphemeralContainer struct { TargetContainerName string `json:"targetContainerName,omitempty" protobuf:"bytes,2,opt,name=targetContainerName"` } +// EvictionResponder allows you to specify the responder reacting to an Eviction. +// Responders should observe and communicate through the Eviction Resource API to help with +// the graceful eviction of a target (e.g. termination of a pod). +// +structType=atomic +type EvictionResponder struct { + // name allows you to identify the responder responding to the Eviction. + // + // It must be a valid domain-prefixed key (such as "acme.io/foo"). + // Domain names *.k8s.io and *.kubernetes.io are reserved. + // This field must be unique for each responder. + // This field is required. + // +required + // +k8s:required + // +k8s:format=k8s-prefixed-label-key + // +k8s:customValidation + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + + // priority for this responder. Higher priorities are selected first by the evictionrequest-controller. + // If there are responders with the same priority, the responder whose domain name comes first in the + // alphabetical higher domain order, will be picked. This means that the top domain labels are compared + // alphabetically first, followed by the lower domain labels. The key is compared last. + // + // The responder that is the managing controller of the pod should set the value of + // this field to 10000 to allow both for preemption or fallback registration by other + // responders. + // + // The minimum value is 0 and the maximum value is 100000. + // The interval 0-999 is reserved for responders with *.k8s.io suffix. + // This field is required. + // +required + // +k8s:required + // +k8s:minimum=0 + // +k8s:maximum=100000 + // +k8s:customValidation + Priority *int32 `json:"priority" protobuf:"varint,2,opt,name=priority"` +} + // PodStatus represents information about the status of a pod. Status may trail the actual // state of a system, especially if the node that hosts the pod cannot contact the control // plane. @@ -5476,27 +5755,25 @@ type PodStatus struct { // Examples include "cpu", "memory", "ephemeral-storage", and hugepages. // +featureGate=DRANodeAllocatableResources // +optional - // +listType=atomic - NodeAllocatableResourceClaimStatuses []NodeAllocatableResourceClaimStatus `json:"nodeAllocatableResourceClaimStatuses,omitempty" protobuf:"bytes,21,rep,name=nodeAllocatableResourceClaimStatuses"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.0 + // +patchStrategy=merge + // +patchMergeKey=resourceClaimName + // +listType=map + // +listMapKey=resourceClaimName + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=resourceClaimName + NodeAllocatableResourceClaimStatuses []NodeAllocatableResourceClaimStatus `json:"nodeAllocatableResourceClaimStatuses,omitempty" patchStrategy:"merge" patchMergeKey:"resourceClaimName" protobuf:"bytes,21,rep,name=nodeAllocatableResourceClaimStatuses"` -// PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded -type PodStatusResult struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Most recently observed status of the pod. - // This data may not be up to date. - // Populated by the system. - // Read-only. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // volumeHealth contains node-reported health for each volume the pod is using. + // Populated by the kubelet on the pod's node. + // +featureGate=CSIVolumeHealth // +optional - Status PodStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + VolumeHealth []PodVolumeHealth `json:"volumeHealth,omitempty" protobuf:"bytes,22,rep,name=volumeHealth"` } // +genclient @@ -5507,8 +5784,12 @@ type PodStatusResult struct { // Pod is a collection of containers that can run on a host. This resource is created // by clients and scheduled onto hosts. +// +k8s:supportsSubresource="/status" +// +k8s:supportsSubresource="/ephemeralcontainers" +// +k8s:supportsSubresource="/resize" +// +k8s:supportsSubresource="/eviction" type Pod struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -5533,7 +5814,7 @@ type Pod struct { // PodList is a list of Pods. type PodList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -5549,6 +5830,7 @@ type PodTemplateSpec struct { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Specification of the desired behavior of the pod. @@ -5563,7 +5845,7 @@ type PodTemplateSpec struct { // PodTemplate describes a template for creating copies of a predefined pod. type PodTemplate struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -5580,7 +5862,7 @@ type PodTemplate struct { // PodTemplateList is a list of PodTemplates. type PodTemplateList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -5597,18 +5879,18 @@ type ReplicationControllerSpec struct { // Defaults to 1. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +default=1 - // +k8s:alpha(since: "1.36")=+k8s:minimum=0 + // +k8s:beta(since: "1.37")=+k8s:minimum=0 Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"` // Minimum number of seconds for which a newly created pod should be ready // without any of its container crashing, for it to be considered available. // Defaults to 0 (pod will be considered available as soon as it is ready) // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +default=0 - // +k8s:alpha(since: "1.36")=+k8s:minimum=0 + // +k8s:beta(since: "1.37")=+k8s:minimum=0 MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,4,opt,name=minReadySeconds"` // Selector is a label query over pods that should match the Replicas count. @@ -5631,6 +5913,7 @@ type ReplicationControllerSpec struct { // The only allowed template.spec.restartPolicy value is "Always". // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional Template *PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,3,opt,name=template"` } @@ -5699,17 +5982,18 @@ type ReplicationControllerCondition struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.0 // +k8s:supportsSubresource="/scale" +// +k8s:supportsSubresource="/status" // ReplicationController represents the configuration of a replication controller. type ReplicationController struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // If the Labels of a ReplicationController are empty, they are defaulted to // be the same as the Pod(s) that the replication controller manages. // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional - // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:format=k8s-long-name metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec defines the specification of the desired behavior of the replication controller. @@ -5731,7 +6015,7 @@ type ReplicationController struct { // ReplicationControllerList is a collection of replication controllers. type ReplicationControllerList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -5891,6 +6175,7 @@ type ServiceStatus struct { // +patchStrategy=merge // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:eachVal=+k8s:opaqueType Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=conditions"` } @@ -6295,8 +6580,10 @@ type ServicePort struct { // Service is a named abstraction of software service (for example, mysql) consisting of local port // (for example 3306) that the proxy listens on, and the selector that determines which pods // will answer requests sent through the proxy. +// +k8s:supportsSubresource="/status" +// +k8s:supportsSubresource="/proxy" type Service struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -6326,7 +6613,7 @@ const ( // ServiceList holds a list of services. type ServiceList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -6346,7 +6633,7 @@ type ServiceList struct { // * a principal that can be authenticated and authorized // * a set of secrets type ServiceAccount struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -6385,7 +6672,7 @@ type ServiceAccount struct { // ServiceAccountList is a list of ServiceAccount objects type ServiceAccountList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -6419,7 +6706,7 @@ type ServiceAccountList struct { // // Deprecated: This API is deprecated in v1.33+. Use discoveryv1.EndpointSlice. type Endpoints struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -6534,7 +6821,7 @@ type EndpointPort struct { // EndpointsList is a list of endpoints. // Deprecated: This API is deprecated in v1.33+. type EndpointsList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -6560,6 +6847,9 @@ type NodeSpec struct { // ID of the node assigned by the cloud provider in the format: :// // +optional + // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:alpha(since: "1.36")=+k8s:update=NoModify + // +k8s:alpha(since: "1.36")=+k8s:update=NoUnset ProviderID string `json:"providerID,omitempty" protobuf:"bytes,3,opt,name=providerID"` // Unschedulable controls node schedulability of new pods. By default, node is schedulable. // More info: https://kubernetes.io/docs/concepts/nodes/node/#manual-node-administration @@ -6578,6 +6868,29 @@ type NodeSpec struct { // see: https://issues.k8s.io/61966 // +optional DoNotUseExternalID string `json:"externalID,omitempty" protobuf:"bytes,2,opt,name=externalID"` + + // PodPreemptionPolicy controls the node-level preemption behaviors for pods on this node. + // This is an alpha field and requires enabling the InPlacePodVerticalScalingSchedulerPreemption feature gate. + // +featureGate=InPlacePodVerticalScalingSchedulerPreemption + // +optional + // +k8s:optional + // +k8s:ifDisabled(InPlacePodVerticalScalingSchedulerPreemption)=+k8s:forbidden + PodPreemptionPolicy *NodePodPreemptionPolicy `json:"podPreemptionPolicy,omitempty" protobuf:"bytes,8,opt,name=podPreemptionPolicy"` +} + +// NodePodPreemptionPolicy defines the node-level policies governing preemption for pods on this node. +type NodePodPreemptionPolicy struct { + // DisableResizePreemption lists the owners (e.g., autoscalers, operators, administrators) + // that have requested to disable scheduler and Kubelet preemption for in-place pod resize on this node. + // If this list is non-empty, resize-induced preemption is disabled on this node. + // This is an alpha field and requires enabling the InPlacePodVerticalScalingSchedulerPreemption feature gate. + // +listType=set + // +k8s:listType=set + // +optional + // +k8s:maxItems=20 + // +k8s:optional + // +k8s:eachVal=+k8s:format=k8s-label-key + DisableResizePreemption []string `json:"disableResizePreemption,omitempty" protobuf:"bytes,1,rep,name=disableResizePreemption"` } // NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil. @@ -6701,6 +7014,10 @@ type NodeSystemInfo struct { Architecture string `json:"architecture" protobuf:"bytes,10,opt,name=architecture"` // Swap Info reported by the node. Swap *NodeSwapStatus `json:"swap,omitempty" protobuf:"bytes,11,opt,name=swap"` + // Whether the node is running in a user namespace. + // +featureGate=KubeletInUserNamespace + // +optional + RunningInUserNamespace *bool `json:"runningInUserNamespace,omitempty" protobuf:"varint,12,opt,name=runningInUserNamespace"` } // NodeSwapStatus represents swap memory information. @@ -6918,6 +7235,37 @@ const ( NodePIDPressure NodeConditionType = "PIDPressure" // NodeNetworkUnavailable means that network for the node is not correctly configured. NodeNetworkUnavailable NodeConditionType = "NetworkUnavailable" + // NodeGracefulNodeShutdownInProgress reports whether Graceful Node Shutdown is determined to be in progress on this Node. + // + // The admin is responsible for setting and clearing this condition. + NodeGracefulNodeShutdownInProgress NodeConditionType = "GracefulNodeShutdownInProgress" + // NodeDrainInProgress reports that this Node is actively being drained, + // according to the admin's definition of drain. + // Commonly, this involves removing some amount of Pods, volumes, and networks. + // + // The admin is responsible for setting and clearing this condition. + NodeDrainInProgress NodeConditionType = "DrainInProgress" + // NodeDrained reports that this Node has reached the drain criteria selected by the admin. + // + // The admin is responsible for setting and clearing this condition. + NodeDrained NodeConditionType = "Drained" + // NodeMaintenancePlanned reports that this Node is expected to undergo a change in the future. + // If this change impacts Node users, the admin should drain the Node first. + // + // Admins can use the Node maintenance condition for cases like hardware or software rollout, + // remediation, decommissioning, or debugging. + // + // The admin is responsible for setting and clearing this condition. + NodeMaintenancePlanned NodeConditionType = "MaintenancePlanned" + // NodeMaintenanceInProgress reports that this Node is actively undergoing maintenance. + // + // The admin decides whether the change will impact Node users and require a Node drain. + // For example, it is recommended to drain a Node before a Kubernetes upgrade. + // In contrast, a kernel live patch may not require a Node drain, but it can still be useful + // to communicate that maintenance is in progress. + // + // The admin is responsible for setting and clearing this condition. + NodeMaintenanceInProgress NodeConditionType = "MaintenanceInProgress" ) // NodeCondition contains condition information for a node. @@ -7030,8 +7378,10 @@ type ResourceList map[ResourceName]resource.Quantity // Node is a worker node in Kubernetes. // Each node will have a unique identifier in the cache (i.e. in etcd). +// +k8s:supportsSubresource="/status" +// +k8s:supportsSubresource="/proxy" type Node struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -7055,7 +7405,7 @@ type Node struct { // NodeList is the whole list of all Nodes which have been registered with master. type NodeList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -7157,8 +7507,10 @@ type NamespaceCondition struct { // Namespace provides a scope for Names. // Use of multiple namespaces is optional. +// +k8s:supportsSubresource="/status" +// +k8s:supportsSubresource="/finalize" type Namespace struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -7180,7 +7532,7 @@ type Namespace struct { // NamespaceList is a list of Namespaces. type NamespaceList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -7196,10 +7548,11 @@ type NamespaceList struct { // Binding ties one object to another; for example, a pod is bound to a node by a scheduler. type Binding struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // The target object that you want to bind to the standard object. @@ -7229,7 +7582,7 @@ const ( // PodLogOptions is the query options for a Pod's logs REST call. type PodLogOptions struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // The container for which to stream logs. Defaults to only container if there is one container in the pod. // +optional @@ -7294,7 +7647,7 @@ type PodLogOptions struct { // TODO: merge w/ PodExecOptions below for stdin, stdout, etc // and also when we cut V2, we should export a "StreamOptions" or somesuch that contains Stdin, Stdout, Stder and TTY type PodAttachOptions struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Stdin if true, redirects the standard input stream of the pod for this call. // Defaults to false. @@ -7333,7 +7686,7 @@ type PodAttachOptions struct { // TODO: This is largely identical to PodAttachOptions above, make sure they stay in sync and see about merging // and also when we cut V2, we should export a "StreamOptions" or somesuch that contains Stdin, Stdout, Stder and TTY type PodExecOptions struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Redirect the standard input stream of the pod for this call. // Defaults to false. @@ -7374,7 +7727,7 @@ type PodExecOptions struct { // Port forwarding over SPDY does not use these options. It requires the port // to be passed in the `port` header as part of request. type PodPortForwardOptions struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // List of ports to forward // Required when using WebSockets @@ -7389,7 +7742,7 @@ type PodPortForwardOptions struct { // PodProxyOptions is the query options to a Pod's proxy call. type PodProxyOptions struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Path is the URL path to use for the current proxy request to pod. // +optional @@ -7402,7 +7755,7 @@ type PodProxyOptions struct { // NodeProxyOptions is the query options to a Node's proxy call. type NodeProxyOptions struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Path is the URL path to use for the current proxy request to node. // +optional @@ -7415,7 +7768,7 @@ type NodeProxyOptions struct { // ServiceProxyOptions is the query options to a Service's proxy call. type ServiceProxyOptions struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Path is the part of URLs that include service endpoints, suffixes, // and parameters to use for the current proxy request to service. @@ -7542,7 +7895,7 @@ type TypedLocalObjectReference struct { // SerializedReference is a reference to serialized object. type SerializedReference struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // The reference to an object in the system. // +optional Reference ObjectReference `json:"reference,omitempty" protobuf:"bytes,1,opt,name=reference"` @@ -7577,7 +7930,7 @@ const ( // continued existence of events with that Reason. Events should be // treated as informative, best-effort, supplemental data. type Event struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata metav1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"` @@ -7657,7 +8010,7 @@ type EventSeries struct { // EventList is a list of events. type EventList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -7720,7 +8073,7 @@ type LimitRangeSpec struct { // LimitRange sets resource usage limits for each kind of resource in a Namespace. type LimitRange struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -7737,7 +8090,7 @@ type LimitRange struct { // LimitRangeList is a list of LimitRange items. type LimitRangeList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -7892,8 +8245,9 @@ type ResourceQuotaStatus struct { // +k8s:prerelease-lifecycle-gen:introduced=1.0 // ResourceQuota sets aggregate quota restrictions enforced per namespace +// +k8s:supportsSubresource="/status" type ResourceQuota struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -7915,7 +8269,7 @@ type ResourceQuota struct { // ResourceQuotaList is a list of ResourceQuota items. type ResourceQuotaList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -7933,7 +8287,7 @@ type ResourceQuotaList struct { // Secret holds secret data of a certain type. The total bytes of the values in // the Data field must be less than MaxSecretSize bytes. type Secret struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -7964,6 +8318,8 @@ type Secret struct { // Used to facilitate programmatic handling of secret data. // More info: https://kubernetes.io/docs/concepts/configuration/secret/#secret-types // +optional + // +k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:immutable Type SecretType `json:"type,omitempty" protobuf:"bytes,3,opt,name=type,casttype=SecretType"` } @@ -8059,7 +8415,7 @@ const ( // SecretList is a list of Secret. type SecretList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -8076,7 +8432,7 @@ type SecretList struct { // ConfigMap holds configuration data for pods to consume. type ConfigMap struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -8104,6 +8460,8 @@ type ConfigMap struct { // the Data field, this is enforced during validation process. // Using this field will require 1.10+ apiserver and // kubelet. + // Note: BinaryData keys are not currently propagated to container env vars + // via ConfigMapKeyRef or ConfigMapRef env sources; only Data keys are used. // +optional BinaryData map[string][]byte `json:"binaryData,omitempty" protobuf:"bytes,3,rep,name=binaryData"` } @@ -8113,7 +8471,7 @@ type ConfigMap struct { // ConfigMapList is a resource containing a list of ConfigMap objects. type ConfigMapList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -8157,10 +8515,11 @@ type ComponentCondition struct { // ComponentStatus (and ComponentStatusList) holds the cluster validation info. // Deprecated: This API is deprecated in v1.19+ type ComponentStatus struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // List of component conditions observed @@ -8178,7 +8537,7 @@ type ComponentStatus struct { // Status of all the conditions for the component as a list of ComponentStatus objects. // Deprecated: This API is deprecated in v1.19+ type ComponentStatusList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -8205,6 +8564,12 @@ type DownwardAPIVolumeSource struct { // mode, like fsGroup, and the result can be other mode bits set. // +optional DefaultMode *int32 `json:"defaultMode,omitempty" protobuf:"varint,2,opt,name=defaultMode"` + // defaultUser is Optional: The owner UID of the created files by default. + // The defaultUser field is only used as a fallback when the item-level user field is unset. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + // +featureGate=AtomicWriteVolumeUserFields + // +optional + DefaultUser *int64 `json:"defaultUser,omitempty" protobuf:"varint,3,opt,name=defaultUser"` } const ( @@ -8230,6 +8595,12 @@ type DownwardAPIVolumeFile struct { // mode, like fsGroup, and the result can be other mode bits set. // +optional Mode *int32 `json:"mode,omitempty" protobuf:"varint,4,opt,name=mode"` + // user is Optional: The owner UID of the created file. + // If specified, the item-level user field takes precedence over defaultUser. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + // +featureGate=AtomicWriteVolumeUserFields + // +optional + User *int64 `json:"user,omitempty" protobuf:"varint,5,opt,name=user"` } // Represents downward API info for projecting into a projected volume. @@ -8388,10 +8759,11 @@ type WindowsSecurityContextOptions struct { // RangeAllocation is not a public type. type RangeAllocation struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Range is string that identifies the range represented by 'data'. @@ -8518,12 +8890,78 @@ type ImageVolumeSource struct { type NodeAllocatableResourceClaimStatus struct { // ResourceClaimName is the resource claim referenced by the pod that resulted in this node allocatable resource allocation. // +required + // +k8s:required ResourceClaimName string `json:"resourceClaimName" protobuf:"bytes,1,opt,name=resourceClaimName"` // Containers lists the names of all containers in this pod that reference the claim. // +optional // +listType=set + // +k8s:optional + // +k8s:listType=set Containers []string `json:"containers,omitempty" protobuf:"bytes,2,rep,name=containers"` - // Resources is a map of the node-allocatable resource name to the aggregate quantity allocated to the claim. + + // Resources is tombstoned since it got replaced with more granular Mapping and Overhead fields. + // Resources map[ResourceName]resource.Quantity `json:"resources,omitempty" protobuf:"bytes,3,rep,name=resources"` + + // Mapping contains allocations through devices mapped in the device spec's `nodeAllocatableResources[...].mapping` field. + // This is used by kubelet for pod level and container-level cgroup enforcement. + // +optional + // +patchStrategy=merge + // +patchMergeKey=name + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + Mapping []NodeAllocatableMappedResources `json:"mapping,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,4,rep,name=mapping"` + // Overhead contains allocations through devices mapped in the device spec's `nodeAllocatableResources[...].overhead` field. + // This is used by kubelet for pod level and container-level cgroup enforcement. + // +optional + // +patchStrategy=merge + // +patchMergeKey=name + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + Overhead []NodeAllocatableOverheadResources `json:"overhead,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,5,rep,name=overhead"` +} + +// NodeAllocatableMappedResources describes mapped node allocatable resource allocations. +type NodeAllocatableMappedResources struct { + // Name is the name of the resource (e.g., cpu, memory). + // +required + // +k8s:required + Name ResourceName `json:"name" protobuf:"bytes,1,opt,name=name,casttype=ResourceName"` + // Quantity is the total node allocatable resource capacity allocated for the claim. + // This claim's allocated devices is shared by all the containers referencing the claim. + // Kubelet adds this value to both requests and limits at the pod-level cgroup, and to limits at the container-level cgroup for each container referencing the claim. + // +required + // +k8s:required + Quantity *resource.Quantity `json:"quantity" protobuf:"bytes,2,opt,name=quantity"` +} + +// NodeAllocatableOverheadResources describes auxiliary overhead resource allocations. +type NodeAllocatableOverheadResources struct { + // Name is the name of the resource (e.g., cpu, memory). // +required - Resources map[ResourceName]resource.Quantity `json:"resources" protobuf:"bytes,3,rep,name=resources"` + // +k8s:required + Name ResourceName `json:"name" protobuf:"bytes,1,opt,name=name,casttype=ResourceName"` + // PerPod is the flat overhead quantity allocated per pod. + // Adding to each container limit allows individual containers to utilize the overhead, while the parent pod-level cgroup limit caps the total usage at the pod boundary where the overhead is accounted for exactly once. + // At least one of PerPod or PerContainer must be specified. Specifying neither is an invalid configuration. + // +optional + // +k8s:optional + PerPod *resource.Quantity `json:"perPod,omitempty" protobuf:"bytes,2,opt,name=perPod"` + // PerContainer is the variable overhead quantity applied for each container referencing the claim. + // The container references are recorded in `nodeAllocatableResourceClaimStatuses.containers`. + // The total overhead quantity allocated for the claim is computed as: + // Quantity = PerPod + (PerContainer * NumReferences) + // Kubelet accounts for this overhead in cgroups: + // - Pod-level cgroup (requests and limits): Kubelet adds PerPod + (PerContainer * NumReferences). + // - Container-level cgroup (limits only): Kubelet adds PerPod + PerContainer for each referencing container. + // This allows any single container to access the pod-level overhead, while the parent cgroup caps the total usage to account for PerPod exactly once. + // At least one of PerPod or PerContainer must be specified. Specifying neither is an invalid configuration. + // +optional + // +k8s:optional + PerContainer *resource.Quantity `json:"perContainer,omitempty" protobuf:"bytes,3,opt,name=perContainer"` } diff --git a/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go index 97eb5ceec3..4b68c56852 100644 --- a/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go @@ -235,6 +235,7 @@ var map_ClusterTrustBundleProjection = map[string]string{ "labelSelector": "Select all ClusterTrustBundles that match this label selector. Only has effect if signerName is set. Mutually-exclusive with name. If unset, interpreted as \"match nothing\". If set but empty, interpreted as \"match everything\".", "optional": "If true, don't block pod startup if the referenced ClusterTrustBundle(s) aren't available. If using name, then the named ClusterTrustBundle is allowed not to exist. If using signerName, then the combination of signerName and labelSelector is allowed to match zero ClusterTrustBundles.", "path": "Relative path from the volume root to write the bundle.", + "user": "user is Optional: The owner UID of the created file. If specified, the item-level user field takes precedence over defaultUser. (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled.", } func (ClusterTrustBundleProjection) SwaggerDoc() map[string]string { @@ -278,7 +279,7 @@ var map_ConfigMap = map[string]string{ "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "immutable": "Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil.", "data": "Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'. Values with non-UTF-8 byte sequences must use the BinaryData field. The keys stored in Data must not overlap with the keys in the BinaryData field, this is enforced during validation process.", - "binaryData": "BinaryData contains the binary data. Each key must consist of alphanumeric characters, '-', '_' or '.'. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet.", + "binaryData": "BinaryData contains the binary data. Each key must consist of alphanumeric characters, '-', '_' or '.'. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet. Note: BinaryData keys are not currently propagated to container env vars via ConfigMapKeyRef or ConfigMapRef env sources; only Data keys are used.", } func (ConfigMap) SwaggerDoc() map[string]string { @@ -286,7 +287,7 @@ func (ConfigMap) SwaggerDoc() map[string]string { } var map_ConfigMapEnvSource = map[string]string{ - "": "ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.", + "": "ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables. Keys in the BinaryData field are not currently propagated to container env vars.", "optional": "Specify whether the ConfigMap must be defined", } @@ -296,7 +297,7 @@ func (ConfigMapEnvSource) SwaggerDoc() map[string]string { var map_ConfigMapKeySelector = map[string]string{ "": "Selects a key from a ConfigMap.", - "key": "The key to select.", + "key": "The key to select from the ConfigMap's Data field. Keys in the BinaryData field are not currently propagated to container env vars.", "optional": "Specify whether the ConfigMap or its key must be defined", } @@ -342,6 +343,7 @@ var map_ConfigMapVolumeSource = map[string]string{ "items": "items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", "defaultMode": "defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "optional": "optional specify whether the ConfigMap or its keys must be defined", + "defaultUser": "defaultUser is Optional: The owner UID of the created files by default. The defaultUser field is only used as a fallback when the item-level user field is unset. (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled.", } func (ConfigMapVolumeSource) SwaggerDoc() map[string]string { @@ -546,6 +548,7 @@ var map_DownwardAPIVolumeFile = map[string]string{ "fieldRef": "Required: Selects a field of the pod: only annotations, labels, name, namespace and uid are supported.", "resourceFieldRef": "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.", "mode": "Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", + "user": "user is Optional: The owner UID of the created file. If specified, the item-level user field takes precedence over defaultUser. (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled.", } func (DownwardAPIVolumeFile) SwaggerDoc() map[string]string { @@ -556,6 +559,7 @@ var map_DownwardAPIVolumeSource = map[string]string{ "": "DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.", "items": "Items is a list of downward API volume file", "defaultMode": "Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", + "defaultUser": "defaultUser is Optional: The owner UID of the created files by default. The defaultUser field is only used as a fallback when the item-level user field is unset. (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled.", } func (DownwardAPIVolumeSource) SwaggerDoc() map[string]string { @@ -566,6 +570,7 @@ var map_EmptyDirVolumeSource = map[string]string{ "": "Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.", "medium": "medium represents what type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir", "sizeLimit": "sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir", + "mode": "mode specifies the permission bits for the emptyDir directory, in numeric notation (e.g., 0755, 01777). Must be a value between 0000 and 01777. If not specified, defaults to 0777. This might be in conflict with other options that affect the file mode, like fsGroup. If fsGroup is specified, the fsGroup permissions will override the mode specified here. This field has no effect on Windows. This field is alpha and requires EmptyDirVolumeMode featuregate to be enabled.", } func (EmptyDirVolumeSource) SwaggerDoc() map[string]string { @@ -766,6 +771,16 @@ func (EventSource) SwaggerDoc() map[string]string { return map_EventSource } +var map_EvictionResponder = map[string]string{ + "": "EvictionResponder allows you to specify the responder reacting to an Eviction. Responders should observe and communicate through the Eviction Resource API to help with the graceful eviction of a target (e.g. termination of a pod).", + "name": "name allows you to identify the responder responding to the Eviction.\n\nIt must be a valid domain-prefixed key (such as \"acme.io/foo\"). Domain names *.k8s.io and *.kubernetes.io are reserved. This field must be unique for each responder. This field is required.", + "priority": "priority for this responder. Higher priorities are selected first by the evictionrequest-controller. If there are responders with the same priority, the responder whose domain name comes first in the alphabetical higher domain order, will be picked. This means that the top domain labels are compared alphabetically first, followed by the lower domain labels. The key is compared last.\n\nThe responder that is the managing controller of the pod should set the value of this field to 10000 to allow both for preemption or fallback registration by other responders.\n\nThe minimum value is 0 and the maximum value is 100000. The interval 0-999 is reserved for responders with *.k8s.io suffix. This field is required.", +} + +func (EvictionResponder) SwaggerDoc() map[string]string { + return map_EvictionResponder +} + var map_ExecAction = map[string]string{ "": "ExecAction describes a \"run in container\" action.", "command": "Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.", @@ -852,6 +867,7 @@ var map_GRPCAction = map[string]string{ "": "GRPCAction specifies an action involving a GRPC service.", "port": "Port number of the gRPC service. Number must be in the range 1 to 65535.", "service": "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md).\n\nIf this is not specified, the default behavior is defined by gRPC.", + "mode": "mode specifies the connection mode for the gRPC health probe. Set to \"TLS\" to use TLS without certificate verification. Set to \"Plaintext\" to use a plaintext (insecure) connection explicitly. If not specified, the probe uses a plaintext (insecure) connection.", } func (GRPCAction) SwaggerDoc() map[string]string { @@ -899,6 +915,7 @@ var map_HTTPGetAction = map[string]string{ "host": "Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.", "scheme": "Scheme to use for connecting to the host. Defaults to HTTP.", "httpHeaders": "Custom headers to set in the request. HTTP allows repeated headers.", + "protocol": "Protocol selects the wire protocol for the probe connection. Nil defaults to HTTP/1.1.", } func (HTTPGetAction) SwaggerDoc() map[string]string { @@ -1006,6 +1023,7 @@ var map_KeyToPath = map[string]string{ "key": "key is the key to project.", "path": "path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.", "mode": "mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", + "user": "user is Optional: The owner UID of the created file. If specified, the item-level user field takes precedence over defaultUser. (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled.", } func (KeyToPath) SwaggerDoc() map[string]string { @@ -1234,11 +1252,33 @@ func (NodeAffinity) SwaggerDoc() map[string]string { return map_NodeAffinity } +var map_NodeAllocatableMappedResources = map[string]string{ + "": "NodeAllocatableMappedResources describes mapped node allocatable resource allocations.", + "name": "Name is the name of the resource (e.g., cpu, memory).", + "quantity": "Quantity is the total node allocatable resource capacity allocated for the claim. This claim's allocated devices is shared by all the containers referencing the claim. Kubelet adds this value to both requests and limits at the pod-level cgroup, and to limits at the container-level cgroup for each container referencing the claim.", +} + +func (NodeAllocatableMappedResources) SwaggerDoc() map[string]string { + return map_NodeAllocatableMappedResources +} + +var map_NodeAllocatableOverheadResources = map[string]string{ + "": "NodeAllocatableOverheadResources describes auxiliary overhead resource allocations.", + "name": "Name is the name of the resource (e.g., cpu, memory).", + "perPod": "PerPod is the flat overhead quantity allocated per pod. Adding to each container limit allows individual containers to utilize the overhead, while the parent pod-level cgroup limit caps the total usage at the pod boundary where the overhead is accounted for exactly once. At least one of PerPod or PerContainer must be specified. Specifying neither is an invalid configuration.", + "perContainer": "PerContainer is the variable overhead quantity applied for each container referencing the claim. The container references are recorded in `nodeAllocatableResourceClaimStatuses.containers`. The total overhead quantity allocated for the claim is computed as: Quantity = PerPod + (PerContainer * NumReferences) Kubelet accounts for this overhead in cgroups: - Pod-level cgroup (requests and limits): Kubelet adds PerPod + (PerContainer * NumReferences). - Container-level cgroup (limits only): Kubelet adds PerPod + PerContainer for each referencing container. This allows any single container to access the pod-level overhead, while the parent cgroup caps the total usage to account for PerPod exactly once. At least one of PerPod or PerContainer must be specified. Specifying neither is an invalid configuration.", +} + +func (NodeAllocatableOverheadResources) SwaggerDoc() map[string]string { + return map_NodeAllocatableOverheadResources +} + var map_NodeAllocatableResourceClaimStatus = map[string]string{ "": "NodeAllocatableResourceClaimStatus describes the status of node allocatable resources allocated via DRA.", "resourceClaimName": "ResourceClaimName is the resource claim referenced by the pod that resulted in this node allocatable resource allocation.", "containers": "Containers lists the names of all containers in this pod that reference the claim.", - "resources": "Resources is a map of the node-allocatable resource name to the aggregate quantity allocated to the claim.", + "mapping": "Mapping contains allocations through devices mapped in the device spec's `nodeAllocatableResources[...].mapping` field. This is used by kubelet for pod level and container-level cgroup enforcement.", + "overhead": "Overhead contains allocations through devices mapped in the device spec's `nodeAllocatableResources[...].overhead` field. This is used by kubelet for pod level and container-level cgroup enforcement.", } func (NodeAllocatableResourceClaimStatus) SwaggerDoc() map[string]string { @@ -1308,6 +1348,15 @@ func (NodeList) SwaggerDoc() map[string]string { return map_NodeList } +var map_NodePodPreemptionPolicy = map[string]string{ + "": "NodePodPreemptionPolicy defines the node-level policies governing preemption for pods on this node.", + "disableResizePreemption": "DisableResizePreemption lists the owners (e.g., autoscalers, operators, administrators) that have requested to disable scheduler and Kubelet preemption for in-place pod resize on this node. If this list is non-empty, resize-induced preemption is disabled on this node. This is an alpha field and requires enabling the InPlacePodVerticalScalingSchedulerPreemption feature gate.", +} + +func (NodePodPreemptionPolicy) SwaggerDoc() map[string]string { + return map_NodePodPreemptionPolicy +} + var map_NodeProxyOptions = map[string]string{ "": "NodeProxyOptions is the query options to a Node's proxy call.", "path": "Path is the URL path to use for the current proxy request to node.", @@ -1368,14 +1417,15 @@ func (NodeSelectorTerm) SwaggerDoc() map[string]string { } var map_NodeSpec = map[string]string{ - "": "NodeSpec describes the attributes that a node is created with.", - "podCIDR": "PodCIDR represents the pod IP range assigned to the node.", - "podCIDRs": "podCIDRs represents the IP ranges assigned to the node for usage by Pods on that node. If this field is specified, the 0th entry must match the podCIDR field. It may contain at most 1 value for each of IPv4 and IPv6.", - "providerID": "ID of the node assigned by the cloud provider in the format: ://", - "unschedulable": "Unschedulable controls node schedulability of new pods. By default, node is schedulable. More info: https://kubernetes.io/docs/concepts/nodes/node/#manual-node-administration", - "taints": "If specified, the node's taints.", - "configSource": "Deprecated: Previously used to specify the source of the node's configuration for the DynamicKubeletConfig feature. This feature is removed.", - "externalID": "Deprecated. Not all kubelets will set this field. Remove field after 1.13. see: https://issues.k8s.io/61966", + "": "NodeSpec describes the attributes that a node is created with.", + "podCIDR": "PodCIDR represents the pod IP range assigned to the node.", + "podCIDRs": "podCIDRs represents the IP ranges assigned to the node for usage by Pods on that node. If this field is specified, the 0th entry must match the podCIDR field. It may contain at most 1 value for each of IPv4 and IPv6.", + "providerID": "ID of the node assigned by the cloud provider in the format: ://", + "unschedulable": "Unschedulable controls node schedulability of new pods. By default, node is schedulable. More info: https://kubernetes.io/docs/concepts/nodes/node/#manual-node-administration", + "taints": "If specified, the node's taints.", + "configSource": "Deprecated: Previously used to specify the source of the node's configuration for the DynamicKubeletConfig feature. This feature is removed.", + "externalID": "Deprecated. Not all kubelets will set this field. Remove field after 1.13. see: https://issues.k8s.io/61966", + "podPreemptionPolicy": "PodPreemptionPolicy controls the node-level preemption behaviors for pods on this node. This is an alpha field and requires enabling the InPlacePodVerticalScalingSchedulerPreemption feature gate.", } func (NodeSpec) SwaggerDoc() map[string]string { @@ -1426,6 +1476,7 @@ var map_NodeSystemInfo = map[string]string{ "operatingSystem": "The Operating System reported by the node", "architecture": "The Architecture reported by the node", "swap": "Swap Info reported by the node.", + "runningInUserNamespace": "Whether the node is running in a user namespace.", } func (NodeSystemInfo) SwaggerDoc() map[string]string { @@ -1511,8 +1562,8 @@ var map_PersistentVolumeClaimSpec = map[string]string{ "volumeName": "volumeName is the binding reference to the PersistentVolume backing this claim.", "storageClassName": "storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1", "volumeMode": "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.", - "dataSource": "dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.", - "dataSourceRef": "dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef\n allows any non-core object, as well as PersistentVolumeClaim objects.\n* While dataSource ignores disallowed values (dropping them), dataSourceRef\n preserves all values, and generates an error if a disallowed value is\n specified.\n* While dataSource only allows local objects, dataSourceRef allows objects\n in any namespaces.\n(Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.", + "dataSource": "dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.", + "dataSourceRef": "dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn't specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn't set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef\n allows any non-core object, as well as PersistentVolumeClaim objects.\n* While dataSource ignores disallowed values (dropping them), dataSourceRef\n preserves all values, and generates an error if a disallowed value is\n specified.\n* While dataSource only allows local objects, dataSourceRef allows objects\n in any namespaces.\n(Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.", "volumeAttributesClassName": "volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string or nil value indicates that no VolumeAttributesClass will be applied to the claim. If the claim enters an Infeasible error state, this field can be reset to its previous value (including nil) to cancel the modification. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/", } @@ -1530,6 +1581,7 @@ var map_PersistentVolumeClaimStatus = map[string]string{ "allocatedResourceStatuses": "allocatedResourceStatuses stores status of resource being resized for the given PVC. Key names follow standard Kubernetes label syntax. Valid values are either:\n\t* Un-prefixed keys:\n\t\t- storage - the capacity of the volume.\n\t* Custom resources must use implementation-defined prefixed names such as \"example.com/my-custom-resource\"\nApart from above values - keys that are unprefixed or have kubernetes.io prefix are considered reserved and hence may not be used.\n\nClaimResourceStatus can be in any of following states:\n\t- ControllerResizeInProgress:\n\t\tState set when resize controller starts resizing the volume in control-plane.\n\t- ControllerResizeFailed:\n\t\tState set when resize has failed in resize controller with a terminal error.\n\t- NodeResizePending:\n\t\tState set when resize controller has finished resizing the volume but further resizing of\n\t\tvolume is needed on the node.\n\t- NodeResizeInProgress:\n\t\tState set when kubelet starts resizing the volume.\n\t- NodeResizeFailed:\n\t\tState set when resizing has failed in kubelet with a terminal error. Transient errors don't set\n\t\tNodeResizeFailed.\nFor example: if expanding a PVC for more capacity - this field can be one of the following states:\n\t- pvc.status.allocatedResourceStatus['storage'] = \"ControllerResizeInProgress\"\n - pvc.status.allocatedResourceStatus['storage'] = \"ControllerResizeFailed\"\n - pvc.status.allocatedResourceStatus['storage'] = \"NodeResizePending\"\n - pvc.status.allocatedResourceStatus['storage'] = \"NodeResizeInProgress\"\n - pvc.status.allocatedResourceStatus['storage'] = \"NodeResizeFailed\"\nWhen this field is not set, it means that no resize operation is in progress for the given PVC.\n\nA controller that receives PVC update with previously unknown resourceName or ClaimResourceStatus should ignore the update for the purpose it was designed. For example - a controller that only is responsible for resizing capacity of the volume, should ignore PVC updates that change other valid resources associated with PVC.", "currentVolumeAttributesClassName": "currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim", "modifyVolumeStatus": "ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. When this is unset, there is no ModifyVolume operation being attempted.", + "healthStatus": "healthStatus contains the latest controller-reported health information for the volume bound to this claim.", } func (PersistentVolumeClaimStatus) SwaggerDoc() map[string]string { @@ -1702,6 +1754,7 @@ var map_PodCertificateProjection = map[string]string{ "keyPath": "Write the key at this path in the projected volume.\n\nMost applications should use credentialBundlePath. When using keyPath and certificateChainPath, your application needs to check that the key and leaf certificate are consistent, because it is possible to read the files mid-rotation.", "certificateChainPath": "Write the certificate chain at this path in the projected volume.\n\nMost applications should use credentialBundlePath. When using keyPath and certificateChainPath, your application needs to check that the key and leaf certificate are consistent, because it is possible to read the files mid-rotation.", "userAnnotations": "userAnnotations allow pod authors to pass additional information to the signer implementation. Kubernetes does not restrict or validate this metadata in any way.\n\nThese values are copied verbatim into the `spec.unverifiedUserAnnotations` field of the PodCertificateRequest objects that Kubelet creates.\n\nEntries are subject to the same validation as object metadata annotations, with the addition that all keys must be domain-prefixed. No restrictions are placed on values, except an overall size limitation on the entire field.\n\nSigners should document the keys and values they support. Signers should deny requests that contain keys they do not recognize.", + "user": "user is Optional: The owner UID of the created file. If specified, the item-level user field takes precedence over defaultUser. (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled.", } func (PodCertificateProjection) SwaggerDoc() map[string]string { @@ -1894,7 +1947,7 @@ var map_PodSecurityContext = map[string]string{ "fsGroupChangePolicy": "fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified, \"Always\" is used. Note that this field cannot be set when spec.os.name is windows.", "seccompProfile": "The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows.", "appArmorProfile": "appArmorProfile is the AppArmor options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows.", - "seLinuxChangePolicy": "seLinuxChangePolicy defines how the container's SELinux label is applied to all volumes used by the Pod. It has no effect on nodes that do not support SELinux or to volumes does not support SELinux. Valid values are \"MountOption\" and \"Recursive\".\n\n\"Recursive\" means relabeling of all files on all Pod volumes by the container runtime. This may be slow for large volumes, but allows mixing privileged and unprivileged Pods sharing the same volume on the same node.\n\n\"MountOption\" mounts all eligible Pod volumes with `-o context` mount option. This requires all Pods that share the same volume to use the same SELinux label. It is not possible to share the same volume among privileged and unprivileged Pods. Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their CSIDriver instance. Other volumes are always re-labelled recursively. \"MountOption\" value is allowed only when SELinuxMount feature gate is enabled.\n\nIf not specified and SELinuxMount feature gate is enabled, \"MountOption\" is used. If not specified and SELinuxMount feature gate is disabled, \"MountOption\" is used for ReadWriteOncePod volumes and \"Recursive\" for all other volumes.\n\nThis field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers.\n\nAll Pods that use the same volume should use the same seLinuxChangePolicy, otherwise some pods can get stuck in ContainerCreating state. Note that this field cannot be set when spec.os.name is windows.", + "seLinuxChangePolicy": "seLinuxChangePolicy defines how the container's SELinux label is applied to all volumes used by the Pod. It has no effect on nodes that do not support SELinux or to volumes does not support SELinux. Valid values are \"MountOption\" and \"Recursive\".\n\n\"Recursive\" means relabeling of all files on all Pod volumes by the container runtime. This may be slow for large volumes, but allows mixing privileged and unprivileged Pods sharing the same volume on the same node.\n\n\"MountOption\" mounts all eligible Pod volumes with `-o context` mount option. This requires all Pods that share the same volume to use the same SELinux label. It is not possible to share the same volume among privileged and unprivileged Pods. Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their CSIDriver instance. Other volumes are always re-labelled recursively.\n\nIf not specified, \"MountOption\" is used.\n\nThis field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers.\n\nAll Pods that use the same volume should use the same seLinuxChangePolicy, otherwise some pods can get stuck in ContainerCreating state. Note that this field cannot be set when spec.os.name is windows.", } func (PodSecurityContext) SwaggerDoc() map[string]string { @@ -1943,7 +1996,7 @@ var map_PodSpec = map[string]string{ "readinessGates": "If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates", "runtimeClassName": "RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class", "enableServiceLinks": "EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.", - "preemptionPolicy": "PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.", + "preemptionPolicy": "PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. Defaults to PreemptLowerPriority if unset.", "overhead": "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md", "topologySpreadConstraints": "TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.", "setHostnameAsFQDN": "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", @@ -1952,8 +2005,9 @@ var map_PodSpec = map[string]string{ "schedulingGates": "SchedulingGates is an opaque list of values that if specified will block scheduling the pod. If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the scheduler will not attempt to schedule the pod.\n\nSchedulingGates can only be set at pod creation time, and be removed only afterwards.", "resourceClaims": "ResourceClaims defines which ResourceClaims must be allocated and reserved before the Pod is allowed to start. The resources will be made available to those containers which consume them by name.\n\nThis is a stable field but requires that the DynamicResourceAllocation feature gate is enabled.\n\nThis field is immutable.", "resources": "Resources is the total amount of CPU and Memory resources required by all containers in the pod. It supports specifying Requests and Limits for \"cpu\", \"memory\" and \"hugepages-\" resource names only. ResourceClaims are not supported.\n\nThis field enables fine-grained control over resource allocation for the entire pod, allowing resource sharing among containers in a pod.\n\nThis is an alpha field and requires enabling the PodLevelResources feature gate.", - "hostnameOverride": "HostnameOverride specifies an explicit override for the pod's hostname as perceived by the pod. This field only specifies the pod's hostname and does not affect its DNS records. When this field is set to a non-empty string: - It takes precedence over the values set in `hostname` and `subdomain`. - The Pod's hostname will be set to this value. - `setHostnameAsFQDN` must be nil or set to false. - `hostNetwork` must be set to false.\n\nThis field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters. Requires the HostnameOverride feature gate to be enabled.", + "hostnameOverride": "HostnameOverride specifies an explicit override for the pod's hostname as perceived by the pod. This field only specifies the pod's hostname and does not affect its DNS records. When this field is set to a non-empty string: - It takes precedence over the values set in `hostname` and `subdomain`. - The Pod's hostname will be set to this value. - `setHostnameAsFQDN` must be nil or set to false. - `hostNetwork` must be set to false.\n\nThis field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters.", "schedulingGroup": "SchedulingGroup provides a reference to the immediate scheduling runtime grouping object that this Pod belongs to. This field is used by the scheduler to identify the group and apply the correct group scheduling policies. The association with a group also impacts other lifecycle aspects of a Pod that are relevant in a wider context of scheduling like preemption, resource attachment, etc. If not specified, the Pod is treated as a single unit in all of these aspects. The group object referenced by this field may not exist at the time the Pod is created. This field is immutable, but a group object with the same name may be recreated with different policies. Doing this during pod scheduling may result in the placement not conforming to the expected policies.", + "evictionResponders": "evictionResponders reference responders that react to Evictions based on EvictionRequests. Responders should observe and communicate through the Eviction Resource API to help with the graceful termination of a pod. The responders are selected sequentially, according to their specified priority.\n\nResponders should periodically report on an eviction progress by updating the .status.responders[].heartbeatTime field of the Eviction object. If this field is not updated within the heartbeat deadline defined by the Eviction API (currently 20 minutes), the eviction is passed over to the next responder with a lower priority. If there is no other responder, the last default imperative-eviction.k8s.io/evictor responder with a priority of 100 will evict the pod using the imperative Eviction API (pods//eviction subresource).\n\nThe maximum length of the responders list is 10. Responders are not supported when the pod is part of a PodGroup (.spec.schedulingGroup is set). This field can only be set on creation and is immutable afterwards.", } func (PodSpec) SwaggerDoc() map[string]string { @@ -1983,22 +2037,13 @@ var map_PodStatus = map[string]string{ "allocatedResources": "AllocatedResources is the total requests allocated for this pod by the node. If pod-level requests are not set, this will be the total requests aggregated across containers in the pod.", "resources": "Resources represents the compute resource requests and limits that have been applied at the pod level if pod-level requests or limits are set in PodSpec.Resources", "nodeAllocatableResourceClaimStatuses": "NodeAllocatableResourceClaimStatuses contains the status of node-allocatable resources that were allocated for this pod through DRA claims. This includes resources currently reported in v1.Node `status.allocatable` that are not extended resources (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). Examples include \"cpu\", \"memory\", \"ephemeral-storage\", and hugepages.", + "volumeHealth": "volumeHealth contains node-reported health for each volume the pod is using. Populated by the kubelet on the pod's node.", } func (PodStatus) SwaggerDoc() map[string]string { return map_PodStatus } -var map_PodStatusResult = map[string]string{ - "": "PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "status": "Most recently observed status of the pod. This data may not be up to date. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", -} - -func (PodStatusResult) SwaggerDoc() map[string]string { - return map_PodStatusResult -} - var map_PodTemplate = map[string]string{ "": "PodTemplate describes a template for creating copies of a predefined pod.", "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", @@ -2029,6 +2074,17 @@ func (PodTemplateSpec) SwaggerDoc() map[string]string { return map_PodTemplateSpec } +var map_PodVolumeHealth = map[string]string{ + "": "PodVolumeHealth contains health information for a volume used by a pod, reported by the CSI node plugin via the kubelet.", + "name": "name matches an entry in pod.spec.volumes.", + "healthConditions": "conditions is the set of adverse conditions reported by the CSI node plugin for this volume on this node. At most 16 conditions may be reported.", + "lastTransitionTime": "lastTransitionTime is when the current set of conditions first appeared.", +} + +func (PodVolumeHealth) SwaggerDoc() map[string]string { + return map_PodVolumeHealth +} + var map_PortStatus = map[string]string{ "": "PortStatus represents the error condition of a service port", "port": "Port is the port number of the service port of which status is recorded here", @@ -2112,6 +2168,7 @@ var map_ProjectedVolumeSource = map[string]string{ "": "Represents a projected volume source", "sources": "sources is the list of volume projections. Each entry in this list handles one source.", "defaultMode": "defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", + "defaultUser": "defaultUser is Optional: The owner UID of the created files by default. The defaultUser field is only used as a fallback when the item-level user field is unset. (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled.", } func (ProjectedVolumeSource) SwaggerDoc() map[string]string { @@ -2322,7 +2379,7 @@ func (ResourceRequirements) SwaggerDoc() map[string]string { var map_ResourceStatus = map[string]string{ "": "ResourceStatus represents the status of a single resource allocated to a Pod.", - "name": "Name of the resource. Must be unique within the pod and in case of non-DRA resource, match one of the resources from the pod spec. For DRA resources, the value must be \"claim:/\". When this status is reported about a container, the \"claim_name\" and \"request\" must match one of the claims of this container.", + "name": "Name of the resource. Must be unique within the pod and in case of non-DRA resource, match one of the resources from the pod spec. For DRA resources, the value must be \"claim:/\" when container.resources.claims[*].request is set or \"claim:\" when container.resources.claims[*].request is empty. For DRA-backed extended resources, \"claim:/\" is used when the claim name and request name are recorded in pod.status.extendedResourceClaimStatus. When this status is reported about a container, the \"claim_name\" and \"request\" must match one of the claims of this container.", "resources": "List of unique resources health. Each element in the list contains an unique resource ID and its health. At a minimum, for the lifetime of a Pod, resource ID must uniquely identify the resource allocated to the Pod on the Node. If other Pod on the same Node reports the status with the same resource ID, it must be the same resource they share. See ResourceID type definition for a specific format it has in various use cases.", } @@ -2476,6 +2533,7 @@ var map_SecretVolumeSource = map[string]string{ "items": "items If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", "defaultMode": "defaultMode is Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "optional": "optional field specify whether the Secret or its keys must be defined", + "defaultUser": "defaultUser is Optional: The owner UID of the created files by default. The defaultUser field is only used as a fallback when the item-level user field is unset. (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled.", } func (SecretVolumeSource) SwaggerDoc() map[string]string { @@ -2549,6 +2607,7 @@ var map_ServiceAccountTokenProjection = map[string]string{ "audience": "audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver.", "expirationSeconds": "expirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes.", "path": "path is the path relative to the mount point of the file to project the token into.", + "user": "user is Optional: The owner UID of the created file. If specified, the item-level user field takes precedence over defaultUser. (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled.", } func (ServiceAccountTokenProjection) SwaggerDoc() map[string]string { @@ -2792,15 +2851,37 @@ func (VolumeDevice) SwaggerDoc() map[string]string { return map_VolumeDevice } +var map_VolumeHealthCondition = map[string]string{ + "": "VolumeHealthCondition represents an adverse health condition reported for a volume.", + "status": "status is the machine-parseable health category. Possible values: - \"Inaccessible\": the volume cannot be accessed. - \"DataLoss\": data loss has been detected on the volume. - \"Degraded\": the volume is functioning with reduced capability.", + "reason": "reason is a brief CamelCase machine-parseable reason. Together with status it forms the unique identity of a condition entry. Maximum permitted length of a reason is 256 bytes.", + "message": "message is a human-readable description. Maximum permitted length of a message is 1024 bytes.", +} + +func (VolumeHealthCondition) SwaggerDoc() map[string]string { + return map_VolumeHealthCondition +} + +var map_VolumeHealthStatus = map[string]string{ + "": "VolumeHealthStatus contains health information for a volume reported by the CSI controller plugin.", + "healthConditions": "conditions is the set of adverse conditions reported by the CSI controller plugin. An empty list means no adverse condition. At most 16 conditions may be reported.", + "lastTransitionTime": "lastTransitionTime is when the current set of conditions first appeared.", +} + +func (VolumeHealthStatus) SwaggerDoc() map[string]string { + return map_VolumeHealthStatus +} + var map_VolumeMount = map[string]string{ "": "VolumeMount describes a mounting of a Volume within a container.", "name": "This must match the Name of a Volume.", "readOnly": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.", "recursiveReadOnly": "RecursiveReadOnly specifies whether read-only mounts should be handled recursively.\n\nIf ReadOnly is false, this field has no meaning and must be unspecified.\n\nIf ReadOnly is true, and this field is set to Disabled, the mount is not made recursively read-only. If this field is set to IfPossible, the mount is made recursively read-only, if it is supported by the container runtime. If this field is set to Enabled, the mount is made recursively read-only if it is supported by the container runtime, otherwise the pod will not be started and an error will be generated to indicate the reason.\n\nIf this field is set to IfPossible or Enabled, MountPropagation must be set to None (or be unspecified, which defaults to None).\n\nIf this field is not specified, it is treated as an equivalent of Disabled.", - "mountPath": "Path within the container at which the volume should be mounted. Must not contain ':'.", + "mountPath": "Path within the container at which the volume should be mounted.", "subPath": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).", "mountPropagation": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. When RecursiveReadOnly is set to IfPossible or to Enabled, MountPropagation must be None or unspecified (which defaults to None).", "subPathExpr": "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive.", + "bindMountOptions": "bindMountOptions is the list of additional bind mount options to apply when mounting this volume into the container. Allowed values are noexec, nodev, and nosuid. These are Linux mount options and have no effect on Windows nodes. This field is not supported with image volumes. This is an alpha field and requires enabling the VolumeBindMountOptions feature gate.", } func (VolumeMount) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go index 10af6c17d2..4a0b717f30 100644 --- a/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go @@ -22,7 +22,6 @@ limitations under the License. package v1 import ( - resource "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" types "k8s.io/apimachinery/pkg/types" @@ -485,6 +484,11 @@ func (in *ClusterTrustBundleProjection) DeepCopyInto(out *ClusterTrustBundleProj *out = new(bool) **out = **in } + if in.User != nil { + in, out := &in.User, &out.User + *out = new(int64) + **out = **in + } return } @@ -774,6 +778,11 @@ func (in *ConfigMapVolumeSource) DeepCopyInto(out *ConfigMapVolumeSource) { *out = new(bool) **out = **in } + if in.DefaultUser != nil { + in, out := &in.DefaultUser, &out.DefaultUser + *out = new(int64) + **out = **in + } return } @@ -1217,6 +1226,11 @@ func (in *DownwardAPIVolumeFile) DeepCopyInto(out *DownwardAPIVolumeFile) { *out = new(int32) **out = **in } + if in.User != nil { + in, out := &in.User, &out.User + *out = new(int64) + **out = **in + } return } @@ -1245,6 +1259,11 @@ func (in *DownwardAPIVolumeSource) DeepCopyInto(out *DownwardAPIVolumeSource) { *out = new(int32) **out = **in } + if in.DefaultUser != nil { + in, out := &in.DefaultUser, &out.DefaultUser + *out = new(int64) + **out = **in + } return } @@ -1266,6 +1285,11 @@ func (in *EmptyDirVolumeSource) DeepCopyInto(out *EmptyDirVolumeSource) { x := (*in).DeepCopy() *out = &x } + if in.Mode != nil { + in, out := &in.Mode, &out.Mode + *out = new(int32) + **out = **in + } return } @@ -1762,6 +1786,27 @@ func (in *EventSource) DeepCopy() *EventSource { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EvictionResponder) DeepCopyInto(out *EvictionResponder) { + *out = *in + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EvictionResponder. +func (in *EvictionResponder) DeepCopy() *EvictionResponder { + if in == nil { + return nil + } + out := new(EvictionResponder) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecAction) DeepCopyInto(out *ExecAction) { *out = *in @@ -1931,6 +1976,11 @@ func (in *GRPCAction) DeepCopyInto(out *GRPCAction) { *out = new(string) **out = **in } + if in.Mode != nil { + in, out := &in.Mode, &out.Mode + *out = new(GRPCProbeMode) + **out = **in + } return } @@ -2006,6 +2056,11 @@ func (in *HTTPGetAction) DeepCopyInto(out *HTTPGetAction) { *out = make([]HTTPHeader, len(*in)) copy(*out, *in) } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(HTTPProtocol) + **out = **in + } return } @@ -2195,6 +2250,11 @@ func (in *KeyToPath) DeepCopyInto(out *KeyToPath) { *out = new(int32) **out = **in } + if in.User != nil { + in, out := &in.User, &out.User + *out = new(int64) + **out = **in + } return } @@ -2777,6 +2837,53 @@ func (in *NodeAffinity) DeepCopy() *NodeAffinity { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeAllocatableMappedResources) DeepCopyInto(out *NodeAllocatableMappedResources) { + *out = *in + if in.Quantity != nil { + in, out := &in.Quantity, &out.Quantity + x := (*in).DeepCopy() + *out = &x + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocatableMappedResources. +func (in *NodeAllocatableMappedResources) DeepCopy() *NodeAllocatableMappedResources { + if in == nil { + return nil + } + out := new(NodeAllocatableMappedResources) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeAllocatableOverheadResources) DeepCopyInto(out *NodeAllocatableOverheadResources) { + *out = *in + if in.PerPod != nil { + in, out := &in.PerPod, &out.PerPod + x := (*in).DeepCopy() + *out = &x + } + if in.PerContainer != nil { + in, out := &in.PerContainer, &out.PerContainer + x := (*in).DeepCopy() + *out = &x + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocatableOverheadResources. +func (in *NodeAllocatableOverheadResources) DeepCopy() *NodeAllocatableOverheadResources { + if in == nil { + return nil + } + out := new(NodeAllocatableOverheadResources) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeAllocatableResourceClaimStatus) DeepCopyInto(out *NodeAllocatableResourceClaimStatus) { *out = *in @@ -2785,11 +2892,18 @@ func (in *NodeAllocatableResourceClaimStatus) DeepCopyInto(out *NodeAllocatableR *out = make([]string, len(*in)) copy(*out, *in) } - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = make(map[ResourceName]resource.Quantity, len(*in)) - for key, val := range *in { - (*out)[key] = val.DeepCopy() + if in.Mapping != nil { + in, out := &in.Mapping, &out.Mapping + *out = make([]NodeAllocatableMappedResources, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Overhead != nil { + in, out := &in.Overhead, &out.Overhead + *out = make([]NodeAllocatableOverheadResources, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) } } return @@ -2946,6 +3060,27 @@ func (in *NodeList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodePodPreemptionPolicy) DeepCopyInto(out *NodePodPreemptionPolicy) { + *out = *in + if in.DisableResizePreemption != nil { + in, out := &in.DisableResizePreemption, &out.DisableResizePreemption + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodePodPreemptionPolicy. +func (in *NodePodPreemptionPolicy) DeepCopy() *NodePodPreemptionPolicy { + if in == nil { + return nil + } + out := new(NodePodPreemptionPolicy) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeProxyOptions) DeepCopyInto(out *NodeProxyOptions) { *out = *in @@ -3112,6 +3247,11 @@ func (in *NodeSpec) DeepCopyInto(out *NodeSpec) { *out = new(NodeConfigSource) (*in).DeepCopyInto(*out) } + if in.PodPreemptionPolicy != nil { + in, out := &in.PodPreemptionPolicy, &out.PodPreemptionPolicy + *out = new(NodePodPreemptionPolicy) + (*in).DeepCopyInto(*out) + } return } @@ -3237,6 +3377,11 @@ func (in *NodeSystemInfo) DeepCopyInto(out *NodeSystemInfo) { *out = new(NodeSwapStatus) (*in).DeepCopyInto(*out) } + if in.RunningInUserNamespace != nil { + in, out := &in.RunningInUserNamespace, &out.RunningInUserNamespace + *out = new(bool) + **out = **in + } return } @@ -3495,6 +3640,11 @@ func (in *PersistentVolumeClaimStatus) DeepCopyInto(out *PersistentVolumeClaimSt *out = new(ModifyVolumeStatus) **out = **in } + if in.HealthStatus != nil { + in, out := &in.HealthStatus, &out.HealthStatus + *out = new(VolumeHealthStatus) + (*in).DeepCopyInto(*out) + } return } @@ -3960,6 +4110,11 @@ func (in *PodCertificateProjection) DeepCopyInto(out *PodCertificateProjection) (*out)[key] = val } } + if in.User != nil { + in, out := &in.User, &out.User + *out = new(int64) + **out = **in + } return } @@ -4640,6 +4795,13 @@ func (in *PodSpec) DeepCopyInto(out *PodSpec) { *out = new(PodSchedulingGroup) (*in).DeepCopyInto(*out) } + if in.EvictionResponders != nil { + in, out := &in.EvictionResponders, &out.EvictionResponders + *out = make([]EvictionResponder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } @@ -4729,6 +4891,13 @@ func (in *PodStatus) DeepCopyInto(out *PodStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.VolumeHealth != nil { + in, out := &in.VolumeHealth, &out.VolumeHealth + *out = make([]PodVolumeHealth, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } @@ -4742,33 +4911,6 @@ func (in *PodStatus) DeepCopy() *PodStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PodStatusResult) DeepCopyInto(out *PodStatusResult) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodStatusResult. -func (in *PodStatusResult) DeepCopy() *PodStatusResult { - if in == nil { - return nil - } - out := new(PodStatusResult) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PodStatusResult) 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 *PodTemplate) DeepCopyInto(out *PodTemplate) { *out = *in @@ -4847,6 +4989,28 @@ func (in *PodTemplateSpec) DeepCopy() *PodTemplateSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodVolumeHealth) DeepCopyInto(out *PodVolumeHealth) { + *out = *in + if in.HealthConditions != nil { + in, out := &in.HealthConditions, &out.HealthConditions + *out = make([]VolumeHealthCondition, len(*in)) + copy(*out, *in) + } + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodVolumeHealth. +func (in *PodVolumeHealth) DeepCopy() *PodVolumeHealth { + if in == nil { + return nil + } + out := new(PodVolumeHealth) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PortStatus) DeepCopyInto(out *PortStatus) { *out = *in @@ -5013,6 +5177,11 @@ func (in *ProjectedVolumeSource) DeepCopyInto(out *ProjectedVolumeSource) { *out = new(int32) **out = **in } + if in.DefaultUser != nil { + in, out := &in.DefaultUser, &out.DefaultUser + *out = new(int64) + **out = **in + } return } @@ -5835,6 +6004,11 @@ func (in *SecretVolumeSource) DeepCopyInto(out *SecretVolumeSource) { *out = new(bool) **out = **in } + if in.DefaultUser != nil { + in, out := &in.DefaultUser, &out.DefaultUser + *out = new(int64) + **out = **in + } return } @@ -6060,6 +6234,11 @@ func (in *ServiceAccountTokenProjection) DeepCopyInto(out *ServiceAccountTokenPr *out = new(int64) **out = **in } + if in.User != nil { + in, out := &in.User, &out.User + *out = new(int64) + **out = **in + } return } @@ -6575,6 +6754,44 @@ func (in *VolumeDevice) DeepCopy() *VolumeDevice { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeHealthCondition) DeepCopyInto(out *VolumeHealthCondition) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeHealthCondition. +func (in *VolumeHealthCondition) DeepCopy() *VolumeHealthCondition { + if in == nil { + return nil + } + out := new(VolumeHealthCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeHealthStatus) DeepCopyInto(out *VolumeHealthStatus) { + *out = *in + if in.HealthConditions != nil { + in, out := &in.HealthConditions, &out.HealthConditions + *out = make([]VolumeHealthCondition, len(*in)) + copy(*out, *in) + } + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeHealthStatus. +func (in *VolumeHealthStatus) DeepCopy() *VolumeHealthStatus { + if in == nil { + return nil + } + out := new(VolumeHealthStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VolumeMount) DeepCopyInto(out *VolumeMount) { *out = *in @@ -6588,6 +6805,11 @@ func (in *VolumeMount) DeepCopyInto(out *VolumeMount) { *out = new(MountPropagationMode) **out = **in } + if in.BindMountOptions != nil { + in, out := &in.BindMountOptions, &out.BindMountOptions + *out = make([]string, len(*in)) + copy(*out, *in) + } return } diff --git a/vendor/k8s.io/api/core/v1/zz_generated.model_name.go b/vendor/k8s.io/api/core/v1/zz_generated.model_name.go index 8e79ad909e..65cfb59c13 100644 --- a/vendor/k8s.io/api/core/v1/zz_generated.model_name.go +++ b/vendor/k8s.io/api/core/v1/zz_generated.model_name.go @@ -326,6 +326,11 @@ func (in EventSource) OpenAPIModelName() string { return "io.k8s.api.core.v1.EventSource" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EvictionResponder) OpenAPIModelName() string { + return "io.k8s.api.core.v1.EvictionResponder" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in ExecAction) OpenAPIModelName() string { return "io.k8s.api.core.v1.ExecAction" @@ -541,6 +546,16 @@ func (in NodeAffinity) OpenAPIModelName() string { return "io.k8s.api.core.v1.NodeAffinity" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeAllocatableMappedResources) OpenAPIModelName() string { + return "io.k8s.api.core.v1.NodeAllocatableMappedResources" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeAllocatableOverheadResources) OpenAPIModelName() string { + return "io.k8s.api.core.v1.NodeAllocatableOverheadResources" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in NodeAllocatableResourceClaimStatus) OpenAPIModelName() string { return "io.k8s.api.core.v1.NodeAllocatableResourceClaimStatus" @@ -576,6 +591,11 @@ func (in NodeList) OpenAPIModelName() string { return "io.k8s.api.core.v1.NodeList" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodePodPreemptionPolicy) OpenAPIModelName() string { + return "io.k8s.api.core.v1.NodePodPreemptionPolicy" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in NodeProxyOptions) OpenAPIModelName() string { return "io.k8s.api.core.v1.NodeProxyOptions" @@ -831,11 +851,6 @@ func (in PodStatus) OpenAPIModelName() string { return "io.k8s.api.core.v1.PodStatus" } -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in PodStatusResult) OpenAPIModelName() string { - return "io.k8s.api.core.v1.PodStatusResult" -} - // OpenAPIModelName returns the OpenAPI model name for this type. func (in PodTemplate) OpenAPIModelName() string { return "io.k8s.api.core.v1.PodTemplate" @@ -851,6 +866,11 @@ func (in PodTemplateSpec) OpenAPIModelName() string { return "io.k8s.api.core.v1.PodTemplateSpec" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodVolumeHealth) OpenAPIModelName() string { + return "io.k8s.api.core.v1.PodVolumeHealth" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in PortStatus) OpenAPIModelName() string { return "io.k8s.api.core.v1.PortStatus" @@ -1176,6 +1196,16 @@ func (in VolumeDevice) OpenAPIModelName() string { return "io.k8s.api.core.v1.VolumeDevice" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VolumeHealthCondition) OpenAPIModelName() string { + return "io.k8s.api.core.v1.VolumeHealthCondition" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VolumeHealthStatus) OpenAPIModelName() string { + return "io.k8s.api.core.v1.VolumeHealthStatus" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in VolumeMount) OpenAPIModelName() string { return "io.k8s.api.core.v1.VolumeMount" diff --git a/vendor/k8s.io/api/core/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/core/v1/zz_generated.prerelease-lifecycle.go index 6710a96d1c..d473e30999 100644 --- a/vendor/k8s.io/api/core/v1/zz_generated.prerelease-lifecycle.go +++ b/vendor/k8s.io/api/core/v1/zz_generated.prerelease-lifecycle.go @@ -177,12 +177,6 @@ func (in *PodProxyOptions) APILifecycleIntroduced() (major, minor int) { return 1, 0 } -// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. -// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. -func (in *PodStatusResult) APILifecycleIntroduced() (major, minor int) { - return 1, 0 -} - // APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. func (in *PodTemplate) APILifecycleIntroduced() (major, minor int) { diff --git a/vendor/k8s.io/api/discovery/v1/generated.proto b/vendor/k8s.io/api/discovery/v1/generated.proto index edbc4304b1..a1713290dd 100644 --- a/vendor/k8s.io/api/discovery/v1/generated.proto +++ b/vendor/k8s.io/api/discovery/v1/generated.proto @@ -39,8 +39,8 @@ message Endpoint { // additional addresses beyond the first, and kube-proxy does not look at them. // +listType=set // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:maxItems=100 + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:maxItems=100 repeated string addresses = 1; // conditions contains information about the current status of the endpoint. @@ -185,15 +185,15 @@ message EndpointSlice { // slices of addressType "IPv4" and "IPv6". No semantics are defined for // the "FQDN" type. // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:immutable optional string addressType = 4; // endpoints is a list of unique endpoints in this slice. Each slice may // include a maximum of 1000 endpoints. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated Endpoint endpoints = 2; // ports specifies the list of network ports exposed by each endpoint in diff --git a/vendor/k8s.io/api/discovery/v1/types.go b/vendor/k8s.io/api/discovery/v1/types.go index c291ed85dd..a5b5f827b6 100644 --- a/vendor/k8s.io/api/discovery/v1/types.go +++ b/vendor/k8s.io/api/discovery/v1/types.go @@ -32,7 +32,7 @@ import ( // by listing EndpointSlices in the service's namespace whose `kubernetes.io/service-name` // label contains the service's name. type EndpointSlice struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // +optional @@ -49,15 +49,15 @@ type EndpointSlice struct { // slices of addressType "IPv4" and "IPv6". No semantics are defined for // the "FQDN" type. // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:immutable AddressType AddressType `json:"addressType" protobuf:"bytes,4,rep,name=addressType"` // endpoints is a list of unique endpoints in this slice. Each slice may // include a maximum of 1000 endpoints. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Endpoints []Endpoint `json:"endpoints" protobuf:"bytes,2,rep,name=endpoints"` // ports specifies the list of network ports exposed by each endpoint in @@ -73,7 +73,7 @@ type EndpointSlice struct { // AddressType represents the type of address referred to by an endpoint. // +enum -// +k8s:alpha(since: "1.36")=+k8s:enum +// +k8s:beta(since: "1.37")=+k8s:enum type AddressType string const ( @@ -97,8 +97,8 @@ type Endpoint struct { // additional addresses beyond the first, and kube-proxy does not look at them. // +listType=set // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:maxItems=100 + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:maxItems=100 Addresses []string `json:"addresses" protobuf:"bytes,1,rep,name=addresses"` // conditions contains information about the current status of the endpoint. @@ -238,7 +238,7 @@ type EndpointPort struct { // EndpointSliceList represents a list of endpoint slices type EndpointSliceList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // +optional diff --git a/vendor/k8s.io/api/discovery/v1beta1/generated.proto b/vendor/k8s.io/api/discovery/v1beta1/generated.proto index 9b6edb1479..fa45b0ed92 100644 --- a/vendor/k8s.io/api/discovery/v1beta1/generated.proto +++ b/vendor/k8s.io/api/discovery/v1beta1/generated.proto @@ -39,8 +39,8 @@ message Endpoint { // use the first element. Refer to: https://issue.k8s.io/106267 // +listType=set // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:maxItems=100 + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:maxItems=100 repeated string addresses = 1; // conditions contains information about the current status of the endpoint. @@ -171,14 +171,14 @@ message EndpointSlice { // * IPv6: Represents an IPv6 Address. // * FQDN: Represents a Fully Qualified Domain Name. // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:immutable optional string addressType = 4; // endpoints is a list of unique endpoints in this slice. Each slice may // include a maximum of 1000 endpoints. // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated Endpoint endpoints = 2; // ports specifies the list of network ports exposed by each endpoint in diff --git a/vendor/k8s.io/api/discovery/v1beta1/types.go b/vendor/k8s.io/api/discovery/v1beta1/types.go index 1334194d2a..ef7cf4ab34 100644 --- a/vendor/k8s.io/api/discovery/v1beta1/types.go +++ b/vendor/k8s.io/api/discovery/v1beta1/types.go @@ -32,7 +32,7 @@ import ( // For a given service there may be multiple EndpointSlice objects, selected by // labels, which must be joined to produce the full set of endpoints. type EndpointSlice struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // +optional @@ -46,14 +46,14 @@ type EndpointSlice struct { // * IPv6: Represents an IPv6 Address. // * FQDN: Represents a Fully Qualified Domain Name. // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:immutable AddressType AddressType `json:"addressType" protobuf:"bytes,4,rep,name=addressType"` // endpoints is a list of unique endpoints in this slice. Each slice may // include a maximum of 1000 endpoints. // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Endpoints []Endpoint `json:"endpoints" protobuf:"bytes,2,rep,name=endpoints"` // ports specifies the list of network ports exposed by each endpoint in @@ -68,7 +68,7 @@ type EndpointSlice struct { // AddressType represents the type of address referred to by an endpoint. // +enum -// +k8s:alpha(since: "1.36")=+k8s:enum +// +k8s:beta(since: "1.37")=+k8s:enum type AddressType string const ( @@ -92,8 +92,8 @@ type Endpoint struct { // use the first element. Refer to: https://issue.k8s.io/106267 // +listType=set // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:maxItems=100 + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:maxItems=100 Addresses []string `json:"addresses" protobuf:"bytes,1,rep,name=addresses"` // conditions contains information about the current status of the endpoint. @@ -228,7 +228,7 @@ type EndpointPort struct { // EndpointSliceList represents a list of endpoint slices type EndpointSliceList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // +optional diff --git a/vendor/k8s.io/api/events/v1/generated.proto b/vendor/k8s.io/api/events/v1/generated.proto index 6c7e4cca19..f1e63a33a2 100644 --- a/vendor/k8s.io/api/events/v1/generated.proto +++ b/vendor/k8s.io/api/events/v1/generated.proto @@ -36,7 +36,7 @@ option go_package = "k8s.io/api/events/v1"; // continued existence of events with that Reason. Events should be // treated as informative, best-effort, supplemental data. message Event { - // Standard object's metadata. + // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -105,7 +105,7 @@ message Event { // EventList is a list of Event objects. message EventList { - // Standard list metadata. + // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; diff --git a/vendor/k8s.io/api/events/v1/types.go b/vendor/k8s.io/api/events/v1/types.go index 86b12eee15..c545284100 100644 --- a/vendor/k8s.io/api/events/v1/types.go +++ b/vendor/k8s.io/api/events/v1/types.go @@ -32,9 +32,9 @@ import ( // continued existence of events with that Reason. Events should be // treated as informative, best-effort, supplemental data. type Event struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object's metadata. + // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"` @@ -114,8 +114,8 @@ type EventSeries struct { // EventList is a list of Event objects. type EventList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata. + metav1.TypeMeta `json:""` + // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` diff --git a/vendor/k8s.io/api/events/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/events/v1/types_swagger_doc_generated.go index 44ac0c3bb6..f5b83f049a 100644 --- a/vendor/k8s.io/api/events/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/events/v1/types_swagger_doc_generated.go @@ -29,7 +29,7 @@ package v1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_Event = map[string]string{ "": "Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system. Events have a limited retention time and triggers and messages may evolve with time. Event consumers should not rely on the timing of an event with a given Reason reflecting a consistent underlying trigger, or the continued existence of events with that Reason. Events should be treated as informative, best-effort, supplemental data.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "eventTime": "eventTime is the time when this Event was first observed. It is required.", "series": "series is data about the Event series this event represents or nil if it's a singleton Event.", "reportingController": "reportingController is the name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. This field cannot be empty for new Events.", @@ -52,7 +52,7 @@ func (Event) SwaggerDoc() map[string]string { var map_EventList = map[string]string{ "": "EventList is a list of Event objects.", - "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "items": "items is a list of schema objects.", } diff --git a/vendor/k8s.io/api/events/v1beta1/generated.proto b/vendor/k8s.io/api/events/v1beta1/generated.proto index fbdb309701..6e39c03bc3 100644 --- a/vendor/k8s.io/api/events/v1beta1/generated.proto +++ b/vendor/k8s.io/api/events/v1beta1/generated.proto @@ -36,7 +36,7 @@ option go_package = "k8s.io/api/events/v1beta1"; // continued existence of events with that Reason. Events should be // treated as informative, best-effort, supplemental data. message Event { - // Standard object's metadata. + // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -109,7 +109,7 @@ message Event { // EventList is a list of Event objects. message EventList { - // Standard list metadata. + // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; diff --git a/vendor/k8s.io/api/events/v1beta1/types.go b/vendor/k8s.io/api/events/v1beta1/types.go index 5bb6f92b22..dfe1e4cc10 100644 --- a/vendor/k8s.io/api/events/v1beta1/types.go +++ b/vendor/k8s.io/api/events/v1beta1/types.go @@ -33,9 +33,9 @@ import ( // continued existence of events with that Reason. Events should be // treated as informative, best-effort, supplemental data. type Event struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object's metadata. + // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"` @@ -120,8 +120,8 @@ type EventSeries struct { // EventList is a list of Event objects. type EventList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata. + metav1.TypeMeta `json:""` + // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` diff --git a/vendor/k8s.io/api/events/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/events/v1beta1/types_swagger_doc_generated.go index e6c28a4f8c..4f188b2abb 100644 --- a/vendor/k8s.io/api/events/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/events/v1beta1/types_swagger_doc_generated.go @@ -29,7 +29,7 @@ package v1beta1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_Event = map[string]string{ "": "Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system. Events have a limited retention time and triggers and messages may evolve with time. Event consumers should not rely on the timing of an event with a given Reason reflecting a consistent underlying trigger, or the continued existence of events with that Reason. Events should be treated as informative, best-effort, supplemental data.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "eventTime": "eventTime is the time when this Event was first observed. It is required.", "series": "series is data about the Event series this event represents or nil if it's a singleton Event.", "reportingController": "reportingController is the name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. This field cannot be empty for new Events.", @@ -52,7 +52,7 @@ func (Event) SwaggerDoc() map[string]string { var map_EventList = map[string]string{ "": "EventList is a list of Event objects.", - "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "items": "items is a list of schema objects.", } diff --git a/vendor/k8s.io/api/extensions/v1beta1/doc.go b/vendor/k8s.io/api/extensions/v1beta1/doc.go index bf39ca3e1e..98ccb7685f 100644 --- a/vendor/k8s.io/api/extensions/v1beta1/doc.go +++ b/vendor/k8s.io/api/extensions/v1beta1/doc.go @@ -19,7 +19,8 @@ limitations under the License. // +k8s:openapi-gen=true // +k8s:prerelease-lifecycle-gen=true // +k8s:openapi-model-package=io.k8s.api.extensions.v1beta1 -// +k8s:validation-gen=TypeMeta -// +k8s:validation-gen-input=k8s.io/api/extensions/v1beta1 +// extensions/v1beta1 is permanently unserved, so version-specific declarative +// validation here is unreachable. +// +k8s:validation-gen=false package v1beta1 diff --git a/vendor/k8s.io/api/extensions/v1beta1/generated.proto b/vendor/k8s.io/api/extensions/v1beta1/generated.proto index f090306686..9d45061d5a 100644 --- a/vendor/k8s.io/api/extensions/v1beta1/generated.proto +++ b/vendor/k8s.io/api/extensions/v1beta1/generated.proto @@ -33,6 +33,7 @@ option go_package = "k8s.io/api/extensions/v1beta1"; // DEPRECATED - This group version of DaemonSet is deprecated by apps/v1beta2/DaemonSet. See the release notes for // more information. // DaemonSet represents the configuration of a daemon set. +// +k8s:supportsSubresource="/status" message DaemonSet { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -202,6 +203,7 @@ message DaemonSetUpdateStrategy { // DEPRECATED - This group version of Deployment is deprecated by apps/v1beta2/Deployment. See the release notes for // more information. // Deployment enables declarative updates for Pods and ReplicaSets. +// +k8s:supportsSubresource="/status" message Deployment { // Standard object metadata. // +optional @@ -429,7 +431,7 @@ message IPBlock { // CIDR is a string representing the IP Block // Valid examples are "192.168.1.0/24" or "2001:db8::/64" // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string cidr = 1; // Except is a slice of CIDRs that should not be included within an IP Block @@ -445,6 +447,7 @@ message IPBlock { // externally-reachable urls, load balance traffic, terminate SSL, offer name // based virtual hosting etc. // DEPRECATED - This group version of Ingress is deprecated by networking.k8s.io/v1beta1 Ingress. See the release notes for more information. +// +k8s:supportsSubresource="/status" message Ingress { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -688,7 +691,7 @@ message NetworkPolicyEgressRule { // allows traffic only if the traffic matches at least one item in the to list. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated NetworkPolicyPeer to = 2; } @@ -711,7 +714,7 @@ message NetworkPolicyIngressRule { // traffic matches at least one item in the from list. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated NetworkPolicyPeer from = 2; } @@ -750,7 +753,7 @@ message NetworkPolicyPeer { // IPBlock defines policy on a particular IPBlock. If this field is set then // neither of the other fields can be. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional IPBlock ipBlock = 3; } @@ -794,7 +797,7 @@ message NetworkPolicySpec { // (and serves solely to ensure that the pods it selects are isolated by default). // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated NetworkPolicyIngressRule ingress = 2; // List of egress rules to be applied to the selected pods. Outgoing traffic is @@ -806,7 +809,7 @@ message NetworkPolicySpec { // This field is beta-level in 1.8 // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated NetworkPolicyEgressRule egress = 3; // List of rule types that the NetworkPolicy relates to. @@ -827,6 +830,7 @@ message NetworkPolicySpec { // DEPRECATED - This group version of ReplicaSet is deprecated by apps/v1beta2/ReplicaSet. See the release notes for // more information. // ReplicaSet ensures that a specified number of pod replicas are running at any given time. +// +k8s:supportsSubresource="/status" message ReplicaSet { // If the Labels of a ReplicaSet are empty, they are defaulted to // be the same as the Pod(s) that the ReplicaSet manages. @@ -1046,9 +1050,9 @@ message Scale { message ScaleSpec { // desired number of instances for the scaled object. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +default=0 - // +k8s:alpha(since: "1.36")=+k8s:minimum=0 + // +k8s:beta(since: "1.37")=+k8s:minimum=0 optional int32 replicas = 1; } diff --git a/vendor/k8s.io/api/extensions/v1beta1/types.go b/vendor/k8s.io/api/extensions/v1beta1/types.go index 09d143ea60..e0caf19823 100644 --- a/vendor/k8s.io/api/extensions/v1beta1/types.go +++ b/vendor/k8s.io/api/extensions/v1beta1/types.go @@ -27,9 +27,9 @@ import ( type ScaleSpec struct { // desired number of instances for the scaled object. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +default=0 - // +k8s:alpha(since: "1.36")=+k8s:minimum=0 + // +k8s:beta(since: "1.37")=+k8s:minimum=0 Replicas int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"` } @@ -61,7 +61,7 @@ type ScaleStatus struct { // represents a scaling request for a resource. type Scale struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -88,8 +88,9 @@ type Scale struct { // DEPRECATED - This group version of Deployment is deprecated by apps/v1beta2/Deployment. See the release notes for // more information. // Deployment enables declarative updates for Pods and ReplicaSets. +// +k8s:supportsSubresource="/status" type Deployment struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -164,7 +165,7 @@ type DeploymentSpec struct { // DEPRECATED. // DeploymentRollback stores the information required to rollback a deployment. type DeploymentRollback struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Required: This must match the Name of a deployment. Name string `json:"name" protobuf:"bytes,1,opt,name=name"` // The annotations to be updated to a deployment @@ -333,7 +334,7 @@ type DeploymentCondition struct { // DeploymentList is a list of Deployments. type DeploymentList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -539,8 +540,9 @@ type DaemonSetCondition struct { // DEPRECATED - This group version of DaemonSet is deprecated by apps/v1beta2/DaemonSet. See the release notes for // more information. // DaemonSet represents the configuration of a daemon set. +// +k8s:supportsSubresource="/status" type DaemonSet struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -581,7 +583,7 @@ const ( // DaemonSetList is a collection of daemon sets. type DaemonSetList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -603,8 +605,9 @@ type DaemonSetList struct { // externally-reachable urls, load balance traffic, terminate SSL, offer name // based virtual hosting etc. // DEPRECATED - This group version of Ingress is deprecated by networking.k8s.io/v1beta1 Ingress. See the release notes for more information. +// +k8s:supportsSubresource="/status" type Ingress struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -629,7 +632,7 @@ type Ingress struct { // IngressList is a collection of Ingress. type IngressList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -786,7 +789,7 @@ type IngressRule struct { // default backend, is left to the controller fulfilling the Ingress. Http is // currently the only supported IngressRuleValue. // +optional - IngressRuleValue `json:",inline" protobuf:"bytes,2,opt,name=ingressRuleValue"` + IngressRuleValue `json:"" protobuf:"bytes,2,opt,name=ingressRuleValue"` } // IngressRuleValue represents a rule to apply against incoming requests. If the @@ -914,8 +917,9 @@ type IngressBackend struct { // DEPRECATED - This group version of ReplicaSet is deprecated by apps/v1beta2/ReplicaSet. See the release notes for // more information. // ReplicaSet ensures that a specified number of pod replicas are running at any given time. +// +k8s:supportsSubresource="/status" type ReplicaSet struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // If the Labels of a ReplicaSet are empty, they are defaulted to // be the same as the Pod(s) that the ReplicaSet manages. @@ -945,7 +949,7 @@ type ReplicaSet struct { // ReplicaSetList is a collection of ReplicaSets. type ReplicaSetList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -1060,7 +1064,7 @@ type ReplicaSetCondition struct { // DEPRECATED 1.9 - This group version of NetworkPolicy is deprecated by networking/v1/NetworkPolicy. // NetworkPolicy describes what network traffic is allowed for a set of Pods type NetworkPolicy struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -1106,7 +1110,7 @@ type NetworkPolicySpec struct { // (and serves solely to ensure that the pods it selects are isolated by default). // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Ingress []NetworkPolicyIngressRule `json:"ingress,omitempty" protobuf:"bytes,2,rep,name=ingress"` // List of egress rules to be applied to the selected pods. Outgoing traffic is @@ -1118,7 +1122,7 @@ type NetworkPolicySpec struct { // This field is beta-level in 1.8 // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Egress []NetworkPolicyEgressRule `json:"egress,omitempty" protobuf:"bytes,3,rep,name=egress"` // List of rule types that the NetworkPolicy relates to. @@ -1155,7 +1159,7 @@ type NetworkPolicyIngressRule struct { // traffic matches at least one item in the from list. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional From []NetworkPolicyPeer `json:"from,omitempty" protobuf:"bytes,2,rep,name=from"` } @@ -1180,7 +1184,7 @@ type NetworkPolicyEgressRule struct { // allows traffic only if the traffic matches at least one item in the to list. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional To []NetworkPolicyPeer `json:"to,omitempty" protobuf:"bytes,2,rep,name=to"` } @@ -1214,7 +1218,7 @@ type IPBlock struct { // CIDR is a string representing the IP Block // Valid examples are "192.168.1.0/24" or "2001:db8::/64" // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required CIDR string `json:"cidr" protobuf:"bytes,1,name=cidr"` // Except is a slice of CIDRs that should not be included within an IP Block // Valid examples are "192.168.1.0/24" or "2001:db8::/64" @@ -1247,7 +1251,7 @@ type NetworkPolicyPeer struct { // IPBlock defines policy on a particular IPBlock. If this field is set then // neither of the other fields can be. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional IPBlock *IPBlock `json:"ipBlock,omitempty" protobuf:"bytes,3,rep,name=ipBlock"` } @@ -1260,7 +1264,7 @@ type NetworkPolicyPeer struct { // DEPRECATED 1.9 - This group version of NetworkPolicyList is deprecated by networking/v1/NetworkPolicyList. // Network Policy List is a list of NetworkPolicy objects. type NetworkPolicyList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional diff --git a/vendor/k8s.io/api/extensions/v1beta1/zz_generated.validations.go b/vendor/k8s.io/api/extensions/v1beta1/zz_generated.validations.go deleted file mode 100644 index d504d5452e..0000000000 --- a/vendor/k8s.io/api/extensions/v1beta1/zz_generated.validations.go +++ /dev/null @@ -1,279 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by validation-gen. DO NOT EDIT. - -package v1beta1 - -import ( - context "context" - fmt "fmt" - - equality "k8s.io/apimachinery/pkg/api/equality" - operation "k8s.io/apimachinery/pkg/api/operation" - safe "k8s.io/apimachinery/pkg/api/safe" - validate "k8s.io/apimachinery/pkg/api/validate" - runtime "k8s.io/apimachinery/pkg/runtime" - field "k8s.io/apimachinery/pkg/util/validation/field" -) - -func init() { localSchemeBuilder.Register(RegisterValidations) } - -// RegisterValidations adds validation functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterValidations(scheme *runtime.Scheme) error { - // type NetworkPolicy - scheme.AddValidationFunc((*NetworkPolicy)(nil), func(ctx context.Context, op operation.Operation, obj, oldObj interface{}) field.ErrorList { - switch op.Request.SubresourcePath() { - case "/": - return Validate_NetworkPolicy(ctx, op, nil /* fldPath */, obj.(*NetworkPolicy), safe.Cast[*NetworkPolicy](oldObj)) - } - return field.ErrorList{field.InternalError(nil, fmt.Errorf("no validation found for %T, subresource: %v", obj, op.Request.SubresourcePath()))} - }) - // type Scale - scheme.AddValidationFunc((*Scale)(nil), func(ctx context.Context, op operation.Operation, obj, oldObj interface{}) field.ErrorList { - switch op.Request.SubresourcePath() { - case "/scale": - return Validate_Scale(ctx, op, nil /* fldPath */, obj.(*Scale), safe.Cast[*Scale](oldObj)) - } - return field.ErrorList{field.InternalError(nil, fmt.Errorf("no validation found for %T, subresource: %v", obj, op.Request.SubresourcePath()))} - }) - return nil -} - -// Validate_IPBlock validates an instance of IPBlock according -// to declarative validation rules in the API schema. -func Validate_IPBlock(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *IPBlock) (errs field.ErrorList) { - // field IPBlock.CIDR - errs = append(errs, - func(fldPath *field.Path, obj, oldObj *string, oldValueCorrelated bool) (errs field.ErrorList) { - // don't revalidate unchanged data - if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) { - return nil - } - // call field-attached validations - earlyReturn := false - if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 { - errs = append(errs, e...) - earlyReturn = true - } - if earlyReturn { - return // do not proceed - } - return - }(fldPath.Child("cidr"), &obj.CIDR, safe.Field(oldObj, func(oldObj *IPBlock) *string { return &oldObj.CIDR }), oldObj != nil)...) - - // field IPBlock.Except has no validation - return errs -} - -// Validate_NetworkPolicy validates an instance of NetworkPolicy according -// to declarative validation rules in the API schema. -func Validate_NetworkPolicy(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *NetworkPolicy) (errs field.ErrorList) { - // field NetworkPolicy.TypeMeta has no validation - // field NetworkPolicy.ObjectMeta has no validation - - // field NetworkPolicy.Spec - errs = append(errs, - func(fldPath *field.Path, obj, oldObj *NetworkPolicySpec, oldValueCorrelated bool) (errs field.ErrorList) { - // don't revalidate unchanged data - if oldValueCorrelated && op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) { - return nil - } - // call the type's validation function - errs = append(errs, Validate_NetworkPolicySpec(ctx, op, fldPath, obj, oldObj)...) - return - }(fldPath.Child("spec"), &obj.Spec, safe.Field(oldObj, func(oldObj *NetworkPolicy) *NetworkPolicySpec { return &oldObj.Spec }), oldObj != nil)...) - - return errs -} - -// Validate_NetworkPolicyEgressRule validates an instance of NetworkPolicyEgressRule according -// to declarative validation rules in the API schema. -func Validate_NetworkPolicyEgressRule(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *NetworkPolicyEgressRule) (errs field.ErrorList) { - // field NetworkPolicyEgressRule.Ports has no validation - - // field NetworkPolicyEgressRule.To - errs = append(errs, - func(fldPath *field.Path, obj, oldObj []NetworkPolicyPeer, oldValueCorrelated bool) (errs field.ErrorList) { - // don't revalidate unchanged data - if oldValueCorrelated && op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) { - return nil - } - // call field-attached validations - earlyReturn := false - if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 { - earlyReturn = true - } - if earlyReturn { - return // do not proceed - } - // iterate the list and call the type's validation function - errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_NetworkPolicyPeer)...) - return - }(fldPath.Child("to"), obj.To, safe.Field(oldObj, func(oldObj *NetworkPolicyEgressRule) []NetworkPolicyPeer { return oldObj.To }), oldObj != nil)...) - - return errs -} - -// Validate_NetworkPolicyIngressRule validates an instance of NetworkPolicyIngressRule according -// to declarative validation rules in the API schema. -func Validate_NetworkPolicyIngressRule(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *NetworkPolicyIngressRule) (errs field.ErrorList) { - // field NetworkPolicyIngressRule.Ports has no validation - - // field NetworkPolicyIngressRule.From - errs = append(errs, - func(fldPath *field.Path, obj, oldObj []NetworkPolicyPeer, oldValueCorrelated bool) (errs field.ErrorList) { - // don't revalidate unchanged data - if oldValueCorrelated && op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) { - return nil - } - // call field-attached validations - earlyReturn := false - if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 { - earlyReturn = true - } - if earlyReturn { - return // do not proceed - } - // iterate the list and call the type's validation function - errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_NetworkPolicyPeer)...) - return - }(fldPath.Child("from"), obj.From, safe.Field(oldObj, func(oldObj *NetworkPolicyIngressRule) []NetworkPolicyPeer { return oldObj.From }), oldObj != nil)...) - - return errs -} - -// Validate_NetworkPolicyPeer validates an instance of NetworkPolicyPeer according -// to declarative validation rules in the API schema. -func Validate_NetworkPolicyPeer(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *NetworkPolicyPeer) (errs field.ErrorList) { - // field NetworkPolicyPeer.PodSelector has no validation - // field NetworkPolicyPeer.NamespaceSelector has no validation - - // field NetworkPolicyPeer.IPBlock - errs = append(errs, - func(fldPath *field.Path, obj, oldObj *IPBlock, oldValueCorrelated bool) (errs field.ErrorList) { - // don't revalidate unchanged data - if oldValueCorrelated && op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) { - return nil - } - // call field-attached validations - earlyReturn := false - if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 { - earlyReturn = true - } - if earlyReturn { - return // do not proceed - } - // call the type's validation function - errs = append(errs, Validate_IPBlock(ctx, op, fldPath, obj, oldObj)...) - return - }(fldPath.Child("ipBlock"), obj.IPBlock, safe.Field(oldObj, func(oldObj *NetworkPolicyPeer) *IPBlock { return oldObj.IPBlock }), oldObj != nil)...) - - return errs -} - -// Validate_NetworkPolicySpec validates an instance of NetworkPolicySpec according -// to declarative validation rules in the API schema. -func Validate_NetworkPolicySpec(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *NetworkPolicySpec) (errs field.ErrorList) { - // field NetworkPolicySpec.PodSelector has no validation - - // field NetworkPolicySpec.Ingress - errs = append(errs, - func(fldPath *field.Path, obj, oldObj []NetworkPolicyIngressRule, oldValueCorrelated bool) (errs field.ErrorList) { - // don't revalidate unchanged data - if oldValueCorrelated && op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) { - return nil - } - // call field-attached validations - earlyReturn := false - if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 { - earlyReturn = true - } - if earlyReturn { - return // do not proceed - } - // iterate the list and call the type's validation function - errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_NetworkPolicyIngressRule)...) - return - }(fldPath.Child("ingress"), obj.Ingress, safe.Field(oldObj, func(oldObj *NetworkPolicySpec) []NetworkPolicyIngressRule { return oldObj.Ingress }), oldObj != nil)...) - - // field NetworkPolicySpec.Egress - errs = append(errs, - func(fldPath *field.Path, obj, oldObj []NetworkPolicyEgressRule, oldValueCorrelated bool) (errs field.ErrorList) { - // don't revalidate unchanged data - if oldValueCorrelated && op.Type == operation.Update && equality.Semantic.DeepEqual(obj, oldObj) { - return nil - } - // call field-attached validations - earlyReturn := false - if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 { - earlyReturn = true - } - if earlyReturn { - return // do not proceed - } - // iterate the list and call the type's validation function - errs = append(errs, validate.EachSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_NetworkPolicyEgressRule)...) - return - }(fldPath.Child("egress"), obj.Egress, safe.Field(oldObj, func(oldObj *NetworkPolicySpec) []NetworkPolicyEgressRule { return oldObj.Egress }), oldObj != nil)...) - - // field NetworkPolicySpec.PolicyTypes has no validation - return errs -} - -// Validate_Scale validates an instance of Scale according -// to declarative validation rules in the API schema. -func Validate_Scale(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *Scale) (errs field.ErrorList) { - // field Scale.TypeMeta has no validation - // field Scale.ObjectMeta has no validation - - // field Scale.Spec - errs = append(errs, - func(fldPath *field.Path, obj, oldObj *ScaleSpec, oldValueCorrelated bool) (errs field.ErrorList) { - // don't revalidate unchanged data - if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) { - return nil - } - // call the type's validation function - errs = append(errs, Validate_ScaleSpec(ctx, op, fldPath, obj, oldObj)...) - return - }(fldPath.Child("spec"), &obj.Spec, safe.Field(oldObj, func(oldObj *Scale) *ScaleSpec { return &oldObj.Spec }), oldObj != nil)...) - - // field Scale.Status has no validation - return errs -} - -// Validate_ScaleSpec validates an instance of ScaleSpec according -// to declarative validation rules in the API schema. -func Validate_ScaleSpec(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *ScaleSpec) (errs field.ErrorList) { - // field ScaleSpec.Replicas - errs = append(errs, - func(fldPath *field.Path, obj, oldObj *int32, oldValueCorrelated bool) (errs field.ErrorList) { - // don't revalidate unchanged data - if oldValueCorrelated && op.Type == operation.Update && (obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj)) { - return nil - } - // call field-attached validations - errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0).MarkAlpha()...) - return - }(fldPath.Child("replicas"), &obj.Replicas, safe.Field(oldObj, func(oldObj *ScaleSpec) *int32 { return &oldObj.Replicas }), oldObj != nil)...) - - return errs -} diff --git a/vendor/k8s.io/api/flowcontrol/v1/generated.proto b/vendor/k8s.io/api/flowcontrol/v1/generated.proto index eb9186d013..29e51ed05b 100644 --- a/vendor/k8s.io/api/flowcontrol/v1/generated.proto +++ b/vendor/k8s.io/api/flowcontrol/v1/generated.proto @@ -67,11 +67,13 @@ message FlowDistinguisherMethod { // `type` is the type of flow distinguisher method // The supported types are "ByUser" and "ByNamespace". // Required. + // +required optional string type = 1; } // FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with // similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". +// +k8s:supportsSubresource="/status" message FlowSchema { // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -80,7 +82,7 @@ message FlowSchema { // `spec` is the specification of the desired behavior of a FlowSchema. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required optional FlowSchemaSpec spec = 2; // `status` is the current status of a FlowSchema. @@ -93,20 +95,24 @@ message FlowSchema { message FlowSchemaCondition { // `type` is the type of the condition. // Required. + // +required optional string type = 1; // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. + // +optional optional string status = 2; // `lastTransitionTime` is the last time the condition transitioned from one status to another. + // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional optional string reason = 4; // `message` is a human-readable message indicating details about last transition. + // +optional optional string message = 5; } @@ -126,6 +132,7 @@ message FlowSchemaSpec { // `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot // be resolved, the FlowSchema will be ignored and marked as invalid in its status. // Required. + // +required optional PriorityLevelConfigurationReference priorityLevelConfiguration = 1; // `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen @@ -165,6 +172,7 @@ message GroupSubject { // See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some // well-known group names. // Required. + // +required optional string name = 1; } @@ -178,17 +186,17 @@ message LimitResponse { // "Reject" means that requests that can not be executed upon arrival // are rejected. // Required. + // +required // +unionDiscriminator - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:discriminator + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:modeDiscriminator optional string type = 1; // `queuing` holds the configuration parameters for queuing. // This field may be non-empty only if `type` is `"Queue"`. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Queue")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:member("Reject")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Queue")=+k8s:required optional QueuingConfiguration queuing = 2; } @@ -221,6 +229,7 @@ message LimitedPriorityLevelConfiguration { optional int32 nominalConcurrencyShares = 1; // `limitResponse` indicates what to do with requests that can not be executed right now + // +required optional LimitResponse limitResponse = 2; // `lendablePercent` prescribes the fraction of the level's NominalCL that @@ -261,6 +270,7 @@ message NonResourcePolicyRule { // "*" matches all verbs. If it is present, it must be the only entry. // +listType=set // Required. + // +required repeated string verbs = 1; // `nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty. @@ -273,6 +283,7 @@ message NonResourcePolicyRule { // "*" matches all non-resource urls. if it is present, it must be the only entry. // +listType=set // Required. + // +required repeated string nonResourceURLs = 6; } @@ -286,6 +297,7 @@ message PolicyRulesWithSubjects { // A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. // +listType=atomic // Required. + // +required repeated Subject subjects = 1; // `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the @@ -303,6 +315,7 @@ message PolicyRulesWithSubjects { } // PriorityLevelConfiguration represents the configuration of a priority level. +// +k8s:supportsSubresource="/status" message PriorityLevelConfiguration { // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -311,7 +324,7 @@ message PriorityLevelConfiguration { // `spec` is the specification of the desired behavior of a "request-priority". // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required optional PriorityLevelConfigurationSpec spec = 2; // `status` is the current status of a "request-priority". @@ -324,20 +337,24 @@ message PriorityLevelConfiguration { message PriorityLevelConfigurationCondition { // `type` is the type of the condition. // Required. + // +required optional string type = 1; // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. + // +optional optional string status = 2; // `lastTransitionTime` is the last time the condition transitioned from one status to another. + // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional optional string reason = 4; // `message` is a human-readable message indicating details about last transition. + // +optional optional string message = 5; } @@ -356,6 +373,7 @@ message PriorityLevelConfigurationList { message PriorityLevelConfigurationReference { // `name` is the name of the priority level configuration being referenced // Required. + // +required optional string name = 1; } @@ -371,17 +389,17 @@ message PriorityLevelConfigurationSpec { // _are_ subject to limits and (b) some of the server's limited // capacity is made available exclusively to this priority level. // Required. + // +required // +unionDiscriminator - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:discriminator + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:modeDiscriminator optional string type = 1; // `limited` specifies how requests are handled for a Limited priority level. // This field must be non-empty if and only if `type` is `"Limited"`. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Limited")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:member("Exempt")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Limited")=+k8s:required optional LimitedPriorityLevelConfiguration limited = 2; // `exempt` specifies how requests are handled for an exempt priority level. @@ -390,9 +408,8 @@ message PriorityLevelConfigurationSpec { // If empty and `type` is `"Exempt"` then the default values // for `ExemptPriorityLevelConfiguration` apply. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Exempt")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Limited")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Exempt")=+k8s:optional optional ExemptPriorityLevelConfiguration exempt = 3; } @@ -454,12 +471,14 @@ message ResourcePolicyRule { // "*" matches all verbs and, if present, must be the only entry. // +listType=set // Required. + // +required repeated string verbs = 1; // `apiGroups` is a list of matching API groups and may not be empty. // "*" matches all API groups and, if present, must be the only entry. // +listType=set // Required. + // +required repeated string apiGroups = 2; // `resources` is a list of matching resources (i.e., lowercase @@ -468,6 +487,7 @@ message ResourcePolicyRule { // "*" matches all resources and, if present, must be the only entry. // Required. // +listType=set + // +required repeated string resources = 3; // `clusterScope` indicates whether to match requests that do not @@ -495,10 +515,12 @@ message ResourcePolicyRule { message ServiceAccountSubject { // `namespace` is the namespace of matching ServiceAccount objects. // Required. + // +required optional string namespace = 1; // `name` is the name of matching ServiceAccount objects, or "*" to match regardless of name. // Required. + // +required optional string name = 2; } @@ -508,6 +530,7 @@ message ServiceAccountSubject { message Subject { // `kind` indicates which one of the other fields is non-empty. // Required + // +required // +unionDiscriminator optional string kind = 1; @@ -528,6 +551,7 @@ message Subject { message UserSubject { // `name` is the username that matches, or "*" to match all usernames. // Required. + // +required optional string name = 1; } diff --git a/vendor/k8s.io/api/flowcontrol/v1/types.go b/vendor/k8s.io/api/flowcontrol/v1/types.go index 4a40bdca42..31e421f280 100644 --- a/vendor/k8s.io/api/flowcontrol/v1/types.go +++ b/vendor/k8s.io/api/flowcontrol/v1/types.go @@ -110,15 +110,16 @@ const ( // FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with // similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". +// +k8s:supportsSubresource="/status" type FlowSchema struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // `spec` is the specification of the desired behavior of a FlowSchema. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required Spec FlowSchemaSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // `status` is the current status of a FlowSchema. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status @@ -131,7 +132,7 @@ type FlowSchema struct { // FlowSchemaList is a list of FlowSchema objects. type FlowSchemaList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // `metadata` is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -146,6 +147,7 @@ type FlowSchemaSpec struct { // `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot // be resolved, the FlowSchema will be ignored and marked as invalid in its status. // Required. + // +required PriorityLevelConfiguration PriorityLevelConfigurationReference `json:"priorityLevelConfiguration" protobuf:"bytes,1,opt,name=priorityLevelConfiguration"` // `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen // FlowSchema is among those with the numerically lowest (which we take to be logically highest) @@ -187,6 +189,7 @@ type FlowDistinguisherMethod struct { // `type` is the type of flow distinguisher method // The supported types are "ByUser" and "ByNamespace". // Required. + // +required Type FlowDistinguisherMethodType `json:"type" protobuf:"bytes,1,opt,name=type"` } @@ -194,6 +197,7 @@ type FlowDistinguisherMethod struct { type PriorityLevelConfigurationReference struct { // `name` is the name of the priority level configuration being referenced // Required. + // +required Name string `json:"name" protobuf:"bytes,1,opt,name=name"` } @@ -207,6 +211,7 @@ type PolicyRulesWithSubjects struct { // A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. // +listType=atomic // Required. + // +required Subjects []Subject `json:"subjects" protobuf:"bytes,1,rep,name=subjects"` // `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the // target resource. @@ -227,6 +232,7 @@ type PolicyRulesWithSubjects struct { type Subject struct { // `kind` indicates which one of the other fields is non-empty. // Required + // +required // +unionDiscriminator Kind SubjectKind `json:"kind" protobuf:"bytes,1,opt,name=kind"` // `user` matches based on username. @@ -254,6 +260,7 @@ const ( type UserSubject struct { // `name` is the username that matches, or "*" to match all usernames. // Required. + // +required Name string `json:"name" protobuf:"bytes,1,opt,name=name"` } @@ -263,6 +270,7 @@ type GroupSubject struct { // See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some // well-known group names. // Required. + // +required Name string `json:"name" protobuf:"bytes,1,opt,name=name"` } @@ -270,9 +278,11 @@ type GroupSubject struct { type ServiceAccountSubject struct { // `namespace` is the namespace of matching ServiceAccount objects. // Required. + // +required Namespace string `json:"namespace" protobuf:"bytes,1,opt,name=namespace"` // `name` is the name of matching ServiceAccount objects, or "*" to match regardless of name. // Required. + // +required Name string `json:"name" protobuf:"bytes,2,opt,name=name"` } @@ -290,12 +300,14 @@ type ResourcePolicyRule struct { // "*" matches all verbs and, if present, must be the only entry. // +listType=set // Required. + // +required Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` // `apiGroups` is a list of matching API groups and may not be empty. // "*" matches all API groups and, if present, must be the only entry. // +listType=set // Required. + // +required APIGroups []string `json:"apiGroups" protobuf:"bytes,2,rep,name=apiGroups"` // `resources` is a list of matching resources (i.e., lowercase @@ -304,6 +316,7 @@ type ResourcePolicyRule struct { // "*" matches all resources and, if present, must be the only entry. // Required. // +listType=set + // +required Resources []string `json:"resources" protobuf:"bytes,3,rep,name=resources"` // `clusterScope` indicates whether to match requests that do not @@ -335,6 +348,7 @@ type NonResourcePolicyRule struct { // "*" matches all verbs. If it is present, it must be the only entry. // +listType=set // Required. + // +required Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` // `nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty. // For example: @@ -346,6 +360,7 @@ type NonResourcePolicyRule struct { // "*" matches all non-resource urls. if it is present, it must be the only entry. // +listType=set // Required. + // +required NonResourceURLs []string `json:"nonResourceURLs" protobuf:"bytes,6,rep,name=nonResourceURLs"` } @@ -364,16 +379,20 @@ type FlowSchemaStatus struct { type FlowSchemaCondition struct { // `type` is the type of the condition. // Required. + // +required Type FlowSchemaConditionType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"` // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. + // +optional Status ConditionStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` // `lastTransitionTime` is the last time the condition transitioned from one status to another. + // +optional LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` // `message` is a human-readable message indicating details about last transition. + // +optional Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` } @@ -386,15 +405,16 @@ type FlowSchemaConditionType string // +k8s:prerelease-lifecycle-gen:introduced=1.29 // PriorityLevelConfiguration represents the configuration of a priority level. +// +k8s:supportsSubresource="/status" type PriorityLevelConfiguration struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // `spec` is the specification of the desired behavior of a "request-priority". // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required Spec PriorityLevelConfigurationSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // `status` is the current status of a "request-priority". // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status @@ -407,7 +427,7 @@ type PriorityLevelConfiguration struct { // PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects. type PriorityLevelConfigurationList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -428,17 +448,17 @@ type PriorityLevelConfigurationSpec struct { // _are_ subject to limits and (b) some of the server's limited // capacity is made available exclusively to this priority level. // Required. + // +required // +unionDiscriminator - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:discriminator + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:modeDiscriminator Type PriorityLevelEnablement `json:"type" protobuf:"bytes,1,opt,name=type"` // `limited` specifies how requests are handled for a Limited priority level. // This field must be non-empty if and only if `type` is `"Limited"`. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Limited")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:member("Exempt")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Limited")=+k8s:required Limited *LimitedPriorityLevelConfiguration `json:"limited,omitempty" protobuf:"bytes,2,opt,name=limited"` // `exempt` specifies how requests are handled for an exempt priority level. @@ -447,9 +467,8 @@ type PriorityLevelConfigurationSpec struct { // If empty and `type` is `"Exempt"` then the default values // for `ExemptPriorityLevelConfiguration` apply. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Exempt")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Limited")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Exempt")=+k8s:optional Exempt *ExemptPriorityLevelConfiguration `json:"exempt,omitempty" protobuf:"bytes,3,opt,name=exempt"` } @@ -494,6 +513,7 @@ type LimitedPriorityLevelConfiguration struct { NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares" protobuf:"varint,1,opt,name=nominalConcurrencyShares"` // `limitResponse` indicates what to do with requests that can not be executed right now + // +required LimitResponse LimitResponse `json:"limitResponse,omitempty" protobuf:"bytes,2,opt,name=limitResponse"` // `lendablePercent` prescribes the fraction of the level's NominalCL that @@ -573,17 +593,17 @@ type LimitResponse struct { // "Reject" means that requests that can not be executed upon arrival // are rejected. // Required. + // +required // +unionDiscriminator - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:discriminator + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:modeDiscriminator Type LimitResponseType `json:"type" protobuf:"bytes,1,opt,name=type"` // `queuing` holds the configuration parameters for queuing. // This field may be non-empty only if `type` is `"Queue"`. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Queue")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:member("Reject")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Queue")=+k8s:required Queuing *QueuingConfiguration `json:"queuing,omitempty" protobuf:"bytes,2,opt,name=queuing"` } @@ -650,16 +670,20 @@ type PriorityLevelConfigurationStatus struct { type PriorityLevelConfigurationCondition struct { // `type` is the type of the condition. // Required. + // +required Type PriorityLevelConfigurationConditionType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"` // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. + // +optional Status ConditionStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` // `lastTransitionTime` is the last time the condition transitioned from one status to another. + // +optional LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` // `message` is a human-readable message indicating details about last transition. + // +optional Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` } diff --git a/vendor/k8s.io/api/flowcontrol/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/flowcontrol/v1/types_swagger_doc_generated.go index b8cb436367..96b7a78e7d 100644 --- a/vendor/k8s.io/api/flowcontrol/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/flowcontrol/v1/types_swagger_doc_generated.go @@ -60,7 +60,7 @@ func (FlowSchema) SwaggerDoc() map[string]string { var map_FlowSchemaCondition = map[string]string{ "": "FlowSchemaCondition describes conditions for a FlowSchema.", "type": "`type` is the type of the condition. Required.", - "status": "`status` is the status of the condition. Can be True, False, Unknown. Required.", + "status": "`status` is the status of the condition. Should be specified and set to one of True, False, Unknown.", "lastTransitionTime": "`lastTransitionTime` is the last time the condition transitioned from one status to another.", "reason": "`reason` is a unique, one-word, CamelCase reason for the condition's last transition.", "message": "`message` is a human-readable message indicating details about last transition.", @@ -167,7 +167,7 @@ func (PriorityLevelConfiguration) SwaggerDoc() map[string]string { var map_PriorityLevelConfigurationCondition = map[string]string{ "": "PriorityLevelConfigurationCondition defines the condition of priority level.", "type": "`type` is the type of the condition. Required.", - "status": "`status` is the status of the condition. Can be True, False, Unknown. Required.", + "status": "`status` is the status of the condition. Should be specified and set to one of True, False, Unknown.", "lastTransitionTime": "`lastTransitionTime` is the last time the condition transitioned from one status to another.", "reason": "`reason` is a unique, one-word, CamelCase reason for the condition's last transition.", "message": "`message` is a human-readable message indicating details about last transition.", diff --git a/vendor/k8s.io/api/flowcontrol/v1beta1/generated.proto b/vendor/k8s.io/api/flowcontrol/v1beta1/generated.proto index 8a701a6100..c06ec1a2a6 100644 --- a/vendor/k8s.io/api/flowcontrol/v1beta1/generated.proto +++ b/vendor/k8s.io/api/flowcontrol/v1beta1/generated.proto @@ -67,11 +67,13 @@ message FlowDistinguisherMethod { // `type` is the type of flow distinguisher method // The supported types are "ByUser" and "ByNamespace". // Required. + // +required optional string type = 1; } // FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with // similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". +// +k8s:supportsSubresource="/status" message FlowSchema { // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -80,7 +82,7 @@ message FlowSchema { // `spec` is the specification of the desired behavior of a FlowSchema. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required optional FlowSchemaSpec spec = 2; // `status` is the current status of a FlowSchema. @@ -93,20 +95,24 @@ message FlowSchema { message FlowSchemaCondition { // `type` is the type of the condition. // Required. + // +required optional string type = 1; // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. + // +optional optional string status = 2; // `lastTransitionTime` is the last time the condition transitioned from one status to another. + // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional optional string reason = 4; // `message` is a human-readable message indicating details about last transition. + // +optional optional string message = 5; } @@ -126,6 +132,7 @@ message FlowSchemaSpec { // `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot // be resolved, the FlowSchema will be ignored and marked as invalid in its status. // Required. + // +required optional PriorityLevelConfigurationReference priorityLevelConfiguration = 1; // `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen @@ -163,6 +170,7 @@ message GroupSubject { // See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some // well-known group names. // Required. + // +required optional string name = 1; } @@ -176,17 +184,17 @@ message LimitResponse { // "Reject" means that requests that can not be executed upon arrival // are rejected. // Required. + // +required // +unionDiscriminator - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:discriminator + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:modeDiscriminator optional string type = 1; // `queuing` holds the configuration parameters for queuing. // This field may be non-empty only if `type` is `"Queue"`. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Queue")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:member("Reject")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Queue")=+k8s:required optional QueuingConfiguration queuing = 2; } @@ -214,6 +222,7 @@ message LimitedPriorityLevelConfiguration { optional int32 assuredConcurrencyShares = 1; // `limitResponse` indicates what to do with requests that can not be executed right now + // +required optional LimitResponse limitResponse = 2; // `lendablePercent` prescribes the fraction of the level's NominalCL that @@ -254,6 +263,7 @@ message NonResourcePolicyRule { // "*" matches all verbs. If it is present, it must be the only entry. // +listType=set // Required. + // +required repeated string verbs = 1; // `nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty. @@ -266,6 +276,7 @@ message NonResourcePolicyRule { // "*" matches all non-resource urls. if it is present, it must be the only entry. // +listType=set // Required. + // +required repeated string nonResourceURLs = 6; } @@ -279,6 +290,7 @@ message PolicyRulesWithSubjects { // A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. // +listType=atomic // Required. + // +required repeated Subject subjects = 1; // `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the @@ -296,6 +308,7 @@ message PolicyRulesWithSubjects { } // PriorityLevelConfiguration represents the configuration of a priority level. +// +k8s:supportsSubresource="/status" message PriorityLevelConfiguration { // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -304,7 +317,7 @@ message PriorityLevelConfiguration { // `spec` is the specification of the desired behavior of a "request-priority". // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required optional PriorityLevelConfigurationSpec spec = 2; // `status` is the current status of a "request-priority". @@ -317,20 +330,24 @@ message PriorityLevelConfiguration { message PriorityLevelConfigurationCondition { // `type` is the type of the condition. // Required. + // +required optional string type = 1; // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. + // +optional optional string status = 2; // `lastTransitionTime` is the last time the condition transitioned from one status to another. + // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional optional string reason = 4; // `message` is a human-readable message indicating details about last transition. + // +optional optional string message = 5; } @@ -349,6 +366,7 @@ message PriorityLevelConfigurationList { message PriorityLevelConfigurationReference { // `name` is the name of the priority level configuration being referenced // Required. + // +required optional string name = 1; } @@ -364,17 +382,17 @@ message PriorityLevelConfigurationSpec { // _are_ subject to limits and (b) some of the server's limited // capacity is made available exclusively to this priority level. // Required. + // +required // +unionDiscriminator - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:discriminator + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:modeDiscriminator optional string type = 1; // `limited` specifies how requests are handled for a Limited priority level. // This field must be non-empty if and only if `type` is `"Limited"`. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Limited")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:member("Exempt")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Limited")=+k8s:required optional LimitedPriorityLevelConfiguration limited = 2; // `exempt` specifies how requests are handled for an exempt priority level. @@ -383,9 +401,8 @@ message PriorityLevelConfigurationSpec { // If empty and `type` is `"Exempt"` then the default values // for `ExemptPriorityLevelConfiguration` apply. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Exempt")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Limited")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Exempt")=+k8s:optional optional ExemptPriorityLevelConfiguration exempt = 3; } @@ -445,12 +462,14 @@ message ResourcePolicyRule { // "*" matches all verbs and, if present, must be the only entry. // +listType=set // Required. + // +required repeated string verbs = 1; // `apiGroups` is a list of matching API groups and may not be empty. // "*" matches all API groups and, if present, must be the only entry. // +listType=set // Required. + // +required repeated string apiGroups = 2; // `resources` is a list of matching resources (i.e., lowercase @@ -459,6 +478,7 @@ message ResourcePolicyRule { // "*" matches all resources and, if present, must be the only entry. // Required. // +listType=set + // +required repeated string resources = 3; // `clusterScope` indicates whether to match requests that do not @@ -486,10 +506,12 @@ message ResourcePolicyRule { message ServiceAccountSubject { // `namespace` is the namespace of matching ServiceAccount objects. // Required. + // +required optional string namespace = 1; // `name` is the name of matching ServiceAccount objects, or "*" to match regardless of name. // Required. + // +required optional string name = 2; } @@ -499,6 +521,7 @@ message ServiceAccountSubject { message Subject { // `kind` indicates which one of the other fields is non-empty. // Required + // +required // +unionDiscriminator optional string kind = 1; @@ -519,6 +542,7 @@ message Subject { message UserSubject { // `name` is the username that matches, or "*" to match all usernames. // Required. + // +required optional string name = 1; } diff --git a/vendor/k8s.io/api/flowcontrol/v1beta1/types.go b/vendor/k8s.io/api/flowcontrol/v1beta1/types.go index 0de6ea940e..39f869f6c6 100644 --- a/vendor/k8s.io/api/flowcontrol/v1beta1/types.go +++ b/vendor/k8s.io/api/flowcontrol/v1beta1/types.go @@ -111,15 +111,16 @@ const ( // FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with // similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". +// +k8s:supportsSubresource="/status" type FlowSchema struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // `spec` is the specification of the desired behavior of a FlowSchema. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required Spec FlowSchemaSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // `status` is the current status of a FlowSchema. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status @@ -133,7 +134,7 @@ type FlowSchema struct { // FlowSchemaList is a list of FlowSchema objects. type FlowSchemaList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // `metadata` is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -148,6 +149,7 @@ type FlowSchemaSpec struct { // `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot // be resolved, the FlowSchema will be ignored and marked as invalid in its status. // Required. + // +required PriorityLevelConfiguration PriorityLevelConfigurationReference `json:"priorityLevelConfiguration" protobuf:"bytes,1,opt,name=priorityLevelConfiguration"` // `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen // FlowSchema is among those with the numerically lowest (which we take to be logically highest) @@ -189,6 +191,7 @@ type FlowDistinguisherMethod struct { // `type` is the type of flow distinguisher method // The supported types are "ByUser" and "ByNamespace". // Required. + // +required Type FlowDistinguisherMethodType `json:"type" protobuf:"bytes,1,opt,name=type"` } @@ -196,6 +199,7 @@ type FlowDistinguisherMethod struct { type PriorityLevelConfigurationReference struct { // `name` is the name of the priority level configuration being referenced // Required. + // +required Name string `json:"name" protobuf:"bytes,1,opt,name=name"` } @@ -209,6 +213,7 @@ type PolicyRulesWithSubjects struct { // A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. // +listType=atomic // Required. + // +required Subjects []Subject `json:"subjects" protobuf:"bytes,1,rep,name=subjects"` // `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the // target resource. @@ -229,6 +234,7 @@ type PolicyRulesWithSubjects struct { type Subject struct { // `kind` indicates which one of the other fields is non-empty. // Required + // +required // +unionDiscriminator Kind SubjectKind `json:"kind" protobuf:"bytes,1,opt,name=kind"` // `user` matches based on username. @@ -256,6 +262,7 @@ const ( type UserSubject struct { // `name` is the username that matches, or "*" to match all usernames. // Required. + // +required Name string `json:"name" protobuf:"bytes,1,opt,name=name"` } @@ -265,6 +272,7 @@ type GroupSubject struct { // See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some // well-known group names. // Required. + // +required Name string `json:"name" protobuf:"bytes,1,opt,name=name"` } @@ -272,9 +280,11 @@ type GroupSubject struct { type ServiceAccountSubject struct { // `namespace` is the namespace of matching ServiceAccount objects. // Required. + // +required Namespace string `json:"namespace" protobuf:"bytes,1,opt,name=namespace"` // `name` is the name of matching ServiceAccount objects, or "*" to match regardless of name. // Required. + // +required Name string `json:"name" protobuf:"bytes,2,opt,name=name"` } @@ -292,12 +302,14 @@ type ResourcePolicyRule struct { // "*" matches all verbs and, if present, must be the only entry. // +listType=set // Required. + // +required Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` // `apiGroups` is a list of matching API groups and may not be empty. // "*" matches all API groups and, if present, must be the only entry. // +listType=set // Required. + // +required APIGroups []string `json:"apiGroups" protobuf:"bytes,2,rep,name=apiGroups"` // `resources` is a list of matching resources (i.e., lowercase @@ -306,6 +318,7 @@ type ResourcePolicyRule struct { // "*" matches all resources and, if present, must be the only entry. // Required. // +listType=set + // +required Resources []string `json:"resources" protobuf:"bytes,3,rep,name=resources"` // `clusterScope` indicates whether to match requests that do not @@ -337,6 +350,7 @@ type NonResourcePolicyRule struct { // "*" matches all verbs. If it is present, it must be the only entry. // +listType=set // Required. + // +required Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` // `nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty. // For example: @@ -348,6 +362,7 @@ type NonResourcePolicyRule struct { // "*" matches all non-resource urls. if it is present, it must be the only entry. // +listType=set // Required. + // +required NonResourceURLs []string `json:"nonResourceURLs" protobuf:"bytes,6,rep,name=nonResourceURLs"` } @@ -364,16 +379,20 @@ type FlowSchemaStatus struct { type FlowSchemaCondition struct { // `type` is the type of the condition. // Required. + // +required Type FlowSchemaConditionType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"` // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. + // +optional Status ConditionStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` // `lastTransitionTime` is the last time the condition transitioned from one status to another. + // +optional LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` // `message` is a human-readable message indicating details about last transition. + // +optional Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` } @@ -387,15 +406,16 @@ type FlowSchemaConditionType string // +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1beta3,PriorityLevelConfiguration // PriorityLevelConfiguration represents the configuration of a priority level. +// +k8s:supportsSubresource="/status" type PriorityLevelConfiguration struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // `spec` is the specification of the desired behavior of a "request-priority". // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required Spec PriorityLevelConfigurationSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // `status` is the current status of a "request-priority". // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status @@ -409,7 +429,7 @@ type PriorityLevelConfiguration struct { // PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects. type PriorityLevelConfigurationList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -430,17 +450,17 @@ type PriorityLevelConfigurationSpec struct { // _are_ subject to limits and (b) some of the server's limited // capacity is made available exclusively to this priority level. // Required. + // +required // +unionDiscriminator - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:discriminator + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:modeDiscriminator Type PriorityLevelEnablement `json:"type" protobuf:"bytes,1,opt,name=type"` // `limited` specifies how requests are handled for a Limited priority level. // This field must be non-empty if and only if `type` is `"Limited"`. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Limited")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:member("Exempt")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Limited")=+k8s:required Limited *LimitedPriorityLevelConfiguration `json:"limited,omitempty" protobuf:"bytes,2,opt,name=limited"` // `exempt` specifies how requests are handled for an exempt priority level. @@ -449,9 +469,8 @@ type PriorityLevelConfigurationSpec struct { // If empty and `type` is `"Exempt"` then the default values // for `ExemptPriorityLevelConfiguration` apply. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Exempt")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Limited")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Exempt")=+k8s:optional Exempt *ExemptPriorityLevelConfiguration `json:"exempt,omitempty" protobuf:"bytes,3,opt,name=exempt"` } @@ -491,6 +510,7 @@ type LimitedPriorityLevelConfiguration struct { AssuredConcurrencyShares int32 `json:"assuredConcurrencyShares" protobuf:"varint,1,opt,name=assuredConcurrencyShares"` // `limitResponse` indicates what to do with requests that can not be executed right now + // +required LimitResponse LimitResponse `json:"limitResponse,omitempty" protobuf:"bytes,2,opt,name=limitResponse"` // `lendablePercent` prescribes the fraction of the level's NominalCL that @@ -570,17 +590,17 @@ type LimitResponse struct { // "Reject" means that requests that can not be executed upon arrival // are rejected. // Required. + // +required // +unionDiscriminator - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:discriminator + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:modeDiscriminator Type LimitResponseType `json:"type" protobuf:"bytes,1,opt,name=type"` // `queuing` holds the configuration parameters for queuing. // This field may be non-empty only if `type` is `"Queue"`. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Queue")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:member("Reject")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Queue")=+k8s:required Queuing *QueuingConfiguration `json:"queuing,omitempty" protobuf:"bytes,2,opt,name=queuing"` } @@ -645,16 +665,20 @@ type PriorityLevelConfigurationStatus struct { type PriorityLevelConfigurationCondition struct { // `type` is the type of the condition. // Required. + // +required Type PriorityLevelConfigurationConditionType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"` // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. + // +optional Status ConditionStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` // `lastTransitionTime` is the last time the condition transitioned from one status to another. + // +optional LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` // `message` is a human-readable message indicating details about last transition. + // +optional Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` } diff --git a/vendor/k8s.io/api/flowcontrol/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/flowcontrol/v1beta1/types_swagger_doc_generated.go index d69bdac622..fee54a89bf 100644 --- a/vendor/k8s.io/api/flowcontrol/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/flowcontrol/v1beta1/types_swagger_doc_generated.go @@ -60,7 +60,7 @@ func (FlowSchema) SwaggerDoc() map[string]string { var map_FlowSchemaCondition = map[string]string{ "": "FlowSchemaCondition describes conditions for a FlowSchema.", "type": "`type` is the type of the condition. Required.", - "status": "`status` is the status of the condition. Can be True, False, Unknown. Required.", + "status": "`status` is the status of the condition. Should be specified and set to one of True, False, Unknown.", "lastTransitionTime": "`lastTransitionTime` is the last time the condition transitioned from one status to another.", "reason": "`reason` is a unique, one-word, CamelCase reason for the condition's last transition.", "message": "`message` is a human-readable message indicating details about last transition.", @@ -167,7 +167,7 @@ func (PriorityLevelConfiguration) SwaggerDoc() map[string]string { var map_PriorityLevelConfigurationCondition = map[string]string{ "": "PriorityLevelConfigurationCondition defines the condition of priority level.", "type": "`type` is the type of the condition. Required.", - "status": "`status` is the status of the condition. Can be True, False, Unknown. Required.", + "status": "`status` is the status of the condition. Should be specified and set to one of True, False, Unknown.", "lastTransitionTime": "`lastTransitionTime` is the last time the condition transitioned from one status to another.", "reason": "`reason` is a unique, one-word, CamelCase reason for the condition's last transition.", "message": "`message` is a human-readable message indicating details about last transition.", diff --git a/vendor/k8s.io/api/flowcontrol/v1beta2/generated.proto b/vendor/k8s.io/api/flowcontrol/v1beta2/generated.proto index 371b90a5cd..a80455d670 100644 --- a/vendor/k8s.io/api/flowcontrol/v1beta2/generated.proto +++ b/vendor/k8s.io/api/flowcontrol/v1beta2/generated.proto @@ -67,11 +67,13 @@ message FlowDistinguisherMethod { // `type` is the type of flow distinguisher method // The supported types are "ByUser" and "ByNamespace". // Required. + // +required optional string type = 1; } // FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with // similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". +// +k8s:supportsSubresource="/status" message FlowSchema { // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -80,7 +82,7 @@ message FlowSchema { // `spec` is the specification of the desired behavior of a FlowSchema. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required optional FlowSchemaSpec spec = 2; // `status` is the current status of a FlowSchema. @@ -93,20 +95,24 @@ message FlowSchema { message FlowSchemaCondition { // `type` is the type of the condition. // Required. + // +required optional string type = 1; // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. + // +optional optional string status = 2; // `lastTransitionTime` is the last time the condition transitioned from one status to another. + // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional optional string reason = 4; // `message` is a human-readable message indicating details about last transition. + // +optional optional string message = 5; } @@ -126,6 +132,7 @@ message FlowSchemaSpec { // `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot // be resolved, the FlowSchema will be ignored and marked as invalid in its status. // Required. + // +required optional PriorityLevelConfigurationReference priorityLevelConfiguration = 1; // `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen @@ -163,6 +170,7 @@ message GroupSubject { // See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some // well-known group names. // Required. + // +required optional string name = 1; } @@ -176,17 +184,17 @@ message LimitResponse { // "Reject" means that requests that can not be executed upon arrival // are rejected. // Required. + // +required // +unionDiscriminator - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:discriminator + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:modeDiscriminator optional string type = 1; // `queuing` holds the configuration parameters for queuing. // This field may be non-empty only if `type` is `"Queue"`. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Queue")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:member("Reject")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Queue")=+k8s:required optional QueuingConfiguration queuing = 2; } @@ -214,6 +222,7 @@ message LimitedPriorityLevelConfiguration { optional int32 assuredConcurrencyShares = 1; // `limitResponse` indicates what to do with requests that can not be executed right now + // +required optional LimitResponse limitResponse = 2; // `lendablePercent` prescribes the fraction of the level's NominalCL that @@ -254,6 +263,7 @@ message NonResourcePolicyRule { // "*" matches all verbs. If it is present, it must be the only entry. // +listType=set // Required. + // +required repeated string verbs = 1; // `nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty. @@ -266,6 +276,7 @@ message NonResourcePolicyRule { // "*" matches all non-resource urls. if it is present, it must be the only entry. // +listType=set // Required. + // +required repeated string nonResourceURLs = 6; } @@ -279,6 +290,7 @@ message PolicyRulesWithSubjects { // A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. // +listType=atomic // Required. + // +required repeated Subject subjects = 1; // `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the @@ -296,6 +308,7 @@ message PolicyRulesWithSubjects { } // PriorityLevelConfiguration represents the configuration of a priority level. +// +k8s:supportsSubresource="/status" message PriorityLevelConfiguration { // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -304,7 +317,7 @@ message PriorityLevelConfiguration { // `spec` is the specification of the desired behavior of a "request-priority". // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required optional PriorityLevelConfigurationSpec spec = 2; // `status` is the current status of a "request-priority". @@ -317,20 +330,24 @@ message PriorityLevelConfiguration { message PriorityLevelConfigurationCondition { // `type` is the type of the condition. // Required. + // +required optional string type = 1; // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. + // +optional optional string status = 2; // `lastTransitionTime` is the last time the condition transitioned from one status to another. + // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional optional string reason = 4; // `message` is a human-readable message indicating details about last transition. + // +optional optional string message = 5; } @@ -349,6 +366,7 @@ message PriorityLevelConfigurationList { message PriorityLevelConfigurationReference { // `name` is the name of the priority level configuration being referenced // Required. + // +required optional string name = 1; } @@ -364,17 +382,17 @@ message PriorityLevelConfigurationSpec { // _are_ subject to limits and (b) some of the server's limited // capacity is made available exclusively to this priority level. // Required. + // +required // +unionDiscriminator - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:discriminator + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:modeDiscriminator optional string type = 1; // `limited` specifies how requests are handled for a Limited priority level. // This field must be non-empty if and only if `type` is `"Limited"`. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Limited")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:member("Exempt")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Limited")=+k8s:required optional LimitedPriorityLevelConfiguration limited = 2; // `exempt` specifies how requests are handled for an exempt priority level. @@ -383,9 +401,8 @@ message PriorityLevelConfigurationSpec { // If empty and `type` is `"Exempt"` then the default values // for `ExemptPriorityLevelConfiguration` apply. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Exempt")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Limited")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Exempt")=+k8s:optional optional ExemptPriorityLevelConfiguration exempt = 3; } @@ -445,12 +462,14 @@ message ResourcePolicyRule { // "*" matches all verbs and, if present, must be the only entry. // +listType=set // Required. + // +required repeated string verbs = 1; // `apiGroups` is a list of matching API groups and may not be empty. // "*" matches all API groups and, if present, must be the only entry. // +listType=set // Required. + // +required repeated string apiGroups = 2; // `resources` is a list of matching resources (i.e., lowercase @@ -459,6 +478,7 @@ message ResourcePolicyRule { // "*" matches all resources and, if present, must be the only entry. // Required. // +listType=set + // +required repeated string resources = 3; // `clusterScope` indicates whether to match requests that do not @@ -486,10 +506,12 @@ message ResourcePolicyRule { message ServiceAccountSubject { // `namespace` is the namespace of matching ServiceAccount objects. // Required. + // +required optional string namespace = 1; // `name` is the name of matching ServiceAccount objects, or "*" to match regardless of name. // Required. + // +required optional string name = 2; } @@ -499,6 +521,7 @@ message ServiceAccountSubject { message Subject { // `kind` indicates which one of the other fields is non-empty. // Required + // +required // +unionDiscriminator optional string kind = 1; @@ -519,6 +542,7 @@ message Subject { message UserSubject { // `name` is the username that matches, or "*" to match all usernames. // Required. + // +required optional string name = 1; } diff --git a/vendor/k8s.io/api/flowcontrol/v1beta2/types.go b/vendor/k8s.io/api/flowcontrol/v1beta2/types.go index 2f82a6823b..38ab2a2a7b 100644 --- a/vendor/k8s.io/api/flowcontrol/v1beta2/types.go +++ b/vendor/k8s.io/api/flowcontrol/v1beta2/types.go @@ -111,15 +111,16 @@ const ( // FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with // similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". +// +k8s:supportsSubresource="/status" type FlowSchema struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // `spec` is the specification of the desired behavior of a FlowSchema. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required Spec FlowSchemaSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // `status` is the current status of a FlowSchema. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status @@ -133,7 +134,7 @@ type FlowSchema struct { // FlowSchemaList is a list of FlowSchema objects. type FlowSchemaList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // `metadata` is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -148,6 +149,7 @@ type FlowSchemaSpec struct { // `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot // be resolved, the FlowSchema will be ignored and marked as invalid in its status. // Required. + // +required PriorityLevelConfiguration PriorityLevelConfigurationReference `json:"priorityLevelConfiguration" protobuf:"bytes,1,opt,name=priorityLevelConfiguration"` // `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen // FlowSchema is among those with the numerically lowest (which we take to be logically highest) @@ -189,6 +191,7 @@ type FlowDistinguisherMethod struct { // `type` is the type of flow distinguisher method // The supported types are "ByUser" and "ByNamespace". // Required. + // +required Type FlowDistinguisherMethodType `json:"type" protobuf:"bytes,1,opt,name=type"` } @@ -196,6 +199,7 @@ type FlowDistinguisherMethod struct { type PriorityLevelConfigurationReference struct { // `name` is the name of the priority level configuration being referenced // Required. + // +required Name string `json:"name" protobuf:"bytes,1,opt,name=name"` } @@ -209,6 +213,7 @@ type PolicyRulesWithSubjects struct { // A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. // +listType=atomic // Required. + // +required Subjects []Subject `json:"subjects" protobuf:"bytes,1,rep,name=subjects"` // `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the // target resource. @@ -229,6 +234,7 @@ type PolicyRulesWithSubjects struct { type Subject struct { // `kind` indicates which one of the other fields is non-empty. // Required + // +required // +unionDiscriminator Kind SubjectKind `json:"kind" protobuf:"bytes,1,opt,name=kind"` // `user` matches based on username. @@ -256,6 +262,7 @@ const ( type UserSubject struct { // `name` is the username that matches, or "*" to match all usernames. // Required. + // +required Name string `json:"name" protobuf:"bytes,1,opt,name=name"` } @@ -265,6 +272,7 @@ type GroupSubject struct { // See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some // well-known group names. // Required. + // +required Name string `json:"name" protobuf:"bytes,1,opt,name=name"` } @@ -272,9 +280,11 @@ type GroupSubject struct { type ServiceAccountSubject struct { // `namespace` is the namespace of matching ServiceAccount objects. // Required. + // +required Namespace string `json:"namespace" protobuf:"bytes,1,opt,name=namespace"` // `name` is the name of matching ServiceAccount objects, or "*" to match regardless of name. // Required. + // +required Name string `json:"name" protobuf:"bytes,2,opt,name=name"` } @@ -292,12 +302,14 @@ type ResourcePolicyRule struct { // "*" matches all verbs and, if present, must be the only entry. // +listType=set // Required. + // +required Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` // `apiGroups` is a list of matching API groups and may not be empty. // "*" matches all API groups and, if present, must be the only entry. // +listType=set // Required. + // +required APIGroups []string `json:"apiGroups" protobuf:"bytes,2,rep,name=apiGroups"` // `resources` is a list of matching resources (i.e., lowercase @@ -306,6 +318,7 @@ type ResourcePolicyRule struct { // "*" matches all resources and, if present, must be the only entry. // Required. // +listType=set + // +required Resources []string `json:"resources" protobuf:"bytes,3,rep,name=resources"` // `clusterScope` indicates whether to match requests that do not @@ -337,6 +350,7 @@ type NonResourcePolicyRule struct { // "*" matches all verbs. If it is present, it must be the only entry. // +listType=set // Required. + // +required Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` // `nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty. // For example: @@ -348,6 +362,7 @@ type NonResourcePolicyRule struct { // "*" matches all non-resource urls. if it is present, it must be the only entry. // +listType=set // Required. + // +required NonResourceURLs []string `json:"nonResourceURLs" protobuf:"bytes,6,rep,name=nonResourceURLs"` } @@ -364,16 +379,20 @@ type FlowSchemaStatus struct { type FlowSchemaCondition struct { // `type` is the type of the condition. // Required. + // +required Type FlowSchemaConditionType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"` // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. + // +optional Status ConditionStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` // `lastTransitionTime` is the last time the condition transitioned from one status to another. + // +optional LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` // `message` is a human-readable message indicating details about last transition. + // +optional Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` } @@ -387,15 +406,16 @@ type FlowSchemaConditionType string // +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1beta3,PriorityLevelConfiguration // PriorityLevelConfiguration represents the configuration of a priority level. +// +k8s:supportsSubresource="/status" type PriorityLevelConfiguration struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // `spec` is the specification of the desired behavior of a "request-priority". // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required Spec PriorityLevelConfigurationSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // `status` is the current status of a "request-priority". // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status @@ -409,7 +429,7 @@ type PriorityLevelConfiguration struct { // PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects. type PriorityLevelConfigurationList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -430,17 +450,17 @@ type PriorityLevelConfigurationSpec struct { // _are_ subject to limits and (b) some of the server's limited // capacity is made available exclusively to this priority level. // Required. + // +required // +unionDiscriminator - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:discriminator + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:modeDiscriminator Type PriorityLevelEnablement `json:"type" protobuf:"bytes,1,opt,name=type"` // `limited` specifies how requests are handled for a Limited priority level. // This field must be non-empty if and only if `type` is `"Limited"`. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Limited")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:member("Exempt")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Limited")=+k8s:required Limited *LimitedPriorityLevelConfiguration `json:"limited,omitempty" protobuf:"bytes,2,opt,name=limited"` // `exempt` specifies how requests are handled for an exempt priority level. @@ -449,9 +469,8 @@ type PriorityLevelConfigurationSpec struct { // If empty and `type` is `"Exempt"` then the default values // for `ExemptPriorityLevelConfiguration` apply. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Exempt")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Limited")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Exempt")=+k8s:optional Exempt *ExemptPriorityLevelConfiguration `json:"exempt,omitempty" protobuf:"bytes,3,opt,name=exempt"` } @@ -491,6 +510,7 @@ type LimitedPriorityLevelConfiguration struct { AssuredConcurrencyShares int32 `json:"assuredConcurrencyShares" protobuf:"varint,1,opt,name=assuredConcurrencyShares"` // `limitResponse` indicates what to do with requests that can not be executed right now + // +required LimitResponse LimitResponse `json:"limitResponse,omitempty" protobuf:"bytes,2,opt,name=limitResponse"` // `lendablePercent` prescribes the fraction of the level's NominalCL that @@ -570,17 +590,17 @@ type LimitResponse struct { // "Reject" means that requests that can not be executed upon arrival // are rejected. // Required. + // +required // +unionDiscriminator - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:discriminator + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:modeDiscriminator Type LimitResponseType `json:"type" protobuf:"bytes,1,opt,name=type"` // `queuing` holds the configuration parameters for queuing. // This field may be non-empty only if `type` is `"Queue"`. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Queue")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:member("Reject")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Queue")=+k8s:required Queuing *QueuingConfiguration `json:"queuing,omitempty" protobuf:"bytes,2,opt,name=queuing"` } @@ -645,16 +665,20 @@ type PriorityLevelConfigurationStatus struct { type PriorityLevelConfigurationCondition struct { // `type` is the type of the condition. // Required. + // +required Type PriorityLevelConfigurationConditionType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"` // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. + // +optional Status ConditionStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` // `lastTransitionTime` is the last time the condition transitioned from one status to another. + // +optional LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` // `message` is a human-readable message indicating details about last transition. + // +optional Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` } diff --git a/vendor/k8s.io/api/flowcontrol/v1beta2/types_swagger_doc_generated.go b/vendor/k8s.io/api/flowcontrol/v1beta2/types_swagger_doc_generated.go index 921122731a..bf12ce5e0b 100644 --- a/vendor/k8s.io/api/flowcontrol/v1beta2/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/flowcontrol/v1beta2/types_swagger_doc_generated.go @@ -60,7 +60,7 @@ func (FlowSchema) SwaggerDoc() map[string]string { var map_FlowSchemaCondition = map[string]string{ "": "FlowSchemaCondition describes conditions for a FlowSchema.", "type": "`type` is the type of the condition. Required.", - "status": "`status` is the status of the condition. Can be True, False, Unknown. Required.", + "status": "`status` is the status of the condition. Should be specified and set to one of True, False, Unknown.", "lastTransitionTime": "`lastTransitionTime` is the last time the condition transitioned from one status to another.", "reason": "`reason` is a unique, one-word, CamelCase reason for the condition's last transition.", "message": "`message` is a human-readable message indicating details about last transition.", @@ -167,7 +167,7 @@ func (PriorityLevelConfiguration) SwaggerDoc() map[string]string { var map_PriorityLevelConfigurationCondition = map[string]string{ "": "PriorityLevelConfigurationCondition defines the condition of priority level.", "type": "`type` is the type of the condition. Required.", - "status": "`status` is the status of the condition. Can be True, False, Unknown. Required.", + "status": "`status` is the status of the condition. Should be specified and set to one of True, False, Unknown.", "lastTransitionTime": "`lastTransitionTime` is the last time the condition transitioned from one status to another.", "reason": "`reason` is a unique, one-word, CamelCase reason for the condition's last transition.", "message": "`message` is a human-readable message indicating details about last transition.", diff --git a/vendor/k8s.io/api/flowcontrol/v1beta3/generated.proto b/vendor/k8s.io/api/flowcontrol/v1beta3/generated.proto index 7e11de2a28..68344b79b6 100644 --- a/vendor/k8s.io/api/flowcontrol/v1beta3/generated.proto +++ b/vendor/k8s.io/api/flowcontrol/v1beta3/generated.proto @@ -67,11 +67,13 @@ message FlowDistinguisherMethod { // `type` is the type of flow distinguisher method // The supported types are "ByUser" and "ByNamespace". // Required. + // +required optional string type = 1; } // FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with // similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". +// +k8s:supportsSubresource="/status" message FlowSchema { // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -80,7 +82,7 @@ message FlowSchema { // `spec` is the specification of the desired behavior of a FlowSchema. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required optional FlowSchemaSpec spec = 2; // `status` is the current status of a FlowSchema. @@ -93,20 +95,24 @@ message FlowSchema { message FlowSchemaCondition { // `type` is the type of the condition. // Required. + // +required optional string type = 1; // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. + // +optional optional string status = 2; // `lastTransitionTime` is the last time the condition transitioned from one status to another. + // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional optional string reason = 4; // `message` is a human-readable message indicating details about last transition. + // +optional optional string message = 5; } @@ -126,6 +132,7 @@ message FlowSchemaSpec { // `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot // be resolved, the FlowSchema will be ignored and marked as invalid in its status. // Required. + // +required optional PriorityLevelConfigurationReference priorityLevelConfiguration = 1; // `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen @@ -165,6 +172,7 @@ message GroupSubject { // See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some // well-known group names. // Required. + // +required optional string name = 1; } @@ -178,17 +186,17 @@ message LimitResponse { // "Reject" means that requests that can not be executed upon arrival // are rejected. // Required. + // +required // +unionDiscriminator - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:discriminator + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:modeDiscriminator optional string type = 1; // `queuing` holds the configuration parameters for queuing. // This field may be non-empty only if `type` is `"Queue"`. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Queue")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:member("Reject")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Queue")=+k8s:required optional QueuingConfiguration queuing = 2; } @@ -216,6 +224,7 @@ message LimitedPriorityLevelConfiguration { optional int32 nominalConcurrencyShares = 1; // `limitResponse` indicates what to do with requests that can not be executed right now + // +required optional LimitResponse limitResponse = 2; // `lendablePercent` prescribes the fraction of the level's NominalCL that @@ -256,6 +265,7 @@ message NonResourcePolicyRule { // "*" matches all verbs. If it is present, it must be the only entry. // +listType=set // Required. + // +required repeated string verbs = 1; // `nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty. @@ -268,6 +278,7 @@ message NonResourcePolicyRule { // "*" matches all non-resource urls. if it is present, it must be the only entry. // +listType=set // Required. + // +required repeated string nonResourceURLs = 6; } @@ -281,6 +292,7 @@ message PolicyRulesWithSubjects { // A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. // +listType=atomic // Required. + // +required repeated Subject subjects = 1; // `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the @@ -298,6 +310,7 @@ message PolicyRulesWithSubjects { } // PriorityLevelConfiguration represents the configuration of a priority level. +// +k8s:supportsSubresource="/status" message PriorityLevelConfiguration { // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -306,7 +319,7 @@ message PriorityLevelConfiguration { // `spec` is the specification of the desired behavior of a "request-priority". // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required optional PriorityLevelConfigurationSpec spec = 2; // `status` is the current status of a "request-priority". @@ -319,20 +332,24 @@ message PriorityLevelConfiguration { message PriorityLevelConfigurationCondition { // `type` is the type of the condition. // Required. + // +required optional string type = 1; // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. + // +optional optional string status = 2; // `lastTransitionTime` is the last time the condition transitioned from one status to another. + // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional optional string reason = 4; // `message` is a human-readable message indicating details about last transition. + // +optional optional string message = 5; } @@ -351,6 +368,7 @@ message PriorityLevelConfigurationList { message PriorityLevelConfigurationReference { // `name` is the name of the priority level configuration being referenced // Required. + // +required optional string name = 1; } @@ -366,17 +384,17 @@ message PriorityLevelConfigurationSpec { // _are_ subject to limits and (b) some of the server's limited // capacity is made available exclusively to this priority level. // Required. + // +required // +unionDiscriminator - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:discriminator + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:modeDiscriminator optional string type = 1; // `limited` specifies how requests are handled for a Limited priority level. // This field must be non-empty if and only if `type` is `"Limited"`. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Limited")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:member("Exempt")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Limited")=+k8s:required optional LimitedPriorityLevelConfiguration limited = 2; // `exempt` specifies how requests are handled for an exempt priority level. @@ -385,9 +403,8 @@ message PriorityLevelConfigurationSpec { // If empty and `type` is `"Exempt"` then the default values // for `ExemptPriorityLevelConfiguration` apply. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Exempt")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Limited")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Exempt")=+k8s:optional optional ExemptPriorityLevelConfiguration exempt = 3; } @@ -449,12 +466,14 @@ message ResourcePolicyRule { // "*" matches all verbs and, if present, must be the only entry. // +listType=set // Required. + // +required repeated string verbs = 1; // `apiGroups` is a list of matching API groups and may not be empty. // "*" matches all API groups and, if present, must be the only entry. // +listType=set // Required. + // +required repeated string apiGroups = 2; // `resources` is a list of matching resources (i.e., lowercase @@ -463,6 +482,7 @@ message ResourcePolicyRule { // "*" matches all resources and, if present, must be the only entry. // Required. // +listType=set + // +required repeated string resources = 3; // `clusterScope` indicates whether to match requests that do not @@ -490,10 +510,12 @@ message ResourcePolicyRule { message ServiceAccountSubject { // `namespace` is the namespace of matching ServiceAccount objects. // Required. + // +required optional string namespace = 1; // `name` is the name of matching ServiceAccount objects, or "*" to match regardless of name. // Required. + // +required optional string name = 2; } @@ -503,6 +525,7 @@ message ServiceAccountSubject { message Subject { // `kind` indicates which one of the other fields is non-empty. // Required + // +required // +unionDiscriminator optional string kind = 1; @@ -523,6 +546,7 @@ message Subject { message UserSubject { // `name` is the username that matches, or "*" to match all usernames. // Required. + // +required optional string name = 1; } diff --git a/vendor/k8s.io/api/flowcontrol/v1beta3/types.go b/vendor/k8s.io/api/flowcontrol/v1beta3/types.go index 26b67629ce..cbebca3574 100644 --- a/vendor/k8s.io/api/flowcontrol/v1beta3/types.go +++ b/vendor/k8s.io/api/flowcontrol/v1beta3/types.go @@ -125,15 +125,16 @@ const ( // FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with // similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". +// +k8s:supportsSubresource="/status" type FlowSchema struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // `spec` is the specification of the desired behavior of a FlowSchema. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required Spec FlowSchemaSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // `status` is the current status of a FlowSchema. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status @@ -147,7 +148,7 @@ type FlowSchema struct { // FlowSchemaList is a list of FlowSchema objects. type FlowSchemaList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // `metadata` is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -162,6 +163,7 @@ type FlowSchemaSpec struct { // `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot // be resolved, the FlowSchema will be ignored and marked as invalid in its status. // Required. + // +required PriorityLevelConfiguration PriorityLevelConfigurationReference `json:"priorityLevelConfiguration" protobuf:"bytes,1,opt,name=priorityLevelConfiguration"` // `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen // FlowSchema is among those with the numerically lowest (which we take to be logically highest) @@ -203,6 +205,7 @@ type FlowDistinguisherMethod struct { // `type` is the type of flow distinguisher method // The supported types are "ByUser" and "ByNamespace". // Required. + // +required Type FlowDistinguisherMethodType `json:"type" protobuf:"bytes,1,opt,name=type"` } @@ -210,6 +213,7 @@ type FlowDistinguisherMethod struct { type PriorityLevelConfigurationReference struct { // `name` is the name of the priority level configuration being referenced // Required. + // +required Name string `json:"name" protobuf:"bytes,1,opt,name=name"` } @@ -223,6 +227,7 @@ type PolicyRulesWithSubjects struct { // A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. // +listType=atomic // Required. + // +required Subjects []Subject `json:"subjects" protobuf:"bytes,1,rep,name=subjects"` // `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the // target resource. @@ -243,6 +248,7 @@ type PolicyRulesWithSubjects struct { type Subject struct { // `kind` indicates which one of the other fields is non-empty. // Required + // +required // +unionDiscriminator Kind SubjectKind `json:"kind" protobuf:"bytes,1,opt,name=kind"` // `user` matches based on username. @@ -270,6 +276,7 @@ const ( type UserSubject struct { // `name` is the username that matches, or "*" to match all usernames. // Required. + // +required Name string `json:"name" protobuf:"bytes,1,opt,name=name"` } @@ -279,6 +286,7 @@ type GroupSubject struct { // See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some // well-known group names. // Required. + // +required Name string `json:"name" protobuf:"bytes,1,opt,name=name"` } @@ -286,9 +294,11 @@ type GroupSubject struct { type ServiceAccountSubject struct { // `namespace` is the namespace of matching ServiceAccount objects. // Required. + // +required Namespace string `json:"namespace" protobuf:"bytes,1,opt,name=namespace"` // `name` is the name of matching ServiceAccount objects, or "*" to match regardless of name. // Required. + // +required Name string `json:"name" protobuf:"bytes,2,opt,name=name"` } @@ -306,12 +316,14 @@ type ResourcePolicyRule struct { // "*" matches all verbs and, if present, must be the only entry. // +listType=set // Required. + // +required Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` // `apiGroups` is a list of matching API groups and may not be empty. // "*" matches all API groups and, if present, must be the only entry. // +listType=set // Required. + // +required APIGroups []string `json:"apiGroups" protobuf:"bytes,2,rep,name=apiGroups"` // `resources` is a list of matching resources (i.e., lowercase @@ -320,6 +332,7 @@ type ResourcePolicyRule struct { // "*" matches all resources and, if present, must be the only entry. // Required. // +listType=set + // +required Resources []string `json:"resources" protobuf:"bytes,3,rep,name=resources"` // `clusterScope` indicates whether to match requests that do not @@ -351,6 +364,7 @@ type NonResourcePolicyRule struct { // "*" matches all verbs. If it is present, it must be the only entry. // +listType=set // Required. + // +required Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` // `nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty. // For example: @@ -362,6 +376,7 @@ type NonResourcePolicyRule struct { // "*" matches all non-resource urls. if it is present, it must be the only entry. // +listType=set // Required. + // +required NonResourceURLs []string `json:"nonResourceURLs" protobuf:"bytes,6,rep,name=nonResourceURLs"` } @@ -380,16 +395,20 @@ type FlowSchemaStatus struct { type FlowSchemaCondition struct { // `type` is the type of the condition. // Required. + // +required Type FlowSchemaConditionType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"` // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. + // +optional Status ConditionStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` // `lastTransitionTime` is the last time the condition transitioned from one status to another. + // +optional LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` // `message` is a human-readable message indicating details about last transition. + // +optional Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` } @@ -403,15 +422,16 @@ type FlowSchemaConditionType string // +k8s:prerelease-lifecycle-gen:replacement=flowcontrol.apiserver.k8s.io,v1,PriorityLevelConfiguration // PriorityLevelConfiguration represents the configuration of a priority level. +// +k8s:supportsSubresource="/status" type PriorityLevelConfiguration struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // `spec` is the specification of the desired behavior of a "request-priority". // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional + // +required Spec PriorityLevelConfigurationSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` // `status` is the current status of a "request-priority". // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status @@ -425,7 +445,7 @@ type PriorityLevelConfiguration struct { // PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects. type PriorityLevelConfigurationList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -446,17 +466,17 @@ type PriorityLevelConfigurationSpec struct { // _are_ subject to limits and (b) some of the server's limited // capacity is made available exclusively to this priority level. // Required. + // +required // +unionDiscriminator - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:discriminator + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:modeDiscriminator Type PriorityLevelEnablement `json:"type" protobuf:"bytes,1,opt,name=type"` // `limited` specifies how requests are handled for a Limited priority level. // This field must be non-empty if and only if `type` is `"Limited"`. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Limited")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:member("Exempt")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Limited")=+k8s:required Limited *LimitedPriorityLevelConfiguration `json:"limited,omitempty" protobuf:"bytes,2,opt,name=limited"` // `exempt` specifies how requests are handled for an exempt priority level. @@ -465,9 +485,8 @@ type PriorityLevelConfigurationSpec struct { // If empty and `type` is `"Exempt"` then the default values // for `ExemptPriorityLevelConfiguration` apply. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Exempt")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Limited")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Exempt")=+k8s:optional Exempt *ExemptPriorityLevelConfiguration `json:"exempt,omitempty" protobuf:"bytes,3,opt,name=exempt"` } @@ -507,6 +526,7 @@ type LimitedPriorityLevelConfiguration struct { NominalConcurrencyShares int32 `json:"nominalConcurrencyShares" protobuf:"varint,1,opt,name=nominalConcurrencyShares"` // `limitResponse` indicates what to do with requests that can not be executed right now + // +required LimitResponse LimitResponse `json:"limitResponse,omitempty" protobuf:"bytes,2,opt,name=limitResponse"` // `lendablePercent` prescribes the fraction of the level's NominalCL that @@ -586,17 +606,17 @@ type LimitResponse struct { // "Reject" means that requests that can not be executed upon arrival // are rejected. // Required. + // +required // +unionDiscriminator - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:discriminator + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:modeDiscriminator Type LimitResponseType `json:"type" protobuf:"bytes,1,opt,name=type"` // `queuing` holds the configuration parameters for queuing. // This field may be non-empty only if `type` is `"Queue"`. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:member("Queue")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:member("Reject")=+k8s:forbidden + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:ifMode("Queue")=+k8s:required Queuing *QueuingConfiguration `json:"queuing,omitempty" protobuf:"bytes,2,opt,name=queuing"` } @@ -663,16 +683,20 @@ type PriorityLevelConfigurationStatus struct { type PriorityLevelConfigurationCondition struct { // `type` is the type of the condition. // Required. + // +required Type PriorityLevelConfigurationConditionType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"` // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. + // +optional Status ConditionStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` // `lastTransitionTime` is the last time the condition transitioned from one status to another. + // +optional LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. + // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` // `message` is a human-readable message indicating details about last transition. + // +optional Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` } diff --git a/vendor/k8s.io/api/flowcontrol/v1beta3/types_swagger_doc_generated.go b/vendor/k8s.io/api/flowcontrol/v1beta3/types_swagger_doc_generated.go index fa76112a72..c799e5d8d7 100644 --- a/vendor/k8s.io/api/flowcontrol/v1beta3/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/flowcontrol/v1beta3/types_swagger_doc_generated.go @@ -60,7 +60,7 @@ func (FlowSchema) SwaggerDoc() map[string]string { var map_FlowSchemaCondition = map[string]string{ "": "FlowSchemaCondition describes conditions for a FlowSchema.", "type": "`type` is the type of the condition. Required.", - "status": "`status` is the status of the condition. Can be True, False, Unknown. Required.", + "status": "`status` is the status of the condition. Should be specified and set to one of True, False, Unknown.", "lastTransitionTime": "`lastTransitionTime` is the last time the condition transitioned from one status to another.", "reason": "`reason` is a unique, one-word, CamelCase reason for the condition's last transition.", "message": "`message` is a human-readable message indicating details about last transition.", @@ -167,7 +167,7 @@ func (PriorityLevelConfiguration) SwaggerDoc() map[string]string { var map_PriorityLevelConfigurationCondition = map[string]string{ "": "PriorityLevelConfigurationCondition defines the condition of priority level.", "type": "`type` is the type of the condition. Required.", - "status": "`status` is the status of the condition. Can be True, False, Unknown. Required.", + "status": "`status` is the status of the condition. Should be specified and set to one of True, False, Unknown.", "lastTransitionTime": "`lastTransitionTime` is the last time the condition transitioned from one status to another.", "reason": "`reason` is a unique, one-word, CamelCase reason for the condition's last transition.", "message": "`message` is a human-readable message indicating details about last transition.", diff --git a/vendor/k8s.io/api/imagepolicy/v1alpha1/generated.proto b/vendor/k8s.io/api/imagepolicy/v1alpha1/generated.proto index 03b1ac45c0..b9cd53b108 100644 --- a/vendor/k8s.io/api/imagepolicy/v1alpha1/generated.proto +++ b/vendor/k8s.io/api/imagepolicy/v1alpha1/generated.proto @@ -29,59 +29,61 @@ import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; option go_package = "k8s.io/api/imagepolicy/v1alpha1"; // ImageReview checks if the set of images in a pod are allowed. +// +k8s:supportsSubresource="/status" message ImageReview { - // Standard object's metadata. + // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Spec holds information about the pod being evaluated + // spec holds information about the pod being evaluated // +optional optional ImageReviewSpec spec = 2; - // Status is filled in by the backend and indicates whether the pod should be allowed. + // status is filled in by the backend and indicates whether the pod should be allowed. // +optional optional ImageReviewStatus status = 3; } // ImageReviewContainerSpec is a description of a container within the pod creation request. message ImageReviewContainerSpec { - // This can be in the form image:tag or image@SHA:012345679abcdef. + // image can be in the form image:tag or image@SHA:012345679abcdef. // +optional optional string image = 1; } // ImageReviewSpec is a description of the pod creation request. message ImageReviewSpec { - // Containers is a list of a subset of the information in each container of the Pod being created. + // containers is a list of a subset of the information in each container of the Pod being created. // +optional // +listType=atomic repeated ImageReviewContainerSpec containers = 1; - // Annotations is a list of key-value pairs extracted from the Pod's annotations. + // annotations is a list of key-value pairs extracted from the Pod's annotations. // It only includes keys which match the pattern `*.image-policy.k8s.io/*`. // It is up to each webhook backend to determine how to interpret these annotations, if at all. // +optional map annotations = 2; - // Namespace is the namespace the pod is being created in. + // namespace is the namespace the pod is being created in. // +optional optional string namespace = 3; } // ImageReviewStatus is the result of the review for the pod creation request. message ImageReviewStatus { - // Allowed indicates that all images were allowed to be run. + // allowed indicates that all images were allowed to be run. // +optional optional bool allowed = 1; - // Reason should be empty unless Allowed is false in which case it + // reason should be empty unless Allowed is false in which case it // may contain a short description of what is wrong. Kubernetes // may truncate excessively long errors when displaying to the user. // +optional optional string reason = 2; - // AuditAnnotations will be added to the attributes object of the + // auditAnnotations will be added to the attributes object of the // admission controller request using 'AddAnnotation'. The keys should // be prefix-less (i.e., the admission controller will add an // appropriate prefix). diff --git a/vendor/k8s.io/api/imagepolicy/v1alpha1/types.go b/vendor/k8s.io/api/imagepolicy/v1alpha1/types.go index cc8f4cf89f..9807c17534 100644 --- a/vendor/k8s.io/api/imagepolicy/v1alpha1/types.go +++ b/vendor/k8s.io/api/imagepolicy/v1alpha1/types.go @@ -26,41 +26,43 @@ import ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ImageReview checks if the set of images in a pod are allowed. +// +k8s:supportsSubresource="/status" type ImageReview struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Spec holds information about the pod being evaluated + // spec holds information about the pod being evaluated // +optional Spec ImageReviewSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` - // Status is filled in by the backend and indicates whether the pod should be allowed. + // status is filled in by the backend and indicates whether the pod should be allowed. // +optional Status ImageReviewStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } // ImageReviewSpec is a description of the pod creation request. type ImageReviewSpec struct { - // Containers is a list of a subset of the information in each container of the Pod being created. + // containers is a list of a subset of the information in each container of the Pod being created. // +optional // +listType=atomic Containers []ImageReviewContainerSpec `json:"containers,omitempty" protobuf:"bytes,1,rep,name=containers"` - // Annotations is a list of key-value pairs extracted from the Pod's annotations. + // annotations is a list of key-value pairs extracted from the Pod's annotations. // It only includes keys which match the pattern `*.image-policy.k8s.io/*`. // It is up to each webhook backend to determine how to interpret these annotations, if at all. // +optional Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,2,rep,name=annotations"` - // Namespace is the namespace the pod is being created in. + // namespace is the namespace the pod is being created in. // +optional Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"` } // ImageReviewContainerSpec is a description of a container within the pod creation request. type ImageReviewContainerSpec struct { - // This can be in the form image:tag or image@SHA:012345679abcdef. + // image can be in the form image:tag or image@SHA:012345679abcdef. // +optional Image string `json:"image,omitempty" protobuf:"bytes,1,opt,name=image"` // In future, we may add command line overrides, exec health check command lines, and so on. @@ -68,15 +70,15 @@ type ImageReviewContainerSpec struct { // ImageReviewStatus is the result of the review for the pod creation request. type ImageReviewStatus struct { - // Allowed indicates that all images were allowed to be run. + // allowed indicates that all images were allowed to be run. // +optional Allowed bool `json:"allowed" protobuf:"varint,1,opt,name=allowed"` - // Reason should be empty unless Allowed is false in which case it + // reason should be empty unless Allowed is false in which case it // may contain a short description of what is wrong. Kubernetes // may truncate excessively long errors when displaying to the user. // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,2,opt,name=reason"` - // AuditAnnotations will be added to the attributes object of the + // auditAnnotations will be added to the attributes object of the // admission controller request using 'AddAnnotation'. The keys should // be prefix-less (i.e., the admission controller will add an // appropriate prefix). diff --git a/vendor/k8s.io/api/imagepolicy/v1alpha1/types_swagger_doc_generated.go b/vendor/k8s.io/api/imagepolicy/v1alpha1/types_swagger_doc_generated.go index dadf95e1d5..802b79ba7a 100644 --- a/vendor/k8s.io/api/imagepolicy/v1alpha1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/imagepolicy/v1alpha1/types_swagger_doc_generated.go @@ -29,9 +29,9 @@ package v1alpha1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_ImageReview = map[string]string{ "": "ImageReview checks if the set of images in a pod are allowed.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "spec": "Spec holds information about the pod being evaluated", - "status": "Status is filled in by the backend and indicates whether the pod should be allowed.", + "metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec holds information about the pod being evaluated", + "status": "status is filled in by the backend and indicates whether the pod should be allowed.", } func (ImageReview) SwaggerDoc() map[string]string { @@ -40,7 +40,7 @@ func (ImageReview) SwaggerDoc() map[string]string { var map_ImageReviewContainerSpec = map[string]string{ "": "ImageReviewContainerSpec is a description of a container within the pod creation request.", - "image": "This can be in the form image:tag or image@SHA:012345679abcdef.", + "image": "image can be in the form image:tag or image@SHA:012345679abcdef.", } func (ImageReviewContainerSpec) SwaggerDoc() map[string]string { @@ -49,9 +49,9 @@ func (ImageReviewContainerSpec) SwaggerDoc() map[string]string { var map_ImageReviewSpec = map[string]string{ "": "ImageReviewSpec is a description of the pod creation request.", - "containers": "Containers is a list of a subset of the information in each container of the Pod being created.", - "annotations": "Annotations is a list of key-value pairs extracted from the Pod's annotations. It only includes keys which match the pattern `*.image-policy.k8s.io/*`. It is up to each webhook backend to determine how to interpret these annotations, if at all.", - "namespace": "Namespace is the namespace the pod is being created in.", + "containers": "containers is a list of a subset of the information in each container of the Pod being created.", + "annotations": "annotations is a list of key-value pairs extracted from the Pod's annotations. It only includes keys which match the pattern `*.image-policy.k8s.io/*`. It is up to each webhook backend to determine how to interpret these annotations, if at all.", + "namespace": "namespace is the namespace the pod is being created in.", } func (ImageReviewSpec) SwaggerDoc() map[string]string { @@ -60,9 +60,9 @@ func (ImageReviewSpec) SwaggerDoc() map[string]string { var map_ImageReviewStatus = map[string]string{ "": "ImageReviewStatus is the result of the review for the pod creation request.", - "allowed": "Allowed indicates that all images were allowed to be run.", - "reason": "Reason should be empty unless Allowed is false in which case it may contain a short description of what is wrong. Kubernetes may truncate excessively long errors when displaying to the user.", - "auditAnnotations": "AuditAnnotations will be added to the attributes object of the admission controller request using 'AddAnnotation'. The keys should be prefix-less (i.e., the admission controller will add an appropriate prefix).", + "allowed": "allowed indicates that all images were allowed to be run.", + "reason": "reason should be empty unless Allowed is false in which case it may contain a short description of what is wrong. Kubernetes may truncate excessively long errors when displaying to the user.", + "auditAnnotations": "auditAnnotations will be added to the attributes object of the admission controller request using 'AddAnnotation'. The keys should be prefix-less (i.e., the admission controller will add an appropriate prefix).", } func (ImageReviewStatus) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/scheduling/v1alpha2/doc.go b/vendor/k8s.io/api/lifecycle/v1alpha1/doc.go similarity index 81% rename from vendor/k8s.io/api/scheduling/v1alpha2/doc.go rename to vendor/k8s.io/api/lifecycle/v1alpha1/doc.go index 24ba23e72c..b8ccba674d 100644 --- a/vendor/k8s.io/api/scheduling/v1alpha2/doc.go +++ b/vendor/k8s.io/api/lifecycle/v1alpha1/doc.go @@ -17,8 +17,9 @@ limitations under the License. // +k8s:deepcopy-gen=package // +k8s:protobuf-gen=package // +k8s:openapi-gen=true -// +k8s:openapi-model-package=io.k8s.api.scheduling.v1alpha2 +// +k8s:prerelease-lifecycle-gen=true +// +k8s:openapi-model-package=io.k8s.api.lifecycle.v1alpha1 -// +groupName=scheduling.k8s.io +// +groupName=lifecycle.k8s.io -package v1alpha2 +package v1alpha1 diff --git a/vendor/k8s.io/api/scheduling/v1alpha2/generated.pb.go b/vendor/k8s.io/api/lifecycle/v1alpha1/generated.pb.go similarity index 61% rename from vendor/k8s.io/api/scheduling/v1alpha2/generated.pb.go rename to vendor/k8s.io/api/lifecycle/v1alpha1/generated.pb.go index 12402df3d2..f8835cc6a7 100644 --- a/vendor/k8s.io/api/scheduling/v1alpha2/generated.pb.go +++ b/vendor/k8s.io/api/lifecycle/v1alpha1/generated.pb.go @@ -15,9 +15,9 @@ limitations under the License. */ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: k8s.io/api/scheduling/v1alpha2/generated.proto +// source: k8s.io/api/lifecycle/v1alpha1/generated.proto -package v1alpha2 +package v1alpha1 import ( fmt "fmt" @@ -29,45 +29,94 @@ import ( math_bits "math/bits" reflect "reflect" strings "strings" + + k8s_io_apimachinery_pkg_types "k8s.io/apimachinery/pkg/types" ) -func (m *BasicSchedulingPolicy) Reset() { *m = BasicSchedulingPolicy{} } +func (m *Eviction) Reset() { *m = Eviction{} } -func (m *GangSchedulingPolicy) Reset() { *m = GangSchedulingPolicy{} } +func (m *EvictionList) Reset() { *m = EvictionList{} } -func (m *PodGroup) Reset() { *m = PodGroup{} } +func (m *EvictionPodReference) Reset() { *m = EvictionPodReference{} } -func (m *PodGroupList) Reset() { *m = PodGroupList{} } +func (m *EvictionRequest) Reset() { *m = EvictionRequest{} } -func (m *PodGroupResourceClaim) Reset() { *m = PodGroupResourceClaim{} } +func (m *EvictionRequestList) Reset() { *m = EvictionRequestList{} } -func (m *PodGroupResourceClaimStatus) Reset() { *m = PodGroupResourceClaimStatus{} } +func (m *EvictionRequestPodReference) Reset() { *m = EvictionRequestPodReference{} } -func (m *PodGroupSchedulingConstraints) Reset() { *m = PodGroupSchedulingConstraints{} } +func (m *EvictionRequestSpec) Reset() { *m = EvictionRequestSpec{} } -func (m *PodGroupSchedulingPolicy) Reset() { *m = PodGroupSchedulingPolicy{} } +func (m *EvictionRequestStatus) Reset() { *m = EvictionRequestStatus{} } -func (m *PodGroupSpec) Reset() { *m = PodGroupSpec{} } +func (m *EvictionRequestTarget) Reset() { *m = EvictionRequestTarget{} } -func (m *PodGroupStatus) Reset() { *m = PodGroupStatus{} } +func (m *EvictionSpec) Reset() { *m = EvictionSpec{} } -func (m *PodGroupTemplate) Reset() { *m = PodGroupTemplate{} } +func (m *EvictionStatus) Reset() { *m = EvictionStatus{} } -func (m *PodGroupTemplateReference) Reset() { *m = PodGroupTemplateReference{} } +func (m *EvictionTarget) Reset() { *m = EvictionTarget{} } -func (m *TopologyConstraint) Reset() { *m = TopologyConstraint{} } +func (m *Requester) Reset() { *m = Requester{} } -func (m *TypedLocalObjectReference) Reset() { *m = TypedLocalObjectReference{} } +func (m *ResponderStatus) Reset() { *m = ResponderStatus{} } -func (m *Workload) Reset() { *m = Workload{} } +func (m *TargetResponder) Reset() { *m = TargetResponder{} } -func (m *WorkloadList) Reset() { *m = WorkloadList{} } +func (m *Eviction) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} -func (m *WorkloadPodGroupTemplateReference) Reset() { *m = WorkloadPodGroupTemplateReference{} } +func (m *Eviction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} -func (m *WorkloadSpec) Reset() { *m = WorkloadSpec{} } +func (m *Eviction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} -func (m *BasicSchedulingPolicy) Marshal() (dAtA []byte, err error) { +func (m *EvictionList) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -77,20 +126,44 @@ func (m *BasicSchedulingPolicy) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *BasicSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { +func (m *EvictionList) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *BasicSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EvictionList) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *GangSchedulingPolicy) Marshal() (dAtA []byte, err error) { +func (m *EvictionPodReference) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -100,23 +173,30 @@ func (m *GangSchedulingPolicy) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GangSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { +func (m *EvictionPodReference) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GangSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EvictionPodReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - i = encodeVarintGenerated(dAtA, i, uint64(m.MinCount)) + i -= len(m.UID) + copy(dAtA[i:], m.UID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.UID))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0x12 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *PodGroup) Marshal() (dAtA []byte, err error) { +func (m *EvictionRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -126,12 +206,12 @@ func (m *PodGroup) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PodGroup) MarshalTo(dAtA []byte) (int, error) { +func (m *EvictionRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PodGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EvictionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -169,7 +249,7 @@ func (m *PodGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *PodGroupList) Marshal() (dAtA []byte, err error) { +func (m *EvictionRequestList) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -179,12 +259,12 @@ func (m *PodGroupList) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PodGroupList) MarshalTo(dAtA []byte) (int, error) { +func (m *EvictionRequestList) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PodGroupList) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EvictionRequestList) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -216,7 +296,7 @@ func (m *PodGroupList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *PodGroupResourceClaim) Marshal() (dAtA []byte, err error) { +func (m *EvictionRequestPodReference) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -226,30 +306,21 @@ func (m *PodGroupResourceClaim) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PodGroupResourceClaim) MarshalTo(dAtA []byte) (int, error) { +func (m *EvictionRequestPodReference) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PodGroupResourceClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EvictionRequestPodReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.ResourceClaimTemplateName != nil { - i -= len(*m.ResourceClaimTemplateName) - copy(dAtA[i:], *m.ResourceClaimTemplateName) - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ResourceClaimTemplateName))) - i-- - dAtA[i] = 0x1a - } - if m.ResourceClaimName != nil { - i -= len(*m.ResourceClaimName) - copy(dAtA[i:], *m.ResourceClaimName) - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ResourceClaimName))) - i-- - dAtA[i] = 0x12 - } + i -= len(m.UID) + copy(dAtA[i:], m.UID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.UID))) + i-- + dAtA[i] = 0x12 i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) @@ -258,7 +329,7 @@ func (m *PodGroupResourceClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *PodGroupResourceClaimStatus) Marshal() (dAtA []byte, err error) { +func (m *EvictionRequestSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -268,32 +339,40 @@ func (m *PodGroupResourceClaimStatus) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PodGroupResourceClaimStatus) MarshalTo(dAtA []byte) (int, error) { +func (m *EvictionRequestSpec) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PodGroupResourceClaimStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EvictionRequestSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.ResourceClaimName != nil { - i -= len(*m.ResourceClaimName) - copy(dAtA[i:], *m.ResourceClaimName) - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ResourceClaimName))) - i-- - dAtA[i] = 0x12 + i -= len(m.Intent) + copy(dAtA[i:], m.Intent) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Intent))) + i-- + dAtA[i] = 0x1a + i -= len(m.Requester) + copy(dAtA[i:], m.Requester) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Requester))) + i-- + dAtA[i] = 0x12 + { + size, err := m.Target.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *PodGroupSchedulingConstraints) Marshal() (dAtA []byte, err error) { +func (m *EvictionRequestStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -303,20 +382,25 @@ func (m *PodGroupSchedulingConstraints) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PodGroupSchedulingConstraints) MarshalTo(dAtA []byte) (int, error) { +func (m *EvictionRequestStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PodGroupSchedulingConstraints) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EvictionRequestStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Topology) > 0 { - for iNdEx := len(m.Topology) - 1; iNdEx >= 0; iNdEx-- { + if m.ObservedGeneration != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.ObservedGeneration)) + i-- + dAtA[i] = 0x10 + } + if len(m.Conditions) > 0 { + for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Topology[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -330,7 +414,7 @@ func (m *PodGroupSchedulingConstraints) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *PodGroupSchedulingPolicy) Marshal() (dAtA []byte, err error) { +func (m *EvictionRequestTarget) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -340,31 +424,19 @@ func (m *PodGroupSchedulingPolicy) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PodGroupSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { +func (m *EvictionRequestTarget) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PodGroupSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EvictionRequestTarget) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Gang != nil { - { - size, err := m.Gang.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Basic != nil { + if m.Pod != nil { { - size, err := m.Basic.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Pod.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -377,7 +449,7 @@ func (m *PodGroupSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *PodGroupSpec) Marshal() (dAtA []byte, err error) { +func (m *EvictionSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -387,61 +459,18 @@ func (m *PodGroupSpec) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PodGroupSpec) MarshalTo(dAtA []byte) (int, error) { +func (m *EvictionSpec) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PodGroupSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EvictionSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Priority != nil { - i = encodeVarintGenerated(dAtA, i, uint64(*m.Priority)) - i-- - dAtA[i] = 0x38 - } - i -= len(m.PriorityClassName) - copy(dAtA[i:], m.PriorityClassName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.PriorityClassName))) - i-- - dAtA[i] = 0x32 - if m.DisruptionMode != nil { - i -= len(*m.DisruptionMode) - copy(dAtA[i:], *m.DisruptionMode) - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.DisruptionMode))) - i-- - dAtA[i] = 0x2a - } - if len(m.ResourceClaims) > 0 { - for iNdEx := len(m.ResourceClaims) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ResourceClaims[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.SchedulingConstraints != nil { - { - size, err := m.SchedulingConstraints.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } { - size, err := m.SchedulingPolicy.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Target.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -449,23 +478,11 @@ func (m *PodGroupSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 - if m.PodGroupTemplateRef != nil { - { - size, err := m.PodGroupTemplateRef.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *PodGroupStatus) Marshal() (dAtA []byte, err error) { +func (m *EvictionStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -475,20 +492,20 @@ func (m *PodGroupStatus) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PodGroupStatus) MarshalTo(dAtA []byte) (int, error) { +func (m *EvictionStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PodGroupStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EvictionStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ResourceClaimStatuses) > 0 { - for iNdEx := len(m.ResourceClaimStatuses) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Responders) > 0 { + for iNdEx := len(m.Responders) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.ResourceClaimStatuses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Responders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -496,13 +513,13 @@ func (m *PodGroupStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x2a } } - if len(m.Conditions) > 0 { - for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { + if len(m.TargetResponders) > 0 { + for iNdEx := len(m.TargetResponders) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.TargetResponders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -510,53 +527,13 @@ func (m *PodGroupStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x22 } } - return len(dAtA) - i, nil -} - -func (m *PodGroupTemplate) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PodGroupTemplate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PodGroupTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Priority != nil { - i = encodeVarintGenerated(dAtA, i, uint64(*m.Priority)) - i-- - dAtA[i] = 0x38 - } - i -= len(m.PriorityClassName) - copy(dAtA[i:], m.PriorityClassName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.PriorityClassName))) - i-- - dAtA[i] = 0x32 - if m.DisruptionMode != nil { - i -= len(*m.DisruptionMode) - copy(dAtA[i:], *m.DisruptionMode) - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.DisruptionMode))) - i-- - dAtA[i] = 0x2a - } - if len(m.ResourceClaims) > 0 { - for iNdEx := len(m.ResourceClaims) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Requesters) > 0 { + for iNdEx := len(m.Requesters) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.ResourceClaims[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Requesters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -564,40 +541,32 @@ func (m *PodGroupTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a } } - if m.SchedulingConstraints != nil { - { - size, err := m.SchedulingConstraints.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } + if m.ObservedGeneration != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.ObservedGeneration)) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x10 } - { - size, err := m.SchedulingPolicy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Conditions) > 0 { + for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x12 - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *PodGroupTemplateReference) Marshal() (dAtA []byte, err error) { +func (m *EvictionTarget) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -607,19 +576,19 @@ func (m *PodGroupTemplateReference) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PodGroupTemplateReference) MarshalTo(dAtA []byte) (int, error) { +func (m *EvictionTarget) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PodGroupTemplateReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EvictionTarget) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Workload != nil { + if m.Pod != nil { { - size, err := m.Workload.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Pod.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -632,7 +601,7 @@ func (m *PodGroupTemplateReference) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *TopologyConstraint) Marshal() (dAtA []byte, err error) { +func (m *Requester) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -642,63 +611,30 @@ func (m *TopologyConstraint) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TopologyConstraint) MarshalTo(dAtA []byte) (int, error) { +func (m *Requester) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TopologyConstraint) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Requester) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Key))) + i -= len(m.Intent) + copy(dAtA[i:], m.Intent) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Intent))) i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *TypedLocalObjectReference) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TypedLocalObjectReference) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TypedLocalObjectReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l + dAtA[i] = 0x12 i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) i-- - dAtA[i] = 0x1a - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0x12 - i -= len(m.APIGroup) - copy(dAtA[i:], m.APIGroup) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIGroup))) - i-- dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *Workload) Marshal() (dAtA []byte, err error) { +func (m *ResponderStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -708,87 +644,80 @@ func (m *Workload) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Workload) MarshalTo(dAtA []byte) (int, error) { +func (m *ResponderStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Workload) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ResponderStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + if m.Message != nil { + i -= len(*m.Message) + copy(dAtA[i:], *m.Message) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Message))) + i-- + dAtA[i] = 0x32 } - i-- - dAtA[i] = 0x12 - { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.CompletionTime != nil { + { + size, err := m.CompletionTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *WorkloadList) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if m.ExpectedCompletionTime != nil { + { + size, err := m.ExpectedCompletionTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } - return dAtA[:n], nil -} - -func (m *WorkloadList) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WorkloadList) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + if m.HeartbeatTime != nil { + { + size, err := m.HeartbeatTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1a } - { - size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.StartTime != nil { + { + size, err := m.StartTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *WorkloadPodGroupTemplateReference) Marshal() (dAtA []byte, err error) { +func (m *TargetResponder) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -798,75 +727,31 @@ func (m *WorkloadPodGroupTemplateReference) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *WorkloadPodGroupTemplateReference) MarshalTo(dAtA []byte) (int, error) { +func (m *TargetResponder) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *WorkloadPodGroupTemplateReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TargetResponder) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - i -= len(m.PodGroupTemplateName) - copy(dAtA[i:], m.PodGroupTemplateName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.PodGroupTemplateName))) - i-- - dAtA[i] = 0x12 - i -= len(m.WorkloadName) - copy(dAtA[i:], m.WorkloadName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.WorkloadName))) + i -= len(m.State) + copy(dAtA[i:], m.State) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.State))) i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *WorkloadSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WorkloadSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WorkloadSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.PodGroupTemplates) > 0 { - for iNdEx := len(m.PodGroupTemplates) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PodGroupTemplates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.ControllerRef != nil { - { - size, err := m.ControllerRef.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } + dAtA[i] = 0x1a + if m.Priority != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Priority)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x10 } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -881,26 +766,52 @@ func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *BasicSchedulingPolicy) Size() (n int) { +func (m *Eviction) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) return n } -func (m *GangSchedulingPolicy) Size() (n int) { +func (m *EvictionList) Size() (n int) { if m == nil { return 0 } var l int _ = l - n += 1 + sovGenerated(uint64(m.MinCount)) + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *EvictionPodReference) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.UID) + n += 1 + l + sovGenerated(uint64(l)) return n } -func (m *PodGroup) Size() (n int) { +func (m *EvictionRequest) Size() (n int) { if m == nil { return 0 } @@ -915,7 +826,7 @@ func (m *PodGroup) Size() (n int) { return n } -func (m *PodGroupList) Size() (n int) { +func (m *EvictionRequestList) Size() (n int) { if m == nil { return 0 } @@ -932,7 +843,7 @@ func (m *PodGroupList) Size() (n int) { return n } -func (m *PodGroupResourceClaim) Size() (n int) { +func (m *EvictionRequestPodReference) Size() (n int) { if m == nil { return 0 } @@ -940,99 +851,69 @@ func (m *PodGroupResourceClaim) Size() (n int) { _ = l l = len(m.Name) n += 1 + l + sovGenerated(uint64(l)) - if m.ResourceClaimName != nil { - l = len(*m.ResourceClaimName) - n += 1 + l + sovGenerated(uint64(l)) - } - if m.ResourceClaimTemplateName != nil { - l = len(*m.ResourceClaimTemplateName) - n += 1 + l + sovGenerated(uint64(l)) - } + l = len(m.UID) + n += 1 + l + sovGenerated(uint64(l)) return n } -func (m *PodGroupResourceClaimStatus) Size() (n int) { +func (m *EvictionRequestSpec) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Name) + l = m.Target.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Requester) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Intent) n += 1 + l + sovGenerated(uint64(l)) - if m.ResourceClaimName != nil { - l = len(*m.ResourceClaimName) - n += 1 + l + sovGenerated(uint64(l)) - } return n } -func (m *PodGroupSchedulingConstraints) Size() (n int) { +func (m *EvictionRequestStatus) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Topology) > 0 { - for _, e := range m.Topology { + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { l = e.Size() n += 1 + l + sovGenerated(uint64(l)) } } + if m.ObservedGeneration != nil { + n += 1 + sovGenerated(uint64(*m.ObservedGeneration)) + } return n } -func (m *PodGroupSchedulingPolicy) Size() (n int) { +func (m *EvictionRequestTarget) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Basic != nil { - l = m.Basic.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.Gang != nil { - l = m.Gang.Size() + if m.Pod != nil { + l = m.Pod.Size() n += 1 + l + sovGenerated(uint64(l)) } return n } -func (m *PodGroupSpec) Size() (n int) { +func (m *EvictionSpec) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.PodGroupTemplateRef != nil { - l = m.PodGroupTemplateRef.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - l = m.SchedulingPolicy.Size() + l = m.Target.Size() n += 1 + l + sovGenerated(uint64(l)) - if m.SchedulingConstraints != nil { - l = m.SchedulingConstraints.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if len(m.ResourceClaims) > 0 { - for _, e := range m.ResourceClaims { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - if m.DisruptionMode != nil { - l = len(*m.DisruptionMode) - n += 1 + l + sovGenerated(uint64(l)) - } - l = len(m.PriorityClassName) - n += 1 + l + sovGenerated(uint64(l)) - if m.Priority != nil { - n += 1 + sovGenerated(uint64(*m.Priority)) - } return n } -func (m *PodGroupStatus) Size() (n int) { +func (m *EvictionStatus) Size() (n int) { if m == nil { return 0 } @@ -1044,145 +925,100 @@ func (m *PodGroupStatus) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } - if len(m.ResourceClaimStatuses) > 0 { - for _, e := range m.ResourceClaimStatuses { + if m.ObservedGeneration != nil { + n += 1 + sovGenerated(uint64(*m.ObservedGeneration)) + } + if len(m.Requesters) > 0 { + for _, e := range m.Requesters { l = e.Size() n += 1 + l + sovGenerated(uint64(l)) } } - return n -} - -func (m *PodGroupTemplate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - n += 1 + l + sovGenerated(uint64(l)) - l = m.SchedulingPolicy.Size() - n += 1 + l + sovGenerated(uint64(l)) - if m.SchedulingConstraints != nil { - l = m.SchedulingConstraints.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if len(m.ResourceClaims) > 0 { - for _, e := range m.ResourceClaims { + if len(m.TargetResponders) > 0 { + for _, e := range m.TargetResponders { l = e.Size() n += 1 + l + sovGenerated(uint64(l)) } } - if m.DisruptionMode != nil { - l = len(*m.DisruptionMode) - n += 1 + l + sovGenerated(uint64(l)) - } - l = len(m.PriorityClassName) - n += 1 + l + sovGenerated(uint64(l)) - if m.Priority != nil { - n += 1 + sovGenerated(uint64(*m.Priority)) + if len(m.Responders) > 0 { + for _, e := range m.Responders { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } } return n } -func (m *PodGroupTemplateReference) Size() (n int) { +func (m *EvictionTarget) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Workload != nil { - l = m.Workload.Size() + if m.Pod != nil { + l = m.Pod.Size() n += 1 + l + sovGenerated(uint64(l)) } return n } -func (m *TopologyConstraint) Size() (n int) { +func (m *Requester) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Key) + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Intent) n += 1 + l + sovGenerated(uint64(l)) return n } -func (m *TypedLocalObjectReference) Size() (n int) { +func (m *ResponderStatus) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.APIGroup) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Kind) - n += 1 + l + sovGenerated(uint64(l)) l = len(m.Name) n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *Workload) Size() (n int) { - if m == nil { - return 0 + if m.StartTime != nil { + l = m.StartTime.Size() + n += 1 + l + sovGenerated(uint64(l)) } - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *WorkloadList) Size() (n int) { - if m == nil { - return 0 + if m.HeartbeatTime != nil { + l = m.HeartbeatTime.Size() + n += 1 + l + sovGenerated(uint64(l)) } - var l int - _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } + if m.ExpectedCompletionTime != nil { + l = m.ExpectedCompletionTime.Size() + n += 1 + l + sovGenerated(uint64(l)) } - return n -} - -func (m *WorkloadPodGroupTemplateReference) Size() (n int) { - if m == nil { - return 0 + if m.CompletionTime != nil { + l = m.CompletionTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Message != nil { + l = len(*m.Message) + n += 1 + l + sovGenerated(uint64(l)) } - var l int - _ = l - l = len(m.WorkloadName) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.PodGroupTemplateName) - n += 1 + l + sovGenerated(uint64(l)) return n } -func (m *WorkloadSpec) Size() (n int) { +func (m *TargetResponder) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.ControllerRef != nil { - l = m.ControllerRef.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if len(m.PodGroupTemplates) > 0 { - for _, e := range m.PodGroupTemplates { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if m.Priority != nil { + n += 1 + sovGenerated(uint64(*m.Priority)) } + l = len(m.State) + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -1192,124 +1028,97 @@ func sovGenerated(x uint64) (n int) { func sozGenerated(x uint64) (n int) { return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (this *BasicSchedulingPolicy) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&BasicSchedulingPolicy{`, - `}`, - }, "") - return s -} -func (this *GangSchedulingPolicy) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GangSchedulingPolicy{`, - `MinCount:` + fmt.Sprintf("%v", this.MinCount) + `,`, - `}`, - }, "") - return s -} -func (this *PodGroup) String() string { +func (this *Eviction) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&PodGroup{`, + s := strings.Join([]string{`&Eviction{`, `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "PodGroupSpec", "PodGroupSpec", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "PodGroupStatus", "PodGroupStatus", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "EvictionSpec", "EvictionSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "EvictionStatus", "EvictionStatus", 1), `&`, ``, 1) + `,`, `}`, }, "") return s } -func (this *PodGroupList) String() string { +func (this *EvictionList) String() string { if this == nil { return "nil" } - repeatedStringForItems := "[]PodGroup{" + repeatedStringForItems := "[]Eviction{" for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "PodGroup", "PodGroup", 1), `&`, ``, 1) + "," + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "Eviction", "Eviction", 1), `&`, ``, 1) + "," } repeatedStringForItems += "}" - s := strings.Join([]string{`&PodGroupList{`, + s := strings.Join([]string{`&EvictionList{`, `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, `Items:` + repeatedStringForItems + `,`, `}`, }, "") return s } -func (this *PodGroupResourceClaim) String() string { +func (this *EvictionPodReference) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&PodGroupResourceClaim{`, + s := strings.Join([]string{`&EvictionPodReference{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `ResourceClaimName:` + valueToStringGenerated(this.ResourceClaimName) + `,`, - `ResourceClaimTemplateName:` + valueToStringGenerated(this.ResourceClaimTemplateName) + `,`, + `UID:` + fmt.Sprintf("%v", this.UID) + `,`, `}`, }, "") return s } -func (this *PodGroupResourceClaimStatus) String() string { +func (this *EvictionRequest) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&PodGroupResourceClaimStatus{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `ResourceClaimName:` + valueToStringGenerated(this.ResourceClaimName) + `,`, + s := strings.Join([]string{`&EvictionRequest{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "EvictionRequestSpec", "EvictionRequestSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "EvictionRequestStatus", "EvictionRequestStatus", 1), `&`, ``, 1) + `,`, `}`, }, "") return s } -func (this *PodGroupSchedulingConstraints) String() string { +func (this *EvictionRequestList) String() string { if this == nil { return "nil" } - repeatedStringForTopology := "[]TopologyConstraint{" - for _, f := range this.Topology { - repeatedStringForTopology += strings.Replace(strings.Replace(f.String(), "TopologyConstraint", "TopologyConstraint", 1), `&`, ``, 1) + "," + repeatedStringForItems := "[]EvictionRequest{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "EvictionRequest", "EvictionRequest", 1), `&`, ``, 1) + "," } - repeatedStringForTopology += "}" - s := strings.Join([]string{`&PodGroupSchedulingConstraints{`, - `Topology:` + repeatedStringForTopology + `,`, + repeatedStringForItems += "}" + s := strings.Join([]string{`&EvictionRequestList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, `}`, }, "") return s } -func (this *PodGroupSchedulingPolicy) String() string { +func (this *EvictionRequestPodReference) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&PodGroupSchedulingPolicy{`, - `Basic:` + strings.Replace(this.Basic.String(), "BasicSchedulingPolicy", "BasicSchedulingPolicy", 1) + `,`, - `Gang:` + strings.Replace(this.Gang.String(), "GangSchedulingPolicy", "GangSchedulingPolicy", 1) + `,`, + s := strings.Join([]string{`&EvictionRequestPodReference{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `UID:` + fmt.Sprintf("%v", this.UID) + `,`, `}`, }, "") return s } -func (this *PodGroupSpec) String() string { +func (this *EvictionRequestSpec) String() string { if this == nil { return "nil" } - repeatedStringForResourceClaims := "[]PodGroupResourceClaim{" - for _, f := range this.ResourceClaims { - repeatedStringForResourceClaims += strings.Replace(strings.Replace(f.String(), "PodGroupResourceClaim", "PodGroupResourceClaim", 1), `&`, ``, 1) + "," - } - repeatedStringForResourceClaims += "}" - s := strings.Join([]string{`&PodGroupSpec{`, - `PodGroupTemplateRef:` + strings.Replace(this.PodGroupTemplateRef.String(), "PodGroupTemplateReference", "PodGroupTemplateReference", 1) + `,`, - `SchedulingPolicy:` + strings.Replace(strings.Replace(this.SchedulingPolicy.String(), "PodGroupSchedulingPolicy", "PodGroupSchedulingPolicy", 1), `&`, ``, 1) + `,`, - `SchedulingConstraints:` + strings.Replace(this.SchedulingConstraints.String(), "PodGroupSchedulingConstraints", "PodGroupSchedulingConstraints", 1) + `,`, - `ResourceClaims:` + repeatedStringForResourceClaims + `,`, - `DisruptionMode:` + valueToStringGenerated(this.DisruptionMode) + `,`, - `PriorityClassName:` + fmt.Sprintf("%v", this.PriorityClassName) + `,`, - `Priority:` + valueToStringGenerated(this.Priority) + `,`, + s := strings.Join([]string{`&EvictionRequestSpec{`, + `Target:` + strings.Replace(strings.Replace(this.Target.String(), "EvictionRequestTarget", "EvictionRequestTarget", 1), `&`, ``, 1) + `,`, + `Requester:` + fmt.Sprintf("%v", this.Requester) + `,`, + `Intent:` + fmt.Sprintf("%v", this.Intent) + `,`, `}`, }, "") return s } -func (this *PodGroupStatus) String() string { +func (this *EvictionRequestStatus) String() string { if this == nil { return "nil" } @@ -1318,253 +1127,124 @@ func (this *PodGroupStatus) String() string { repeatedStringForConditions += fmt.Sprintf("%v", f) + "," } repeatedStringForConditions += "}" - repeatedStringForResourceClaimStatuses := "[]PodGroupResourceClaimStatus{" - for _, f := range this.ResourceClaimStatuses { - repeatedStringForResourceClaimStatuses += strings.Replace(strings.Replace(f.String(), "PodGroupResourceClaimStatus", "PodGroupResourceClaimStatus", 1), `&`, ``, 1) + "," - } - repeatedStringForResourceClaimStatuses += "}" - s := strings.Join([]string{`&PodGroupStatus{`, + s := strings.Join([]string{`&EvictionRequestStatus{`, `Conditions:` + repeatedStringForConditions + `,`, - `ResourceClaimStatuses:` + repeatedStringForResourceClaimStatuses + `,`, - `}`, - }, "") - return s -} -func (this *PodGroupTemplate) String() string { - if this == nil { - return "nil" - } - repeatedStringForResourceClaims := "[]PodGroupResourceClaim{" - for _, f := range this.ResourceClaims { - repeatedStringForResourceClaims += strings.Replace(strings.Replace(f.String(), "PodGroupResourceClaim", "PodGroupResourceClaim", 1), `&`, ``, 1) + "," - } - repeatedStringForResourceClaims += "}" - s := strings.Join([]string{`&PodGroupTemplate{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `SchedulingPolicy:` + strings.Replace(strings.Replace(this.SchedulingPolicy.String(), "PodGroupSchedulingPolicy", "PodGroupSchedulingPolicy", 1), `&`, ``, 1) + `,`, - `SchedulingConstraints:` + strings.Replace(this.SchedulingConstraints.String(), "PodGroupSchedulingConstraints", "PodGroupSchedulingConstraints", 1) + `,`, - `ResourceClaims:` + repeatedStringForResourceClaims + `,`, - `DisruptionMode:` + valueToStringGenerated(this.DisruptionMode) + `,`, - `PriorityClassName:` + fmt.Sprintf("%v", this.PriorityClassName) + `,`, - `Priority:` + valueToStringGenerated(this.Priority) + `,`, - `}`, - }, "") - return s -} -func (this *PodGroupTemplateReference) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PodGroupTemplateReference{`, - `Workload:` + strings.Replace(this.Workload.String(), "WorkloadPodGroupTemplateReference", "WorkloadPodGroupTemplateReference", 1) + `,`, - `}`, - }, "") - return s -} -func (this *TopologyConstraint) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TopologyConstraint{`, - `Key:` + fmt.Sprintf("%v", this.Key) + `,`, - `}`, - }, "") - return s -} -func (this *TypedLocalObjectReference) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TypedLocalObjectReference{`, - `APIGroup:` + fmt.Sprintf("%v", this.APIGroup) + `,`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `}`, - }, "") - return s -} -func (this *Workload) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Workload{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "WorkloadSpec", "WorkloadSpec", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *WorkloadList) String() string { - if this == nil { - return "nil" - } - repeatedStringForItems := "[]Workload{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "Workload", "Workload", 1), `&`, ``, 1) + "," - } - repeatedStringForItems += "}" - s := strings.Join([]string{`&WorkloadList{`, - `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `}`, - }, "") - return s -} -func (this *WorkloadPodGroupTemplateReference) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&WorkloadPodGroupTemplateReference{`, - `WorkloadName:` + fmt.Sprintf("%v", this.WorkloadName) + `,`, - `PodGroupTemplateName:` + fmt.Sprintf("%v", this.PodGroupTemplateName) + `,`, + `ObservedGeneration:` + valueToStringGenerated(this.ObservedGeneration) + `,`, `}`, }, "") return s } -func (this *WorkloadSpec) String() string { +func (this *EvictionRequestTarget) String() string { if this == nil { return "nil" } - repeatedStringForPodGroupTemplates := "[]PodGroupTemplate{" - for _, f := range this.PodGroupTemplates { - repeatedStringForPodGroupTemplates += strings.Replace(strings.Replace(f.String(), "PodGroupTemplate", "PodGroupTemplate", 1), `&`, ``, 1) + "," - } - repeatedStringForPodGroupTemplates += "}" - s := strings.Join([]string{`&WorkloadSpec{`, - `ControllerRef:` + strings.Replace(this.ControllerRef.String(), "TypedLocalObjectReference", "TypedLocalObjectReference", 1) + `,`, - `PodGroupTemplates:` + repeatedStringForPodGroupTemplates + `,`, + s := strings.Join([]string{`&EvictionRequestTarget{`, + `Pod:` + strings.Replace(this.Pod.String(), "EvictionRequestPodReference", "EvictionRequestPodReference", 1) + `,`, `}`, }, "") return s -} -func valueToStringGenerated(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *BasicSchedulingPolicy) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BasicSchedulingPolicy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BasicSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GangSchedulingPolicy) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GangSchedulingPolicy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GangSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinCount", wireType) - } - m.MinCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinCount |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } +} +func (this *EvictionSpec) String() string { + if this == nil { + return "nil" } - - if iNdEx > l { - return io.ErrUnexpectedEOF + s := strings.Join([]string{`&EvictionSpec{`, + `Target:` + strings.Replace(strings.Replace(this.Target.String(), "EvictionTarget", "EvictionTarget", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *EvictionStatus) String() string { + if this == nil { + return "nil" } - return nil + repeatedStringForConditions := "[]Condition{" + for _, f := range this.Conditions { + repeatedStringForConditions += fmt.Sprintf("%v", f) + "," + } + repeatedStringForConditions += "}" + repeatedStringForRequesters := "[]Requester{" + for _, f := range this.Requesters { + repeatedStringForRequesters += strings.Replace(strings.Replace(f.String(), "Requester", "Requester", 1), `&`, ``, 1) + "," + } + repeatedStringForRequesters += "}" + repeatedStringForTargetResponders := "[]TargetResponder{" + for _, f := range this.TargetResponders { + repeatedStringForTargetResponders += strings.Replace(strings.Replace(f.String(), "TargetResponder", "TargetResponder", 1), `&`, ``, 1) + "," + } + repeatedStringForTargetResponders += "}" + repeatedStringForResponders := "[]ResponderStatus{" + for _, f := range this.Responders { + repeatedStringForResponders += strings.Replace(strings.Replace(f.String(), "ResponderStatus", "ResponderStatus", 1), `&`, ``, 1) + "," + } + repeatedStringForResponders += "}" + s := strings.Join([]string{`&EvictionStatus{`, + `Conditions:` + repeatedStringForConditions + `,`, + `ObservedGeneration:` + valueToStringGenerated(this.ObservedGeneration) + `,`, + `Requesters:` + repeatedStringForRequesters + `,`, + `TargetResponders:` + repeatedStringForTargetResponders + `,`, + `Responders:` + repeatedStringForResponders + `,`, + `}`, + }, "") + return s +} +func (this *EvictionTarget) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&EvictionTarget{`, + `Pod:` + strings.Replace(this.Pod.String(), "EvictionPodReference", "EvictionPodReference", 1) + `,`, + `}`, + }, "") + return s +} +func (this *Requester) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Requester{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Intent:` + fmt.Sprintf("%v", this.Intent) + `,`, + `}`, + }, "") + return s +} +func (this *ResponderStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ResponderStatus{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `StartTime:` + strings.Replace(fmt.Sprintf("%v", this.StartTime), "Time", "v1.Time", 1) + `,`, + `HeartbeatTime:` + strings.Replace(fmt.Sprintf("%v", this.HeartbeatTime), "Time", "v1.Time", 1) + `,`, + `ExpectedCompletionTime:` + strings.Replace(fmt.Sprintf("%v", this.ExpectedCompletionTime), "Time", "v1.Time", 1) + `,`, + `CompletionTime:` + strings.Replace(fmt.Sprintf("%v", this.CompletionTime), "Time", "v1.Time", 1) + `,`, + `Message:` + valueToStringGenerated(this.Message) + `,`, + `}`, + }, "") + return s +} +func (this *TargetResponder) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TargetResponder{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Priority:` + valueToStringGenerated(this.Priority) + `,`, + `State:` + fmt.Sprintf("%v", this.State) + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) } -func (m *PodGroup) Unmarshal(dAtA []byte) error { +func (m *Eviction) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1587,10 +1267,10 @@ func (m *PodGroup) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodGroup: wiretype end group for non-group") + return fmt.Errorf("proto: Eviction: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodGroup: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Eviction: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1713,7 +1393,7 @@ func (m *PodGroup) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodGroupList) Unmarshal(dAtA []byte) error { +func (m *EvictionList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1736,10 +1416,10 @@ func (m *PodGroupList) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodGroupList: wiretype end group for non-group") + return fmt.Errorf("proto: EvictionList: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodGroupList: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EvictionList: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1804,7 +1484,7 @@ func (m *PodGroupList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, PodGroup{}) + m.Items = append(m.Items, Eviction{}) if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1830,7 +1510,7 @@ func (m *PodGroupList) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodGroupResourceClaim) Unmarshal(dAtA []byte) error { +func (m *EvictionPodReference) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1853,10 +1533,10 @@ func (m *PodGroupResourceClaim) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodGroupResourceClaim: wiretype end group for non-group") + return fmt.Errorf("proto: EvictionPodReference: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodGroupResourceClaim: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EvictionPodReference: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1893,40 +1573,7 @@ func (m *PodGroupResourceClaim) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.ResourceClaimName = &s - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimTemplateName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1954,8 +1601,7 @@ func (m *PodGroupResourceClaim) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.ResourceClaimTemplateName = &s + m.UID = k8s_io_apimachinery_pkg_types.UID(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1978,7 +1624,7 @@ func (m *PodGroupResourceClaim) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodGroupResourceClaimStatus) Unmarshal(dAtA []byte) error { +func (m *EvictionRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2001,17 +1647,17 @@ func (m *PodGroupResourceClaimStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodGroupResourceClaimStatus: wiretype end group for non-group") + return fmt.Errorf("proto: EvictionRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodGroupResourceClaimStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EvictionRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -2021,29 +1667,30 @@ func (m *PodGroupResourceClaimStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -2053,78 +1700,28 @@ func (m *PodGroupResourceClaimStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.ResourceClaimName = &s - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PodGroupSchedulingConstraints) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PodGroupSchedulingConstraints: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PodGroupSchedulingConstraints: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Topology", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2151,8 +1748,7 @@ func (m *PodGroupSchedulingConstraints) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Topology = append(m.Topology, TopologyConstraint{}) - if err := m.Topology[len(m.Topology)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2177,7 +1773,7 @@ func (m *PodGroupSchedulingConstraints) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodGroupSchedulingPolicy) Unmarshal(dAtA []byte) error { +func (m *EvictionRequestList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2200,15 +1796,15 @@ func (m *PodGroupSchedulingPolicy) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodGroupSchedulingPolicy: wiretype end group for non-group") + return fmt.Errorf("proto: EvictionRequestList: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodGroupSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EvictionRequestList: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Basic", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2235,16 +1831,13 @@ func (m *PodGroupSchedulingPolicy) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Basic == nil { - m.Basic = &BasicSchedulingPolicy{} - } - if err := m.Basic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Gang", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2271,10 +1864,8 @@ func (m *PodGroupSchedulingPolicy) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Gang == nil { - m.Gang = &GangSchedulingPolicy{} - } - if err := m.Gang.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Items = append(m.Items, EvictionRequest{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2299,7 +1890,7 @@ func (m *PodGroupSchedulingPolicy) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodGroupSpec) Unmarshal(dAtA []byte) error { +func (m *EvictionRequestPodReference) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2322,17 +1913,17 @@ func (m *PodGroupSpec) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodGroupSpec: wiretype end group for non-group") + return fmt.Errorf("proto: EvictionRequestPodReference: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodGroupSpec: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EvictionRequestPodReference: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PodGroupTemplateRef", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -2342,33 +1933,29 @@ func (m *PodGroupSpec) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if m.PodGroupTemplateRef == nil { - m.PodGroupTemplateRef = &PodGroupTemplateReference{} - } - if err := m.PodGroupTemplateRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SchedulingPolicy", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -2378,64 +1965,77 @@ func (m *PodGroupSpec) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.SchedulingPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.UID = k8s_io_apimachinery_pkg_types.UID(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SchedulingConstraints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGenerated } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if m.SchedulingConstraints == nil { - m.SchedulingConstraints = &PodGroupSchedulingConstraints{} + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EvictionRequestSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF } - if err := m.SchedulingConstraints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex - case 4: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EvictionRequestSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EvictionRequestSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaims", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2462,14 +2062,13 @@ func (m *PodGroupSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ResourceClaims = append(m.ResourceClaims, PodGroupResourceClaim{}) - if err := m.ResourceClaims[len(m.ResourceClaims)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Target.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DisruptionMode", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Requester", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2497,12 +2096,11 @@ func (m *PodGroupSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := DisruptionMode(dAtA[iNdEx:postIndex]) - m.DisruptionMode = &s + m.Requester = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriorityClassName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Intent", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2530,28 +2128,8 @@ func (m *PodGroupSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PriorityClassName = string(dAtA[iNdEx:postIndex]) + m.Intent = EvictionRequestIntent(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Priority = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -2573,7 +2151,7 @@ func (m *PodGroupSpec) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodGroupStatus) Unmarshal(dAtA []byte) error { +func (m *EvictionRequestStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2596,10 +2174,10 @@ func (m *PodGroupStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodGroupStatus: wiretype end group for non-group") + return fmt.Errorf("proto: EvictionRequestStatus: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodGroupStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EvictionRequestStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2637,10 +2215,10 @@ func (m *PodGroupStatus) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimStatuses", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ObservedGeneration", wireType) } - var msglen int + var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -2650,26 +2228,12 @@ func (m *PodGroupStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + v |= int64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResourceClaimStatuses = append(m.ResourceClaimStatuses, PodGroupResourceClaimStatus{}) - if err := m.ResourceClaimStatuses[len(m.ResourceClaimStatuses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex + m.ObservedGeneration = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -2691,7 +2255,7 @@ func (m *PodGroupStatus) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodGroupTemplate) Unmarshal(dAtA []byte) error { +func (m *EvictionRequestTarget) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2714,17 +2278,17 @@ func (m *PodGroupTemplate) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodGroupTemplate: wiretype end group for non-group") + return fmt.Errorf("proto: EvictionRequestTarget: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodGroupTemplate: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EvictionRequestTarget: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pod", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -2734,60 +2298,81 @@ func (m *PodGroupTemplate) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SchedulingPolicy", wireType) + if m.Pod == nil { + m.Pod = &EvictionRequestPodReference{} } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } + if err := m.Pod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - if msglen < 0 { - return ErrInvalidLengthGenerated + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGenerated } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if err := m.SchedulingPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EvictionSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated } - iNdEx = postIndex - case 3: + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EvictionSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EvictionSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SchedulingConstraints", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2814,16 +2399,63 @@ func (m *PodGroupTemplate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.SchedulingConstraints == nil { - m.SchedulingConstraints = &PodGroupSchedulingConstraints{} - } - if err := m.SchedulingConstraints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Target.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EvictionStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EvictionStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EvictionStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaims", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2850,16 +2482,16 @@ func (m *PodGroupTemplate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ResourceClaims = append(m.ResourceClaims, PodGroupResourceClaim{}) - if err := m.ResourceClaims[len(m.ResourceClaims)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Conditions = append(m.Conditions, v1.Condition{}) + if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DisruptionMode", wireType) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ObservedGeneration", wireType) } - var stringLen uint64 + var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -2869,30 +2501,17 @@ func (m *PodGroupTemplate) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + v |= int64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := DisruptionMode(dAtA[iNdEx:postIndex]) - m.DisruptionMode = &s - iNdEx = postIndex - case 6: + m.ObservedGeneration = &v + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriorityClassName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Requesters", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -2902,29 +2521,31 @@ func (m *PodGroupTemplate) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.PriorityClassName = string(dAtA[iNdEx:postIndex]) + m.Requesters = append(m.Requesters, Requester{}) + if err := m.Requesters[len(m.Requesters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetResponders", wireType) } - var v int32 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -2934,65 +2555,29 @@ func (m *PodGroupTemplate) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int32(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.Priority = &v - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PodGroupTemplateReference) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated + if msglen < 0 { + return ErrInvalidLengthGenerated } - if iNdEx >= l { + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.TargetResponders = append(m.TargetResponders, TargetResponder{}) + if err := m.TargetResponders[len(m.TargetResponders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PodGroupTemplateReference: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PodGroupTemplateReference: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Workload", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Responders", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3019,10 +2604,8 @@ func (m *PodGroupTemplateReference) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Workload == nil { - m.Workload = &WorkloadPodGroupTemplateReference{} - } - if err := m.Workload.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Responders = append(m.Responders, ResponderStatus{}) + if err := m.Responders[len(m.Responders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3047,7 +2630,7 @@ func (m *PodGroupTemplateReference) Unmarshal(dAtA []byte) error { } return nil } -func (m *TopologyConstraint) Unmarshal(dAtA []byte) error { +func (m *EvictionTarget) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3070,17 +2653,17 @@ func (m *TopologyConstraint) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TopologyConstraint: wiretype end group for non-group") + return fmt.Errorf("proto: EvictionTarget: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TopologyConstraint: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EvictionTarget: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pod", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -3090,23 +2673,27 @@ func (m *TopologyConstraint) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Key = string(dAtA[iNdEx:postIndex]) + if m.Pod == nil { + m.Pod = &EvictionPodReference{} + } + if err := m.Pod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -3129,7 +2716,7 @@ func (m *TopologyConstraint) Unmarshal(dAtA []byte) error { } return nil } -func (m *TypedLocalObjectReference) Unmarshal(dAtA []byte) error { +func (m *Requester) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3152,15 +2739,15 @@ func (m *TypedLocalObjectReference) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TypedLocalObjectReference: wiretype end group for non-group") + return fmt.Errorf("proto: Requester: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TypedLocalObjectReference: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Requester: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field APIGroup", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3188,43 +2775,11 @@ func (m *TypedLocalObjectReference) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.APIGroup = string(dAtA[iNdEx:postIndex]) + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Intent", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3252,7 +2807,7 @@ func (m *TypedLocalObjectReference) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Intent = RequesterIntent(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3275,7 +2830,7 @@ func (m *TypedLocalObjectReference) Unmarshal(dAtA []byte) error { } return nil } -func (m *Workload) Unmarshal(dAtA []byte) error { +func (m *ResponderStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3298,17 +2853,17 @@ func (m *Workload) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Workload: wiretype end group for non-group") + return fmt.Errorf("proto: ResponderStatus: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Workload: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResponderStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -3318,28 +2873,27 @@ func (m *Workload) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3366,63 +2920,16 @@ func (m *Workload) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if m.StartTime == nil { + m.StartTime = &v1.Time{} } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { + if err := m.StartTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WorkloadList) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WorkloadList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WorkloadList: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HeartbeatTime", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3449,13 +2956,16 @@ func (m *WorkloadList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.HeartbeatTime == nil { + m.HeartbeatTime = &v1.Time{} + } + if err := m.HeartbeatTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExpectedCompletionTime", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3482,66 +2992,18 @@ func (m *WorkloadList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, Workload{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if m.ExpectedCompletionTime == nil { + m.ExpectedCompletionTime = &v1.Time{} } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { + if err := m.ExpectedCompletionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WorkloadPodGroupTemplateReference) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WorkloadPodGroupTemplateReference: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WorkloadPodGroupTemplateReference: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WorkloadName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CompletionTime", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -3551,27 +3013,31 @@ func (m *WorkloadPodGroupTemplateReference) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.WorkloadName = string(dAtA[iNdEx:postIndex]) + if m.CompletionTime == nil { + m.CompletionTime = &v1.Time{} + } + if err := m.CompletionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PodGroupTemplateName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3599,7 +3065,8 @@ func (m *WorkloadPodGroupTemplateReference) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PodGroupTemplateName = string(dAtA[iNdEx:postIndex]) + s := string(dAtA[iNdEx:postIndex]) + m.Message = &s iNdEx = postIndex default: iNdEx = preIndex @@ -3622,7 +3089,7 @@ func (m *WorkloadPodGroupTemplateReference) Unmarshal(dAtA []byte) error { } return nil } -func (m *WorkloadSpec) Unmarshal(dAtA []byte) error { +func (m *TargetResponder) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3645,17 +3112,17 @@ func (m *WorkloadSpec) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: WorkloadSpec: wiretype end group for non-group") + return fmt.Errorf("proto: TargetResponder: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: WorkloadSpec: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TargetResponder: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ControllerRef", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -3665,33 +3132,49 @@ func (m *WorkloadSpec) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if m.ControllerRef == nil { - m.ControllerRef = &TypedLocalObjectReference{} - } - if err := m.ControllerRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Priority = &v + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PodGroupTemplates", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -3701,25 +3184,23 @@ func (m *WorkloadSpec) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.PodGroupTemplates = append(m.PodGroupTemplates, PodGroupTemplate{}) - if err := m.PodGroupTemplates[len(m.PodGroupTemplates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.State = ResponderStateType(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/vendor/k8s.io/api/lifecycle/v1alpha1/generated.proto b/vendor/k8s.io/api/lifecycle/v1alpha1/generated.proto new file mode 100644 index 0000000000..cef2c730dc --- /dev/null +++ b/vendor/k8s.io/api/lifecycle/v1alpha1/generated.proto @@ -0,0 +1,529 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + + +// This file was autogenerated by go-to-protobuf. Do not edit it manually! + +syntax = "proto2"; + +package k8s.io.api.lifecycle.v1alpha1; + +import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; +import "k8s.io/apimachinery/pkg/runtime/generated.proto"; +import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; + +// Package-wide variables from generator "generated". +option go_package = "k8s.io/api/lifecycle/v1alpha1"; + +// Eviction initiates an eviction process, which should ideally result in a graceful eviction of a +// .spec.target (e.g. termination of a pod). +// +// The evictionrequest-controller observes intents of all EvictionRequests and transforms them into +// Evictions. It manages the Eviction lifecycle. +// Requesters are preserved in .status.requesters even after they have withdrawn their request. +// If all requesters withdraw their eviction intent for a common target, the eviction will be +// canceled. Once all EvictionRequest corresponding to this Eviction .spec.target have been +// removed, this Eviction object will eventually be garbage collected. +// +// If the target is a pod, the .status.targetResponders is populated from Pod's +// .spec.evictionResponders. +// +// Responders should observe and communicate through the .status to help with the eviction +// of the target when they see their state == Active in .status.targetResponders. ResponderStatus +// struct should then be periodically updated to indicate the progress or completion of the eviction +// process by each responder in .status.responders. If .status.responders[].heartbeatTime is not +// updated within the heartbeat deadline defined by the Eviction API (currently 20 minutes), the +// eviction is passed over to the next responder with a lower priority. +// +// If there are no other responders and the target is a pod, the last default +// imperative-eviction.k8s.io/evictor responder with a priority of 100 will evict the pod using the +// imperative Eviction API (pods//eviction subresource). +// +k8s:validation-gen-nolint // Note: remove this when the API got GA +message Eviction { + // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. + // .metadata.name set by the evictionrequest-controller is purely informative and subject to change. + // .spec.target field should be used to identify the target precisesly. + // + // The requester and responder names will be used as label keys and added to the labels of the + // eviction in one of the following formats: + // 1. acme.io/foo: "requester" + // 2. acme.io/foo: "responder" + // 3. acme.io/foo: "requester-responder" + // + // Please see EvictionParticipantRole for available role label values. + // +optional + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:format=k8s-long-name + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // spec defines the eviction specification. + // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +required + optional EvictionSpec spec = 2; + + // status represents the most recently observed status of the eviction. + // Populated by responders and evictionrequest-controller. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + optional EvictionStatus status = 3; +} + +// EvictionList contains a list of Eviction resources. +message EvictionList { + // metadata is the standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // items is the list of Evictions. + repeated Eviction items = 2; +} + +// EvictionPodReference contains enough information to locate the referenced pod inside the same +// namespace. +message EvictionPodReference { + // name of the target. + // This field is required. + // +required + // +k8s:required + // +k8s:format=k8s-long-name + optional string name = 1; + + // uid of the target. + // It can be found in .metadata.uid of the target and is a lowercase UUID in 8-4-4-4-12 format. + // This field is required. + // +required + // +k8s:required + // +k8s:format=k8s-uuid + optional string uid = 2; +} + +// EvictionRequest defines a request that should ideally result in a graceful eviction of a +// .spec.target (e.g. termination of a pod). +// +// The evictionrequest-controller observes intents of all EvictionRequests and transforms them into +// Evictions. +// - .spec.requester is set as a label on the Eviction for easier lookup. +// - Each target can have a set of responders assigned to it. Eviction objects are observed by +// these responders, who implement the eviction logic and update the Eviction's status with +// progress. +// +// There is many-to-many relationship between EvictionRequests and Evictions in general. +// And many-to-one if the target is a pod. +// +// If all requesters withdraw their eviction intent for a common target, the eviction will be +// canceled. Deleting an EvictionRequest also counts as a withdrawal. +// Once all EvictionRequest of a target are removed, the corresponding Evictions are eventually +// garbage collected. +// +// +k8s:validation-gen-nolint // Note: remove this when the API got GA +message EvictionRequest { + // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. + // +optional + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:format=k8s-long-name + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // spec defines the eviction request specification. + // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +required + optional EvictionRequestSpec spec = 2; + + // status represents the most recently observed status of the eviction request. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + optional EvictionRequestStatus status = 3; +} + +// EvictionRequestList contains a list of EvictionRequests resources. +message EvictionRequestList { + // metadata is the standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // items is the list of EvictionRequests. + repeated EvictionRequest items = 2; +} + +// EvictionRequestPodReference contains enough information to locate the referenced pod inside the +// same namespace. +message EvictionRequestPodReference { + // name of the target. + // This field is required. + // +required + // +k8s:required + // +k8s:format=k8s-long-name + optional string name = 1; + + // uid of the target. + // It can be found in .metadata.uid of the target and is a lowercase UUID in 8-4-4-4-12 format. + // This field is required. + // +required + // +k8s:required + // +k8s:format=k8s-uuid + optional string uid = 2; +} + +// EvictionRequestSpec is a specification of an EvictionRequest. +message EvictionRequestSpec { + // target contains a reference to an object (e.g. a pod) that should be evicted. + // This field is required and immutable. + // +required + // +k8s:immutable + optional EvictionRequestTarget target = 1; + + // requester allows you to identify the entity, that requested the eviction of the target. + // + // It must be a valid domain-prefixed key (such as "acme.io/foo"). + // Domain names *.k8s.io and *.kubernetes.io are reserved. + // This field is required and immutable. + // +required + // +k8s:required + // +k8s:immutable + // +k8s:format=k8s-prefixed-label-key + // +k8s:customValidation + optional string requester = 2; + + // intent specifies the action that should be taken for the specified target. + // + // - Eviction means that the requester is interested in the eviction of the target. + // - Withdrawn means that the requester is no longer interested in the eviction of the target. + // If all requesters' intents are withdrawn for a common target, the eviction will be canceled. + // Cancellation consequences: + // - Inactive responders will never run. + // - Active responders are expected to cancel the eviction. + // - Completed or Interrupted responders should not take any action. + // +required + // +k8s:required + optional string intent = 3; +} + +// EvictionRequestStatus represents the last observed status of the eviction request. +message EvictionRequestStatus { + // conditions contain information about the eviction request. + // + // EvictionRequest specific conditions are: TargetEvicted or Failed (managed by evictionrequest-controller). + // - Failed means that the eviction request is no longer being processed + // by any eviction responder. This can happen if the request is canceled or if no responder + // managed to evict the target (e.g. terminate or delete a pod). + // - TargetEvicted means that the target has been evicted (e.g. a pod has been terminated or deleted). + // + // These conditions can be reset if the eviction was unsuccessful and a new Eviction intent has + // been submitted. + // + // The maximum length of the conditions list is 100. + // +optional + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + // +k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type + // +k8s:maxItems=100 + repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1; + + // observedGeneration is EvictionRequest's .metadata.generation observed by the evictionrequest-controller. + // The observed generation value cannot be negative and can only be incremented. + // The minimum value is 1. + // This field is managed by evictionrequest-controller. + // +optional + // +k8s:optional + // +k8s:minimum=1 + // +k8s:update=NoUnset + // +k8s:monotonic + optional int64 observedGeneration = 2; +} + +// EvictionRequestTarget contains a reference to an object that should be evicted. +// +union +message EvictionRequestTarget { + // pod references a pod that is subject to eviction/termination. + // Pods that are part of a PodGroup (.spec.schedulingGroup is set) are not supported. + // +optional + // +k8s:optional + // +k8s:unionMember + optional EvictionRequestPodReference pod = 1; +} + +// EvictionSpec is a specification of an Eviction. +message EvictionSpec { + // target contains a reference to an object (e.g. a pod) that should be evicted. + // This field is required and immutable. + // +required + // +k8s:immutable + optional EvictionTarget target = 1; +} + +// EvictionStatus represents the last observed status of the eviction request. +message EvictionStatus { + // conditions contain information about the eviction request. + // + // Eviction specific conditions are: TargetEvicted or Failed (managed by evictionrequest-controller). + // - Failed means that the eviction request is no longer being processed + // by any eviction responder. This can happen if the request is canceled or if no responder + // managed to evict the target (e.g. terminate or delete a pod). + // - TargetEvicted means that the target has been evicted (e.g. a pod has been terminated or deleted). + // + // The maximum length of the conditions list is 100. + // +optional + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + // +k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type + // +k8s:maxItems=100 + repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1; + + // observedGeneration is Eviction's .metadata.generation observed by the evictionrequest-controller. + // The observed generation value cannot be negative and can only be incremented. + // The minimum value is 1. + // This field is managed by evictionrequest-controller. + // +optional + // +k8s:optional + // +k8s:minimum=1 + // +k8s:monotonic + // +k8s:update=NoUnset + optional int64 observedGeneration = 2; + + // requesters allow you to identify the entities, that requested the eviction of the target. + // If all the requesters withdraw their eviction intent, the eviction will be canceled. + // + // The maximum length of the requesters list is 100. + // If this limit is exceeded, requesters with Withdrawn intent should be dropped first. + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=100 + repeated Requester requesters = 3; + + // targetResponders reference responders that should eventually respond to this eviction + // to help with the graceful eviction of a target. These responders are selected sequentially, + // according to their specified priority by setting the Active state to the TargetResponder + // .state field. The maximum number of active responders allowed is 1. + // Eventually each responder can end up in an Interrupted, Canceled or, Completed state. + // Responders should observe these states in order to navigate their lifecycle. + // + // If the target is a pod, the field is populated from Pod's .spec.evictionResponders. Default + // responders may be added to the list according to the target. + // + // Default responders: + // - imperative-eviction.k8s.io/evictor responder with a priority of 100 is added to the list if the + // target is a pod. It will call the imperative Eviction API (pods//eviction subresource). + // This call may not succeed due to PodDisruptionBudgets, which may block the pod termination. + // It will update the responder message and try again with a backoff. + // + // The maximum length of the responders list is 11. + // The length and keys of the list cannot change once set. + // This field is managed by evictionrequest-controller. + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=11 + repeated TargetResponder targetResponders = 4; + + // responders represents the eviction process status of each declared responder. + // + // The responder list should be the same length and have the same .name fields as + // .status.targetResponders. Only responders with .name that have Active state in + // .targetResponders[].state should be updated and can be mutated. First initialization + // of the list is allowed. + // + // Each ResponderStatus is initialized by evictionrequest-controller and then managed by + // the designated responder. + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=11 + repeated ResponderStatus responders = 5; +} + +// EvictionTarget contains a reference to an object that should be evicted. +// +union +message EvictionTarget { + // pod references a pod that is subject to eviction/termination. + // Pods that are part of a PodGroup (.spec.schedulingGroup is set) are not supported. + // +optional + // +k8s:optional + // +k8s:unionMember + optional EvictionPodReference pod = 1; +} + +// Requester allows you to identify the entity, that requested the eviction of the target. +// +structType=atomic +message Requester { + // name allows you to identify the entity, that requested the eviction of the target. + // + // It must be a valid domain-prefixed key (such as "acme.io/foo"). + // This field must be unique for each requester. + // This field is required. + // +required + // +k8s:required + // +k8s:format=k8s-prefixed-label-key + optional string name = 1; + + // intent specifies the action that should be taken for the specified target. + // + // - Eviction means that the requester is interested in the eviction of the target. + // - Withdrawn means that the requester is no longer interested in the eviction of the target. + // If all requesters' intents are withdrawn, the eviction will be canceled. + // Cancellation consequences: + // - Inactive responders will never run. + // - Active responders are expected to cancel the eviction. + // - Completed or Interrupted responders should not take any action. + // +required + // +k8s:required + optional string intent = 2; +} + +// ResponderStatus represents the last observed status of the eviction process of the responder. +// It should be only updated by the designated responder whose name is .name field. +// +structType=granular +message ResponderStatus { + // name allows you to identify the responder reacting to the Eviction. + // + // It must be a valid domain-prefixed key (such as "acme.io/foo"). + // This field is initialized by Kubernetes and must be unique for each responder. + // This field is required. + // +required + // +k8s:required + // +k8s:format=k8s-prefixed-label-key + optional string name = 1; + + // startTime tracks the time at which this responder was designated as active and should start + // processing the eviction request. + // It should reflect the present time when set. + // This field is initialized by Kubernetes when this responder becomes active. + // This field becomes immutable once set. + // +optional + // +k8s:optional + // +k8s:update=NoModify + // +k8s:update=NoUnset + optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time startTime = 2; + + // heartbeatTime is the last time at which the eviction process was reported to be in progress + // by the responder. + // It should reflect the present time when set. + // Responders should avoid heartbeats more frequent than 20 seconds to avoid overloading the + // control-plane. + // +optional + // +k8s:optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time heartbeatTime = 3; + + // expectedCompletionTime is the time at which the eviction process step is expected to end for the + // responder. + // The time cannot be set to the past. + // May be omitted if no estimate can be made. + // +optional + // +k8s:optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time expectedCompletionTime = 4; + + // completionTime tracks the time at which the Responder stopped processing the eviction request. + // Completion means that the responders has either fully or partially completed the + // eviction process, which may have resulted in target eviction (e.g. pod termination). + // It should reflect the present time when set. + // This field becomes immutable once set. + // +optional + // +k8s:optional + // +k8s:update=NoModify + // +k8s:update=NoUnset + optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time completionTime = 5; + + // message provides human-readable details about the state of the responder and the eviction + // process. + // Maximum length is 4000 characters. + // +optional + // +k8s:optional + // +k8s:maxLength=4000 + optional string message = 6; +} + +// TargetResponder allows you to specify the responder reacting to the Eviction. +// Responders should observe and communicate through the Eviction API (see .state) to help +// with the graceful eviction of a target (e.g. termination of a pod). +// +structType=atomic +message TargetResponder { + // name allows you to identify the responder reacting to the Eviction. + // + // It must be a valid domain-prefixed key (such as "acme.io/foo"). + // This field must be unique for each responder. + // This field is required. + // +required + // +k8s:required + // +k8s:format=k8s-prefixed-label-key + optional string name = 1; + + // priority for this responder. Higher priorities are selected first by the evictionrequest-controller. + // If there are responders with the same priority, the responder whose domain name comes first in the + // alphabetical higher domain order, will be picked. This means that the top domain labels are compared + // alphabetically first, followed by the lower domain labels. The key is compared last. + // + // The responder that is the managing controller of the pod should set the value of + // this field to 10000 to allow both for preemption or fallback registration by other + // responders. + // + // The minimum value is 0 and the maximum value is 100000. + // The interval 0-999 is reserved for responders with *.k8s.io suffix. + // This field is required and immutable. + // +required + // +k8s:required + // +k8s:minimum=0 + // +k8s:maximum=100000 + // +k8s:update=NoModify + // +k8s:update=NoUnset + optional int32 priority = 2; + + // state specifies a state that is assigned by the evictionrequest-controller. Responders should observe + // this state in order to navigate their lifecycle. + // - Inactive means that the responder should not yet process this eviction request. + // - Active means that the responder is either running or expected to start soon. + // Also, startTime has been set in the ResponderStatus by the evictionrequest-controller. + // + // An active responder should currently interact with the eviction process by updating + // .status.responders, where .name is the active responder name. ResponderStatus fields + // should be periodically updated to indicate the progress or completion of the eviction process. + // If .status.responders[].heartbeatTime field is not updated within the heartbeat deadline defined + // by the Eviction API (currently 20 minutes), the eviction is passed over to the next responder + // with a lower priority. Only one responder can be active at a time. + // - Interrupted means that the responder has failed to start or failed to update + // heartbeatTime in ResponderStatus in a timely manner. + // - Canceled means that the responder has been canceled. In other words, there is no + // EvictionRequest with the same target and Eviction intent in .spec.intent. + // - Completed means that the responder has successfully completed and set completionTime + // in ResponderStatus. + // + // Please refer to the ResponderStatus in .status.responders for more details on each responder. + // +required + // +k8s:required + optional string state = 3; +} + diff --git a/vendor/k8s.io/api/lifecycle/v1alpha1/register.go b/vendor/k8s.io/api/lifecycle/v1alpha1/register.go new file mode 100644 index 0000000000..1efd341724 --- /dev/null +++ b/vendor/k8s.io/api/lifecycle/v1alpha1/register.go @@ -0,0 +1,55 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// GroupName is the group name use in this package +const GroupName = "lifecycle.k8s.io" + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. + // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + localSchemeBuilder = &SchemeBuilder + AddToScheme = localSchemeBuilder.AddToScheme +) + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &Eviction{}, + &EvictionList{}, + &EvictionRequest{}, + &EvictionRequestList{}, + ) + + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/vendor/k8s.io/api/lifecycle/v1alpha1/types.go b/vendor/k8s.io/api/lifecycle/v1alpha1/types.go new file mode 100644 index 0000000000..42bbb44cf3 --- /dev/null +++ b/vendor/k8s.io/api/lifecycle/v1alpha1/types.go @@ -0,0 +1,680 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + apimachinerytypes "k8s.io/apimachinery/pkg/types" +) + +const ( + // EvictionResponderImperativeEviction is a default responder that will evict pods using the imperative + // Eviction API (pods//eviction subresource) with a backoff. + EvictionResponderImperativeEviction string = "imperative-eviction.k8s.io/evictor" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.37 +// +k8s:supportsSubresource="/status" + +// EvictionRequest defines a request that should ideally result in a graceful eviction of a +// .spec.target (e.g. termination of a pod). +// +// The evictionrequest-controller observes intents of all EvictionRequests and transforms them into +// Evictions. +// - .spec.requester is set as a label on the Eviction for easier lookup. +// - Each target can have a set of responders assigned to it. Eviction objects are observed by +// these responders, who implement the eviction logic and update the Eviction's status with +// progress. +// +// There is many-to-many relationship between EvictionRequests and Evictions in general. +// And many-to-one if the target is a pod. +// +// If all requesters withdraw their eviction intent for a common target, the eviction will be +// canceled. Deleting an EvictionRequest also counts as a withdrawal. +// Once all EvictionRequest of a target are removed, the corresponding Evictions are eventually +// garbage collected. +// +// +k8s:validation-gen-nolint // Note: remove this when the API got GA +type EvictionRequest struct { + metav1.TypeMeta `json:",inline"` + + // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. + // +optional + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:format=k8s-long-name + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // spec defines the eviction request specification. + // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +required + Spec EvictionRequestSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` + + // status represents the most recently observed status of the eviction request. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + Status EvictionRequestStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// EvictionRequestSpec is a specification of an EvictionRequest. +type EvictionRequestSpec struct { + // target contains a reference to an object (e.g. a pod) that should be evicted. + // This field is required and immutable. + // +required + // +k8s:immutable + Target EvictionRequestTarget `json:"target" protobuf:"bytes,1,opt,name=target"` + + // requester allows you to identify the entity, that requested the eviction of the target. + // + // It must be a valid domain-prefixed key (such as "acme.io/foo"). + // Domain names *.k8s.io and *.kubernetes.io are reserved. + // This field is required and immutable. + // +required + // +k8s:required + // +k8s:immutable + // +k8s:format=k8s-prefixed-label-key + // +k8s:customValidation + Requester string `json:"requester" protobuf:"bytes,2,opt,name=requester"` + + // intent specifies the action that should be taken for the specified target. + // + // - Eviction means that the requester is interested in the eviction of the target. + // - Withdrawn means that the requester is no longer interested in the eviction of the target. + // If all requesters' intents are withdrawn for a common target, the eviction will be canceled. + // Cancellation consequences: + // - Inactive responders will never run. + // - Active responders are expected to cancel the eviction. + // - Completed or Interrupted responders should not take any action. + // +required + // +k8s:required + Intent EvictionRequestIntent `json:"intent" protobuf:"bytes,3,opt,name=intent,casttype=EvictionRequestIntent"` +} + +// EvictionRequestTarget contains a reference to an object that should be evicted. +// +union +type EvictionRequestTarget struct { + // pod references a pod that is subject to eviction/termination. + // Pods that are part of a PodGroup (.spec.schedulingGroup is set) are not supported. + // +optional + // +k8s:optional + // +k8s:unionMember + Pod *EvictionRequestPodReference `json:"pod,omitempty" protobuf:"bytes,1,opt,name=pod"` +} + +// EvictionRequestPodReference contains enough information to locate the referenced pod inside the +// same namespace. +type EvictionRequestPodReference struct { + // name of the target. + // This field is required. + // +required + // +k8s:required + // +k8s:format=k8s-long-name + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + // uid of the target. + // It can be found in .metadata.uid of the target and is a lowercase UUID in 8-4-4-4-12 format. + // This field is required. + // +required + // +k8s:required + // +k8s:format=k8s-uuid + UID apimachinerytypes.UID `json:"uid" protobuf:"bytes,2,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` +} + +// EvictionRequestIntent specifies a requester intent. +// +enum +// +k8s:enum +type EvictionRequestIntent string + +// These are intents that can be set by each requester. +const ( + // EvictionRequestIntentEviction means that the requester is interested in the eviction of the target. + EvictionRequestIntentEviction EvictionRequestIntent = "Eviction" + + // EvictionRequestIntentWithdrawn means that the requester is no longer interested in the eviction of the target. + // If all requesters' intents are withdrawn for a common target, the eviction will be canceled. + // Cancellation consequences: + // - Inactive responders will never run. + // - Active responders are expected to cancel the eviction. + // - Completed or Interrupted responders should not take any action. + EvictionRequestIntentWithdrawn EvictionRequestIntent = "Withdrawn" +) + +// EvictionRequestStatus represents the last observed status of the eviction request. +type EvictionRequestStatus struct { + // conditions contain information about the eviction request. + // + // EvictionRequest specific conditions are: TargetEvicted or Failed (managed by evictionrequest-controller). + // - Failed means that the eviction request is no longer being processed + // by any eviction responder. This can happen if the request is canceled or if no responder + // managed to evict the target (e.g. terminate or delete a pod). + // - TargetEvicted means that the target has been evicted (e.g. a pod has been terminated or deleted). + // + // These conditions can be reset if the eviction was unsuccessful and a new Eviction intent has + // been submitted. + // + // The maximum length of the conditions list is 100. + // +optional + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + // +k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type + // +k8s:maxItems=100 + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` + + // observedGeneration is EvictionRequest's .metadata.generation observed by the evictionrequest-controller. + // The observed generation value cannot be negative and can only be incremented. + // The minimum value is 1. + // This field is managed by evictionrequest-controller. + // +optional + // +k8s:optional + // +k8s:minimum=1 + // +k8s:update=NoUnset + // +k8s:monotonic + ObservedGeneration *int64 `json:"observedGeneration,omitempty" protobuf:"varint,2,opt,name=observedGeneration"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.37 + +// EvictionRequestList contains a list of EvictionRequests resources. +type EvictionRequestList struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // items is the list of EvictionRequests. + Items []EvictionRequest `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.37 +// +k8s:supportsSubresource="/status" + +// Eviction initiates an eviction process, which should ideally result in a graceful eviction of a +// .spec.target (e.g. termination of a pod). +// +// The evictionrequest-controller observes intents of all EvictionRequests and transforms them into +// Evictions. It manages the Eviction lifecycle. +// Requesters are preserved in .status.requesters even after they have withdrawn their request. +// If all requesters withdraw their eviction intent for a common target, the eviction will be +// canceled. Once all EvictionRequest corresponding to this Eviction .spec.target have been +// removed, this Eviction object will eventually be garbage collected. +// +// If the target is a pod, the .status.targetResponders is populated from Pod's +// .spec.evictionResponders. +// +// Responders should observe and communicate through the .status to help with the eviction +// of the target when they see their state == Active in .status.targetResponders. ResponderStatus +// struct should then be periodically updated to indicate the progress or completion of the eviction +// process by each responder in .status.responders. If .status.responders[].heartbeatTime is not +// updated within the heartbeat deadline defined by the Eviction API (currently 20 minutes), the +// eviction is passed over to the next responder with a lower priority. +// +// If there are no other responders and the target is a pod, the last default +// imperative-eviction.k8s.io/evictor responder with a priority of 100 will evict the pod using the +// imperative Eviction API (pods//eviction subresource). +// +k8s:validation-gen-nolint // Note: remove this when the API got GA +type Eviction struct { + metav1.TypeMeta `json:",inline"` + + // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. + // .metadata.name set by the evictionrequest-controller is purely informative and subject to change. + // .spec.target field should be used to identify the target precisesly. + // + // The requester and responder names will be used as label keys and added to the labels of the + // eviction in one of the following formats: + // 1. acme.io/foo: "requester" + // 2. acme.io/foo: "responder" + // 3. acme.io/foo: "requester-responder" + // + // Please see EvictionParticipantRole for available role label values. + // +optional + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:format=k8s-long-name + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // spec defines the eviction specification. + // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +required + Spec EvictionSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` + + // status represents the most recently observed status of the eviction. + // Populated by responders and evictionrequest-controller. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + Status EvictionStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// EvictionParticipantRole specifies a role of an eviction participant intent. +type EvictionParticipantRole string + +const ( + // EvictionParticipantRoleRequester identifies a requester which creates EvictionRequests. + EvictionParticipantRoleRequester EvictionParticipantRole = "requester" + + // EvictionParticipantRoleResponder identifies a responder which responds to an Eviction. + EvictionParticipantRoleResponder EvictionParticipantRole = "responder" + + // EvictionParticipantRoleRequesterResponder is both a "requester" and a "responder" at the same time. + EvictionParticipantRoleRequesterResponder EvictionParticipantRole = "requester-responder" +) + +// EvictionSpec is a specification of an Eviction. +type EvictionSpec struct { + // target contains a reference to an object (e.g. a pod) that should be evicted. + // This field is required and immutable. + // +required + // +k8s:immutable + Target EvictionTarget `json:"target" protobuf:"bytes,1,opt,name=target"` +} + +// EvictionTarget contains a reference to an object that should be evicted. +// +union +type EvictionTarget struct { + // pod references a pod that is subject to eviction/termination. + // Pods that are part of a PodGroup (.spec.schedulingGroup is set) are not supported. + // +optional + // +k8s:optional + // +k8s:unionMember + Pod *EvictionPodReference `json:"pod,omitempty" protobuf:"bytes,1,opt,name=pod"` +} + +// EvictionPodReference contains enough information to locate the referenced pod inside the same +// namespace. +type EvictionPodReference struct { + // name of the target. + // This field is required. + // +required + // +k8s:required + // +k8s:format=k8s-long-name + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + // uid of the target. + // It can be found in .metadata.uid of the target and is a lowercase UUID in 8-4-4-4-12 format. + // This field is required. + // +required + // +k8s:required + // +k8s:format=k8s-uuid + UID apimachinerytypes.UID `json:"uid" protobuf:"bytes,2,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` +} + +// EvictionStatus represents the last observed status of the eviction request. +type EvictionStatus struct { + // conditions contain information about the eviction request. + // + // Eviction specific conditions are: TargetEvicted or Failed (managed by evictionrequest-controller). + // - Failed means that the eviction request is no longer being processed + // by any eviction responder. This can happen if the request is canceled or if no responder + // managed to evict the target (e.g. terminate or delete a pod). + // - TargetEvicted means that the target has been evicted (e.g. a pod has been terminated or deleted). + // + // The maximum length of the conditions list is 100. + // +optional + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + // +k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type + // +k8s:maxItems=100 + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` + + // observedGeneration is Eviction's .metadata.generation observed by the evictionrequest-controller. + // The observed generation value cannot be negative and can only be incremented. + // The minimum value is 1. + // This field is managed by evictionrequest-controller. + // +optional + // +k8s:optional + // +k8s:minimum=1 + // +k8s:monotonic + // +k8s:update=NoUnset + ObservedGeneration *int64 `json:"observedGeneration,omitempty" protobuf:"varint,2,opt,name=observedGeneration"` + + // requesters allow you to identify the entities, that requested the eviction of the target. + // If all the requesters withdraw their eviction intent, the eviction will be canceled. + // + // The maximum length of the requesters list is 100. + // If this limit is exceeded, requesters with Withdrawn intent should be dropped first. + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=100 + Requesters []Requester `json:"requesters,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,3,rep,name=requesters"` + + // targetResponders reference responders that should eventually respond to this eviction + // to help with the graceful eviction of a target. These responders are selected sequentially, + // according to their specified priority by setting the Active state to the TargetResponder + // .state field. The maximum number of active responders allowed is 1. + // Eventually each responder can end up in an Interrupted, Canceled or, Completed state. + // Responders should observe these states in order to navigate their lifecycle. + // + // If the target is a pod, the field is populated from Pod's .spec.evictionResponders. Default + // responders may be added to the list according to the target. + // + // Default responders: + // - imperative-eviction.k8s.io/evictor responder with a priority of 100 is added to the list if the + // target is a pod. It will call the imperative Eviction API (pods//eviction subresource). + // This call may not succeed due to PodDisruptionBudgets, which may block the pod termination. + // It will update the responder message and try again with a backoff. + // + // The maximum length of the responders list is 11. + // The length and keys of the list cannot change once set. + // This field is managed by evictionrequest-controller. + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=11 + TargetResponders []TargetResponder `json:"targetResponders,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,4,rep,name=targetResponders"` + + // responders represents the eviction process status of each declared responder. + // + // The responder list should be the same length and have the same .name fields as + // .status.targetResponders. Only responders with .name that have Active state in + // .targetResponders[].state should be updated and can be mutated. First initialization + // of the list is allowed. + // + // Each ResponderStatus is initialized by evictionrequest-controller and then managed by + // the designated responder. + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=11 + Responders []ResponderStatus `json:"responders,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,5,rep,name=responders"` +} + +type EvictionConditionType string + +// These are built-in conditions of an eviction request. +const ( + // EvictionConditionFailed means that the eviction request is no longer being processed + // by any eviction responder. This can happen if the request is canceled or if no responder + // managed to evict the target (e.g. terminate or delete a pod). + EvictionConditionFailed EvictionConditionType = "Failed" + + // EvictionConditionTargetEvicted means that the target has been evicted (e.g. a pod has been + // terminated or deleted). + EvictionConditionTargetEvicted EvictionConditionType = "TargetEvicted" +) + +type EvictionConditionReason string + +// These are built-in condition reasons of an eviction request. +const ( + // EvictionConditionReasonAwaitingEviction means that this Eviction works as expected and the target + // is scheduled for an eviction. + // This reason is set for the Failed and TargetEvicted condition. + EvictionConditionReasonAwaitingEviction EvictionConditionReason = "AwaitingEviction" + // EvictionConditionReasonEvictionInvalid means that the Eviction is not accepted because the + // initial configuration is not valid. + // This reason is set for the Failed condition. + EvictionConditionReasonEvictionInvalid EvictionConditionReason = "EvictionInvalid" + // EvictionConditionReasonCanceledDueToNoRequesters means that the Eviction is canceled because there is no + // EvictionRequest with the same target and Eviction intent in .spec.intent. + // This reason is set for the Failed condition. + EvictionConditionReasonCanceledDueToNoRequesters EvictionConditionReason = "CanceledDueToNoRequesters" + // EvictionConditionReasonSucceeded means that the Eviction has successfully evicted the target. + // This reason is set for the Failed condition. + EvictionConditionReasonSucceeded EvictionConditionReason = "Succeeded" + // EvictionConditionReasonNoFurtherResponder means that the Eviction responders failed to evict + // the target and that no further responder is available. + // This reason is set for the Failed condition. + EvictionConditionReasonNoFurtherResponder EvictionConditionReason = "NoFurtherResponder" + // EvictionConditionReasonPodDeleted means that the target pod has been deleted. + // This reason is set for the TargetEvicted condition. + EvictionConditionReasonPodDeleted EvictionConditionReason = "PodDeleted" + // EvictionConditionReasonPodTerminal means that the target pod has reached a terminal state. + // This reason is set for the TargetEvicted condition. + EvictionConditionReasonPodTerminal EvictionConditionReason = "PodTerminal" + // EvictionConditionReasonEvictionFailed means that the eviction of the target was unsuccessful. + // This reason is set for the TargetEvicted condition. + EvictionConditionReasonEvictionFailed EvictionConditionReason = "EvictionFailed" +) + +// Requester allows you to identify the entity, that requested the eviction of the target. +// +structType=atomic +type Requester struct { + // name allows you to identify the entity, that requested the eviction of the target. + // + // It must be a valid domain-prefixed key (such as "acme.io/foo"). + // This field must be unique for each requester. + // This field is required. + // +required + // +k8s:required + // +k8s:format=k8s-prefixed-label-key + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + + // intent specifies the action that should be taken for the specified target. + // + // - Eviction means that the requester is interested in the eviction of the target. + // - Withdrawn means that the requester is no longer interested in the eviction of the target. + // If all requesters' intents are withdrawn, the eviction will be canceled. + // Cancellation consequences: + // - Inactive responders will never run. + // - Active responders are expected to cancel the eviction. + // - Completed or Interrupted responders should not take any action. + // +required + // +k8s:required + Intent RequesterIntent `json:"intent" protobuf:"bytes,2,opt,name=intent,casttype=RequesterIntent"` +} + +// RequesterIntent specifies a requester intent. +// +enum +// +k8s:enum +type RequesterIntent string + +// These are intents that can be set by each requester. +const ( + // RequesterIntentEviction means that the requester is interested in the eviction of the target. + RequesterIntentEviction RequesterIntent = "Eviction" + + // RequesterIntentWithdrawn means that the requester is no longer interested in the eviction of the target. + // If all requesters' intents are withdrawn, the eviction will be canceled. + // Cancellation consequences: + // - Inactive responders will never run. + // - Active responders are expected to cancel the eviction. + // - Completed or Interrupted responders should not take any action. + RequesterIntentWithdrawn RequesterIntent = "Withdrawn" +) + +// TargetResponder allows you to specify the responder reacting to the Eviction. +// Responders should observe and communicate through the Eviction API (see .state) to help +// with the graceful eviction of a target (e.g. termination of a pod). +// +structType=atomic +type TargetResponder struct { + // name allows you to identify the responder reacting to the Eviction. + // + // It must be a valid domain-prefixed key (such as "acme.io/foo"). + // This field must be unique for each responder. + // This field is required. + // +required + // +k8s:required + // +k8s:format=k8s-prefixed-label-key + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + + // priority for this responder. Higher priorities are selected first by the evictionrequest-controller. + // If there are responders with the same priority, the responder whose domain name comes first in the + // alphabetical higher domain order, will be picked. This means that the top domain labels are compared + // alphabetically first, followed by the lower domain labels. The key is compared last. + // + // The responder that is the managing controller of the pod should set the value of + // this field to 10000 to allow both for preemption or fallback registration by other + // responders. + // + // The minimum value is 0 and the maximum value is 100000. + // The interval 0-999 is reserved for responders with *.k8s.io suffix. + // This field is required and immutable. + // +required + // +k8s:required + // +k8s:minimum=0 + // +k8s:maximum=100000 + // +k8s:update=NoModify + // +k8s:update=NoUnset + Priority *int32 `json:"priority" protobuf:"varint,2,opt,name=priority"` + + // state specifies a state that is assigned by the evictionrequest-controller. Responders should observe + // this state in order to navigate their lifecycle. + // - Inactive means that the responder should not yet process this eviction request. + // - Active means that the responder is either running or expected to start soon. + // Also, startTime has been set in the ResponderStatus by the evictionrequest-controller. + // + // An active responder should currently interact with the eviction process by updating + // .status.responders, where .name is the active responder name. ResponderStatus fields + // should be periodically updated to indicate the progress or completion of the eviction process. + // If .status.responders[].heartbeatTime field is not updated within the heartbeat deadline defined + // by the Eviction API (currently 20 minutes), the eviction is passed over to the next responder + // with a lower priority. Only one responder can be active at a time. + // - Interrupted means that the responder has failed to start or failed to update + // heartbeatTime in ResponderStatus in a timely manner. + // - Canceled means that the responder has been canceled. In other words, there is no + // EvictionRequest with the same target and Eviction intent in .spec.intent. + // - Completed means that the responder has successfully completed and set completionTime + // in ResponderStatus. + // + // Please refer to the ResponderStatus in .status.responders for more details on each responder. + // +required + // +k8s:required + State ResponderStateType `json:"state" protobuf:"bytes,3,opt,name=state,casttype=ResponderStateType"` +} + +// ResponderStateType specifies a state that is assigned by the evictionrequest-controller. +// +enum +// +k8s:enum +type ResponderStateType string + +const ( + // ResponderStateInactive means that the responder should not yet process this eviction request. + ResponderStateInactive ResponderStateType = "Inactive" + + // ResponderStateActive means that the responder is either running or expected to start soon. + // Also, startTime has been set in the ResponderStatus by the evictionrequest-controller. + // + // An active responder should currently interact with the eviction process by updating + // .status.responders, where .name is the active responder name. ResponderStatus fields + // should be periodically updated to indicate the progress or completion of the eviction process. + // If .status.responders[].heartbeatTime field is not updated within the heartbeat deadline defined + // by the Eviction API (currently 20 minutes), the eviction is passed over to the next responder + // with a lower priority. Only one responder can be active at a time. + ResponderStateActive ResponderStateType = "Active" + + // ResponderStateInterrupted means that the responder has failed to start or failed to update + // heartbeatTime in ResponderStatus in a timely manner. + ResponderStateInterrupted ResponderStateType = "Interrupted" + + // ResponderStateCanceled means that the responder has been canceled. In other words, there + // is no EvictionRequest with the same target and Eviction intent in .spec.intent. + ResponderStateCanceled ResponderStateType = "Canceled" + + // ResponderStateCompleted means that the responder has successfully completed and set completionTime + // in ResponderStatus. + ResponderStateCompleted ResponderStateType = "Completed" +) + +// ResponderStatus represents the last observed status of the eviction process of the responder. +// It should be only updated by the designated responder whose name is .name field. +// +structType=granular +type ResponderStatus struct { + // name allows you to identify the responder reacting to the Eviction. + // + // It must be a valid domain-prefixed key (such as "acme.io/foo"). + // This field is initialized by Kubernetes and must be unique for each responder. + // This field is required. + // +required + // +k8s:required + // +k8s:format=k8s-prefixed-label-key + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + + // startTime tracks the time at which this responder was designated as active and should start + // processing the eviction request. + // It should reflect the present time when set. + // This field is initialized by Kubernetes when this responder becomes active. + // This field becomes immutable once set. + // +optional + // +k8s:optional + // +k8s:update=NoModify + // +k8s:update=NoUnset + StartTime *metav1.Time `json:"startTime,omitempty" protobuf:"bytes,2,opt,name=startTime"` + + // heartbeatTime is the last time at which the eviction process was reported to be in progress + // by the responder. + // It should reflect the present time when set. + // Responders should avoid heartbeats more frequent than 20 seconds to avoid overloading the + // control-plane. + // +optional + // +k8s:optional + HeartbeatTime *metav1.Time `json:"heartbeatTime,omitempty" protobuf:"bytes,3,opt,name=heartbeatTime"` + + // expectedCompletionTime is the time at which the eviction process step is expected to end for the + // responder. + // The time cannot be set to the past. + // May be omitted if no estimate can be made. + // +optional + // +k8s:optional + ExpectedCompletionTime *metav1.Time `json:"expectedCompletionTime,omitempty" protobuf:"bytes,4,opt,name=expectedCompletionTime"` + + // completionTime tracks the time at which the Responder stopped processing the eviction request. + // Completion means that the responders has either fully or partially completed the + // eviction process, which may have resulted in target eviction (e.g. pod termination). + // It should reflect the present time when set. + // This field becomes immutable once set. + // +optional + // +k8s:optional + // +k8s:update=NoModify + // +k8s:update=NoUnset + CompletionTime *metav1.Time `json:"completionTime,omitempty" protobuf:"bytes,5,opt,name=completionTime"` + + // message provides human-readable details about the state of the responder and the eviction + // process. + // Maximum length is 4000 characters. + // +optional + // +k8s:optional + // +k8s:maxLength=4000 + Message *string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.37 + +// EvictionList contains a list of Eviction resources. +type EvictionList struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard list metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // items is the list of Evictions. + Items []Eviction `json:"items" protobuf:"bytes,2,rep,name=items"` +} diff --git a/vendor/k8s.io/api/lifecycle/v1alpha1/types_swagger_doc_generated.go b/vendor/k8s.io/api/lifecycle/v1alpha1/types_swagger_doc_generated.go new file mode 100644 index 0000000000..3646f84345 --- /dev/null +++ b/vendor/k8s.io/api/lifecycle/v1alpha1/types_swagger_doc_generated.go @@ -0,0 +1,188 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +// This file contains a collection of methods that can be used from go-restful to +// generate Swagger API documentation for its models. Please read this PR for more +// information on the implementation: https://github.com/emicklei/go-restful/pull/215 +// +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. +// Any context after a --- is ignored. +// +// Those methods can be generated by using hack/update-codegen.sh + +// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. +var map_Eviction = map[string]string{ + "": "Eviction initiates an eviction process, which should ideally result in a graceful eviction of a .spec.target (e.g. termination of a pod).\n\nThe evictionrequest-controller observes intents of all EvictionRequests and transforms them into Evictions. It manages the Eviction lifecycle. Requesters are preserved in .status.requesters even after they have withdrawn their request. If all requesters withdraw their eviction intent for a common target, the eviction will be canceled. Once all EvictionRequest corresponding to this Eviction .spec.target have been removed, this Eviction object will eventually be garbage collected.\n\nIf the target is a pod, the .status.targetResponders is populated from Pod's .spec.evictionResponders.\n\nResponders should observe and communicate through the .status to help with the eviction of the target when they see their state == Active in .status.targetResponders. ResponderStatus struct should then be periodically updated to indicate the progress or completion of the eviction process by each responder in .status.responders. If .status.responders[].heartbeatTime is not updated within the heartbeat deadline defined by the Eviction API (currently 20 minutes), the eviction is passed over to the next responder with a lower priority.\n\nIf there are no other responders and the target is a pod, the last default imperative-eviction.k8s.io/evictor responder with a priority of 100 will evict the pod using the imperative Eviction API (pods//eviction subresource).", + "metadata": "metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. .metadata.name set by the evictionrequest-controller is purely informative and subject to change. .spec.target field should be used to identify the target precisesly.\n\nThe requester and responder names will be used as label keys and added to the labels of the eviction in one of the following formats: 1. acme.io/foo: \"requester\" 2. acme.io/foo: \"responder\" 3. acme.io/foo: \"requester-responder\"\n\nPlease see EvictionParticipantRole for available role label values.", + "spec": "spec defines the eviction specification. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", + "status": "status represents the most recently observed status of the eviction. Populated by responders and evictionrequest-controller. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", +} + +func (Eviction) SwaggerDoc() map[string]string { + return map_Eviction +} + +var map_EvictionList = map[string]string{ + "": "EvictionList contains a list of Eviction resources.", + "metadata": "metadata is the standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "items": "items is the list of Evictions.", +} + +func (EvictionList) SwaggerDoc() map[string]string { + return map_EvictionList +} + +var map_EvictionPodReference = map[string]string{ + "": "EvictionPodReference contains enough information to locate the referenced pod inside the same namespace.", + "name": "name of the target. This field is required.", + "uid": "uid of the target. It can be found in .metadata.uid of the target and is a lowercase UUID in 8-4-4-4-12 format. This field is required.", +} + +func (EvictionPodReference) SwaggerDoc() map[string]string { + return map_EvictionPodReference +} + +var map_EvictionRequest = map[string]string{ + "": "EvictionRequest defines a request that should ideally result in a graceful eviction of a .spec.target (e.g. termination of a pod).\n\nThe evictionrequest-controller observes intents of all EvictionRequests and transforms them into Evictions.\n - .spec.requester is set as a label on the Eviction for easier lookup.\n - Each target can have a set of responders assigned to it. Eviction objects are observed by\n these responders, who implement the eviction logic and update the Eviction's status with\n progress.\n\nThere is many-to-many relationship between EvictionRequests and Evictions in general. And many-to-one if the target is a pod.\n\nIf all requesters withdraw their eviction intent for a common target, the eviction will be canceled. Deleting an EvictionRequest also counts as a withdrawal. Once all EvictionRequest of a target are removed, the corresponding Evictions are eventually garbage collected.", + "metadata": "metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.", + "spec": "spec defines the eviction request specification. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", + "status": "status represents the most recently observed status of the eviction request. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", +} + +func (EvictionRequest) SwaggerDoc() map[string]string { + return map_EvictionRequest +} + +var map_EvictionRequestList = map[string]string{ + "": "EvictionRequestList contains a list of EvictionRequests resources.", + "metadata": "metadata is the standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "items": "items is the list of EvictionRequests.", +} + +func (EvictionRequestList) SwaggerDoc() map[string]string { + return map_EvictionRequestList +} + +var map_EvictionRequestPodReference = map[string]string{ + "": "EvictionRequestPodReference contains enough information to locate the referenced pod inside the same namespace.", + "name": "name of the target. This field is required.", + "uid": "uid of the target. It can be found in .metadata.uid of the target and is a lowercase UUID in 8-4-4-4-12 format. This field is required.", +} + +func (EvictionRequestPodReference) SwaggerDoc() map[string]string { + return map_EvictionRequestPodReference +} + +var map_EvictionRequestSpec = map[string]string{ + "": "EvictionRequestSpec is a specification of an EvictionRequest.", + "target": "target contains a reference to an object (e.g. a pod) that should be evicted. This field is required and immutable.", + "requester": "requester allows you to identify the entity, that requested the eviction of the target.\n\nIt must be a valid domain-prefixed key (such as \"acme.io/foo\"). Domain names *.k8s.io and *.kubernetes.io are reserved. This field is required and immutable.", + "intent": "intent specifies the action that should be taken for the specified target.\n\n- Eviction means that the requester is interested in the eviction of the target. - Withdrawn means that the requester is no longer interested in the eviction of the target.\n If all requesters' intents are withdrawn for a common target, the eviction will be canceled.\n Cancellation consequences:\n - Inactive responders will never run.\n - Active responders are expected to cancel the eviction.\n - Completed or Interrupted responders should not take any action.", +} + +func (EvictionRequestSpec) SwaggerDoc() map[string]string { + return map_EvictionRequestSpec +} + +var map_EvictionRequestStatus = map[string]string{ + "": "EvictionRequestStatus represents the last observed status of the eviction request.", + "conditions": "conditions contain information about the eviction request.\n\nEvictionRequest specific conditions are: TargetEvicted or Failed (managed by evictionrequest-controller). - Failed means that the eviction request is no longer being processed\n by any eviction responder. This can happen if the request is canceled or if no responder\n managed to evict the target (e.g. terminate or delete a pod).\n- TargetEvicted means that the target has been evicted (e.g. a pod has been terminated or deleted).\n\nThese conditions can be reset if the eviction was unsuccessful and a new Eviction intent has been submitted.\n\nThe maximum length of the conditions list is 100.", + "observedGeneration": "observedGeneration is EvictionRequest's .metadata.generation observed by the evictionrequest-controller. The observed generation value cannot be negative and can only be incremented. The minimum value is 1. This field is managed by evictionrequest-controller.", +} + +func (EvictionRequestStatus) SwaggerDoc() map[string]string { + return map_EvictionRequestStatus +} + +var map_EvictionRequestTarget = map[string]string{ + "": "EvictionRequestTarget contains a reference to an object that should be evicted.", + "pod": "pod references a pod that is subject to eviction/termination. Pods that are part of a PodGroup (.spec.schedulingGroup is set) are not supported.", +} + +func (EvictionRequestTarget) SwaggerDoc() map[string]string { + return map_EvictionRequestTarget +} + +var map_EvictionSpec = map[string]string{ + "": "EvictionSpec is a specification of an Eviction.", + "target": "target contains a reference to an object (e.g. a pod) that should be evicted. This field is required and immutable.", +} + +func (EvictionSpec) SwaggerDoc() map[string]string { + return map_EvictionSpec +} + +var map_EvictionStatus = map[string]string{ + "": "EvictionStatus represents the last observed status of the eviction request.", + "conditions": "conditions contain information about the eviction request.\n\nEviction specific conditions are: TargetEvicted or Failed (managed by evictionrequest-controller). - Failed means that the eviction request is no longer being processed\n by any eviction responder. This can happen if the request is canceled or if no responder\n managed to evict the target (e.g. terminate or delete a pod).\n- TargetEvicted means that the target has been evicted (e.g. a pod has been terminated or deleted).\n\n\tThe maximum length of the conditions list is 100.", + "observedGeneration": "observedGeneration is Eviction's .metadata.generation observed by the evictionrequest-controller. The observed generation value cannot be negative and can only be incremented. The minimum value is 1. This field is managed by evictionrequest-controller.", + "requesters": "requesters allow you to identify the entities, that requested the eviction of the target. If all the requesters withdraw their eviction intent, the eviction will be canceled.\n\nThe maximum length of the requesters list is 100. If this limit is exceeded, requesters with Withdrawn intent should be dropped first.", + "targetResponders": "targetResponders reference responders that should eventually respond to this eviction to help with the graceful eviction of a target. These responders are selected sequentially, according to their specified priority by setting the Active state to the TargetResponder .state field. The maximum number of active responders allowed is 1. Eventually each responder can end up in an Interrupted, Canceled or, Completed state. Responders should observe these states in order to navigate their lifecycle.\n\nIf the target is a pod, the field is populated from Pod's .spec.evictionResponders. Default responders may be added to the list according to the target.\n\nDefault responders: - imperative-eviction.k8s.io/evictor responder with a priority of 100 is added to the list if the\n target is a pod. It will call the imperative Eviction API (pods//eviction subresource).\n This call may not succeed due to PodDisruptionBudgets, which may block the pod termination.\n It will update the responder message and try again with a backoff.\n\nThe maximum length of the responders list is 11. The length and keys of the list cannot change once set. This field is managed by evictionrequest-controller.", + "responders": "responders represents the eviction process status of each declared responder.\n\nThe responder list should be the same length and have the same .name fields as .status.targetResponders. Only responders with .name that have Active state in .targetResponders[].state should be updated and can be mutated. First initialization of the list is allowed.\n\nEach ResponderStatus is initialized by evictionrequest-controller and then managed by the designated responder.", +} + +func (EvictionStatus) SwaggerDoc() map[string]string { + return map_EvictionStatus +} + +var map_EvictionTarget = map[string]string{ + "": "EvictionTarget contains a reference to an object that should be evicted.", + "pod": "pod references a pod that is subject to eviction/termination. Pods that are part of a PodGroup (.spec.schedulingGroup is set) are not supported.", +} + +func (EvictionTarget) SwaggerDoc() map[string]string { + return map_EvictionTarget +} + +var map_Requester = map[string]string{ + "": "Requester allows you to identify the entity, that requested the eviction of the target.", + "name": "name allows you to identify the entity, that requested the eviction of the target.\n\nIt must be a valid domain-prefixed key (such as \"acme.io/foo\"). This field must be unique for each requester. This field is required.", + "intent": "intent specifies the action that should be taken for the specified target.\n\n- Eviction means that the requester is interested in the eviction of the target. - Withdrawn means that the requester is no longer interested in the eviction of the target.\n If all requesters' intents are withdrawn, the eviction will be canceled.\n Cancellation consequences:\n - Inactive responders will never run.\n - Active responders are expected to cancel the eviction.\n - Completed or Interrupted responders should not take any action.", +} + +func (Requester) SwaggerDoc() map[string]string { + return map_Requester +} + +var map_ResponderStatus = map[string]string{ + "": "ResponderStatus represents the last observed status of the eviction process of the responder. It should be only updated by the designated responder whose name is .name field.", + "name": "name allows you to identify the responder reacting to the Eviction.\n\nIt must be a valid domain-prefixed key (such as \"acme.io/foo\"). This field is initialized by Kubernetes and must be unique for each responder. This field is required.", + "startTime": "startTime tracks the time at which this responder was designated as active and should start processing the eviction request. It should reflect the present time when set. This field is initialized by Kubernetes when this responder becomes active. This field becomes immutable once set.", + "heartbeatTime": "heartbeatTime is the last time at which the eviction process was reported to be in progress by the responder. It should reflect the present time when set. Responders should avoid heartbeats more frequent than 20 seconds to avoid overloading the control-plane.", + "expectedCompletionTime": "expectedCompletionTime is the time at which the eviction process step is expected to end for the responder. The time cannot be set to the past. May be omitted if no estimate can be made.", + "completionTime": "completionTime tracks the time at which the Responder stopped processing the eviction request. Completion means that the responders has either fully or partially completed the eviction process, which may have resulted in target eviction (e.g. pod termination). It should reflect the present time when set. This field becomes immutable once set.", + "message": "message provides human-readable details about the state of the responder and the eviction process. Maximum length is 4000 characters.", +} + +func (ResponderStatus) SwaggerDoc() map[string]string { + return map_ResponderStatus +} + +var map_TargetResponder = map[string]string{ + "": "TargetResponder allows you to specify the responder reacting to the Eviction. Responders should observe and communicate through the Eviction API (see .state) to help with the graceful eviction of a target (e.g. termination of a pod).", + "name": "name allows you to identify the responder reacting to the Eviction.\n\nIt must be a valid domain-prefixed key (such as \"acme.io/foo\"). This field must be unique for each responder. This field is required.", + "priority": "priority for this responder. Higher priorities are selected first by the evictionrequest-controller. If there are responders with the same priority, the responder whose domain name comes first in the alphabetical higher domain order, will be picked. This means that the top domain labels are compared alphabetically first, followed by the lower domain labels. The key is compared last.\n\nThe responder that is the managing controller of the pod should set the value of this field to 10000 to allow both for preemption or fallback registration by other responders.\n\nThe minimum value is 0 and the maximum value is 100000. The interval 0-999 is reserved for responders with *.k8s.io suffix. This field is required and immutable.", + "state": "state specifies a state that is assigned by the evictionrequest-controller. Responders should observe this state in order to navigate their lifecycle. - Inactive means that the responder should not yet process this eviction request. - Active means that the responder is either running or expected to start soon.\n Also, startTime has been set in the ResponderStatus by the evictionrequest-controller.\n\n An active responder should currently interact with the eviction process by updating\n .status.responders, where .name is the active responder name. ResponderStatus fields\n should be periodically updated to indicate the progress or completion of the eviction process.\n If .status.responders[].heartbeatTime field is not updated within the heartbeat deadline defined\n by the Eviction API (currently 20 minutes), the eviction is passed over to the next responder\n\t with a lower priority. Only one responder can be active at a time.\n- Interrupted means that the responder has failed to start or failed to update\n heartbeatTime in ResponderStatus in a timely manner.\n- Canceled means that the responder has been canceled. In other words, there\tis no\n EvictionRequest with the same target and Eviction intent in .spec.intent.\n- Completed means that the responder has successfully completed and set completionTime\n in ResponderStatus.\n\nPlease refer to the ResponderStatus in .status.responders for more details on each responder.", +} + +func (TargetResponder) SwaggerDoc() map[string]string { + return map_TargetResponder +} + +// AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/k8s.io/api/lifecycle/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/api/lifecycle/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..1b71bb99fe --- /dev/null +++ b/vendor/k8s.io/api/lifecycle/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,406 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Eviction) DeepCopyInto(out *Eviction) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Eviction. +func (in *Eviction) DeepCopy() *Eviction { + if in == nil { + return nil + } + out := new(Eviction) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Eviction) 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 *EvictionList) DeepCopyInto(out *EvictionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Eviction, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EvictionList. +func (in *EvictionList) DeepCopy() *EvictionList { + if in == nil { + return nil + } + out := new(EvictionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EvictionList) 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 *EvictionPodReference) DeepCopyInto(out *EvictionPodReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EvictionPodReference. +func (in *EvictionPodReference) DeepCopy() *EvictionPodReference { + if in == nil { + return nil + } + out := new(EvictionPodReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EvictionRequest) DeepCopyInto(out *EvictionRequest) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EvictionRequest. +func (in *EvictionRequest) DeepCopy() *EvictionRequest { + if in == nil { + return nil + } + out := new(EvictionRequest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EvictionRequest) 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 *EvictionRequestList) DeepCopyInto(out *EvictionRequestList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]EvictionRequest, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EvictionRequestList. +func (in *EvictionRequestList) DeepCopy() *EvictionRequestList { + if in == nil { + return nil + } + out := new(EvictionRequestList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EvictionRequestList) 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 *EvictionRequestPodReference) DeepCopyInto(out *EvictionRequestPodReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EvictionRequestPodReference. +func (in *EvictionRequestPodReference) DeepCopy() *EvictionRequestPodReference { + if in == nil { + return nil + } + out := new(EvictionRequestPodReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EvictionRequestSpec) DeepCopyInto(out *EvictionRequestSpec) { + *out = *in + in.Target.DeepCopyInto(&out.Target) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EvictionRequestSpec. +func (in *EvictionRequestSpec) DeepCopy() *EvictionRequestSpec { + if in == nil { + return nil + } + out := new(EvictionRequestSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EvictionRequestStatus) DeepCopyInto(out *EvictionRequestStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ObservedGeneration != nil { + in, out := &in.ObservedGeneration, &out.ObservedGeneration + *out = new(int64) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EvictionRequestStatus. +func (in *EvictionRequestStatus) DeepCopy() *EvictionRequestStatus { + if in == nil { + return nil + } + out := new(EvictionRequestStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EvictionRequestTarget) DeepCopyInto(out *EvictionRequestTarget) { + *out = *in + if in.Pod != nil { + in, out := &in.Pod, &out.Pod + *out = new(EvictionRequestPodReference) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EvictionRequestTarget. +func (in *EvictionRequestTarget) DeepCopy() *EvictionRequestTarget { + if in == nil { + return nil + } + out := new(EvictionRequestTarget) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EvictionSpec) DeepCopyInto(out *EvictionSpec) { + *out = *in + in.Target.DeepCopyInto(&out.Target) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EvictionSpec. +func (in *EvictionSpec) DeepCopy() *EvictionSpec { + if in == nil { + return nil + } + out := new(EvictionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EvictionStatus) DeepCopyInto(out *EvictionStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ObservedGeneration != nil { + in, out := &in.ObservedGeneration, &out.ObservedGeneration + *out = new(int64) + **out = **in + } + if in.Requesters != nil { + in, out := &in.Requesters, &out.Requesters + *out = make([]Requester, len(*in)) + copy(*out, *in) + } + if in.TargetResponders != nil { + in, out := &in.TargetResponders, &out.TargetResponders + *out = make([]TargetResponder, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Responders != nil { + in, out := &in.Responders, &out.Responders + *out = make([]ResponderStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EvictionStatus. +func (in *EvictionStatus) DeepCopy() *EvictionStatus { + if in == nil { + return nil + } + out := new(EvictionStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EvictionTarget) DeepCopyInto(out *EvictionTarget) { + *out = *in + if in.Pod != nil { + in, out := &in.Pod, &out.Pod + *out = new(EvictionPodReference) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EvictionTarget. +func (in *EvictionTarget) DeepCopy() *EvictionTarget { + if in == nil { + return nil + } + out := new(EvictionTarget) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Requester) DeepCopyInto(out *Requester) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Requester. +func (in *Requester) DeepCopy() *Requester { + if in == nil { + return nil + } + out := new(Requester) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResponderStatus) DeepCopyInto(out *ResponderStatus) { + *out = *in + if in.StartTime != nil { + in, out := &in.StartTime, &out.StartTime + *out = (*in).DeepCopy() + } + if in.HeartbeatTime != nil { + in, out := &in.HeartbeatTime, &out.HeartbeatTime + *out = (*in).DeepCopy() + } + if in.ExpectedCompletionTime != nil { + in, out := &in.ExpectedCompletionTime, &out.ExpectedCompletionTime + *out = (*in).DeepCopy() + } + if in.CompletionTime != nil { + in, out := &in.CompletionTime, &out.CompletionTime + *out = (*in).DeepCopy() + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResponderStatus. +func (in *ResponderStatus) DeepCopy() *ResponderStatus { + if in == nil { + return nil + } + out := new(ResponderStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TargetResponder) DeepCopyInto(out *TargetResponder) { + *out = *in + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetResponder. +func (in *TargetResponder) DeepCopy() *TargetResponder { + if in == nil { + return nil + } + out := new(TargetResponder) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/k8s.io/api/lifecycle/v1alpha1/zz_generated.model_name.go b/vendor/k8s.io/api/lifecycle/v1alpha1/zz_generated.model_name.go new file mode 100644 index 0000000000..69d36f25fa --- /dev/null +++ b/vendor/k8s.io/api/lifecycle/v1alpha1/zz_generated.model_name.go @@ -0,0 +1,97 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by openapi-gen. DO NOT EDIT. + +package v1alpha1 + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Eviction) OpenAPIModelName() string { + return "io.k8s.api.lifecycle.v1alpha1.Eviction" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EvictionList) OpenAPIModelName() string { + return "io.k8s.api.lifecycle.v1alpha1.EvictionList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EvictionPodReference) OpenAPIModelName() string { + return "io.k8s.api.lifecycle.v1alpha1.EvictionPodReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EvictionRequest) OpenAPIModelName() string { + return "io.k8s.api.lifecycle.v1alpha1.EvictionRequest" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EvictionRequestList) OpenAPIModelName() string { + return "io.k8s.api.lifecycle.v1alpha1.EvictionRequestList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EvictionRequestPodReference) OpenAPIModelName() string { + return "io.k8s.api.lifecycle.v1alpha1.EvictionRequestPodReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EvictionRequestSpec) OpenAPIModelName() string { + return "io.k8s.api.lifecycle.v1alpha1.EvictionRequestSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EvictionRequestStatus) OpenAPIModelName() string { + return "io.k8s.api.lifecycle.v1alpha1.EvictionRequestStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EvictionRequestTarget) OpenAPIModelName() string { + return "io.k8s.api.lifecycle.v1alpha1.EvictionRequestTarget" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EvictionSpec) OpenAPIModelName() string { + return "io.k8s.api.lifecycle.v1alpha1.EvictionSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EvictionStatus) OpenAPIModelName() string { + return "io.k8s.api.lifecycle.v1alpha1.EvictionStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EvictionTarget) OpenAPIModelName() string { + return "io.k8s.api.lifecycle.v1alpha1.EvictionTarget" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Requester) OpenAPIModelName() string { + return "io.k8s.api.lifecycle.v1alpha1.Requester" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ResponderStatus) OpenAPIModelName() string { + return "io.k8s.api.lifecycle.v1alpha1.ResponderStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TargetResponder) OpenAPIModelName() string { + return "io.k8s.api.lifecycle.v1alpha1.TargetResponder" +} diff --git a/vendor/k8s.io/api/lifecycle/v1alpha1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/lifecycle/v1alpha1/zz_generated.prerelease-lifecycle.go new file mode 100644 index 0000000000..b4fbbf6951 --- /dev/null +++ b/vendor/k8s.io/api/lifecycle/v1alpha1/zz_generated.prerelease-lifecycle.go @@ -0,0 +1,94 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by prerelease-lifecycle-gen. DO NOT EDIT. + +package v1alpha1 + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *Eviction) APILifecycleIntroduced() (major, minor int) { + return 1, 37 +} + +// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. +func (in *Eviction) APILifecycleDeprecated() (major, minor int) { + return 1, 40 +} + +// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. +func (in *Eviction) APILifecycleRemoved() (major, minor int) { + return 1, 43 +} + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *EvictionList) APILifecycleIntroduced() (major, minor int) { + return 1, 37 +} + +// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. +func (in *EvictionList) APILifecycleDeprecated() (major, minor int) { + return 1, 40 +} + +// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. +func (in *EvictionList) APILifecycleRemoved() (major, minor int) { + return 1, 43 +} + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *EvictionRequest) APILifecycleIntroduced() (major, minor int) { + return 1, 37 +} + +// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. +func (in *EvictionRequest) APILifecycleDeprecated() (major, minor int) { + return 1, 40 +} + +// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. +func (in *EvictionRequest) APILifecycleRemoved() (major, minor int) { + return 1, 43 +} + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *EvictionRequestList) APILifecycleIntroduced() (major, minor int) { + return 1, 37 +} + +// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. +func (in *EvictionRequestList) APILifecycleDeprecated() (major, minor int) { + return 1, 40 +} + +// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. +func (in *EvictionRequestList) APILifecycleRemoved() (major, minor int) { + return 1, 43 +} diff --git a/vendor/k8s.io/api/networking/v1/generated.proto b/vendor/k8s.io/api/networking/v1/generated.proto index 26dcfdfcc3..8394f2dc08 100644 --- a/vendor/k8s.io/api/networking/v1/generated.proto +++ b/vendor/k8s.io/api/networking/v1/generated.proto @@ -80,7 +80,7 @@ message HTTPIngressRuleValue { // Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 // Invalid: 10.01.2.3 or 2001:db8:0:0:0::1 message IPAddress { - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -104,11 +104,11 @@ message IPAddressList { // IPAddressSpec describe the attributes in an IP Address. message IPAddressSpec { - // ParentRef references the resource that an IPAddress is attached to. + // parentRef references the resource that an IPAddress is attached to. // An IPAddress must reference a parent object. // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:immutable optional ParentReference parentRef = 1; } @@ -119,7 +119,7 @@ message IPBlock { // cidr is a string representing the IPBlock // Valid examples are "192.168.1.0/24" or "2001:db8::/64" // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string cidr = 1; // except is a slice of CIDRs that should not be included within an IPBlock @@ -134,8 +134,9 @@ message IPBlock { // endpoints defined by a backend. An Ingress can be configured to give services // externally-reachable urls, load balance traffic, terminate SSL, offer name // based virtual hosting etc. +// +k8s:supportsSubresource="/status" message Ingress { - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -172,7 +173,7 @@ message IngressBackend { // single IngressClass resource has this annotation set to true, new Ingress // resources without a class specified will be assigned this default class. message IngressClass { - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -204,12 +205,12 @@ message IngressClassParametersReference { // kind is the type of resource being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string kind = 2; // name is the name of resource being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string name = 3; // scope represents if this refers to a cluster or namespace scoped resource. @@ -238,7 +239,7 @@ message IngressClassSpec { // configuration for the controller. This is optional if the controller does // not require extra parameters. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional IngressClassParametersReference parameters = 2; } @@ -344,6 +345,7 @@ message IngressRule { // mixing different types of rules in a single Ingress is disallowed, so exactly // one of the following must be set. message IngressRuleValue { + // http is a HTTP IngressRuleValue, which contains a list of http selectors // +optional optional HTTPIngressRuleValue http = 1; } @@ -425,7 +427,7 @@ message IngressTLS { // NetworkPolicy describes what network traffic is allowed for a set of Pods message NetworkPolicy { - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -455,7 +457,7 @@ message NetworkPolicyEgressRule { // allows traffic only if the traffic matches at least one item in the to list. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated NetworkPolicyPeer to = 2; } @@ -478,7 +480,7 @@ message NetworkPolicyIngressRule { // allows traffic only if the traffic matches at least one item in the from list. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated NetworkPolicyPeer from = 2; } @@ -517,7 +519,7 @@ message NetworkPolicyPeer { // ipBlock defines policy on a particular IPBlock. If this field is set then // neither of the other fields can be. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional IPBlock ipBlock = 3; } @@ -563,7 +565,7 @@ message NetworkPolicySpec { // solely to ensure that the pods it selects are isolated by default) // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated NetworkPolicyIngressRule ingress = 2; // egress is a list of egress rules to be applied to the selected pods. Outgoing traffic @@ -575,7 +577,7 @@ message NetworkPolicySpec { // This field is beta-level in 1.8 // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated NetworkPolicyEgressRule egress = 3; // policyTypes is a list of rule types that the NetworkPolicy relates to. @@ -595,22 +597,22 @@ message NetworkPolicySpec { // ParentReference describes a reference to a parent object. message ParentReference { - // Group is the group of the object being referenced. + // group is the group of the object being referenced. // +optional optional string group = 1; - // Resource is the resource of the object being referenced. + // resource is the resource of the object being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string resource = 2; - // Namespace is the namespace of the object being referenced. + // namespace is the namespace of the object being referenced. // +optional optional string namespace = 3; - // Name is the name of the object being referenced. + // name is the name of the object being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string name = 4; } @@ -630,8 +632,9 @@ message ServiceBackendPort { // ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). // This range is used to allocate ClusterIPs to Service objects. +// +k8s:supportsSubresource="/status" message ServiceCIDR { - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -660,7 +663,7 @@ message ServiceCIDRList { // ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services. message ServiceCIDRSpec { - // CIDRs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64") + // cidrs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64") // from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. // This field is immutable. // +optional @@ -677,6 +680,7 @@ message ServiceCIDRStatus { // +patchStrategy=merge // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:eachVal=+k8s:opaqueType repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1; } diff --git a/vendor/k8s.io/api/networking/v1/types.go b/vendor/k8s.io/api/networking/v1/types.go index a0e737ee15..b455b46c37 100644 --- a/vendor/k8s.io/api/networking/v1/types.go +++ b/vendor/k8s.io/api/networking/v1/types.go @@ -28,9 +28,9 @@ import ( // NetworkPolicy describes what network traffic is allowed for a set of Pods type NetworkPolicy struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -77,7 +77,7 @@ type NetworkPolicySpec struct { // solely to ensure that the pods it selects are isolated by default) // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Ingress []NetworkPolicyIngressRule `json:"ingress,omitempty" protobuf:"bytes,2,rep,name=ingress"` // egress is a list of egress rules to be applied to the selected pods. Outgoing traffic @@ -89,7 +89,7 @@ type NetworkPolicySpec struct { // This field is beta-level in 1.8 // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Egress []NetworkPolicyEgressRule `json:"egress,omitempty" protobuf:"bytes,3,rep,name=egress"` // policyTypes is a list of rule types that the NetworkPolicy relates to. @@ -126,7 +126,7 @@ type NetworkPolicyIngressRule struct { // allows traffic only if the traffic matches at least one item in the from list. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional From []NetworkPolicyPeer `json:"from,omitempty" protobuf:"bytes,2,rep,name=from"` } @@ -150,7 +150,7 @@ type NetworkPolicyEgressRule struct { // allows traffic only if the traffic matches at least one item in the to list. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional To []NetworkPolicyPeer `json:"to,omitempty" protobuf:"bytes,2,rep,name=to"` } @@ -183,7 +183,7 @@ type IPBlock struct { // cidr is a string representing the IPBlock // Valid examples are "192.168.1.0/24" or "2001:db8::/64" // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required CIDR string `json:"cidr" protobuf:"bytes,1,name=cidr"` // except is a slice of CIDRs that should not be included within an IPBlock @@ -218,7 +218,7 @@ type NetworkPolicyPeer struct { // ipBlock defines policy on a particular IPBlock. If this field is set then // neither of the other fields can be. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional IPBlock *IPBlock `json:"ipBlock,omitempty" protobuf:"bytes,3,rep,name=ipBlock"` } @@ -227,7 +227,7 @@ type NetworkPolicyPeer struct { // NetworkPolicyList is a list of NetworkPolicy objects. type NetworkPolicyList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -246,10 +246,11 @@ type NetworkPolicyList struct { // endpoints defined by a backend. An Ingress can be configured to give services // externally-reachable urls, load balance traffic, terminate SSL, offer name // based virtual hosting etc. +// +k8s:supportsSubresource="/status" type Ingress struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -270,7 +271,7 @@ type Ingress struct { // IngressList is a collection of Ingress. type IngressList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -427,7 +428,7 @@ type IngressRule struct { // default backend, is left to the controller fulfilling the Ingress. Http is // currently the only supported IngressRuleValue. // +optional - IngressRuleValue `json:",inline" protobuf:"bytes,2,opt,name=ingressRuleValue"` + IngressRuleValue `json:"" protobuf:"bytes,2,opt,name=ingressRuleValue"` } // IngressRuleValue represents a rule to apply against incoming requests. If the @@ -435,6 +436,7 @@ type IngressRule struct { // mixing different types of rules in a single Ingress is disallowed, so exactly // one of the following must be set. type IngressRuleValue struct { + // http is a HTTP IngressRuleValue, which contains a list of http selectors // +optional HTTP *HTTPIngressRuleValue `json:"http,omitempty" protobuf:"bytes,1,opt,name=http"` } @@ -563,9 +565,9 @@ type ServiceBackendPort struct { // single IngressClass resource has this annotation set to true, new Ingress // resources without a class specified will be assigned this default class. type IngressClass struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -590,7 +592,7 @@ type IngressClassSpec struct { // configuration for the controller. This is optional if the controller does // not require extra parameters. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Parameters *IngressClassParametersReference `json:"parameters,omitempty" protobuf:"bytes,2,opt,name=parameters"` } @@ -614,12 +616,12 @@ type IngressClassParametersReference struct { // kind is the type of resource being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"` // name is the name of resource being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Name string `json:"name" protobuf:"bytes,3,opt,name=name"` // scope represents if this refers to a cluster or namespace scoped resource. @@ -639,7 +641,7 @@ type IngressClassParametersReference struct { // IngressClassList is a collection of IngressClasses. type IngressClassList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // +optional @@ -662,8 +664,8 @@ type IngressClassList struct { // Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 // Invalid: 10.01.2.3 or 2001:db8:0:0:0::1 type IPAddress struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -675,29 +677,29 @@ type IPAddress struct { // IPAddressSpec describe the attributes in an IP Address. type IPAddressSpec struct { - // ParentRef references the resource that an IPAddress is attached to. + // parentRef references the resource that an IPAddress is attached to. // An IPAddress must reference a parent object. // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:immutable ParentRef *ParentReference `json:"parentRef,omitempty" protobuf:"bytes,1,opt,name=parentRef"` } // ParentReference describes a reference to a parent object. type ParentReference struct { - // Group is the group of the object being referenced. + // group is the group of the object being referenced. // +optional Group string `json:"group,omitempty" protobuf:"bytes,1,opt,name=group"` - // Resource is the resource of the object being referenced. + // resource is the resource of the object being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Resource string `json:"resource,omitempty" protobuf:"bytes,2,opt,name=resource"` - // Namespace is the namespace of the object being referenced. + // namespace is the namespace of the object being referenced. // +optional Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"` - // Name is the name of the object being referenced. + // name is the name of the object being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Name string `json:"name,omitempty" protobuf:"bytes,4,opt,name=name"` } @@ -706,7 +708,7 @@ type ParentReference struct { // IPAddressList contains a list of IPAddress. type IPAddressList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -722,9 +724,10 @@ type IPAddressList struct { // ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). // This range is used to allocate ClusterIPs to Service objects. +// +k8s:supportsSubresource="/status" type ServiceCIDR struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -740,7 +743,7 @@ type ServiceCIDR struct { // ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services. type ServiceCIDRSpec struct { - // CIDRs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64") + // cidrs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64") // from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. // This field is immutable. // +optional @@ -766,6 +769,7 @@ type ServiceCIDRStatus struct { // +patchStrategy=merge // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:eachVal=+k8s:opaqueType Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` } @@ -774,7 +778,7 @@ type ServiceCIDRStatus struct { // ServiceCIDRList contains a list of ServiceCIDR objects. type ServiceCIDRList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional diff --git a/vendor/k8s.io/api/networking/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/networking/v1/types_swagger_doc_generated.go index 6210bb7a5a..cb5816b2fd 100644 --- a/vendor/k8s.io/api/networking/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/networking/v1/types_swagger_doc_generated.go @@ -49,7 +49,7 @@ func (HTTPIngressRuleValue) SwaggerDoc() map[string]string { var map_IPAddress = map[string]string{ "": "IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses. An IP address can be represented in different formats, to guarantee the uniqueness of the IP, the name of the object is the IP address in canonical format, four decimal digits separated by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6. Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 Invalid: 10.01.2.3 or 2001:db8:0:0:0::1", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec is the desired state of the IPAddress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", } @@ -69,7 +69,7 @@ func (IPAddressList) SwaggerDoc() map[string]string { var map_IPAddressSpec = map[string]string{ "": "IPAddressSpec describe the attributes in an IP Address.", - "parentRef": "ParentRef references the resource that an IPAddress is attached to. An IPAddress must reference a parent object.", + "parentRef": "parentRef references the resource that an IPAddress is attached to. An IPAddress must reference a parent object.", } func (IPAddressSpec) SwaggerDoc() map[string]string { @@ -88,7 +88,7 @@ func (IPBlock) SwaggerDoc() map[string]string { var map_Ingress = map[string]string{ "": "Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", "status": "status is the current state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", } @@ -109,7 +109,7 @@ func (IngressBackend) SwaggerDoc() map[string]string { var map_IngressClass = map[string]string{ "": "IngressClass represents the class of the Ingress, referenced by the Ingress Spec. The `ingressclass.kubernetes.io/is-default-class` annotation can be used to indicate that an IngressClass should be considered default. When a single IngressClass resource has this annotation set to true, new Ingress resources without a class specified will be assigned this default class.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec is the desired state of the IngressClass. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", } @@ -201,7 +201,8 @@ func (IngressRule) SwaggerDoc() map[string]string { } var map_IngressRuleValue = map[string]string{ - "": "IngressRuleValue represents a rule to apply against incoming requests. If the rule is satisfied, the request is routed to the specified backend. Currently mixing different types of rules in a single Ingress is disallowed, so exactly one of the following must be set.", + "": "IngressRuleValue represents a rule to apply against incoming requests. If the rule is satisfied, the request is routed to the specified backend. Currently mixing different types of rules in a single Ingress is disallowed, so exactly one of the following must be set.", + "http": "http is a HTTP IngressRuleValue, which contains a list of http selectors", } func (IngressRuleValue) SwaggerDoc() map[string]string { @@ -251,7 +252,7 @@ func (IngressTLS) SwaggerDoc() map[string]string { var map_NetworkPolicy = map[string]string{ "": "NetworkPolicy describes what network traffic is allowed for a set of Pods", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec represents the specification of the desired behavior for this NetworkPolicy.", } @@ -325,10 +326,10 @@ func (NetworkPolicySpec) SwaggerDoc() map[string]string { var map_ParentReference = map[string]string{ "": "ParentReference describes a reference to a parent object.", - "group": "Group is the group of the object being referenced.", - "resource": "Resource is the resource of the object being referenced.", - "namespace": "Namespace is the namespace of the object being referenced.", - "name": "Name is the name of the object being referenced.", + "group": "group is the group of the object being referenced.", + "resource": "resource is the resource of the object being referenced.", + "namespace": "namespace is the namespace of the object being referenced.", + "name": "name is the name of the object being referenced.", } func (ParentReference) SwaggerDoc() map[string]string { @@ -347,7 +348,7 @@ func (ServiceBackendPort) SwaggerDoc() map[string]string { var map_ServiceCIDR = map[string]string{ "": "ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). This range is used to allocate ClusterIPs to Service objects.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec is the desired state of the ServiceCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", "status": "status represents the current state of the ServiceCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", } @@ -368,7 +369,7 @@ func (ServiceCIDRList) SwaggerDoc() map[string]string { var map_ServiceCIDRSpec = map[string]string{ "": "ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services.", - "cidrs": "CIDRs defines the IP blocks in CIDR notation (e.g. \"192.168.0.0/24\" or \"2001:db8::/64\") from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. This field is immutable.", + "cidrs": "cidrs defines the IP blocks in CIDR notation (e.g. \"192.168.0.0/24\" or \"2001:db8::/64\") from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. This field is immutable.", } func (ServiceCIDRSpec) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/networking/v1beta1/generated.proto b/vendor/k8s.io/api/networking/v1beta1/generated.proto index a6944d6034..11e2a0123b 100644 --- a/vendor/k8s.io/api/networking/v1beta1/generated.proto +++ b/vendor/k8s.io/api/networking/v1beta1/generated.proto @@ -81,7 +81,7 @@ message HTTPIngressRuleValue { // Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 // Invalid: 10.01.2.3 or 2001:db8:0:0:0::1 message IPAddress { - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -105,11 +105,11 @@ message IPAddressList { // IPAddressSpec describe the attributes in an IP Address. message IPAddressSpec { - // ParentRef references the resource that an IPAddress is attached to. + // parentRef references the resource that an IPAddress is attached to. // An IPAddress must reference a parent object. // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:immutable optional ParentReference parentRef = 1; } @@ -117,8 +117,9 @@ message IPAddressSpec { // endpoints defined by a backend. An Ingress can be configured to give services // externally-reachable urls, load balance traffic, terminate SSL, offer name // based virtual hosting etc. +// +k8s:supportsSubresource="/status" message Ingress { - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -157,7 +158,7 @@ message IngressBackend { // single IngressClass resource has this annotation set to true, new Ingress // resources without a class specified will be assigned this default class. message IngressClass { - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -189,12 +190,12 @@ message IngressClassParametersReference { // kind is the type of resource being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string kind = 2; // name is the name of resource being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string name = 3; // scope represents if this refers to a cluster or namespace scoped resource. @@ -222,7 +223,7 @@ message IngressClassSpec { // configuration for the controller. This is optional if the controller does // not require extra parameters. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional IngressClassParametersReference parameters = 2; } @@ -328,6 +329,7 @@ message IngressRule { // mixing different types of rules in a single Ingress is disallowed, so exactly // one of the following must be set. message IngressRuleValue { + // http is a HTTP IngressRuleValue, which contains a list of http selectors // +optional optional HTTPIngressRuleValue http = 1; } @@ -398,29 +400,30 @@ message IngressTLS { // ParentReference describes a reference to a parent object. message ParentReference { - // Group is the group of the object being referenced. + // group is the group of the object being referenced. // +optional optional string group = 1; - // Resource is the resource of the object being referenced. + // resource is the resource of the object being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string resource = 2; - // Namespace is the namespace of the object being referenced. + // namespace is the namespace of the object being referenced. // +optional optional string namespace = 3; - // Name is the name of the object being referenced. + // name is the name of the object being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string name = 4; } // ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). // This range is used to allocate ClusterIPs to Service objects. +// +k8s:supportsSubresource="/status" message ServiceCIDR { - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -449,7 +452,7 @@ message ServiceCIDRList { // ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services. message ServiceCIDRSpec { - // CIDRs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64") + // cidrs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64") // from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. // This field is immutable. // +optional @@ -466,6 +469,7 @@ message ServiceCIDRStatus { // +patchStrategy=merge // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:eachVal=+k8s:opaqueType repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1; } diff --git a/vendor/k8s.io/api/networking/v1beta1/types.go b/vendor/k8s.io/api/networking/v1beta1/types.go index 7cd9b2b58b..73cddf6a7f 100644 --- a/vendor/k8s.io/api/networking/v1beta1/types.go +++ b/vendor/k8s.io/api/networking/v1beta1/types.go @@ -32,10 +32,11 @@ import ( // endpoints defined by a backend. An Ingress can be configured to give services // externally-reachable urls, load balance traffic, terminate SSL, offer name // based virtual hosting etc. +// +k8s:supportsSubresource="/status" type Ingress struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -58,7 +59,7 @@ type Ingress struct { // IngressList is a collection of Ingress. type IngressList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -218,7 +219,7 @@ type IngressRule struct { // default backend, is left to the controller fulfilling the Ingress. Http is // currently the only supported IngressRuleValue. // +optional - IngressRuleValue `json:",inline" protobuf:"bytes,2,opt,name=ingressRuleValue"` + IngressRuleValue `json:"" protobuf:"bytes,2,opt,name=ingressRuleValue"` } // IngressRuleValue represents a rule to apply against incoming requests. If the @@ -232,6 +233,7 @@ type IngressRuleValue struct { // 2. Consider adding fields for ingress-type specific global options // usable by a loadbalancer, like http keep-alive. + // http is a HTTP IngressRuleValue, which contains a list of http selectors // +optional HTTP *HTTPIngressRuleValue `json:"http,omitempty" protobuf:"bytes,1,opt,name=http"` } @@ -341,9 +343,9 @@ type IngressBackend struct { // single IngressClass resource has this annotation set to true, new Ingress // resources without a class specified will be assigned this default class. type IngressClass struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -368,7 +370,7 @@ type IngressClassSpec struct { // configuration for the controller. This is optional if the controller does // not require extra parameters. // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Parameters *IngressClassParametersReference `json:"parameters,omitempty" protobuf:"bytes,2,opt,name=parameters"` } @@ -392,12 +394,12 @@ type IngressClassParametersReference struct { // kind is the type of resource being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"` // name is the name of resource being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Name string `json:"name" protobuf:"bytes,3,opt,name=name"` // scope represents if this refers to a cluster or namespace scoped resource. @@ -418,7 +420,7 @@ type IngressClassParametersReference struct { // IngressClassList is a collection of IngressClasses. type IngressClassList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -440,8 +442,8 @@ type IngressClassList struct { // Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 // Invalid: 10.01.2.3 or 2001:db8:0:0:0::1 type IPAddress struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -453,29 +455,29 @@ type IPAddress struct { // IPAddressSpec describe the attributes in an IP Address. type IPAddressSpec struct { - // ParentRef references the resource that an IPAddress is attached to. + // parentRef references the resource that an IPAddress is attached to. // An IPAddress must reference a parent object. // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:immutable ParentRef *ParentReference `json:"parentRef,omitempty" protobuf:"bytes,1,opt,name=parentRef"` } // ParentReference describes a reference to a parent object. type ParentReference struct { - // Group is the group of the object being referenced. + // group is the group of the object being referenced. // +optional Group string `json:"group,omitempty" protobuf:"bytes,1,opt,name=group"` - // Resource is the resource of the object being referenced. + // resource is the resource of the object being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Resource string `json:"resource,omitempty" protobuf:"bytes,2,opt,name=resource"` - // Namespace is the namespace of the object being referenced. + // namespace is the namespace of the object being referenced. // +optional Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"` - // Name is the name of the object being referenced. + // name is the name of the object being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Name string `json:"name,omitempty" protobuf:"bytes,4,opt,name=name"` } @@ -484,7 +486,7 @@ type ParentReference struct { // IPAddressList contains a list of IPAddress. type IPAddressList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -500,9 +502,10 @@ type IPAddressList struct { // ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). // This range is used to allocate ClusterIPs to Service objects. +// +k8s:supportsSubresource="/status" type ServiceCIDR struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -518,7 +521,7 @@ type ServiceCIDR struct { // ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services. type ServiceCIDRSpec struct { - // CIDRs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64") + // cidrs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64") // from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. // This field is immutable. // +optional @@ -544,6 +547,7 @@ type ServiceCIDRStatus struct { // +patchStrategy=merge // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:eachVal=+k8s:opaqueType Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` } @@ -552,7 +556,7 @@ type ServiceCIDRStatus struct { // ServiceCIDRList contains a list of ServiceCIDR objects. type ServiceCIDRList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional diff --git a/vendor/k8s.io/api/networking/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/networking/v1beta1/types_swagger_doc_generated.go index 9d27517f3b..03d33b5d48 100644 --- a/vendor/k8s.io/api/networking/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/networking/v1beta1/types_swagger_doc_generated.go @@ -49,7 +49,7 @@ func (HTTPIngressRuleValue) SwaggerDoc() map[string]string { var map_IPAddress = map[string]string{ "": "IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses. An IP address can be represented in different formats, to guarantee the uniqueness of the IP, the name of the object is the IP address in canonical format, four decimal digits separated by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6. Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 Invalid: 10.01.2.3 or 2001:db8:0:0:0::1", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec is the desired state of the IPAddress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", } @@ -69,7 +69,7 @@ func (IPAddressList) SwaggerDoc() map[string]string { var map_IPAddressSpec = map[string]string{ "": "IPAddressSpec describe the attributes in an IP Address.", - "parentRef": "ParentRef references the resource that an IPAddress is attached to. An IPAddress must reference a parent object.", + "parentRef": "parentRef references the resource that an IPAddress is attached to. An IPAddress must reference a parent object.", } func (IPAddressSpec) SwaggerDoc() map[string]string { @@ -78,7 +78,7 @@ func (IPAddressSpec) SwaggerDoc() map[string]string { var map_Ingress = map[string]string{ "": "Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", "status": "status is the current state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", } @@ -100,7 +100,7 @@ func (IngressBackend) SwaggerDoc() map[string]string { var map_IngressClass = map[string]string{ "": "IngressClass represents the class of the Ingress, referenced by the Ingress Spec. The `ingressclass.kubernetes.io/is-default-class` annotation can be used to indicate that an IngressClass should be considered default. When a single IngressClass resource has this annotation set to true, new Ingress resources without a class specified will be assigned this default class.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec is the desired state of the IngressClass. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", } @@ -192,7 +192,8 @@ func (IngressRule) SwaggerDoc() map[string]string { } var map_IngressRuleValue = map[string]string{ - "": "IngressRuleValue represents a rule to apply against incoming requests. If the rule is satisfied, the request is routed to the specified backend. Currently mixing different types of rules in a single Ingress is disallowed, so exactly one of the following must be set.", + "": "IngressRuleValue represents a rule to apply against incoming requests. If the rule is satisfied, the request is routed to the specified backend. Currently mixing different types of rules in a single Ingress is disallowed, so exactly one of the following must be set.", + "http": "http is a HTTP IngressRuleValue, which contains a list of http selectors", } func (IngressRuleValue) SwaggerDoc() map[string]string { @@ -232,10 +233,10 @@ func (IngressTLS) SwaggerDoc() map[string]string { var map_ParentReference = map[string]string{ "": "ParentReference describes a reference to a parent object.", - "group": "Group is the group of the object being referenced.", - "resource": "Resource is the resource of the object being referenced.", - "namespace": "Namespace is the namespace of the object being referenced.", - "name": "Name is the name of the object being referenced.", + "group": "group is the group of the object being referenced.", + "resource": "resource is the resource of the object being referenced.", + "namespace": "namespace is the namespace of the object being referenced.", + "name": "name is the name of the object being referenced.", } func (ParentReference) SwaggerDoc() map[string]string { @@ -244,7 +245,7 @@ func (ParentReference) SwaggerDoc() map[string]string { var map_ServiceCIDR = map[string]string{ "": "ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). This range is used to allocate ClusterIPs to Service objects.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec is the desired state of the ServiceCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", "status": "status represents the current state of the ServiceCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", } @@ -265,7 +266,7 @@ func (ServiceCIDRList) SwaggerDoc() map[string]string { var map_ServiceCIDRSpec = map[string]string{ "": "ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services.", - "cidrs": "CIDRs defines the IP blocks in CIDR notation (e.g. \"192.168.0.0/24\" or \"2001:db8::/64\") from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. This field is immutable.", + "cidrs": "cidrs defines the IP blocks in CIDR notation (e.g. \"192.168.0.0/24\" or \"2001:db8::/64\") from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. This field is immutable.", } func (ServiceCIDRSpec) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/node/v1/generated.proto b/vendor/k8s.io/api/node/v1/generated.proto index 4d77c9b781..f368bd85e6 100644 --- a/vendor/k8s.io/api/node/v1/generated.proto +++ b/vendor/k8s.io/api/node/v1/generated.proto @@ -45,6 +45,7 @@ message Overhead { // pod. For more details, see // https://kubernetes.io/docs/concepts/containers/runtime-class/ message RuntimeClass { + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -60,9 +61,9 @@ message RuntimeClass { // The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, // and is immutable. // +required - // +k8s:alpha(since: "1.36")=+k8s:format="k8s-short-name" - // +k8s:alpha(since: "1.36")=+k8s:immutable - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format="k8s-short-name" + // +k8s:beta(since: "1.37")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:required optional string handler = 2; // overhead represents the resource overhead associated with running a pod for a @@ -76,6 +77,7 @@ message RuntimeClass { // If scheduling is nil, this RuntimeClass is assumed to be supported by all // nodes. // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional optional Scheduling scheduling = 4; } @@ -107,6 +109,7 @@ message Scheduling { // tolerated by the pod and the RuntimeClass. // +optional // +listType=atomic + // +k8s:alpha(since: "1.37")=+k8s:optional repeated .k8s.io.api.core.v1.Toleration tolerations = 2; } diff --git a/vendor/k8s.io/api/node/v1/types.go b/vendor/k8s.io/api/node/v1/types.go index c2ea739dc8..4d781af2a0 100644 --- a/vendor/k8s.io/api/node/v1/types.go +++ b/vendor/k8s.io/api/node/v1/types.go @@ -34,8 +34,9 @@ import ( // pod. For more details, see // https://kubernetes.io/docs/concepts/containers/runtime-class/ type RuntimeClass struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -51,9 +52,9 @@ type RuntimeClass struct { // The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, // and is immutable. // +required - // +k8s:alpha(since: "1.36")=+k8s:format="k8s-short-name" - // +k8s:alpha(since: "1.36")=+k8s:immutable - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format="k8s-short-name" + // +k8s:beta(since: "1.37")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:required Handler string `json:"handler" protobuf:"bytes,2,opt,name=handler"` // overhead represents the resource overhead associated with running a pod for a @@ -67,6 +68,7 @@ type RuntimeClass struct { // If scheduling is nil, this RuntimeClass is assumed to be supported by all // nodes. // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional Scheduling *Scheduling `json:"scheduling,omitempty" protobuf:"bytes,4,opt,name=scheduling"` } @@ -94,6 +96,7 @@ type Scheduling struct { // tolerated by the pod and the RuntimeClass. // +optional // +listType=atomic + // +k8s:alpha(since: "1.37")=+k8s:optional Tolerations []corev1.Toleration `json:"tolerations,omitempty" protobuf:"bytes,2,rep,name=tolerations"` } @@ -102,7 +105,7 @@ type Scheduling struct { // RuntimeClassList is a list of RuntimeClass objects. type RuntimeClassList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata diff --git a/vendor/k8s.io/api/node/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/node/v1/types_swagger_doc_generated.go index f5e6b32779..168f48a58e 100644 --- a/vendor/k8s.io/api/node/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/node/v1/types_swagger_doc_generated.go @@ -38,7 +38,7 @@ func (Overhead) SwaggerDoc() map[string]string { var map_RuntimeClass = map[string]string{ "": "RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://kubernetes.io/docs/concepts/containers/runtime-class/", - "metadata": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "handler": "handler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The Handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, and is immutable.", "overhead": "overhead represents the resource overhead associated with running a pod for a given RuntimeClass. For more details, see\n https://kubernetes.io/docs/concepts/scheduling-eviction/pod-overhead/", "scheduling": "scheduling holds the scheduling constraints to ensure that pods running with this RuntimeClass are scheduled to nodes that support it. If scheduling is nil, this RuntimeClass is assumed to be supported by all nodes.", diff --git a/vendor/k8s.io/api/node/v1alpha1/generated.proto b/vendor/k8s.io/api/node/v1alpha1/generated.proto index c50b639065..faf8b8c89e 100644 --- a/vendor/k8s.io/api/node/v1alpha1/generated.proto +++ b/vendor/k8s.io/api/node/v1alpha1/generated.proto @@ -45,6 +45,7 @@ message Overhead { // pod. For more details, see // https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class message RuntimeClass { + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -82,9 +83,9 @@ message RuntimeClassSpec { // The runtimeHandler must be lowercase, conform to the DNS Label (RFC 1123) // requirements, and is immutable. // +required - // +k8s:alpha(since: "1.36")=+k8s:format="k8s-short-name" - // +k8s:alpha(since: "1.36")=+k8s:immutable - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format="k8s-short-name" + // +k8s:beta(since: "1.37")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:required optional string runtimeHandler = 1; // overhead represents the resource overhead associated with running a pod for a @@ -98,6 +99,7 @@ message RuntimeClassSpec { // If scheduling is nil, this RuntimeClass is assumed to be supported by all // nodes. // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional optional Scheduling scheduling = 3; } @@ -118,6 +120,7 @@ message Scheduling { // tolerated by the pod and the RuntimeClass. // +optional // +listType=atomic + // +k8s:alpha(since: "1.37")=+k8s:optional repeated .k8s.io.api.core.v1.Toleration tolerations = 2; } diff --git a/vendor/k8s.io/api/node/v1alpha1/types.go b/vendor/k8s.io/api/node/v1alpha1/types.go index 3521335b07..16d2794d44 100644 --- a/vendor/k8s.io/api/node/v1alpha1/types.go +++ b/vendor/k8s.io/api/node/v1alpha1/types.go @@ -33,8 +33,9 @@ import ( // pod. For more details, see // https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class type RuntimeClass struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -61,9 +62,9 @@ type RuntimeClassSpec struct { // The runtimeHandler must be lowercase, conform to the DNS Label (RFC 1123) // requirements, and is immutable. // +required - // +k8s:alpha(since: "1.36")=+k8s:format="k8s-short-name" - // +k8s:alpha(since: "1.36")=+k8s:immutable - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format="k8s-short-name" + // +k8s:beta(since: "1.37")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:required RuntimeHandler string `json:"runtimeHandler" protobuf:"bytes,1,opt,name=runtimeHandler"` // overhead represents the resource overhead associated with running a pod for a @@ -77,6 +78,7 @@ type RuntimeClassSpec struct { // If scheduling is nil, this RuntimeClass is assumed to be supported by all // nodes. // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional Scheduling *Scheduling `json:"scheduling,omitempty" protobuf:"bytes,3,opt,name=scheduling"` } @@ -104,6 +106,7 @@ type Scheduling struct { // tolerated by the pod and the RuntimeClass. // +optional // +listType=atomic + // +k8s:alpha(since: "1.37")=+k8s:optional Tolerations []corev1.Toleration `json:"tolerations,omitempty" protobuf:"bytes,2,rep,name=tolerations"` } @@ -111,7 +114,7 @@ type Scheduling struct { // RuntimeClassList is a list of RuntimeClass objects. type RuntimeClassList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata diff --git a/vendor/k8s.io/api/node/v1alpha1/types_swagger_doc_generated.go b/vendor/k8s.io/api/node/v1alpha1/types_swagger_doc_generated.go index ccc1b70853..5c54384789 100644 --- a/vendor/k8s.io/api/node/v1alpha1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/node/v1alpha1/types_swagger_doc_generated.go @@ -38,7 +38,7 @@ func (Overhead) SwaggerDoc() map[string]string { var map_RuntimeClass = map[string]string{ "": "RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are (currently) manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class", - "metadata": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec represents specification of the RuntimeClass More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", } diff --git a/vendor/k8s.io/api/node/v1beta1/generated.proto b/vendor/k8s.io/api/node/v1beta1/generated.proto index 073a185e2c..51fbfd5e8b 100644 --- a/vendor/k8s.io/api/node/v1beta1/generated.proto +++ b/vendor/k8s.io/api/node/v1beta1/generated.proto @@ -45,6 +45,7 @@ message Overhead { // pod. For more details, see // https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class message RuntimeClass { + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -60,9 +61,9 @@ message RuntimeClass { // The handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, // and is immutable. // +required - // +k8s:alpha(since: "1.36")=+k8s:format="k8s-short-name" - // +k8s:alpha(since: "1.36")=+k8s:immutable - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format="k8s-short-name" + // +k8s:beta(since: "1.37")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:required optional string handler = 2; // overhead represents the resource overhead associated with running a pod for a @@ -76,6 +77,7 @@ message RuntimeClass { // If scheduling is nil, this RuntimeClass is assumed to be supported by all // nodes. // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional optional Scheduling scheduling = 4; } @@ -107,6 +109,7 @@ message Scheduling { // tolerated by the pod and the RuntimeClass. // +optional // +listType=atomic + // +k8s:alpha(since: "1.37")=+k8s:optional repeated .k8s.io.api.core.v1.Toleration tolerations = 2; } diff --git a/vendor/k8s.io/api/node/v1beta1/types.go b/vendor/k8s.io/api/node/v1beta1/types.go index 145e138663..3af85a9ee4 100644 --- a/vendor/k8s.io/api/node/v1beta1/types.go +++ b/vendor/k8s.io/api/node/v1beta1/types.go @@ -35,8 +35,9 @@ import ( // pod. For more details, see // https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class type RuntimeClass struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -52,9 +53,9 @@ type RuntimeClass struct { // The handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, // and is immutable. // +required - // +k8s:alpha(since: "1.36")=+k8s:format="k8s-short-name" - // +k8s:alpha(since: "1.36")=+k8s:immutable - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format="k8s-short-name" + // +k8s:beta(since: "1.37")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:required Handler string `json:"handler" protobuf:"bytes,2,opt,name=handler"` // overhead represents the resource overhead associated with running a pod for a @@ -68,6 +69,7 @@ type RuntimeClass struct { // If scheduling is nil, this RuntimeClass is assumed to be supported by all // nodes. // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional Scheduling *Scheduling `json:"scheduling,omitempty" protobuf:"bytes,4,opt,name=scheduling"` } @@ -95,6 +97,7 @@ type Scheduling struct { // tolerated by the pod and the RuntimeClass. // +optional // +listType=atomic + // +k8s:alpha(since: "1.37")=+k8s:optional Tolerations []corev1.Toleration `json:"tolerations,omitempty" protobuf:"bytes,2,rep,name=tolerations"` } @@ -104,7 +107,7 @@ type Scheduling struct { // RuntimeClassList is a list of RuntimeClass objects. type RuntimeClassList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata diff --git a/vendor/k8s.io/api/node/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/node/v1beta1/types_swagger_doc_generated.go index 086105ecc5..74991a89f0 100644 --- a/vendor/k8s.io/api/node/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/node/v1beta1/types_swagger_doc_generated.go @@ -38,7 +38,7 @@ func (Overhead) SwaggerDoc() map[string]string { var map_RuntimeClass = map[string]string{ "": "RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are (currently) manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class", - "metadata": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "handler": "handler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The handler must be lowercase, conform to the DNS Label (RFC 1123) requirements, and is immutable.", "overhead": "overhead represents the resource overhead associated with running a pod for a given RuntimeClass. For more details, see https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md", "scheduling": "scheduling holds the scheduling constraints to ensure that pods running with this RuntimeClass are scheduled to nodes that support it. If scheduling is nil, this RuntimeClass is assumed to be supported by all nodes.", diff --git a/vendor/k8s.io/api/policy/v1/generated.proto b/vendor/k8s.io/api/policy/v1/generated.proto index 704cc10b7d..ceec53a11f 100644 --- a/vendor/k8s.io/api/policy/v1/generated.proto +++ b/vendor/k8s.io/api/policy/v1/generated.proto @@ -33,27 +33,29 @@ option go_package = "k8s.io/api/policy/v1"; // This is a subresource of Pod. A request to cause such an eviction is // created by POSTing to .../pods//evictions. message Eviction { - // ObjectMeta describes the pod that is being evicted. + // metadata describes the pod that is being evicted. // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // DeleteOptions may be provided + // deleteOptions may be provided // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions deleteOptions = 2; } // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods +// +k8s:supportsSubresource="/status" message PodDisruptionBudget { - // Standard object's metadata. + // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Specification of the desired behavior of the PodDisruptionBudget. + // spec is the specification of the desired behavior of the PodDisruptionBudget. // +optional optional PodDisruptionBudgetSpec spec = 2; - // Most recently observed status of the PodDisruptionBudget. + // status is the most recently observed status of the PodDisruptionBudget. // +optional optional PodDisruptionBudgetStatus status = 3; } @@ -71,14 +73,14 @@ message PodDisruptionBudgetList { // PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. message PodDisruptionBudgetSpec { - // An eviction is allowed if at least "minAvailable" pods selected by + // minAvailable indicates that an eviction is allowed if at least "minAvailable" pods selected by // "selector" will still be available after the eviction, i.e. even in the // absence of the evicted pod. So for example you can prevent all voluntary // evictions by specifying "100%". // +optional optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString minAvailable = 1; - // Label query over pods whose evictions are managed by the disruption + // selector is a label query over pods whose evictions are managed by the disruption // budget. // A null selector will match no pods, while an empty ({}) selector will select // all pods within the namespace. @@ -86,14 +88,14 @@ message PodDisruptionBudgetSpec { // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; - // An eviction is allowed if at most "maxUnavailable" pods selected by + // maxUnavailable indicates that an eviction is allowed if at most "maxUnavailable" pods selected by // "selector" are unavailable after the eviction, i.e. even in absence of // the evicted pod. For example, one can prevent all voluntary evictions // by specifying 0. This is a mutually exclusive setting with "minAvailable". // +optional optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 3; - // UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods + // unhealthyPodEvictionPolicy defines the criteria for when unhealthy pods // should be considered for eviction. Current implementation considers healthy pods, // as pods that have status.conditions item with type="Ready",status="True". // @@ -175,6 +177,9 @@ message PodDisruptionBudgetStatus { // +patchStrategy=merge // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 7; } diff --git a/vendor/k8s.io/api/policy/v1/types.go b/vendor/k8s.io/api/policy/v1/types.go index ebf349e317..1d49f92d1f 100644 --- a/vendor/k8s.io/api/policy/v1/types.go +++ b/vendor/k8s.io/api/policy/v1/types.go @@ -26,14 +26,14 @@ const DisruptionBudgetCause metav1.CauseType = "DisruptionBudget" // PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. type PodDisruptionBudgetSpec struct { - // An eviction is allowed if at least "minAvailable" pods selected by + // minAvailable indicates that an eviction is allowed if at least "minAvailable" pods selected by // "selector" will still be available after the eviction, i.e. even in the // absence of the evicted pod. So for example you can prevent all voluntary // evictions by specifying "100%". // +optional MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty" protobuf:"bytes,1,opt,name=minAvailable"` - // Label query over pods whose evictions are managed by the disruption + // selector is a label query over pods whose evictions are managed by the disruption // budget. // A null selector will match no pods, while an empty ({}) selector will select // all pods within the namespace. @@ -41,14 +41,14 @@ type PodDisruptionBudgetSpec struct { // +optional Selector *metav1.LabelSelector `json:"selector,omitempty" patchStrategy:"replace" protobuf:"bytes,2,opt,name=selector"` - // An eviction is allowed if at most "maxUnavailable" pods selected by + // maxUnavailable indicates that an eviction is allowed if at most "maxUnavailable" pods selected by // "selector" are unavailable after the eviction, i.e. even in absence of // the evicted pod. For example, one can prevent all voluntary evictions // by specifying 0. This is a mutually exclusive setting with "minAvailable". // +optional MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"bytes,3,opt,name=maxUnavailable"` - // UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods + // unhealthyPodEvictionPolicy defines the criteria for when unhealthy pods // should be considered for eviction. Current implementation considers healthy pods, // as pods that have status.conditions item with type="Ready",status="True". // @@ -150,6 +150,9 @@ type PodDisruptionBudgetStatus struct { // +patchStrategy=merge // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,7,rep,name=conditions"` } @@ -174,17 +177,18 @@ const ( // +k8s:prerelease-lifecycle-gen:introduced=1.21 // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods +// +k8s:supportsSubresource="/status" type PodDisruptionBudget struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Specification of the desired behavior of the PodDisruptionBudget. + // spec is the specification of the desired behavior of the PodDisruptionBudget. // +optional Spec PodDisruptionBudgetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` - // Most recently observed status of the PodDisruptionBudget. + // status is the most recently observed status of the PodDisruptionBudget. // +optional Status PodDisruptionBudgetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } @@ -194,7 +198,7 @@ type PodDisruptionBudget struct { // PodDisruptionBudgetList is a collection of PodDisruptionBudgets. type PodDisruptionBudgetList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -212,13 +216,14 @@ type PodDisruptionBudgetList struct { // This is a subresource of Pod. A request to cause such an eviction is // created by POSTing to .../pods//evictions. type Eviction struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // ObjectMeta describes the pod that is being evicted. + // metadata describes the pod that is being evicted. // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // DeleteOptions may be provided + // deleteOptions may be provided // +optional DeleteOptions *metav1.DeleteOptions `json:"deleteOptions,omitempty" protobuf:"bytes,2,opt,name=deleteOptions"` } diff --git a/vendor/k8s.io/api/policy/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/policy/v1/types_swagger_doc_generated.go index 9b2f5b9450..cf67a76df6 100644 --- a/vendor/k8s.io/api/policy/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/policy/v1/types_swagger_doc_generated.go @@ -29,8 +29,8 @@ package v1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_Eviction = map[string]string{ "": "Eviction evicts a pod from its node subject to certain policies and safety constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods//evictions.", - "metadata": "ObjectMeta describes the pod that is being evicted.", - "deleteOptions": "DeleteOptions may be provided", + "metadata": "metadata describes the pod that is being evicted.", + "deleteOptions": "deleteOptions may be provided", } func (Eviction) SwaggerDoc() map[string]string { @@ -39,9 +39,9 @@ func (Eviction) SwaggerDoc() map[string]string { var map_PodDisruptionBudget = map[string]string{ "": "PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "spec": "Specification of the desired behavior of the PodDisruptionBudget.", - "status": "Most recently observed status of the PodDisruptionBudget.", + "metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec is the specification of the desired behavior of the PodDisruptionBudget.", + "status": "status is the most recently observed status of the PodDisruptionBudget.", } func (PodDisruptionBudget) SwaggerDoc() map[string]string { @@ -60,10 +60,10 @@ func (PodDisruptionBudgetList) SwaggerDoc() map[string]string { var map_PodDisruptionBudgetSpec = map[string]string{ "": "PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.", - "minAvailable": "An eviction is allowed if at least \"minAvailable\" pods selected by \"selector\" will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying \"100%\".", - "selector": "Label query over pods whose evictions are managed by the disruption budget. A null selector will match no pods, while an empty ({}) selector will select all pods within the namespace.", - "maxUnavailable": "An eviction is allowed if at most \"maxUnavailable\" pods selected by \"selector\" are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with \"minAvailable\".", - "unhealthyPodEvictionPolicy": "UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction. Current implementation considers healthy pods, as pods that have status.conditions item with type=\"Ready\",status=\"True\".\n\nValid policies are IfHealthyBudget and AlwaysAllow. If no policy is specified, the default behavior will be used, which corresponds to the IfHealthyBudget policy.\n\nIfHealthyBudget policy means that running pods (status.phase=\"Running\"), but not yet healthy can be evicted only if the guarded application is not disrupted (status.currentHealthy is at least equal to status.desiredHealthy). Healthy pods will be subject to the PDB for eviction.\n\nAlwaysAllow policy means that all running pods (status.phase=\"Running\"), but not yet healthy are considered disrupted and can be evicted regardless of whether the criteria in a PDB is met. This means perspective running pods of a disrupted application might not get a chance to become healthy. Healthy pods will be subject to the PDB for eviction.\n\nAdditional policies may be added in the future. Clients making eviction decisions should disallow eviction of unhealthy pods if they encounter an unrecognized policy in this field.", + "minAvailable": "minAvailable indicates that an eviction is allowed if at least \"minAvailable\" pods selected by \"selector\" will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying \"100%\".", + "selector": "selector is a label query over pods whose evictions are managed by the disruption budget. A null selector will match no pods, while an empty ({}) selector will select all pods within the namespace.", + "maxUnavailable": "maxUnavailable indicates that an eviction is allowed if at most \"maxUnavailable\" pods selected by \"selector\" are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with \"minAvailable\".", + "unhealthyPodEvictionPolicy": "unhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction. Current implementation considers healthy pods, as pods that have status.conditions item with type=\"Ready\",status=\"True\".\n\nValid policies are IfHealthyBudget and AlwaysAllow. If no policy is specified, the default behavior will be used, which corresponds to the IfHealthyBudget policy.\n\nIfHealthyBudget policy means that running pods (status.phase=\"Running\"), but not yet healthy can be evicted only if the guarded application is not disrupted (status.currentHealthy is at least equal to status.desiredHealthy). Healthy pods will be subject to the PDB for eviction.\n\nAlwaysAllow policy means that all running pods (status.phase=\"Running\"), but not yet healthy are considered disrupted and can be evicted regardless of whether the criteria in a PDB is met. This means perspective running pods of a disrupted application might not get a chance to become healthy. Healthy pods will be subject to the PDB for eviction.\n\nAdditional policies may be added in the future. Clients making eviction decisions should disallow eviction of unhealthy pods if they encounter an unrecognized policy in this field.", } func (PodDisruptionBudgetSpec) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/policy/v1beta1/generated.proto b/vendor/k8s.io/api/policy/v1beta1/generated.proto index a8200a2d78..be469ba611 100644 --- a/vendor/k8s.io/api/policy/v1beta1/generated.proto +++ b/vendor/k8s.io/api/policy/v1beta1/generated.proto @@ -33,27 +33,29 @@ option go_package = "k8s.io/api/policy/v1beta1"; // This is a subresource of Pod. A request to cause such an eviction is // created by POSTing to .../pods//evictions. message Eviction { - // ObjectMeta describes the pod that is being evicted. + // metadata describes the pod that is being evicted. // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // DeleteOptions may be provided + // deleteOptions may be provided // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions deleteOptions = 2; } // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods +// +k8s:supportsSubresource="/status" message PodDisruptionBudget { - // Standard object's metadata. + // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Specification of the desired behavior of the PodDisruptionBudget. + // spec is the specification of the desired behavior of the PodDisruptionBudget. // +optional optional PodDisruptionBudgetSpec spec = 2; - // Most recently observed status of the PodDisruptionBudget. + // status is the most recently observed status of the PodDisruptionBudget. // +optional optional PodDisruptionBudgetStatus status = 3; } @@ -71,14 +73,14 @@ message PodDisruptionBudgetList { // PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. message PodDisruptionBudgetSpec { - // An eviction is allowed if at least "minAvailable" pods selected by + // minAvailable indicates that an eviction is allowed if at least "minAvailable" pods selected by // "selector" will still be available after the eviction, i.e. even in the // absence of the evicted pod. So for example you can prevent all voluntary // evictions by specifying "100%". // +optional optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString minAvailable = 1; - // Label query over pods whose evictions are managed by the disruption + // selector is a label query over pods whose evictions are managed by the disruption // budget. // A null selector selects no pods. // An empty selector ({}) also selects no pods, which differs from standard behavior of selecting all pods. @@ -86,14 +88,14 @@ message PodDisruptionBudgetSpec { // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2; - // An eviction is allowed if at most "maxUnavailable" pods selected by + // maxUnavailable indicates that an eviction is allowed if at most "maxUnavailable" pods selected by // "selector" are unavailable after the eviction, i.e. even in absence of // the evicted pod. For example, one can prevent all voluntary evictions // by specifying 0. This is a mutually exclusive setting with "minAvailable". // +optional optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 3; - // UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods + // unhealthyPodEvictionPolicy defines the criteria for when unhealthy pods // should be considered for eviction. Current implementation considers healthy pods, // as pods that have status.conditions item with type="Ready",status="True". // @@ -175,6 +177,9 @@ message PodDisruptionBudgetStatus { // +patchStrategy=merge // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 7; } diff --git a/vendor/k8s.io/api/policy/v1beta1/types.go b/vendor/k8s.io/api/policy/v1beta1/types.go index 354c22a3d0..6017d4179d 100644 --- a/vendor/k8s.io/api/policy/v1beta1/types.go +++ b/vendor/k8s.io/api/policy/v1beta1/types.go @@ -23,14 +23,14 @@ import ( // PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. type PodDisruptionBudgetSpec struct { - // An eviction is allowed if at least "minAvailable" pods selected by + // minAvailable indicates that an eviction is allowed if at least "minAvailable" pods selected by // "selector" will still be available after the eviction, i.e. even in the // absence of the evicted pod. So for example you can prevent all voluntary // evictions by specifying "100%". // +optional MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty" protobuf:"bytes,1,opt,name=minAvailable"` - // Label query over pods whose evictions are managed by the disruption + // selector is a label query over pods whose evictions are managed by the disruption // budget. // A null selector selects no pods. // An empty selector ({}) also selects no pods, which differs from standard behavior of selecting all pods. @@ -38,14 +38,14 @@ type PodDisruptionBudgetSpec struct { // +optional Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"` - // An eviction is allowed if at most "maxUnavailable" pods selected by + // maxUnavailable indicates that an eviction is allowed if at most "maxUnavailable" pods selected by // "selector" are unavailable after the eviction, i.e. even in absence of // the evicted pod. For example, one can prevent all voluntary evictions // by specifying 0. This is a mutually exclusive setting with "minAvailable". // +optional MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"bytes,3,opt,name=maxUnavailable"` - // UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods + // unhealthyPodEvictionPolicy defines the criteria for when unhealthy pods // should be considered for eviction. Current implementation considers healthy pods, // as pods that have status.conditions item with type="Ready",status="True". // @@ -147,6 +147,9 @@ type PodDisruptionBudgetStatus struct { // +patchStrategy=merge // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,7,rep,name=conditions"` } @@ -174,18 +177,19 @@ const ( // +k8s:prerelease-lifecycle-gen:replacement=policy,v1,PodDisruptionBudget // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods +// +k8s:supportsSubresource="/status" type PodDisruptionBudget struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object's metadata. + // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Specification of the desired behavior of the PodDisruptionBudget. + // spec is the specification of the desired behavior of the PodDisruptionBudget. // +optional Spec PodDisruptionBudgetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` - // Most recently observed status of the PodDisruptionBudget. + // status is the most recently observed status of the PodDisruptionBudget. // +optional Status PodDisruptionBudgetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } @@ -198,7 +202,7 @@ type PodDisruptionBudget struct { // PodDisruptionBudgetList is a collection of PodDisruptionBudgets. type PodDisruptionBudgetList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -218,13 +222,14 @@ type PodDisruptionBudgetList struct { // This is a subresource of Pod. A request to cause such an eviction is // created by POSTing to .../pods//evictions. type Eviction struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // ObjectMeta describes the pod that is being evicted. + // metadata describes the pod that is being evicted. // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // DeleteOptions may be provided + // deleteOptions may be provided // +optional DeleteOptions *metav1.DeleteOptions `json:"deleteOptions,omitempty" protobuf:"bytes,2,opt,name=deleteOptions"` } diff --git a/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go index cffc9a548c..cffdcdd42b 100644 --- a/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/policy/v1beta1/types_swagger_doc_generated.go @@ -29,8 +29,8 @@ package v1beta1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_Eviction = map[string]string{ "": "Eviction evicts a pod from its node subject to certain policies and safety constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods//evictions.", - "metadata": "ObjectMeta describes the pod that is being evicted.", - "deleteOptions": "DeleteOptions may be provided", + "metadata": "metadata describes the pod that is being evicted.", + "deleteOptions": "deleteOptions may be provided", } func (Eviction) SwaggerDoc() map[string]string { @@ -39,9 +39,9 @@ func (Eviction) SwaggerDoc() map[string]string { var map_PodDisruptionBudget = map[string]string{ "": "PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "spec": "Specification of the desired behavior of the PodDisruptionBudget.", - "status": "Most recently observed status of the PodDisruptionBudget.", + "metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec is the specification of the desired behavior of the PodDisruptionBudget.", + "status": "status is the most recently observed status of the PodDisruptionBudget.", } func (PodDisruptionBudget) SwaggerDoc() map[string]string { @@ -60,10 +60,10 @@ func (PodDisruptionBudgetList) SwaggerDoc() map[string]string { var map_PodDisruptionBudgetSpec = map[string]string{ "": "PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.", - "minAvailable": "An eviction is allowed if at least \"minAvailable\" pods selected by \"selector\" will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying \"100%\".", - "selector": "Label query over pods whose evictions are managed by the disruption budget. A null selector selects no pods. An empty selector ({}) also selects no pods, which differs from standard behavior of selecting all pods. In policy/v1, an empty selector will select all pods in the namespace.", - "maxUnavailable": "An eviction is allowed if at most \"maxUnavailable\" pods selected by \"selector\" are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with \"minAvailable\".", - "unhealthyPodEvictionPolicy": "UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction. Current implementation considers healthy pods, as pods that have status.conditions item with type=\"Ready\",status=\"True\".\n\nValid policies are IfHealthyBudget and AlwaysAllow. If no policy is specified, the default behavior will be used, which corresponds to the IfHealthyBudget policy.\n\nIfHealthyBudget policy means that running pods (status.phase=\"Running\"), but not yet healthy can be evicted only if the guarded application is not disrupted (status.currentHealthy is at least equal to status.desiredHealthy). Healthy pods will be subject to the PDB for eviction.\n\nAlwaysAllow policy means that all running pods (status.phase=\"Running\"), but not yet healthy are considered disrupted and can be evicted regardless of whether the criteria in a PDB is met. This means perspective running pods of a disrupted application might not get a chance to become healthy. Healthy pods will be subject to the PDB for eviction.\n\nAdditional policies may be added in the future. Clients making eviction decisions should disallow eviction of unhealthy pods if they encounter an unrecognized policy in this field.", + "minAvailable": "minAvailable indicates that an eviction is allowed if at least \"minAvailable\" pods selected by \"selector\" will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying \"100%\".", + "selector": "selector is a label query over pods whose evictions are managed by the disruption budget. A null selector selects no pods. An empty selector ({}) also selects no pods, which differs from standard behavior of selecting all pods. In policy/v1, an empty selector will select all pods in the namespace.", + "maxUnavailable": "maxUnavailable indicates that an eviction is allowed if at most \"maxUnavailable\" pods selected by \"selector\" are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with \"minAvailable\".", + "unhealthyPodEvictionPolicy": "unhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction. Current implementation considers healthy pods, as pods that have status.conditions item with type=\"Ready\",status=\"True\".\n\nValid policies are IfHealthyBudget and AlwaysAllow. If no policy is specified, the default behavior will be used, which corresponds to the IfHealthyBudget policy.\n\nIfHealthyBudget policy means that running pods (status.phase=\"Running\"), but not yet healthy can be evicted only if the guarded application is not disrupted (status.currentHealthy is at least equal to status.desiredHealthy). Healthy pods will be subject to the PDB for eviction.\n\nAlwaysAllow policy means that all running pods (status.phase=\"Running\"), but not yet healthy are considered disrupted and can be evicted regardless of whether the criteria in a PDB is met. This means perspective running pods of a disrupted application might not get a chance to become healthy. Healthy pods will be subject to the PDB for eviction.\n\nAdditional policies may be added in the future. Clients making eviction decisions should disallow eviction of unhealthy pods if they encounter an unrecognized policy in this field.", } func (PodDisruptionBudgetSpec) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/rbac/v1/generated.proto b/vendor/k8s.io/api/rbac/v1/generated.proto index 7b4ec2afc1..9a2489b7a8 100644 --- a/vendor/k8s.io/api/rbac/v1/generated.proto +++ b/vendor/k8s.io/api/rbac/v1/generated.proto @@ -30,7 +30,7 @@ option go_package = "k8s.io/api/rbac/v1"; // AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole message AggregationRule { - // ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. + // clusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. // If any of the selectors match, then the ClusterRole's permissions will be added // +optional // +listType=atomic @@ -39,17 +39,17 @@ message AggregationRule { // ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. message ClusterRole { - // Standard object's metadata. + // metadata is the standard object's metadata. // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Rules holds all the PolicyRules for this ClusterRole + // rules holds all the PolicyRules for this ClusterRole // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated PolicyRule rules = 2; - // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. + // aggregationRule is an optional field that describes how to build the Rules for this ClusterRole. // If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be // stomped by the controller. // +optional @@ -59,20 +59,21 @@ message ClusterRole { // ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, // and adds who information via Subject. message ClusterRoleBinding { - // Standard object's metadata. + // metadata is the standard object's metadata. // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Subjects holds references to the objects the role applies to. + // subjects holds references to the objects the role applies to. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated Subject subjects = 2; - // RoleRef can only reference a ClusterRole in the global namespace. + // roleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // This field is immutable. // +required + // +k8s:alpha(since:"1.37")=+k8s:immutable optional RoleRef roleRef = 3; } @@ -99,29 +100,29 @@ message ClusterRoleList { // PolicyRule holds information that describes a policy rule, but does not contain information // about who the rule applies to or which namespace the rule applies to. message PolicyRule { - // Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. + // verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. // +listType=atomic // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required repeated string verbs = 1; - // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of + // apiGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of // the enumerated resources in any API group will be allowed. "" represents the core API group and "*" represents all API groups. // +optional // +listType=atomic repeated string apiGroups = 2; - // Resources is a list of resources this rule applies to. '*' represents all resources. + // resources is a list of resources this rule applies to. '*' represents all resources. // +optional // +listType=atomic repeated string resources = 3; - // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. + // resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. // +optional // +listType=atomic repeated string resourceNames = 4; - // NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path + // nonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path // Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. // Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. // +optional @@ -131,14 +132,14 @@ message PolicyRule { // Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. message Role { - // Standard object's metadata. + // metadata is the standard object's metadata. // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Rules holds all the PolicyRules for this Role + // rules holds all the PolicyRules for this Role // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated PolicyRule rules = 2; } @@ -146,20 +147,21 @@ message Role { // It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given // namespace only have effect in that namespace. message RoleBinding { - // Standard object's metadata. + // metadata is the standard object's metadata. // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Subjects holds references to the objects the role applies to. + // subjects holds references to the objects the role applies to. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated Subject subjects = 2; - // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. + // roleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // This field is immutable. // +required + // +k8s:alpha(since:"1.37")=+k8s:immutable optional RoleRef roleRef = 3; } @@ -186,17 +188,17 @@ message RoleList { // RoleRef contains information that points to the role being used // +structType=atomic message RoleRef { - // APIGroup is the group for the resource being referenced + // apiGroup is the group for the resource being referenced // +optional optional string apiGroup = 1; - // Kind is the type of resource being referenced + // kind is the type of resource being referenced // +required optional string kind = 2; - // Name is the name of resource being referenced + // name is the name of resource being referenced // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string name = 3; } @@ -204,23 +206,23 @@ message RoleRef { // or a value for non-objects such as user and group names. // +structType=atomic message Subject { - // Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". + // kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". // If the Authorizer does not recognized the kind value, the Authorizer should report an error. // +required optional string kind = 1; - // APIGroup holds the API group of the referenced subject. + // apiGroup holds the API group of the referenced subject. // Defaults to "" for ServiceAccount subjects. // Defaults to "rbac.authorization.k8s.io" for User and Group subjects. // +optional optional string apiGroup = 2; - // Name of the object being referenced. + // name of the object being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string name = 3; - // Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty + // namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty // the Authorizer should report an error. // +optional optional string namespace = 4; diff --git a/vendor/k8s.io/api/rbac/v1/types.go b/vendor/k8s.io/api/rbac/v1/types.go index d3bb6d1a9c..a1e96067e2 100644 --- a/vendor/k8s.io/api/rbac/v1/types.go +++ b/vendor/k8s.io/api/rbac/v1/types.go @@ -47,27 +47,27 @@ const ( // PolicyRule holds information that describes a policy rule, but does not contain information // about who the rule applies to or which namespace the rule applies to. type PolicyRule struct { - // Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. + // verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. // +listType=atomic // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` - // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of + // apiGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of // the enumerated resources in any API group will be allowed. "" represents the core API group and "*" represents all API groups. // +optional // +listType=atomic APIGroups []string `json:"apiGroups,omitempty" protobuf:"bytes,2,rep,name=apiGroups"` - // Resources is a list of resources this rule applies to. '*' represents all resources. + // resources is a list of resources this rule applies to. '*' represents all resources. // +optional // +listType=atomic Resources []string `json:"resources,omitempty" protobuf:"bytes,3,rep,name=resources"` - // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. + // resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. // +optional // +listType=atomic ResourceNames []string `json:"resourceNames,omitempty" protobuf:"bytes,4,rep,name=resourceNames"` - // NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path + // nonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path // Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. // Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. // +optional @@ -79,20 +79,20 @@ type PolicyRule struct { // or a value for non-objects such as user and group names. // +structType=atomic type Subject struct { - // Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". + // kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". // If the Authorizer does not recognized the kind value, the Authorizer should report an error. // +required Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` - // APIGroup holds the API group of the referenced subject. + // apiGroup holds the API group of the referenced subject. // Defaults to "" for ServiceAccount subjects. // Defaults to "rbac.authorization.k8s.io" for User and Group subjects. // +optional APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,2,opt,name=apiGroup"` - // Name of the object being referenced. + // name of the object being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Name string `json:"name" protobuf:"bytes,3,opt,name=name"` - // Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty + // namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty // the Authorizer should report an error. // +optional Namespace string `json:"namespace,omitempty" protobuf:"bytes,4,opt,name=namespace"` @@ -101,15 +101,15 @@ type Subject struct { // RoleRef contains information that points to the role being used // +structType=atomic type RoleRef struct { - // APIGroup is the group for the resource being referenced + // apiGroup is the group for the resource being referenced // +optional APIGroup string `json:"apiGroup" protobuf:"bytes,1,opt,name=apiGroup"` - // Kind is the type of resource being referenced + // kind is the type of resource being referenced // +required Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"` - // Name is the name of resource being referenced + // name is the name of resource being referenced // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Name string `json:"name" protobuf:"bytes,3,opt,name=name"` } @@ -119,15 +119,15 @@ type RoleRef struct { // Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. type Role struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object's metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Rules holds all the PolicyRules for this Role + // rules holds all the PolicyRules for this Role // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Rules []PolicyRule `json:"rules" protobuf:"bytes,2,rep,name=rules"` } @@ -139,21 +139,22 @@ type Role struct { // It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given // namespace only have effect in that namespace. type RoleBinding struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object's metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Subjects holds references to the objects the role applies to. + // subjects holds references to the objects the role applies to. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Subjects []Subject `json:"subjects,omitempty" protobuf:"bytes,2,rep,name=subjects"` - // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. + // roleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // This field is immutable. // +required + // +k8s:alpha(since:"1.37")=+k8s:immutable RoleRef RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` } @@ -162,7 +163,7 @@ type RoleBinding struct { // RoleBindingList is a collection of RoleBindings type RoleBindingList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -176,7 +177,7 @@ type RoleBindingList struct { // RoleList is a collection of Roles type RoleList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -192,18 +193,18 @@ type RoleList struct { // ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. type ClusterRole struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object's metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Rules holds all the PolicyRules for this ClusterRole + // rules holds all the PolicyRules for this ClusterRole // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Rules []PolicyRule `json:"rules" protobuf:"bytes,2,rep,name=rules"` - // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. + // aggregationRule is an optional field that describes how to build the Rules for this ClusterRole. // If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be // stomped by the controller. // +optional @@ -212,7 +213,7 @@ type ClusterRole struct { // AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole type AggregationRule struct { - // ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. + // clusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. // If any of the selectors match, then the ClusterRole's permissions will be added // +optional // +listType=atomic @@ -227,21 +228,22 @@ type AggregationRule struct { // ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, // and adds who information via Subject. type ClusterRoleBinding struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object's metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Subjects holds references to the objects the role applies to. + // subjects holds references to the objects the role applies to. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Subjects []Subject `json:"subjects,omitempty" protobuf:"bytes,2,rep,name=subjects"` - // RoleRef can only reference a ClusterRole in the global namespace. + // roleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // This field is immutable. // +required + // +k8s:alpha(since:"1.37")=+k8s:immutable RoleRef RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` } @@ -250,7 +252,7 @@ type ClusterRoleBinding struct { // ClusterRoleBindingList is a collection of ClusterRoleBindings type ClusterRoleBindingList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -264,7 +266,7 @@ type ClusterRoleBindingList struct { // ClusterRoleList is a collection of ClusterRoles type ClusterRoleList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` diff --git a/vendor/k8s.io/api/rbac/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/rbac/v1/types_swagger_doc_generated.go index 0471a55944..7cc6a0e3fc 100644 --- a/vendor/k8s.io/api/rbac/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/rbac/v1/types_swagger_doc_generated.go @@ -29,7 +29,7 @@ package v1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_AggregationRule = map[string]string{ "": "AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole", - "clusterRoleSelectors": "ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. If any of the selectors match, then the ClusterRole's permissions will be added", + "clusterRoleSelectors": "clusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. If any of the selectors match, then the ClusterRole's permissions will be added", } func (AggregationRule) SwaggerDoc() map[string]string { @@ -38,9 +38,9 @@ func (AggregationRule) SwaggerDoc() map[string]string { var map_ClusterRole = map[string]string{ "": "ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding.", - "metadata": "Standard object's metadata.", - "rules": "Rules holds all the PolicyRules for this ClusterRole", - "aggregationRule": "AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be stomped by the controller.", + "metadata": "metadata is the standard object's metadata.", + "rules": "rules holds all the PolicyRules for this ClusterRole", + "aggregationRule": "aggregationRule is an optional field that describes how to build the Rules for this ClusterRole. If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be stomped by the controller.", } func (ClusterRole) SwaggerDoc() map[string]string { @@ -49,9 +49,9 @@ func (ClusterRole) SwaggerDoc() map[string]string { var map_ClusterRoleBinding = map[string]string{ "": "ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject.", - "metadata": "Standard object's metadata.", - "subjects": "Subjects holds references to the objects the role applies to.", - "roleRef": "RoleRef can only reference a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error. This field is immutable.", + "metadata": "metadata is the standard object's metadata.", + "subjects": "subjects holds references to the objects the role applies to.", + "roleRef": "roleRef can only reference a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error. This field is immutable.", } func (ClusterRoleBinding) SwaggerDoc() map[string]string { @@ -80,11 +80,11 @@ func (ClusterRoleList) SwaggerDoc() map[string]string { var map_PolicyRule = map[string]string{ "": "PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.", - "verbs": "Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs.", - "apiGroups": "APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. \"\" represents the core API group and \"*\" represents all API groups.", - "resources": "Resources is a list of resources this rule applies to. '*' represents all resources.", - "resourceNames": "ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.", - "nonResourceURLs": "NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as \"pods\" or \"secrets\") or non-resource URL paths (such as \"/api\"), but not both.", + "verbs": "verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs.", + "apiGroups": "apiGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. \"\" represents the core API group and \"*\" represents all API groups.", + "resources": "resources is a list of resources this rule applies to. '*' represents all resources.", + "resourceNames": "resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.", + "nonResourceURLs": "nonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as \"pods\" or \"secrets\") or non-resource URL paths (such as \"/api\"), but not both.", } func (PolicyRule) SwaggerDoc() map[string]string { @@ -93,8 +93,8 @@ func (PolicyRule) SwaggerDoc() map[string]string { var map_Role = map[string]string{ "": "Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding.", - "metadata": "Standard object's metadata.", - "rules": "Rules holds all the PolicyRules for this Role", + "metadata": "metadata is the standard object's metadata.", + "rules": "rules holds all the PolicyRules for this Role", } func (Role) SwaggerDoc() map[string]string { @@ -103,9 +103,9 @@ func (Role) SwaggerDoc() map[string]string { var map_RoleBinding = map[string]string{ "": "RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given namespace only have effect in that namespace.", - "metadata": "Standard object's metadata.", - "subjects": "Subjects holds references to the objects the role applies to.", - "roleRef": "RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error. This field is immutable.", + "metadata": "metadata is the standard object's metadata.", + "subjects": "subjects holds references to the objects the role applies to.", + "roleRef": "roleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error. This field is immutable.", } func (RoleBinding) SwaggerDoc() map[string]string { @@ -134,9 +134,9 @@ func (RoleList) SwaggerDoc() map[string]string { var map_RoleRef = map[string]string{ "": "RoleRef contains information that points to the role being used", - "apiGroup": "APIGroup is the group for the resource being referenced", - "kind": "Kind is the type of resource being referenced", - "name": "Name is the name of resource being referenced", + "apiGroup": "apiGroup is the group for the resource being referenced", + "kind": "kind is the type of resource being referenced", + "name": "name is the name of resource being referenced", } func (RoleRef) SwaggerDoc() map[string]string { @@ -145,10 +145,10 @@ func (RoleRef) SwaggerDoc() map[string]string { var map_Subject = map[string]string{ "": "Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, or a value for non-objects such as user and group names.", - "kind": "Kind of object being referenced. Values defined by this API group are \"User\", \"Group\", and \"ServiceAccount\". If the Authorizer does not recognized the kind value, the Authorizer should report an error.", - "apiGroup": "APIGroup holds the API group of the referenced subject. Defaults to \"\" for ServiceAccount subjects. Defaults to \"rbac.authorization.k8s.io\" for User and Group subjects.", - "name": "Name of the object being referenced.", - "namespace": "Namespace of the referenced object. If the object kind is non-namespace, such as \"User\" or \"Group\", and this value is not empty the Authorizer should report an error.", + "kind": "kind of object being referenced. Values defined by this API group are \"User\", \"Group\", and \"ServiceAccount\". If the Authorizer does not recognized the kind value, the Authorizer should report an error.", + "apiGroup": "apiGroup holds the API group of the referenced subject. Defaults to \"\" for ServiceAccount subjects. Defaults to \"rbac.authorization.k8s.io\" for User and Group subjects.", + "name": "name of the object being referenced.", + "namespace": "namespace of the referenced object. If the object kind is non-namespace, such as \"User\" or \"Group\", and this value is not empty the Authorizer should report an error.", } func (Subject) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/rbac/v1alpha1/generated.proto b/vendor/k8s.io/api/rbac/v1alpha1/generated.proto index 9551d11921..2046778ae8 100644 --- a/vendor/k8s.io/api/rbac/v1alpha1/generated.proto +++ b/vendor/k8s.io/api/rbac/v1alpha1/generated.proto @@ -30,7 +30,7 @@ option go_package = "k8s.io/api/rbac/v1alpha1"; // AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole message AggregationRule { - // ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. + // clusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. // If any of the selectors match, then the ClusterRole's permissions will be added // +optional // +listType=atomic @@ -40,17 +40,17 @@ message AggregationRule { // ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRole, and will no longer be served in v1.22. message ClusterRole { - // Standard object's metadata. + // metadata is the standard object's metadata. // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Rules holds all the PolicyRules for this ClusterRole + // rules holds all the PolicyRules for this ClusterRole // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated PolicyRule rules = 2; - // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. + // aggregationRule is an optional field that describes how to build the Rules for this ClusterRole. // If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be // stomped by the controller. // +optional @@ -61,19 +61,20 @@ message ClusterRole { // and adds who information via Subject. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBinding, and will no longer be served in v1.22. message ClusterRoleBinding { - // Standard object's metadata. + // metadata is the standard object's metadata. // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Subjects holds references to the objects the role applies to. + // subjects holds references to the objects the role applies to. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated Subject subjects = 2; - // RoleRef can only reference a ClusterRole in the global namespace. + // roleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // +required + // +k8s:alpha(since:"1.37")=+k8s:immutable optional RoleRef roleRef = 3; } @@ -102,29 +103,29 @@ message ClusterRoleList { // PolicyRule holds information that describes a policy rule, but does not contain information // about who the rule applies to or which namespace the rule applies to. message PolicyRule { - // Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. + // verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. // +listType=atomic // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required repeated string verbs = 1; - // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of + // apiGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of // the enumerated resources in any API group will be allowed. "" represents the core API group and "*" represents all API groups. // +optional // +listType=atomic repeated string apiGroups = 3; - // Resources is a list of resources this rule applies to. '*' represents all resources. + // resources is a list of resources this rule applies to. '*' represents all resources. // +optional // +listType=atomic repeated string resources = 4; - // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. + // resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. // +optional // +listType=atomic repeated string resourceNames = 5; - // NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path + // nonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path // Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. // Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. // +optional @@ -135,14 +136,14 @@ message PolicyRule { // Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 Role, and will no longer be served in v1.22. message Role { - // Standard object's metadata. + // metadata is the standard object's metadata. // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Rules holds all the PolicyRules for this Role + // rules holds all the PolicyRules for this Role // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated PolicyRule rules = 2; } @@ -151,19 +152,20 @@ message Role { // namespace only have effect in that namespace. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBinding, and will no longer be served in v1.22. message RoleBinding { - // Standard object's metadata. + // metadata is the standard object's metadata. // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Subjects holds references to the objects the role applies to. + // subjects holds references to the objects the role applies to. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated Subject subjects = 2; - // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. + // roleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // +required + // +k8s:alpha(since:"1.37")=+k8s:immutable optional RoleRef roleRef = 3; } @@ -191,41 +193,41 @@ message RoleList { // RoleRef contains information that points to the role being used message RoleRef { - // APIGroup is the group for the resource being referenced + // apiGroup is the group for the resource being referenced // +optional optional string apiGroup = 1; - // Kind is the type of resource being referenced + // kind is the type of resource being referenced // +required optional string kind = 2; - // Name is the name of resource being referenced + // name is the name of resource being referenced // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string name = 3; } // Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, // or a value for non-objects such as user and group names. message Subject { - // Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". + // kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". // If the Authorizer does not recognized the kind value, the Authorizer should report an error. // +required optional string kind = 1; - // APIVersion holds the API group and version of the referenced subject. + // apiVersion holds the API group and version of the referenced subject. // Defaults to "v1" for ServiceAccount subjects. // Defaults to "rbac.authorization.k8s.io/v1alpha1" for User and Group subjects. // +k8s:conversion-gen=false // +optional optional string apiVersion = 2; - // Name of the object being referenced. + // name of the object being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string name = 3; - // Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty + // namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty // the Authorizer should report an error. // +optional optional string namespace = 4; diff --git a/vendor/k8s.io/api/rbac/v1alpha1/types.go b/vendor/k8s.io/api/rbac/v1alpha1/types.go index 4ff4c06015..2f560efb4c 100644 --- a/vendor/k8s.io/api/rbac/v1alpha1/types.go +++ b/vendor/k8s.io/api/rbac/v1alpha1/types.go @@ -47,27 +47,27 @@ const ( // PolicyRule holds information that describes a policy rule, but does not contain information // about who the rule applies to or which namespace the rule applies to. type PolicyRule struct { - // Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. + // verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. // +listType=atomic // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` - // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of + // apiGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of // the enumerated resources in any API group will be allowed. "" represents the core API group and "*" represents all API groups. // +optional // +listType=atomic APIGroups []string `json:"apiGroups,omitempty" protobuf:"bytes,3,rep,name=apiGroups"` - // Resources is a list of resources this rule applies to. '*' represents all resources. + // resources is a list of resources this rule applies to. '*' represents all resources. // +optional // +listType=atomic Resources []string `json:"resources,omitempty" protobuf:"bytes,4,rep,name=resources"` - // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. + // resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. // +optional // +listType=atomic ResourceNames []string `json:"resourceNames,omitempty" protobuf:"bytes,5,rep,name=resourceNames"` - // NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path + // nonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path // Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. // Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. // +optional @@ -78,21 +78,21 @@ type PolicyRule struct { // Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, // or a value for non-objects such as user and group names. type Subject struct { - // Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". + // kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". // If the Authorizer does not recognized the kind value, the Authorizer should report an error. // +required Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` - // APIVersion holds the API group and version of the referenced subject. + // apiVersion holds the API group and version of the referenced subject. // Defaults to "v1" for ServiceAccount subjects. // Defaults to "rbac.authorization.k8s.io/v1alpha1" for User and Group subjects. // +k8s:conversion-gen=false // +optional APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,2,opt,name=apiVersion"` - // Name of the object being referenced. + // name of the object being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Name string `json:"name" protobuf:"bytes,3,opt,name=name"` - // Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty + // namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty // the Authorizer should report an error. // +optional Namespace string `json:"namespace,omitempty" protobuf:"bytes,4,opt,name=namespace"` @@ -100,15 +100,15 @@ type Subject struct { // RoleRef contains information that points to the role being used type RoleRef struct { - // APIGroup is the group for the resource being referenced + // apiGroup is the group for the resource being referenced // +optional APIGroup string `json:"apiGroup" protobuf:"bytes,1,opt,name=apiGroup"` - // Kind is the type of resource being referenced + // kind is the type of resource being referenced // +required Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"` - // Name is the name of resource being referenced + // name is the name of resource being referenced // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Name string `json:"name" protobuf:"bytes,3,opt,name=name"` } @@ -118,15 +118,15 @@ type RoleRef struct { // Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 Role, and will no longer be served in v1.22. type Role struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object's metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Rules holds all the PolicyRules for this Role + // rules holds all the PolicyRules for this Role // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Rules []PolicyRule `json:"rules" protobuf:"bytes,2,rep,name=rules"` } @@ -138,20 +138,21 @@ type Role struct { // namespace only have effect in that namespace. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBinding, and will no longer be served in v1.22. type RoleBinding struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object's metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Subjects holds references to the objects the role applies to. + // subjects holds references to the objects the role applies to. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Subjects []Subject `json:"subjects,omitempty" protobuf:"bytes,2,rep,name=subjects"` - // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. + // roleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // +required + // +k8s:alpha(since:"1.37")=+k8s:immutable RoleRef RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` } @@ -160,7 +161,7 @@ type RoleBinding struct { // RoleBindingList is a collection of RoleBindings // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBindingList, and will no longer be served in v1.22. type RoleBindingList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -174,7 +175,7 @@ type RoleBindingList struct { // RoleList is a collection of Roles. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleList, and will no longer be served in v1.22. type RoleList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -190,18 +191,18 @@ type RoleList struct { // ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRole, and will no longer be served in v1.22. type ClusterRole struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object's metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Rules holds all the PolicyRules for this ClusterRole + // rules holds all the PolicyRules for this ClusterRole // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Rules []PolicyRule `json:"rules" protobuf:"bytes,2,rep,name=rules"` - // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. + // aggregationRule is an optional field that describes how to build the Rules for this ClusterRole. // If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be // stomped by the controller. // +optional @@ -210,7 +211,7 @@ type ClusterRole struct { // AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole type AggregationRule struct { - // ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. + // clusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. // If any of the selectors match, then the ClusterRole's permissions will be added // +optional // +listType=atomic @@ -225,20 +226,21 @@ type AggregationRule struct { // and adds who information via Subject. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBinding, and will no longer be served in v1.22. type ClusterRoleBinding struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object's metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Subjects holds references to the objects the role applies to. + // subjects holds references to the objects the role applies to. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Subjects []Subject `json:"subjects,omitempty" protobuf:"bytes,2,rep,name=subjects"` - // RoleRef can only reference a ClusterRole in the global namespace. + // roleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // +required + // +k8s:alpha(since:"1.37")=+k8s:immutable RoleRef RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` } @@ -247,7 +249,7 @@ type ClusterRoleBinding struct { // ClusterRoleBindingList is a collection of ClusterRoleBindings. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBindings, and will no longer be served in v1.22. type ClusterRoleBindingList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -261,7 +263,7 @@ type ClusterRoleBindingList struct { // ClusterRoleList is a collection of ClusterRoles. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoles, and will no longer be served in v1.22. type ClusterRoleList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` diff --git a/vendor/k8s.io/api/rbac/v1alpha1/types_swagger_doc_generated.go b/vendor/k8s.io/api/rbac/v1alpha1/types_swagger_doc_generated.go index 6708f3e58e..03d69326d6 100644 --- a/vendor/k8s.io/api/rbac/v1alpha1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/rbac/v1alpha1/types_swagger_doc_generated.go @@ -29,7 +29,7 @@ package v1alpha1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_AggregationRule = map[string]string{ "": "AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole", - "clusterRoleSelectors": "ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. If any of the selectors match, then the ClusterRole's permissions will be added", + "clusterRoleSelectors": "clusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. If any of the selectors match, then the ClusterRole's permissions will be added", } func (AggregationRule) SwaggerDoc() map[string]string { @@ -38,9 +38,9 @@ func (AggregationRule) SwaggerDoc() map[string]string { var map_ClusterRole = map[string]string{ "": "ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRole, and will no longer be served in v1.22.", - "metadata": "Standard object's metadata.", - "rules": "Rules holds all the PolicyRules for this ClusterRole", - "aggregationRule": "AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be stomped by the controller.", + "metadata": "metadata is the standard object's metadata.", + "rules": "rules holds all the PolicyRules for this ClusterRole", + "aggregationRule": "aggregationRule is an optional field that describes how to build the Rules for this ClusterRole. If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be stomped by the controller.", } func (ClusterRole) SwaggerDoc() map[string]string { @@ -49,9 +49,9 @@ func (ClusterRole) SwaggerDoc() map[string]string { var map_ClusterRoleBinding = map[string]string{ "": "ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBinding, and will no longer be served in v1.22.", - "metadata": "Standard object's metadata.", - "subjects": "Subjects holds references to the objects the role applies to.", - "roleRef": "RoleRef can only reference a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.", + "metadata": "metadata is the standard object's metadata.", + "subjects": "subjects holds references to the objects the role applies to.", + "roleRef": "roleRef can only reference a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.", } func (ClusterRoleBinding) SwaggerDoc() map[string]string { @@ -80,11 +80,11 @@ func (ClusterRoleList) SwaggerDoc() map[string]string { var map_PolicyRule = map[string]string{ "": "PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.", - "verbs": "Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs.", - "apiGroups": "APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. \"\" represents the core API group and \"*\" represents all API groups.", - "resources": "Resources is a list of resources this rule applies to. '*' represents all resources.", - "resourceNames": "ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.", - "nonResourceURLs": "NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as \"pods\" or \"secrets\") or non-resource URL paths (such as \"/api\"), but not both.", + "verbs": "verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs.", + "apiGroups": "apiGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. \"\" represents the core API group and \"*\" represents all API groups.", + "resources": "resources is a list of resources this rule applies to. '*' represents all resources.", + "resourceNames": "resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.", + "nonResourceURLs": "nonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as \"pods\" or \"secrets\") or non-resource URL paths (such as \"/api\"), but not both.", } func (PolicyRule) SwaggerDoc() map[string]string { @@ -93,8 +93,8 @@ func (PolicyRule) SwaggerDoc() map[string]string { var map_Role = map[string]string{ "": "Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 Role, and will no longer be served in v1.22.", - "metadata": "Standard object's metadata.", - "rules": "Rules holds all the PolicyRules for this Role", + "metadata": "metadata is the standard object's metadata.", + "rules": "rules holds all the PolicyRules for this Role", } func (Role) SwaggerDoc() map[string]string { @@ -103,9 +103,9 @@ func (Role) SwaggerDoc() map[string]string { var map_RoleBinding = map[string]string{ "": "RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given namespace only have effect in that namespace. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBinding, and will no longer be served in v1.22.", - "metadata": "Standard object's metadata.", - "subjects": "Subjects holds references to the objects the role applies to.", - "roleRef": "RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.", + "metadata": "metadata is the standard object's metadata.", + "subjects": "subjects holds references to the objects the role applies to.", + "roleRef": "roleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.", } func (RoleBinding) SwaggerDoc() map[string]string { @@ -134,9 +134,9 @@ func (RoleList) SwaggerDoc() map[string]string { var map_RoleRef = map[string]string{ "": "RoleRef contains information that points to the role being used", - "apiGroup": "APIGroup is the group for the resource being referenced", - "kind": "Kind is the type of resource being referenced", - "name": "Name is the name of resource being referenced", + "apiGroup": "apiGroup is the group for the resource being referenced", + "kind": "kind is the type of resource being referenced", + "name": "name is the name of resource being referenced", } func (RoleRef) SwaggerDoc() map[string]string { @@ -145,10 +145,10 @@ func (RoleRef) SwaggerDoc() map[string]string { var map_Subject = map[string]string{ "": "Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, or a value for non-objects such as user and group names.", - "kind": "Kind of object being referenced. Values defined by this API group are \"User\", \"Group\", and \"ServiceAccount\". If the Authorizer does not recognized the kind value, the Authorizer should report an error.", - "apiVersion": "APIVersion holds the API group and version of the referenced subject. Defaults to \"v1\" for ServiceAccount subjects. Defaults to \"rbac.authorization.k8s.io/v1alpha1\" for User and Group subjects.", - "name": "Name of the object being referenced.", - "namespace": "Namespace of the referenced object. If the object kind is non-namespace, such as \"User\" or \"Group\", and this value is not empty the Authorizer should report an error.", + "kind": "kind of object being referenced. Values defined by this API group are \"User\", \"Group\", and \"ServiceAccount\". If the Authorizer does not recognized the kind value, the Authorizer should report an error.", + "apiVersion": "apiVersion holds the API group and version of the referenced subject. Defaults to \"v1\" for ServiceAccount subjects. Defaults to \"rbac.authorization.k8s.io/v1alpha1\" for User and Group subjects.", + "name": "name of the object being referenced.", + "namespace": "namespace of the referenced object. If the object kind is non-namespace, such as \"User\" or \"Group\", and this value is not empty the Authorizer should report an error.", } func (Subject) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/rbac/v1beta1/generated.proto b/vendor/k8s.io/api/rbac/v1beta1/generated.proto index 326f312ec4..d459646be8 100644 --- a/vendor/k8s.io/api/rbac/v1beta1/generated.proto +++ b/vendor/k8s.io/api/rbac/v1beta1/generated.proto @@ -30,7 +30,7 @@ option go_package = "k8s.io/api/rbac/v1beta1"; // AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole message AggregationRule { - // ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. + // clusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. // If any of the selectors match, then the ClusterRole's permissions will be added // +optional // +listType=atomic @@ -40,17 +40,17 @@ message AggregationRule { // ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRole, and will no longer be served in v1.22. message ClusterRole { - // Standard object's metadata. + // metadata is the standard object's metadata. // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Rules holds all the PolicyRules for this ClusterRole + // rules holds all the PolicyRules for this ClusterRole // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated PolicyRule rules = 2; - // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. + // aggregationRule is an optional field that describes how to build the Rules for this ClusterRole. // If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be // stomped by the controller. // +optional @@ -61,19 +61,20 @@ message ClusterRole { // and adds who information via Subject. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBinding, and will no longer be served in v1.22. message ClusterRoleBinding { - // Standard object's metadata. + // metadata is the standard object's metadata. // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Subjects holds references to the objects the role applies to. + // subjects holds references to the objects the role applies to. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated Subject subjects = 2; - // RoleRef can only reference a ClusterRole in the global namespace. + // roleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // +required + // +k8s:alpha(since:"1.37")=+k8s:immutable optional RoleRef roleRef = 3; } @@ -102,30 +103,30 @@ message ClusterRoleList { // PolicyRule holds information that describes a policy rule, but does not contain information // about who the rule applies to or which namespace the rule applies to. message PolicyRule { - // Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. + // verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. // +listType=atomic // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required repeated string verbs = 1; - // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of + // apiGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of // the enumerated resources in any API group will be allowed. "" represents the core API group and "*" represents all API groups. // +optional // +listType=atomic repeated string apiGroups = 2; - // Resources is a list of resources this rule applies to. '*' represents all resources in the specified apiGroups. + // resources is a list of resources this rule applies to. '*' represents all resources in the specified apiGroups. // '*/foo' represents the subresource 'foo' for all resources in the specified apiGroups. // +optional // +listType=atomic repeated string resources = 3; - // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. + // resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. // +optional // +listType=atomic repeated string resourceNames = 4; - // NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path + // nonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path // Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. // Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. // +optional @@ -136,14 +137,14 @@ message PolicyRule { // Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 Role, and will no longer be served in v1.22. message Role { - // Standard object's metadata. + // metadata is the standard object's metadata. // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Rules holds all the PolicyRules for this Role + // rules holds all the PolicyRules for this Role // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated PolicyRule rules = 2; } @@ -152,19 +153,20 @@ message Role { // namespace only have effect in that namespace. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBinding, and will no longer be served in v1.22. message RoleBinding { - // Standard object's metadata. + // metadata is the standard object's metadata. // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Subjects holds references to the objects the role applies to. + // subjects holds references to the objects the role applies to. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated Subject subjects = 2; - // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. + // roleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // +required + // +k8s:alpha(since:"1.37")=+k8s:immutable optional RoleRef roleRef = 3; } @@ -192,40 +194,40 @@ message RoleList { // RoleRef contains information that points to the role being used message RoleRef { - // APIGroup is the group for the resource being referenced + // apiGroup is the group for the resource being referenced // +optional optional string apiGroup = 1; - // Kind is the type of resource being referenced + // kind is the type of resource being referenced // +required optional string kind = 2; - // Name is the name of resource being referenced + // name is the name of resource being referenced // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string name = 3; } // Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, // or a value for non-objects such as user and group names. message Subject { - // Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". + // kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". // If the Authorizer does not recognized the kind value, the Authorizer should report an error. // +required optional string kind = 1; - // APIGroup holds the API group of the referenced subject. + // apiGroup holds the API group of the referenced subject. // Defaults to "" for ServiceAccount subjects. // Defaults to "rbac.authorization.k8s.io" for User and Group subjects. // +optional optional string apiGroup = 2; - // Name of the object being referenced. + // name of the object being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string name = 3; - // Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty + // namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty // the Authorizer should report an error. // +optional optional string namespace = 4; diff --git a/vendor/k8s.io/api/rbac/v1beta1/types.go b/vendor/k8s.io/api/rbac/v1beta1/types.go index c653d071fe..a635661a8d 100644 --- a/vendor/k8s.io/api/rbac/v1beta1/types.go +++ b/vendor/k8s.io/api/rbac/v1beta1/types.go @@ -47,28 +47,28 @@ const ( // PolicyRule holds information that describes a policy rule, but does not contain information // about who the rule applies to or which namespace the rule applies to. type PolicyRule struct { - // Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. + // verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. // +listType=atomic // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` - // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of + // apiGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of // the enumerated resources in any API group will be allowed. "" represents the core API group and "*" represents all API groups. // +optional // +listType=atomic APIGroups []string `json:"apiGroups,omitempty" protobuf:"bytes,2,rep,name=apiGroups"` - // Resources is a list of resources this rule applies to. '*' represents all resources in the specified apiGroups. + // resources is a list of resources this rule applies to. '*' represents all resources in the specified apiGroups. // '*/foo' represents the subresource 'foo' for all resources in the specified apiGroups. // +optional // +listType=atomic Resources []string `json:"resources,omitempty" protobuf:"bytes,3,rep,name=resources"` - // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. + // resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. // +optional // +listType=atomic ResourceNames []string `json:"resourceNames,omitempty" protobuf:"bytes,4,rep,name=resourceNames"` - // NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path + // nonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path // Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. // Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. // +optional @@ -79,20 +79,20 @@ type PolicyRule struct { // Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, // or a value for non-objects such as user and group names. type Subject struct { - // Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". + // kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". // If the Authorizer does not recognized the kind value, the Authorizer should report an error. // +required Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` - // APIGroup holds the API group of the referenced subject. + // apiGroup holds the API group of the referenced subject. // Defaults to "" for ServiceAccount subjects. // Defaults to "rbac.authorization.k8s.io" for User and Group subjects. // +optional APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,2,opt,name=apiGroup"` - // Name of the object being referenced. + // name of the object being referenced. // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Name string `json:"name" protobuf:"bytes,3,opt,name=name"` - // Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty + // namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty // the Authorizer should report an error. // +optional Namespace string `json:"namespace,omitempty" protobuf:"bytes,4,opt,name=namespace"` @@ -100,15 +100,15 @@ type Subject struct { // RoleRef contains information that points to the role being used type RoleRef struct { - // APIGroup is the group for the resource being referenced + // apiGroup is the group for the resource being referenced // +optional APIGroup string `json:"apiGroup" protobuf:"bytes,1,opt,name=apiGroup"` - // Kind is the type of resource being referenced + // kind is the type of resource being referenced // +required Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"` - // Name is the name of resource being referenced + // name is the name of resource being referenced // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Name string `json:"name" protobuf:"bytes,3,opt,name=name"` } @@ -122,15 +122,15 @@ type RoleRef struct { // Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 Role, and will no longer be served in v1.22. type Role struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object's metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Rules holds all the PolicyRules for this Role + // rules holds all the PolicyRules for this Role // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Rules []PolicyRule `json:"rules" protobuf:"bytes,2,rep,name=rules"` } @@ -146,20 +146,21 @@ type Role struct { // namespace only have effect in that namespace. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBinding, and will no longer be served in v1.22. type RoleBinding struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object's metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Subjects holds references to the objects the role applies to. + // subjects holds references to the objects the role applies to. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Subjects []Subject `json:"subjects,omitempty" protobuf:"bytes,2,rep,name=subjects"` - // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. + // roleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // +required + // +k8s:alpha(since:"1.37")=+k8s:immutable RoleRef RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` } @@ -172,7 +173,7 @@ type RoleBinding struct { // RoleBindingList is a collection of RoleBindings // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBindingList, and will no longer be served in v1.22. type RoleBindingList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -190,7 +191,7 @@ type RoleBindingList struct { // RoleList is a collection of Roles // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleList, and will no longer be served in v1.22. type RoleList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -210,17 +211,17 @@ type RoleList struct { // ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRole, and will no longer be served in v1.22. type ClusterRole struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object's metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Rules holds all the PolicyRules for this ClusterRole + // rules holds all the PolicyRules for this ClusterRole // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Rules []PolicyRule `json:"rules" protobuf:"bytes,2,rep,name=rules"` - // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. + // aggregationRule is an optional field that describes how to build the Rules for this ClusterRole. // If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be // stomped by the controller. // +optional @@ -229,7 +230,7 @@ type ClusterRole struct { // AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole type AggregationRule struct { - // ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. + // clusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. // If any of the selectors match, then the ClusterRole's permissions will be added // +optional // +listType=atomic @@ -248,20 +249,21 @@ type AggregationRule struct { // and adds who information via Subject. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBinding, and will no longer be served in v1.22. type ClusterRoleBinding struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object's metadata. // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Subjects holds references to the objects the role applies to. + // subjects holds references to the objects the role applies to. // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Subjects []Subject `json:"subjects,omitempty" protobuf:"bytes,2,rep,name=subjects"` - // RoleRef can only reference a ClusterRole in the global namespace. + // roleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // +required + // +k8s:alpha(since:"1.37")=+k8s:immutable RoleRef RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` } @@ -274,7 +276,7 @@ type ClusterRoleBinding struct { // ClusterRoleBindingList is a collection of ClusterRoleBindings. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBindingList, and will no longer be served in v1.22. type ClusterRoleBindingList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -292,7 +294,7 @@ type ClusterRoleBindingList struct { // ClusterRoleList is a collection of ClusterRoles. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoles, and will no longer be served in v1.22. type ClusterRoleList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata. // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` diff --git a/vendor/k8s.io/api/rbac/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/rbac/v1beta1/types_swagger_doc_generated.go index fff1fe40fa..0b03d85e62 100644 --- a/vendor/k8s.io/api/rbac/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/rbac/v1beta1/types_swagger_doc_generated.go @@ -29,7 +29,7 @@ package v1beta1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_AggregationRule = map[string]string{ "": "AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole", - "clusterRoleSelectors": "ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. If any of the selectors match, then the ClusterRole's permissions will be added", + "clusterRoleSelectors": "clusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. If any of the selectors match, then the ClusterRole's permissions will be added", } func (AggregationRule) SwaggerDoc() map[string]string { @@ -38,9 +38,9 @@ func (AggregationRule) SwaggerDoc() map[string]string { var map_ClusterRole = map[string]string{ "": "ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRole, and will no longer be served in v1.22.", - "metadata": "Standard object's metadata.", - "rules": "Rules holds all the PolicyRules for this ClusterRole", - "aggregationRule": "AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be stomped by the controller.", + "metadata": "metadata is the standard object's metadata.", + "rules": "rules holds all the PolicyRules for this ClusterRole", + "aggregationRule": "aggregationRule is an optional field that describes how to build the Rules for this ClusterRole. If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be stomped by the controller.", } func (ClusterRole) SwaggerDoc() map[string]string { @@ -49,9 +49,9 @@ func (ClusterRole) SwaggerDoc() map[string]string { var map_ClusterRoleBinding = map[string]string{ "": "ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBinding, and will no longer be served in v1.22.", - "metadata": "Standard object's metadata.", - "subjects": "Subjects holds references to the objects the role applies to.", - "roleRef": "RoleRef can only reference a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.", + "metadata": "metadata is the standard object's metadata.", + "subjects": "subjects holds references to the objects the role applies to.", + "roleRef": "roleRef can only reference a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.", } func (ClusterRoleBinding) SwaggerDoc() map[string]string { @@ -80,11 +80,11 @@ func (ClusterRoleList) SwaggerDoc() map[string]string { var map_PolicyRule = map[string]string{ "": "PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.", - "verbs": "Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs.", - "apiGroups": "APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. \"\" represents the core API group and \"*\" represents all API groups.", - "resources": "Resources is a list of resources this rule applies to. '*' represents all resources in the specified apiGroups. '*/foo' represents the subresource 'foo' for all resources in the specified apiGroups.", - "resourceNames": "ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.", - "nonResourceURLs": "NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as \"pods\" or \"secrets\") or non-resource URL paths (such as \"/api\"), but not both.", + "verbs": "verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs.", + "apiGroups": "apiGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. \"\" represents the core API group and \"*\" represents all API groups.", + "resources": "resources is a list of resources this rule applies to. '*' represents all resources in the specified apiGroups. '*/foo' represents the subresource 'foo' for all resources in the specified apiGroups.", + "resourceNames": "resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.", + "nonResourceURLs": "nonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as \"pods\" or \"secrets\") or non-resource URL paths (such as \"/api\"), but not both.", } func (PolicyRule) SwaggerDoc() map[string]string { @@ -93,8 +93,8 @@ func (PolicyRule) SwaggerDoc() map[string]string { var map_Role = map[string]string{ "": "Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 Role, and will no longer be served in v1.22.", - "metadata": "Standard object's metadata.", - "rules": "Rules holds all the PolicyRules for this Role", + "metadata": "metadata is the standard object's metadata.", + "rules": "rules holds all the PolicyRules for this Role", } func (Role) SwaggerDoc() map[string]string { @@ -103,9 +103,9 @@ func (Role) SwaggerDoc() map[string]string { var map_RoleBinding = map[string]string{ "": "RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given namespace only have effect in that namespace. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBinding, and will no longer be served in v1.22.", - "metadata": "Standard object's metadata.", - "subjects": "Subjects holds references to the objects the role applies to.", - "roleRef": "RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.", + "metadata": "metadata is the standard object's metadata.", + "subjects": "subjects holds references to the objects the role applies to.", + "roleRef": "roleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.", } func (RoleBinding) SwaggerDoc() map[string]string { @@ -134,9 +134,9 @@ func (RoleList) SwaggerDoc() map[string]string { var map_RoleRef = map[string]string{ "": "RoleRef contains information that points to the role being used", - "apiGroup": "APIGroup is the group for the resource being referenced", - "kind": "Kind is the type of resource being referenced", - "name": "Name is the name of resource being referenced", + "apiGroup": "apiGroup is the group for the resource being referenced", + "kind": "kind is the type of resource being referenced", + "name": "name is the name of resource being referenced", } func (RoleRef) SwaggerDoc() map[string]string { @@ -145,10 +145,10 @@ func (RoleRef) SwaggerDoc() map[string]string { var map_Subject = map[string]string{ "": "Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, or a value for non-objects such as user and group names.", - "kind": "Kind of object being referenced. Values defined by this API group are \"User\", \"Group\", and \"ServiceAccount\". If the Authorizer does not recognized the kind value, the Authorizer should report an error.", - "apiGroup": "APIGroup holds the API group of the referenced subject. Defaults to \"\" for ServiceAccount subjects. Defaults to \"rbac.authorization.k8s.io\" for User and Group subjects.", - "name": "Name of the object being referenced.", - "namespace": "Namespace of the referenced object. If the object kind is non-namespace, such as \"User\" or \"Group\", and this value is not empty the Authorizer should report an error.", + "kind": "kind of object being referenced. Values defined by this API group are \"User\", \"Group\", and \"ServiceAccount\". If the Authorizer does not recognized the kind value, the Authorizer should report an error.", + "apiGroup": "apiGroup holds the API group of the referenced subject. Defaults to \"\" for ServiceAccount subjects. Defaults to \"rbac.authorization.k8s.io\" for User and Group subjects.", + "name": "name of the object being referenced.", + "namespace": "namespace of the referenced object. If the object kind is non-namespace, such as \"User\" or \"Group\", and this value is not empty the Authorizer should report an error.", } func (Subject) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/resource/v1/doc.go b/vendor/k8s.io/api/resource/v1/doc.go index 645c1cb53f..b3a5d93d13 100644 --- a/vendor/k8s.io/api/resource/v1/doc.go +++ b/vendor/k8s.io/api/resource/v1/doc.go @@ -20,6 +20,10 @@ limitations under the License. // +k8s:prerelease-lifecycle-gen=true // +k8s:openapi-model-package=io.k8s.api.resource.v1 // +groupName=resource.k8s.io +// +k8s:validation-gen=TypesWithSuffix=DeviceAttribute +// +k8s:validation-gen=TypesWithSuffix=NetworkDeviceData +// +k8s:validation-gen-input=k8s.io/api/resource/v1 +// +k8s:validation-gen-scheme-registry=nil // Package v1 is the v1 version of the resource API. package v1 diff --git a/vendor/k8s.io/api/resource/v1/generated.pb.go b/vendor/k8s.io/api/resource/v1/generated.pb.go index f59e829057..c0099e888d 100644 --- a/vendor/k8s.io/api/resource/v1/generated.pb.go +++ b/vendor/k8s.io/api/resource/v1/generated.pb.go @@ -82,6 +82,8 @@ func (m *DeviceConstraint) Reset() { *m = DeviceConstraint{} } func (m *DeviceCounterConsumption) Reset() { *m = DeviceCounterConsumption{} } +func (m *DeviceDerivedAttribute) Reset() { *m = DeviceDerivedAttribute{} } + func (m *DeviceRequest) Reset() { *m = DeviceRequest{} } func (m *DeviceRequestAllocationResult) Reset() { *m = DeviceRequestAllocationResult{} } @@ -92,13 +94,27 @@ func (m *DeviceSubRequest) Reset() { *m = DeviceSubRequest{} } func (m *DeviceTaint) Reset() { *m = DeviceTaint{} } +func (m *DeviceTaintRule) Reset() { *m = DeviceTaintRule{} } + +func (m *DeviceTaintRuleList) Reset() { *m = DeviceTaintRuleList{} } + +func (m *DeviceTaintRuleSpec) Reset() { *m = DeviceTaintRuleSpec{} } + +func (m *DeviceTaintRuleStatus) Reset() { *m = DeviceTaintRuleStatus{} } + +func (m *DeviceTaintSelector) Reset() { *m = DeviceTaintSelector{} } + func (m *DeviceToleration) Reset() { *m = DeviceToleration{} } func (m *ExactDeviceRequest) Reset() { *m = ExactDeviceRequest{} } func (m *NetworkDeviceData) Reset() { *m = NetworkDeviceData{} } -func (m *NodeAllocatableResourceMapping) Reset() { *m = NodeAllocatableResourceMapping{} } +func (m *NodeAllocatableMapping) Reset() { *m = NodeAllocatableMapping{} } + +func (m *NodeAllocatableOverhead) Reset() { *m = NodeAllocatableOverhead{} } + +func (m *NodeAllocatableResource) Reset() { *m = NodeAllocatableResource{} } func (m *OpaqueDeviceConfiguration) Reset() { *m = OpaqueDeviceConfiguration{} } @@ -576,14 +592,14 @@ func (m *Device) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.NodeAllocatableResourceMappings) > 0 { - keysForNodeAllocatableResourceMappings := make([]string, 0, len(m.NodeAllocatableResourceMappings)) - for k := range m.NodeAllocatableResourceMappings { - keysForNodeAllocatableResourceMappings = append(keysForNodeAllocatableResourceMappings, string(k)) - } - sort.Strings(keysForNodeAllocatableResourceMappings) - for iNdEx := len(keysForNodeAllocatableResourceMappings) - 1; iNdEx >= 0; iNdEx-- { - v := m.NodeAllocatableResourceMappings[k8s_io_api_core_v1.ResourceName(keysForNodeAllocatableResourceMappings[iNdEx])] + if len(m.NodeAllocatableResources) > 0 { + keysForNodeAllocatableResources := make([]string, 0, len(m.NodeAllocatableResources)) + for k := range m.NodeAllocatableResources { + keysForNodeAllocatableResources = append(keysForNodeAllocatableResources, string(k)) + } + sort.Strings(keysForNodeAllocatableResources) + for iNdEx := len(keysForNodeAllocatableResources) - 1; iNdEx >= 0; iNdEx-- { + v := m.NodeAllocatableResources[k8s_io_api_core_v1.ResourceName(keysForNodeAllocatableResources[iNdEx])] baseI := i { size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) @@ -595,14 +611,14 @@ func (m *Device) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x12 - i -= len(keysForNodeAllocatableResourceMappings[iNdEx]) - copy(dAtA[i:], keysForNodeAllocatableResourceMappings[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(keysForNodeAllocatableResourceMappings[iNdEx]))) + i -= len(keysForNodeAllocatableResources[iNdEx]) + copy(dAtA[i:], keysForNodeAllocatableResources[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForNodeAllocatableResources[iNdEx]))) i-- dAtA[i] = 0xa i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) i-- - dAtA[i] = 0x6a + dAtA[i] = 0x72 } } if m.AllowMultipleAllocations != nil { @@ -1387,6 +1403,15 @@ func (m *DeviceCounterConsumption) MarshalToSizedBuffer(dAtA []byte) (int, error _ = i var l int _ = l + if len(m.CompatibilityGroups) > 0 { + for iNdEx := len(m.CompatibilityGroups) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CompatibilityGroups[iNdEx]) + copy(dAtA[i:], m.CompatibilityGroups[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.CompatibilityGroups[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } if len(m.Counters) > 0 { keysForCounters := make([]string, 0, len(m.Counters)) for k := range m.Counters { @@ -1424,6 +1449,39 @@ func (m *DeviceCounterConsumption) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *DeviceDerivedAttribute) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeviceDerivedAttribute) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeviceDerivedAttribute) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Expression) + copy(dAtA[i:], m.Expression) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Expression))) + i-- + dAtA[i] = 0x12 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *DeviceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1498,6 +1556,15 @@ func (m *DeviceRequestAllocationResult) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l + if len(m.SkipNodeOperations) > 0 { + for iNdEx := len(m.SkipNodeOperations) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SkipNodeOperations[iNdEx]) + copy(dAtA[i:], m.SkipNodeOperations[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SkipNodeOperations[iNdEx]))) + i-- + dAtA[i] = 0x5a + } + } if len(m.ConsumedCapacity) > 0 { keysForConsumedCapacity := make([]string, 0, len(m.ConsumedCapacity)) for k := range m.ConsumedCapacity { @@ -1654,6 +1721,20 @@ func (m *DeviceSubRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.DerivedAttributes) > 0 { + for iNdEx := len(m.DerivedAttributes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DerivedAttributes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } if m.Capacity != nil { { size, err := m.Capacity.MarshalToSizedBuffer(dAtA[:i]) @@ -1765,7 +1846,7 @@ func (m *DeviceTaint) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *DeviceToleration) Marshal() (dAtA []byte, err error) { +func (m *DeviceTaintRule) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1775,45 +1856,50 @@ func (m *DeviceToleration) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DeviceToleration) MarshalTo(dAtA []byte) (int, error) { +func (m *DeviceTaintRule) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *DeviceToleration) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeviceTaintRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.TolerationSeconds != nil { - i = encodeVarintGenerated(dAtA, i, uint64(*m.TolerationSeconds)) - i-- - dAtA[i] = 0x28 + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i -= len(m.Effect) - copy(dAtA[i:], m.Effect) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Effect))) - i-- - dAtA[i] = 0x22 - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Value))) i-- dAtA[i] = 0x1a - i -= len(m.Operator) - copy(dAtA[i:], m.Operator) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Operator))) + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x12 - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Key))) + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ExactDeviceRequest) Marshal() (dAtA []byte, err error) { +func (m *DeviceTaintRuleList) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1823,32 +1909,20 @@ func (m *ExactDeviceRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ExactDeviceRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *DeviceTaintRuleList) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ExactDeviceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeviceTaintRuleList) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Capacity != nil { - { - size, err := m.Capacity.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if len(m.Tolerations) > 0 { - for iNdEx := len(m.Tolerations) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Tolerations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1856,50 +1930,23 @@ func (m *ExactDeviceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x32 - } - } - if m.AdminAccess != nil { - i-- - if *m.AdminAccess { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + dAtA[i] = 0x12 } - i-- - dAtA[i] = 0x28 } - i = encodeVarintGenerated(dAtA, i, uint64(m.Count)) - i-- - dAtA[i] = 0x20 - i -= len(m.AllocationMode) - copy(dAtA[i:], m.AllocationMode) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.AllocationMode))) - i-- - dAtA[i] = 0x1a - if len(m.Selectors) > 0 { - for iNdEx := len(m.Selectors) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Selectors[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i -= len(m.DeviceClassName) - copy(dAtA[i:], m.DeviceClassName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeviceClassName))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *NetworkDeviceData) Marshal() (dAtA []byte, err error) { +func (m *DeviceTaintRuleSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1909,39 +1956,42 @@ func (m *NetworkDeviceData) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *NetworkDeviceData) MarshalTo(dAtA []byte) (int, error) { +func (m *DeviceTaintRuleSpec) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *NetworkDeviceData) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeviceTaintRuleSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - i -= len(m.HardwareAddress) - copy(dAtA[i:], m.HardwareAddress) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.HardwareAddress))) - i-- - dAtA[i] = 0x1a - if len(m.IPs) > 0 { - for iNdEx := len(m.IPs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.IPs[iNdEx]) - copy(dAtA[i:], m.IPs[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.IPs[iNdEx]))) - i-- - dAtA[i] = 0x12 + { + size, err := m.Taint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i -= len(m.InterfaceName) - copy(dAtA[i:], m.InterfaceName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.InterfaceName))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + if m.DeviceSelector != nil { + { + size, err := m.DeviceSelector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *NodeAllocatableResourceMapping) Marshal() (dAtA []byte, err error) { +func (m *DeviceTaintRuleStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1951,39 +2001,34 @@ func (m *NodeAllocatableResourceMapping) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *NodeAllocatableResourceMapping) MarshalTo(dAtA []byte) (int, error) { +func (m *DeviceTaintRuleStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *NodeAllocatableResourceMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeviceTaintRuleStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.AllocationMultiplier != nil { - { - size, err := m.AllocationMultiplier.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Conditions) > 0 { + for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0x12 - } - if m.CapacityKey != nil { - i -= len(*m.CapacityKey) - copy(dAtA[i:], *m.CapacityKey) - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.CapacityKey))) - i-- - dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *OpaqueDeviceConfiguration) Marshal() (dAtA []byte, err error) { +func (m *DeviceTaintSelector) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1993,35 +2038,41 @@ func (m *OpaqueDeviceConfiguration) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *OpaqueDeviceConfiguration) MarshalTo(dAtA []byte) (int, error) { +func (m *DeviceTaintSelector) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *OpaqueDeviceConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeviceTaintSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Parameters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + if m.Device != nil { + i -= len(*m.Device) + copy(dAtA[i:], *m.Device) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Device))) + i-- + dAtA[i] = 0x22 + } + if m.Pool != nil { + i -= len(*m.Pool) + copy(dAtA[i:], *m.Pool) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Pool))) + i-- + dAtA[i] = 0x1a + } + if m.Driver != nil { + i -= len(*m.Driver) + copy(dAtA[i:], *m.Driver) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Driver))) + i-- + dAtA[i] = 0x12 } - i-- - dAtA[i] = 0x12 - i -= len(m.Driver) - copy(dAtA[i:], m.Driver) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Driver))) - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ResourceClaim) Marshal() (dAtA []byte, err error) { +func (m *DeviceToleration) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2031,50 +2082,45 @@ func (m *ResourceClaim) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClaim) MarshalTo(dAtA []byte) (int, error) { +func (m *DeviceToleration) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DeviceToleration) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + if m.TolerationSeconds != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.TolerationSeconds)) + i-- + dAtA[i] = 0x28 } + i -= len(m.Effect) + copy(dAtA[i:], m.Effect) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Effect))) + i-- + dAtA[i] = 0x22 + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Value))) i-- dAtA[i] = 0x1a - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Operator))) i-- dAtA[i] = 0x12 - { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Key))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ResourceClaimConsumerReference) Marshal() (dAtA []byte, err error) { +func (m *ExactDeviceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2084,40 +2130,97 @@ func (m *ResourceClaimConsumerReference) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClaimConsumerReference) MarshalTo(dAtA []byte) (int, error) { +func (m *ExactDeviceRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClaimConsumerReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ExactDeviceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - i -= len(m.UID) - copy(dAtA[i:], m.UID) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.UID))) - i-- - dAtA[i] = 0x2a - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + if len(m.DerivedAttributes) > 0 { + for iNdEx := len(m.DerivedAttributes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DerivedAttributes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if m.Capacity != nil { + { + size, err := m.Capacity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if len(m.Tolerations) > 0 { + for iNdEx := len(m.Tolerations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tolerations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if m.AdminAccess != nil { + i-- + if *m.AdminAccess { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + i = encodeVarintGenerated(dAtA, i, uint64(m.Count)) i-- - dAtA[i] = 0x22 - i -= len(m.Resource) - copy(dAtA[i:], m.Resource) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Resource))) + dAtA[i] = 0x20 + i -= len(m.AllocationMode) + copy(dAtA[i:], m.AllocationMode) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.AllocationMode))) i-- dAtA[i] = 0x1a - i -= len(m.APIGroup) - copy(dAtA[i:], m.APIGroup) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIGroup))) + if len(m.Selectors) > 0 { + for iNdEx := len(m.Selectors) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Selectors[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.DeviceClassName) + copy(dAtA[i:], m.DeviceClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.DeviceClassName))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ResourceClaimList) Marshal() (dAtA []byte, err error) { +func (m *NetworkDeviceData) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2127,44 +2230,39 @@ func (m *ResourceClaimList) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClaimList) MarshalTo(dAtA []byte) (int, error) { +func (m *NetworkDeviceData) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClaimList) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *NetworkDeviceData) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } + i -= len(m.HardwareAddress) + copy(dAtA[i:], m.HardwareAddress) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.HardwareAddress))) + i-- + dAtA[i] = 0x1a + if len(m.IPs) > 0 { + for iNdEx := len(m.IPs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.IPs[iNdEx]) + copy(dAtA[i:], m.IPs[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.IPs[iNdEx]))) i-- dAtA[i] = 0x12 } } - { - size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } + i -= len(m.InterfaceName) + copy(dAtA[i:], m.InterfaceName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.InterfaceName))) i-- dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ResourceClaimSpec) Marshal() (dAtA []byte, err error) { +func (m *NodeAllocatableMapping) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2174,30 +2272,51 @@ func (m *ResourceClaimSpec) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClaimSpec) MarshalTo(dAtA []byte) (int, error) { +func (m *NodeAllocatableMapping) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClaimSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *NodeAllocatableMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Devices.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.DeviceMultiplier != nil { + { + size, err := m.DeviceMultiplier.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.CapacityMultiplier != nil { + { + size, err := m.CapacityMultiplier.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.CapacityKey != nil { + i -= len(*m.CapacityKey) + copy(dAtA[i:], *m.CapacityKey) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.CapacityKey))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ResourceClaimStatus) Marshal() (dAtA []byte, err error) { +func (m *NodeAllocatableOverhead) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2207,47 +2326,31 @@ func (m *ResourceClaimStatus) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClaimStatus) MarshalTo(dAtA []byte) (int, error) { +func (m *NodeAllocatableOverhead) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClaimStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *NodeAllocatableOverhead) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Devices) > 0 { - for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.ReservedFor) > 0 { - for iNdEx := len(m.ReservedFor) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ReservedFor[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + if m.PerContainer != nil { + { + size, err := m.PerContainer.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } - if m.Allocation != nil { + if m.PerPod != nil { { - size, err := m.Allocation.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.PerPod.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2260,7 +2363,7 @@ func (m *ResourceClaimStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ResourceClaimTemplate) Marshal() (dAtA []byte, err error) { +func (m *NodeAllocatableResource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2270,40 +2373,44 @@ func (m *ResourceClaimTemplate) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClaimTemplate) MarshalTo(dAtA []byte) (int, error) { +func (m *NodeAllocatableResource) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClaimTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *NodeAllocatableResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.Overhead != nil { + { + size, err := m.Overhead.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 } - i-- - dAtA[i] = 0x12 - { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.Mapping != nil { + { + size, err := m.Mapping.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ResourceClaimTemplateList) Marshal() (dAtA []byte, err error) { +func (m *OpaqueDeviceConfiguration) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2313,32 +2420,18 @@ func (m *ResourceClaimTemplateList) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClaimTemplateList) MarshalTo(dAtA []byte) (int, error) { +func (m *OpaqueDeviceConfiguration) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClaimTemplateList) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *OpaqueDeviceConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } { - size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Parameters.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2346,11 +2439,16 @@ func (m *ResourceClaimTemplateList) MarshalToSizedBuffer(dAtA []byte) (int, erro i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x12 + i -= len(m.Driver) + copy(dAtA[i:], m.Driver) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Driver))) + i-- dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ResourceClaimTemplateSpec) Marshal() (dAtA []byte, err error) { +func (m *ResourceClaim) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2360,16 +2458,26 @@ func (m *ResourceClaimTemplateSpec) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceClaimTemplateSpec) MarshalTo(dAtA []byte) (int, error) { +func (m *ResourceClaim) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceClaimTemplateSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ResourceClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a { size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -2393,7 +2501,7 @@ func (m *ResourceClaimTemplateSpec) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *ResourcePool) Marshal() (dAtA []byte, err error) { +func (m *ResourceClaimConsumerReference) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2403,31 +2511,40 @@ func (m *ResourcePool) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourcePool) MarshalTo(dAtA []byte) (int, error) { +func (m *ResourceClaimConsumerReference) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourcePool) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ResourceClaimConsumerReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - i = encodeVarintGenerated(dAtA, i, uint64(m.ResourceSliceCount)) - i-- - dAtA[i] = 0x18 - i = encodeVarintGenerated(dAtA, i, uint64(m.Generation)) + i -= len(m.UID) + copy(dAtA[i:], m.UID) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.UID))) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x2a i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) i-- + dAtA[i] = 0x22 + i -= len(m.Resource) + copy(dAtA[i:], m.Resource) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Resource))) + i-- + dAtA[i] = 0x1a + i -= len(m.APIGroup) + copy(dAtA[i:], m.APIGroup) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIGroup))) + i-- dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ResourceSlice) Marshal() (dAtA []byte, err error) { +func (m *ResourceClaimList) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2437,28 +2554,32 @@ func (m *ResourceSlice) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceSlice) MarshalTo(dAtA []byte) (int, error) { +func (m *ResourceClaimList) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceSlice) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ResourceClaimList) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x12 { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2470,7 +2591,7 @@ func (m *ResourceSlice) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ResourceSliceList) Marshal() (dAtA []byte, err error) { +func (m *ResourceClaimSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2480,32 +2601,18 @@ func (m *ResourceSliceList) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceSliceList) MarshalTo(dAtA []byte) (int, error) { +func (m *ResourceClaimSpec) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceSliceList) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ResourceClaimSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } { - size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Devices.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2517,7 +2624,7 @@ func (m *ResourceSliceList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ResourceSliceSpec) Marshal() (dAtA []byte, err error) { +func (m *ResourceClaimStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2527,20 +2634,20 @@ func (m *ResourceSliceSpec) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResourceSliceSpec) MarshalTo(dAtA []byte) (int, error) { +func (m *ResourceClaimStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ResourceSliceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ResourceClaimStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.SharedCounters) > 0 { - for iNdEx := len(m.SharedCounters) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Devices) > 0 { + for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.SharedCounters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2548,23 +2655,13 @@ func (m *ResourceSliceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x42 - } - } - if m.PerDeviceNodeSelection != nil { - i-- - if *m.PerDeviceNodeSelection { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + dAtA[i] = 0x22 } - i-- - dAtA[i] = 0x38 } - if len(m.Devices) > 0 { - for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { + if len(m.ReservedFor) > 0 { + for iNdEx := len(m.ReservedFor) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ReservedFor[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2572,22 +2669,12 @@ func (m *ResourceSliceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x32 - } - } - if m.AllNodes != nil { - i-- - if *m.AllNodes { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + dAtA[i] = 0x12 } - i-- - dAtA[i] = 0x28 } - if m.NodeSelector != nil { + if m.Allocation != nil { { - size, err := m.NodeSelector.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Allocation.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2595,17 +2682,33 @@ func (m *ResourceSliceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0xa } - if m.NodeName != nil { - i -= len(*m.NodeName) - copy(dAtA[i:], *m.NodeName) - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.NodeName))) - i-- - dAtA[i] = 0x1a + return len(dAtA) - i, nil +} + +func (m *ResourceClaimTemplate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *ResourceClaimTemplate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceClaimTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l { - size, err := m.Pool.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2614,311 +2717,651 @@ func (m *ResourceSliceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x12 - i -= len(m.Driver) - copy(dAtA[i:], m.Driver) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Driver))) + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0xa return len(dAtA) - i, nil } -func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { - offset -= sovGenerated(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *ResourceClaimTemplateList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *AllocatedDeviceStatus) Size() (n int) { - if m == nil { - return 0 - } + +func (m *ResourceClaimTemplateList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceClaimTemplateList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Driver) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Pool) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Device) - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Conditions) > 0 { - for _, e := range m.Conditions { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } } - if m.Data != nil { - l = m.Data.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.NetworkData != nil { - l = m.NetworkData.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.ShareID != nil { - l = len(*m.ShareID) - n += 1 + l + sovGenerated(uint64(l)) + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - return n + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *AllocationResult) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Devices.Size() - n += 1 + l + sovGenerated(uint64(l)) - if m.NodeSelector != nil { - l = m.NodeSelector.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.AllocationTimestamp != nil { - l = m.AllocationTimestamp.Size() - n += 1 + l + sovGenerated(uint64(l)) +func (m *ResourceClaimTemplateSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *CELDeviceSelector) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Expression) - n += 1 + l + sovGenerated(uint64(l)) - return n +func (m *ResourceClaimTemplateSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *CapacityRequestPolicy) Size() (n int) { - if m == nil { - return 0 - } +func (m *ResourceClaimTemplateSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.Default != nil { - l = m.Default.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if len(m.ValidValues) > 0 { - for _, e := range m.ValidValues { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - if m.ValidRange != nil { - l = m.ValidRange.Size() - n += 1 + l + sovGenerated(uint64(l)) + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - return n + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *CapacityRequestPolicyRange) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Min != nil { - l = m.Min.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.Max != nil { - l = m.Max.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.Step != nil { - l = m.Step.Size() - n += 1 + l + sovGenerated(uint64(l)) +func (m *ResourcePool) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *CapacityRequirements) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Requests) > 0 { - for k, v := range m.Requests { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) - } - } - return n +func (m *ResourcePool) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Counter) Size() (n int) { - if m == nil { - return 0 - } +func (m *ResourcePool) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = m.Value.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n + i = encodeVarintGenerated(dAtA, i, uint64(m.ResourceSliceCount)) + i-- + dAtA[i] = 0x18 + i = encodeVarintGenerated(dAtA, i, uint64(m.Generation)) + i-- + dAtA[i] = 0x10 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *CounterSet) Size() (n int) { - if m == nil { - return 0 +func (m *ResourceSlice) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *ResourceSlice) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceSlice) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Name) - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Counters) > 0 { - for k, v := range m.Counters { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - return n + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *Device) Size() (n int) { - if m == nil { - return 0 +func (m *ResourceSliceList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *ResourceSliceList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceSliceList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Name) - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Attributes) > 0 { - for k, v := range m.Attributes { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } } - if len(m.Capacity) > 0 { - for k, v := range m.Capacity { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - if len(m.ConsumesCounters) > 0 { - for _, e := range m.ConsumesCounters { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ResourceSliceSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResourceSliceSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceSliceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SkipNodeOperations) > 0 { + for iNdEx := len(m.SkipNodeOperations) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SkipNodeOperations[iNdEx]) + copy(dAtA[i:], m.SkipNodeOperations[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SkipNodeOperations[iNdEx]))) + i-- + dAtA[i] = 0x52 } } - if m.NodeName != nil { - l = len(*m.NodeName) - n += 1 + l + sovGenerated(uint64(l)) + if m.PartitionTypeAttribute != nil { + i -= len(*m.PartitionTypeAttribute) + copy(dAtA[i:], *m.PartitionTypeAttribute) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PartitionTypeAttribute))) + i-- + dAtA[i] = 0x4a } - if m.NodeSelector != nil { - l = m.NodeSelector.Size() - n += 1 + l + sovGenerated(uint64(l)) + if len(m.SharedCounters) > 0 { + for iNdEx := len(m.SharedCounters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SharedCounters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if m.PerDeviceNodeSelection != nil { + i-- + if *m.PerDeviceNodeSelection { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if len(m.Devices) > 0 { + for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } } if m.AllNodes != nil { - n += 2 + i-- + if *m.AllNodes { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 } - if len(m.Taints) > 0 { - for _, e := range m.Taints { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) + if m.NodeSelector != nil { + { + size, err := m.NodeSelector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x22 } - if m.BindsToNode != nil { - n += 2 + if m.NodeName != nil { + i -= len(*m.NodeName) + copy(dAtA[i:], *m.NodeName) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.NodeName))) + i-- + dAtA[i] = 0x1a } - if len(m.BindingConditions) > 0 { - for _, s := range m.BindingConditions { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) + { + size, err := m.Pool.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - if len(m.BindingFailureConditions) > 0 { - for _, s := range m.BindingFailureConditions { - l = len(s) + i-- + dAtA[i] = 0x12 + i -= len(m.Driver) + copy(dAtA[i:], m.Driver) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Driver))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { + offset -= sovGenerated(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AllocatedDeviceStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Driver) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Pool) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Device) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { + l = e.Size() n += 1 + l + sovGenerated(uint64(l)) } } - if m.AllowMultipleAllocations != nil { - n += 2 + if m.Data != nil { + l = m.Data.Size() + n += 1 + l + sovGenerated(uint64(l)) } - if len(m.NodeAllocatableResourceMappings) > 0 { - for k, v := range m.NodeAllocatableResourceMappings { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) - n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) - } + if m.NetworkData != nil { + l = m.NetworkData.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ShareID != nil { + l = len(*m.ShareID) + n += 1 + l + sovGenerated(uint64(l)) } return n } -func (m *DeviceAllocationConfiguration) Size() (n int) { +func (m *AllocationResult) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Source) + l = m.Devices.Size() n += 1 + l + sovGenerated(uint64(l)) - if len(m.Requests) > 0 { - for _, s := range m.Requests { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } + if m.NodeSelector != nil { + l = m.NodeSelector.Size() + n += 1 + l + sovGenerated(uint64(l)) } - l = m.DeviceConfiguration.Size() + if m.AllocationTimestamp != nil { + l = m.AllocationTimestamp.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *CELDeviceSelector) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Expression) n += 1 + l + sovGenerated(uint64(l)) return n } -func (m *DeviceAllocationResult) Size() (n int) { +func (m *CapacityRequestPolicy) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Results) > 0 { - for _, e := range m.Results { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } + if m.Default != nil { + l = m.Default.Size() + n += 1 + l + sovGenerated(uint64(l)) } - if len(m.Config) > 0 { - for _, e := range m.Config { + if len(m.ValidValues) > 0 { + for _, e := range m.ValidValues { l = e.Size() n += 1 + l + sovGenerated(uint64(l)) } } + if m.ValidRange != nil { + l = m.ValidRange.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } -func (m *DeviceAttribute) Size() (n int) { +func (m *CapacityRequestPolicyRange) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.IntValue != nil { - n += 1 + sovGenerated(uint64(*m.IntValue)) - } - if m.BoolValue != nil { - n += 2 + if m.Min != nil { + l = m.Min.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Max != nil { + l = m.Max.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Step != nil { + l = m.Step.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *CapacityRequirements) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Requests) > 0 { + for k, v := range m.Requests { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *Counter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Value.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *CounterSet) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Counters) > 0 { + for k, v := range m.Counters { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *Device) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Attributes) > 0 { + for k, v := range m.Attributes { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Capacity) > 0 { + for k, v := range m.Capacity { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.ConsumesCounters) > 0 { + for _, e := range m.ConsumesCounters { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.NodeName != nil { + l = len(*m.NodeName) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.NodeSelector != nil { + l = m.NodeSelector.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.AllNodes != nil { + n += 2 + } + if len(m.Taints) > 0 { + for _, e := range m.Taints { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.BindsToNode != nil { + n += 2 + } + if len(m.BindingConditions) > 0 { + for _, s := range m.BindingConditions { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.BindingFailureConditions) > 0 { + for _, s := range m.BindingFailureConditions { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.AllowMultipleAllocations != nil { + n += 2 + } + if len(m.NodeAllocatableResources) > 0 { + for k, v := range m.NodeAllocatableResources { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *DeviceAllocationConfiguration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Source) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Requests) > 0 { + for _, s := range m.Requests { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = m.DeviceConfiguration.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *DeviceAllocationResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Results) > 0 { + for _, e := range m.Results { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Config) > 0 { + for _, e := range m.Config { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *DeviceAttribute) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IntValue != nil { + n += 1 + sovGenerated(uint64(*m.IntValue)) + } + if m.BoolValue != nil { + n += 2 } if m.StringValue != nil { l = len(*m.StringValue) @@ -3129,6 +3572,25 @@ func (m *DeviceCounterConsumption) Size() (n int) { n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) } } + if len(m.CompatibilityGroups) > 0 { + for _, s := range m.CompatibilityGroups { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *DeviceDerivedAttribute) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Expression) + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -3201,6 +3663,12 @@ func (m *DeviceRequestAllocationResult) Size() (n int) { n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) } } + if len(m.SkipNodeOperations) > 0 { + for _, s := range m.SkipNodeOperations { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -3246,6 +3714,12 @@ func (m *DeviceSubRequest) Size() (n int) { l = m.Capacity.Size() n += 1 + l + sovGenerated(uint64(l)) } + if len(m.DerivedAttributes) > 0 { + for _, e := range m.DerivedAttributes { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -3268,67 +3742,156 @@ func (m *DeviceTaint) Size() (n int) { return n } -func (m *DeviceToleration) Size() (n int) { +func (m *DeviceTaintRule) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Key) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Operator) + l = m.ObjectMeta.Size() n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Value) + l = m.Spec.Size() n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Effect) + l = m.Status.Size() n += 1 + l + sovGenerated(uint64(l)) - if m.TolerationSeconds != nil { - n += 1 + sovGenerated(uint64(*m.TolerationSeconds)) - } return n } -func (m *ExactDeviceRequest) Size() (n int) { +func (m *DeviceTaintRuleList) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.DeviceClassName) + l = m.ListMeta.Size() n += 1 + l + sovGenerated(uint64(l)) - if len(m.Selectors) > 0 { - for _, e := range m.Selectors { + if len(m.Items) > 0 { + for _, e := range m.Items { l = e.Size() n += 1 + l + sovGenerated(uint64(l)) } } - l = len(m.AllocationMode) - n += 1 + l + sovGenerated(uint64(l)) - n += 1 + sovGenerated(uint64(m.Count)) - if m.AdminAccess != nil { - n += 2 - } - if len(m.Tolerations) > 0 { - for _, e := range m.Tolerations { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } + return n +} + +func (m *DeviceTaintRuleSpec) Size() (n int) { + if m == nil { + return 0 } - if m.Capacity != nil { - l = m.Capacity.Size() + var l int + _ = l + if m.DeviceSelector != nil { + l = m.DeviceSelector.Size() n += 1 + l + sovGenerated(uint64(l)) } + l = m.Taint.Size() + n += 1 + l + sovGenerated(uint64(l)) return n } -func (m *NetworkDeviceData) Size() (n int) { +func (m *DeviceTaintRuleStatus) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.InterfaceName) - n += 1 + l + sovGenerated(uint64(l)) + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *DeviceTaintSelector) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Driver != nil { + l = len(*m.Driver) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Pool != nil { + l = len(*m.Pool) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Device != nil { + l = len(*m.Device) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *DeviceToleration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Operator) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Value) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Effect) + n += 1 + l + sovGenerated(uint64(l)) + if m.TolerationSeconds != nil { + n += 1 + sovGenerated(uint64(*m.TolerationSeconds)) + } + return n +} + +func (m *ExactDeviceRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DeviceClassName) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Selectors) > 0 { + for _, e := range m.Selectors { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.AllocationMode) + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.Count)) + if m.AdminAccess != nil { + n += 2 + } + if len(m.Tolerations) > 0 { + for _, e := range m.Tolerations { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.Capacity != nil { + l = m.Capacity.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.DerivedAttributes) > 0 { + for _, e := range m.DerivedAttributes { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *NetworkDeviceData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.InterfaceName) + n += 1 + l + sovGenerated(uint64(l)) if len(m.IPs) > 0 { for _, s := range m.IPs { l = len(s) @@ -3340,7 +3903,7 @@ func (m *NetworkDeviceData) Size() (n int) { return n } -func (m *NodeAllocatableResourceMapping) Size() (n int) { +func (m *NodeAllocatableMapping) Size() (n int) { if m == nil { return 0 } @@ -3350,8 +3913,46 @@ func (m *NodeAllocatableResourceMapping) Size() (n int) { l = len(*m.CapacityKey) n += 1 + l + sovGenerated(uint64(l)) } - if m.AllocationMultiplier != nil { - l = m.AllocationMultiplier.Size() + if m.CapacityMultiplier != nil { + l = m.CapacityMultiplier.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.DeviceMultiplier != nil { + l = m.DeviceMultiplier.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NodeAllocatableOverhead) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PerPod != nil { + l = m.PerPod.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.PerContainer != nil { + l = m.PerContainer.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NodeAllocatableResource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Mapping != nil { + l = m.Mapping.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Overhead != nil { + l = m.Overhead.Size() n += 1 + l + sovGenerated(uint64(l)) } return n @@ -3577,6 +4178,16 @@ func (m *ResourceSliceSpec) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } + if m.PartitionTypeAttribute != nil { + l = len(*m.PartitionTypeAttribute) + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.SkipNodeOperations) > 0 { + for _, s := range m.SkipNodeOperations { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -3743,16 +4354,16 @@ func (this *Device) String() string { mapStringForCapacity += fmt.Sprintf("%v: %v,", k, this.Capacity[QualifiedName(k)]) } mapStringForCapacity += "}" - keysForNodeAllocatableResourceMappings := make([]string, 0, len(this.NodeAllocatableResourceMappings)) - for k := range this.NodeAllocatableResourceMappings { - keysForNodeAllocatableResourceMappings = append(keysForNodeAllocatableResourceMappings, string(k)) + keysForNodeAllocatableResources := make([]string, 0, len(this.NodeAllocatableResources)) + for k := range this.NodeAllocatableResources { + keysForNodeAllocatableResources = append(keysForNodeAllocatableResources, string(k)) } - sort.Strings(keysForNodeAllocatableResourceMappings) - mapStringForNodeAllocatableResourceMappings := "map[k8s_io_api_core_v1.ResourceName]NodeAllocatableResourceMapping{" - for _, k := range keysForNodeAllocatableResourceMappings { - mapStringForNodeAllocatableResourceMappings += fmt.Sprintf("%v: %v,", k, this.NodeAllocatableResourceMappings[k8s_io_api_core_v1.ResourceName(k)]) + sort.Strings(keysForNodeAllocatableResources) + mapStringForNodeAllocatableResources := "map[k8s_io_api_core_v1.ResourceName]NodeAllocatableResource{" + for _, k := range keysForNodeAllocatableResources { + mapStringForNodeAllocatableResources += fmt.Sprintf("%v: %v,", k, this.NodeAllocatableResources[k8s_io_api_core_v1.ResourceName(k)]) } - mapStringForNodeAllocatableResourceMappings += "}" + mapStringForNodeAllocatableResources += "}" s := strings.Join([]string{`&Device{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Attributes:` + mapStringForAttributes + `,`, @@ -3766,7 +4377,7 @@ func (this *Device) String() string { `BindingConditions:` + fmt.Sprintf("%v", this.BindingConditions) + `,`, `BindingFailureConditions:` + fmt.Sprintf("%v", this.BindingFailureConditions) + `,`, `AllowMultipleAllocations:` + valueToStringGenerated(this.AllowMultipleAllocations) + `,`, - `NodeAllocatableResourceMappings:` + mapStringForNodeAllocatableResourceMappings + `,`, + `NodeAllocatableResources:` + mapStringForNodeAllocatableResources + `,`, `}`, }, "") return s @@ -3968,6 +4579,18 @@ func (this *DeviceCounterConsumption) String() string { s := strings.Join([]string{`&DeviceCounterConsumption{`, `CounterSet:` + fmt.Sprintf("%v", this.CounterSet) + `,`, `Counters:` + mapStringForCounters + `,`, + `CompatibilityGroups:` + fmt.Sprintf("%v", this.CompatibilityGroups) + `,`, + `}`, + }, "") + return s +} +func (this *DeviceDerivedAttribute) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeviceDerivedAttribute{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Expression:` + fmt.Sprintf("%v", this.Expression) + `,`, `}`, }, "") return s @@ -4019,6 +4642,7 @@ func (this *DeviceRequestAllocationResult) String() string { `BindingFailureConditions:` + fmt.Sprintf("%v", this.BindingFailureConditions) + `,`, `ShareID:` + valueToStringGenerated(this.ShareID) + `,`, `ConsumedCapacity:` + mapStringForConsumedCapacity + `,`, + `SkipNodeOperations:` + fmt.Sprintf("%v", this.SkipNodeOperations) + `,`, `}`, }, "") return s @@ -4047,6 +4671,11 @@ func (this *DeviceSubRequest) String() string { repeatedStringForTolerations += strings.Replace(strings.Replace(f.String(), "DeviceToleration", "DeviceToleration", 1), `&`, ``, 1) + "," } repeatedStringForTolerations += "}" + repeatedStringForDerivedAttributes := "[]DeviceDerivedAttribute{" + for _, f := range this.DerivedAttributes { + repeatedStringForDerivedAttributes += strings.Replace(strings.Replace(f.String(), "DeviceDerivedAttribute", "DeviceDerivedAttribute", 1), `&`, ``, 1) + "," + } + repeatedStringForDerivedAttributes += "}" s := strings.Join([]string{`&DeviceSubRequest{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `DeviceClassName:` + fmt.Sprintf("%v", this.DeviceClassName) + `,`, @@ -4055,6 +4684,73 @@ func (this *DeviceSubRequest) String() string { `Count:` + fmt.Sprintf("%v", this.Count) + `,`, `Tolerations:` + repeatedStringForTolerations + `,`, `Capacity:` + strings.Replace(this.Capacity.String(), "CapacityRequirements", "CapacityRequirements", 1) + `,`, + `DerivedAttributes:` + repeatedStringForDerivedAttributes + `,`, + `}`, + }, "") + return s +} +func (this *DeviceTaintRule) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeviceTaintRule{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "DeviceTaintRuleSpec", "DeviceTaintRuleSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "DeviceTaintRuleStatus", "DeviceTaintRuleStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *DeviceTaintRuleList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]DeviceTaintRule{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "DeviceTaintRule", "DeviceTaintRule", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&DeviceTaintRuleList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *DeviceTaintRuleSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeviceTaintRuleSpec{`, + `DeviceSelector:` + strings.Replace(this.DeviceSelector.String(), "DeviceTaintSelector", "DeviceTaintSelector", 1) + `,`, + `Taint:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Taint), "DeviceTaint", "DeviceTaint", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *DeviceTaintRuleStatus) String() string { + if this == nil { + return "nil" + } + repeatedStringForConditions := "[]Condition{" + for _, f := range this.Conditions { + repeatedStringForConditions += fmt.Sprintf("%v", f) + "," + } + repeatedStringForConditions += "}" + s := strings.Join([]string{`&DeviceTaintRuleStatus{`, + `Conditions:` + repeatedStringForConditions + `,`, + `}`, + }, "") + return s +} +func (this *DeviceTaintSelector) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeviceTaintSelector{`, + `Driver:` + valueToStringGenerated(this.Driver) + `,`, + `Pool:` + valueToStringGenerated(this.Pool) + `,`, + `Device:` + valueToStringGenerated(this.Device) + `,`, `}`, }, "") return s @@ -4087,6 +4783,11 @@ func (this *ExactDeviceRequest) String() string { repeatedStringForTolerations += strings.Replace(strings.Replace(f.String(), "DeviceToleration", "DeviceToleration", 1), `&`, ``, 1) + "," } repeatedStringForTolerations += "}" + repeatedStringForDerivedAttributes := "[]DeviceDerivedAttribute{" + for _, f := range this.DerivedAttributes { + repeatedStringForDerivedAttributes += strings.Replace(strings.Replace(f.String(), "DeviceDerivedAttribute", "DeviceDerivedAttribute", 1), `&`, ``, 1) + "," + } + repeatedStringForDerivedAttributes += "}" s := strings.Join([]string{`&ExactDeviceRequest{`, `DeviceClassName:` + fmt.Sprintf("%v", this.DeviceClassName) + `,`, `Selectors:` + repeatedStringForSelectors + `,`, @@ -4095,6 +4796,7 @@ func (this *ExactDeviceRequest) String() string { `AdminAccess:` + valueToStringGenerated(this.AdminAccess) + `,`, `Tolerations:` + repeatedStringForTolerations + `,`, `Capacity:` + strings.Replace(this.Capacity.String(), "CapacityRequirements", "CapacityRequirements", 1) + `,`, + `DerivedAttributes:` + repeatedStringForDerivedAttributes + `,`, `}`, }, "") return s @@ -4111,13 +4813,36 @@ func (this *NetworkDeviceData) String() string { }, "") return s } -func (this *NodeAllocatableResourceMapping) String() string { +func (this *NodeAllocatableMapping) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&NodeAllocatableResourceMapping{`, + s := strings.Join([]string{`&NodeAllocatableMapping{`, `CapacityKey:` + valueToStringGenerated(this.CapacityKey) + `,`, - `AllocationMultiplier:` + strings.Replace(fmt.Sprintf("%v", this.AllocationMultiplier), "Quantity", "resource.Quantity", 1) + `,`, + `CapacityMultiplier:` + strings.Replace(fmt.Sprintf("%v", this.CapacityMultiplier), "Quantity", "resource.Quantity", 1) + `,`, + `DeviceMultiplier:` + strings.Replace(fmt.Sprintf("%v", this.DeviceMultiplier), "Quantity", "resource.Quantity", 1) + `,`, + `}`, + }, "") + return s +} +func (this *NodeAllocatableOverhead) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NodeAllocatableOverhead{`, + `PerPod:` + strings.Replace(fmt.Sprintf("%v", this.PerPod), "Quantity", "resource.Quantity", 1) + `,`, + `PerContainer:` + strings.Replace(fmt.Sprintf("%v", this.PerContainer), "Quantity", "resource.Quantity", 1) + `,`, + `}`, + }, "") + return s +} +func (this *NodeAllocatableResource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NodeAllocatableResource{`, + `Mapping:` + strings.Replace(this.Mapping.String(), "NodeAllocatableMapping", "NodeAllocatableMapping", 1) + `,`, + `Overhead:` + strings.Replace(this.Overhead.String(), "NodeAllocatableOverhead", "NodeAllocatableOverhead", 1) + `,`, `}`, }, "") return s @@ -4296,29 +5021,867 @@ func (this *ResourceSliceSpec) String() string { for _, f := range this.SharedCounters { repeatedStringForSharedCounters += strings.Replace(strings.Replace(f.String(), "CounterSet", "CounterSet", 1), `&`, ``, 1) + "," } - repeatedStringForSharedCounters += "}" - s := strings.Join([]string{`&ResourceSliceSpec{`, - `Driver:` + fmt.Sprintf("%v", this.Driver) + `,`, - `Pool:` + strings.Replace(strings.Replace(this.Pool.String(), "ResourcePool", "ResourcePool", 1), `&`, ``, 1) + `,`, - `NodeName:` + valueToStringGenerated(this.NodeName) + `,`, - `NodeSelector:` + strings.Replace(fmt.Sprintf("%v", this.NodeSelector), "NodeSelector", "v11.NodeSelector", 1) + `,`, - `AllNodes:` + valueToStringGenerated(this.AllNodes) + `,`, - `Devices:` + repeatedStringForDevices + `,`, - `PerDeviceNodeSelection:` + valueToStringGenerated(this.PerDeviceNodeSelection) + `,`, - `SharedCounters:` + repeatedStringForSharedCounters + `,`, - `}`, - }, "") - return s -} -func valueToStringGenerated(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" + repeatedStringForSharedCounters += "}" + s := strings.Join([]string{`&ResourceSliceSpec{`, + `Driver:` + fmt.Sprintf("%v", this.Driver) + `,`, + `Pool:` + strings.Replace(strings.Replace(this.Pool.String(), "ResourcePool", "ResourcePool", 1), `&`, ``, 1) + `,`, + `NodeName:` + valueToStringGenerated(this.NodeName) + `,`, + `NodeSelector:` + strings.Replace(fmt.Sprintf("%v", this.NodeSelector), "NodeSelector", "v11.NodeSelector", 1) + `,`, + `AllNodes:` + valueToStringGenerated(this.AllNodes) + `,`, + `Devices:` + repeatedStringForDevices + `,`, + `PerDeviceNodeSelection:` + valueToStringGenerated(this.PerDeviceNodeSelection) + `,`, + `SharedCounters:` + repeatedStringForSharedCounters + `,`, + `PartitionTypeAttribute:` + valueToStringGenerated(this.PartitionTypeAttribute) + `,`, + `SkipNodeOperations:` + fmt.Sprintf("%v", this.SkipNodeOperations) + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *AllocatedDeviceStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AllocatedDeviceStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllocatedDeviceStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Driver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pool", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pool = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Device", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Device = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Conditions = append(m.Conditions, v1.Condition{}) + if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Data == nil { + m.Data = &runtime.RawExtension{} + } + if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NetworkData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NetworkData == nil { + m.NetworkData = &NetworkDeviceData{} + } + if err := m.NetworkData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShareID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.ShareID = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AllocationResult) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AllocationResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllocationResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Devices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NodeSelector == nil { + m.NodeSelector = &v11.NodeSelector{} + } + if err := m.NodeSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllocationTimestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AllocationTimestamp == nil { + m.AllocationTimestamp = &v1.Time{} + } + if err := m.AllocationTimestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CELDeviceSelector) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CELDeviceSelector: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CELDeviceSelector: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expression", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Expression = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CapacityRequestPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CapacityRequestPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CapacityRequestPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Default", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Default == nil { + m.Default = &resource.Quantity{} + } + if err := m.Default.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidValues", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidValues = append(m.ValidValues, resource.Quantity{}) + if err := m.ValidValues[len(m.ValidValues)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidRange", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValidRange == nil { + m.ValidRange = &CapacityRequestPolicyRange{} + } + if err := m.ValidRange.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CapacityRequestPolicyRange) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CapacityRequestPolicyRange: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CapacityRequestPolicyRange: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Min == nil { + m.Min = &resource.Quantity{} + } + if err := m.Min.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Max == nil { + m.Max = &resource.Quantity{} + } + if err := m.Max.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Step == nil { + m.Step = &resource.Quantity{} + } + if err := m.Step.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) + return nil } -func (m *AllocatedDeviceStatus) Unmarshal(dAtA []byte) error { +func (m *CapacityRequirements) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4341,17 +5904,17 @@ func (m *AllocatedDeviceStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AllocatedDeviceStatus: wiretype end group for non-group") + return fmt.Errorf("proto: CapacityRequirements: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AllocatedDeviceStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: CapacityRequirements: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -4361,91 +5924,174 @@ func (m *AllocatedDeviceStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Driver = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pool", wireType) + if m.Requests == nil { + m.Requests = make(map[QualifiedName]resource.Quantity) } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + var mapkey QualifiedName + mapvalue := &resource.Quantity{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = QualifiedName(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &resource.Quantity{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated + m.Requests[QualifiedName(mapkey)] = *mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + intStringLen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGenerated } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.Pool = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Device", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Counter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated } - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - m.Device = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Counter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Counter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4472,16 +6118,65 @@ func (m *AllocatedDeviceStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Conditions = append(m.Conditions, v1.Condition{}) - if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CounterSet) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CounterSet: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CounterSet: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -4491,31 +6186,27 @@ func (m *AllocatedDeviceStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Data == nil { - m.Data = &runtime.RawExtension{} - } - if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NetworkData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Counters", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4542,45 +6233,105 @@ func (m *AllocatedDeviceStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.NetworkData == nil { - m.NetworkData = &NetworkDeviceData{} - } - if err := m.NetworkData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShareID", wireType) + if m.Counters == nil { + m.Counters = make(map[string]Counter) } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + var mapkey string + mapvalue := &Counter{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &Counter{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.ShareID = &s + m.Counters[mapkey] = *mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -4603,7 +6354,7 @@ func (m *AllocatedDeviceStatus) Unmarshal(dAtA []byte) error { } return nil } -func (m *AllocationResult) Unmarshal(dAtA []byte) error { +func (m *Device) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4626,50 +6377,17 @@ func (m *AllocationResult) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AllocationResult: wiretype end group for non-group") + return fmt.Errorf("proto: Device: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AllocationResult: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Device: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Devices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeSelector", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -4679,31 +6397,27 @@ func (m *AllocationResult) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if m.NodeSelector == nil { - m.NodeSelector = &v11.NodeSelector{} - } - if err := m.NodeSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AllocationTimestamp", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4730,148 +6444,109 @@ func (m *AllocationResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.AllocationTimestamp == nil { - m.AllocationTimestamp = &v1.Time{} - } - if err := m.AllocationTimestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CELDeviceSelector) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CELDeviceSelector: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CELDeviceSelector: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Expression", wireType) + if m.Attributes == nil { + m.Attributes = make(map[QualifiedName]DeviceAttribute) } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + var mapkey QualifiedName + mapvalue := &DeviceAttribute{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = QualifiedName(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &DeviceAttribute{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Expression = string(dAtA[iNdEx:postIndex]) + m.Attributes[QualifiedName(mapkey)] = *mapvalue iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CapacityRequestPolicy) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CapacityRequestPolicy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CapacityRequestPolicy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Default", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4898,16 +6573,109 @@ func (m *CapacityRequestPolicy) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Default == nil { - m.Default = &resource.Quantity{} + if m.Capacity == nil { + m.Capacity = make(map[QualifiedName]DeviceCapacity) } - if err := m.Default.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + var mapkey QualifiedName + mapvalue := &DeviceCapacity{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = QualifiedName(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &DeviceCapacity{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } + m.Capacity[QualifiedName(mapkey)] = *mapvalue iNdEx = postIndex - case 3: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidValues", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumesCounters", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4934,16 +6702,16 @@ func (m *CapacityRequestPolicy) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidValues = append(m.ValidValues, resource.Quantity{}) - if err := m.ValidValues[len(m.ValidValues)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.ConsumesCounters = append(m.ConsumesCounters, DeviceCounterConsumption{}) + if err := m.ConsumesCounters[len(m.ConsumesCounters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidRange", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -4953,81 +6721,28 @@ func (m *CapacityRequestPolicy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if m.ValidRange == nil { - m.ValidRange = &CapacityRequestPolicyRange{} - } - if err := m.ValidRange.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + s := string(dAtA[iNdEx:postIndex]) + m.NodeName = &s iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CapacityRequestPolicyRange) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CapacityRequestPolicyRange: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CapacityRequestPolicyRange: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NodeSelector", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5054,16 +6769,37 @@ func (m *CapacityRequestPolicyRange) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Min == nil { - m.Min = &resource.Quantity{} + if m.NodeSelector == nil { + m.NodeSelector = &v11.NodeSelector{} } - if err := m.Min.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.NodeSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllNodes", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.AllNodes = &b + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Taints", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5090,18 +6826,37 @@ func (m *CapacityRequestPolicyRange) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Max == nil { - m.Max = &resource.Quantity{} - } - if err := m.Max.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Taints = append(m.Taints, DeviceTaint{}) + if err := m.Taints[len(m.Taints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BindsToNode", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.BindsToNode = &b + case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BindingConditions", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -5111,81 +6866,80 @@ func (m *CapacityRequestPolicyRange) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Step == nil { - m.Step = &resource.Quantity{} + m.BindingConditions = append(m.BindingConditions, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BindingFailureConditions", wireType) } - if err := m.Step.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated } - if (skippy < 0) || (iNdEx+skippy) < 0 { + postIndex := iNdEx + intStringLen + if postIndex < 0 { return ErrInvalidLengthGenerated } - if (iNdEx + skippy) > l { + if postIndex > l { return io.ErrUnexpectedEOF } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CapacityRequirements) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + m.BindingFailureConditions = append(m.BindingFailureConditions, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowMultipleAllocations", wireType) } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CapacityRequirements: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CapacityRequirements: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + b := bool(v != 0) + m.AllowMultipleAllocations = &b + case 14: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NodeAllocatableResources", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5212,11 +6966,11 @@ func (m *CapacityRequirements) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Requests == nil { - m.Requests = make(map[QualifiedName]resource.Quantity) + if m.NodeAllocatableResources == nil { + m.NodeAllocatableResources = make(map[k8s_io_api_core_v1.ResourceName]NodeAllocatableResource) } - var mapkey QualifiedName - mapvalue := &resource.Quantity{} + var mapkey k8s_io_api_core_v1.ResourceName + mapvalue := &NodeAllocatableResource{} for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 @@ -5262,7 +7016,7 @@ func (m *CapacityRequirements) Unmarshal(dAtA []byte) error { if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } - mapkey = QualifiedName(dAtA[iNdEx:postStringIndexmapkey]) + mapkey = k8s_io_api_core_v1.ResourceName(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var mapmsglen int @@ -5290,7 +7044,7 @@ func (m *CapacityRequirements) Unmarshal(dAtA []byte) error { if postmsgIndex > l { return io.ErrUnexpectedEOF } - mapvalue = &resource.Quantity{} + mapvalue = &NodeAllocatableResource{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } @@ -5310,7 +7064,7 @@ func (m *CapacityRequirements) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - m.Requests[QualifiedName(mapkey)] = *mapvalue + m.NodeAllocatableResources[k8s_io_api_core_v1.ResourceName(mapkey)] = *mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -5333,7 +7087,7 @@ func (m *CapacityRequirements) Unmarshal(dAtA []byte) error { } return nil } -func (m *Counter) Unmarshal(dAtA []byte) error { +func (m *DeviceAllocationConfiguration) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5356,17 +7110,17 @@ func (m *Counter) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Counter: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceAllocationConfiguration: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Counter: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceAllocationConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -5376,78 +7130,27 @@ func (m *Counter) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Source = AllocationConfigSource(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CounterSet) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CounterSet: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CounterSet: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5475,11 +7178,11 @@ func (m *CounterSet) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Requests = append(m.Requests, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Counters", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DeviceConfiguration", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5506,105 +7209,9 @@ func (m *CounterSet) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Counters == nil { - m.Counters = make(map[string]Counter) - } - var mapkey string - mapvalue := &Counter{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthGenerated - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthGenerated - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &Counter{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + if err := m.DeviceConfiguration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Counters[mapkey] = *mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -5627,7 +7234,7 @@ func (m *CounterSet) Unmarshal(dAtA []byte) error { } return nil } -func (m *Device) Unmarshal(dAtA []byte) error { +func (m *DeviceAllocationResult) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5650,17 +7257,17 @@ func (m *Device) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Device: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceAllocationResult: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Device: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceAllocationResult: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -5670,27 +7277,29 @@ func (m *Device) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Results = append(m.Results, DeviceRequestAllocationResult{}) + if err := m.Results[len(m.Results)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5717,111 +7326,107 @@ func (m *Device) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Attributes == nil { - m.Attributes = make(map[QualifiedName]DeviceAttribute) + m.Config = append(m.Config, DeviceAllocationConfiguration{}) + if err := m.Config[len(m.Config)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - var mapkey QualifiedName - mapvalue := &DeviceAttribute{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthGenerated - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = QualifiedName(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthGenerated - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &DeviceAttribute{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceAttribute) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceAttribute: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceAttribute: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IntValue", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break } } - m.Attributes[QualifiedName(mapkey)] = *mapvalue - iNdEx = postIndex + m.IntValue = &v case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BoolValue", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.BoolValue = &b + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StringValue", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -5831,29 +7436,61 @@ func (m *Device) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Capacity == nil { - m.Capacity = make(map[QualifiedName]DeviceCapacity) + s := string(dAtA[iNdEx:postIndex]) + m.StringValue = &s + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VersionValue", wireType) } - var mapkey QualifiedName - mapvalue := &DeviceCapacity{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.VersionValue = &s + iNdEx = postIndex + case 6: + if wireType == 0 { + var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -5863,43 +7500,51 @@ func (m *Device) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= uint64(b&0x7F) << shift + v |= int64(b&0x7F) << shift if b < 0x80 { break } } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + m.IntValues = append(m.IntValues, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated + if iNdEx >= l { + return io.ErrUnexpectedEOF } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthGenerated + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF + } + if packedLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ } - mapkey = QualifiedName(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int + } + elementCount = count + if elementCount != 0 && len(m.IntValues) == 0 { + m.IntValues = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -5909,48 +7554,91 @@ func (m *Device) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - mapmsglen |= int(b&0x7F) << shift + v |= int64(b&0x7F) << shift if b < 0x80 { break } } - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthGenerated + m.IntValues = append(m.IntValues, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field IntValues", wireType) + } + case 7: + if wireType == 0 { + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated } - if postmsgIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - mapvalue = &DeviceCapacity{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated + } + m.BoolValues = append(m.BoolValues, bool(v != 0)) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated } - if (iNdEx + skippy) > postIndex { + if iNdEx >= l { return io.ErrUnexpectedEOF } - iNdEx += skippy + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + elementCount = packedLen + if elementCount != 0 && len(m.BoolValues) == 0 { + m.BoolValues = make([]bool, 0, elementCount) + } + for iNdEx < postIndex { + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BoolValues = append(m.BoolValues, bool(v != 0)) } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field BoolValues", wireType) } - m.Capacity[QualifiedName(mapkey)] = *mapvalue - iNdEx = postIndex - case 4: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumesCounters", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StringValues", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -5960,29 +7648,27 @@ func (m *Device) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsumesCounters = append(m.ConsumesCounters, DeviceCounterConsumption{}) - if err := m.ConsumesCounters[len(m.ConsumesCounters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.StringValues = append(m.StringValues, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 5: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field VersionValues", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6010,12 +7696,61 @@ func (m *Device) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.NodeName = &s + m.VersionValues = append(m.VersionValues, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 6: + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceCapacity) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceCapacity: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceCapacity: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeSelector", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6042,18 +7777,15 @@ func (m *Device) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.NodeSelector == nil { - m.NodeSelector = &v11.NodeSelector{} - } - if err := m.NodeSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllNodes", wireType) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestPolicy", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -6063,16 +7795,81 @@ func (m *Device) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - b := bool(v != 0) - m.AllNodes = &b - case 8: + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RequestPolicy == nil { + m.RequestPolicy = &CapacityRequestPolicy{} + } + if err := m.RequestPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceClaim) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceClaim: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceClaim: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Taints", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6099,16 +7896,16 @@ func (m *Device) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Taints = append(m.Taints, DeviceTaint{}) - if err := m.Taints[len(m.Taints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Requests = append(m.Requests, DeviceRequest{}) + if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BindsToNode", wireType) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Constraints", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -6118,18 +7915,31 @@ func (m *Device) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - b := bool(v != 0) - m.BindsToNode = &b - case 10: + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Constraints = append(m.Constraints, DeviceConstraint{}) + if err := m.Constraints[len(m.Constraints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BindingConditions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -6139,27 +7949,79 @@ func (m *Device) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } - if postIndex > l { + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Config = append(m.Config, DeviceClaimConfiguration{}) + if err := m.Config[len(m.Config)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceClaimConfiguration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { return io.ErrUnexpectedEOF } - m.BindingConditions = append(m.BindingConditions, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 11: + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceClaimConfiguration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceClaimConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BindingFailureConditions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6187,32 +8049,11 @@ func (m *Device) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.BindingFailureConditions = append(m.BindingFailureConditions, string(dAtA[iNdEx:postIndex])) + m.Requests = append(m.Requests, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowMultipleAllocations", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.AllowMultipleAllocations = &b - case 13: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeAllocatableResourceMappings", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DeviceConfiguration", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6239,105 +8080,9 @@ func (m *Device) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.NodeAllocatableResourceMappings == nil { - m.NodeAllocatableResourceMappings = make(map[k8s_io_api_core_v1.ResourceName]NodeAllocatableResourceMapping) - } - var mapkey k8s_io_api_core_v1.ResourceName - mapvalue := &NodeAllocatableResourceMapping{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthGenerated - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = k8s_io_api_core_v1.ResourceName(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthGenerated - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &NodeAllocatableResourceMapping{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + if err := m.DeviceConfiguration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.NodeAllocatableResourceMappings[k8s_io_api_core_v1.ResourceName(mapkey)] = *mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -6360,7 +8105,7 @@ func (m *Device) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeviceAllocationConfiguration) Unmarshal(dAtA []byte) error { +func (m *DeviceClass) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6383,17 +8128,17 @@ func (m *DeviceAllocationConfiguration) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeviceAllocationConfiguration: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceClass: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceAllocationConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceClass: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -6403,29 +8148,30 @@ func (m *DeviceAllocationConfiguration) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Source = AllocationConfigSource(dAtA[iNdEx:postIndex]) + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -6435,25 +8181,76 @@ func (m *DeviceAllocationConfiguration) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Requests = append(m.Requests, string(dAtA[iNdEx:postIndex])) + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 3: + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceClassConfiguration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceClassConfiguration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceClassConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DeviceConfiguration", wireType) } @@ -6507,7 +8304,7 @@ func (m *DeviceAllocationConfiguration) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeviceAllocationResult) Unmarshal(dAtA []byte) error { +func (m *DeviceClassList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6530,15 +8327,15 @@ func (m *DeviceAllocationResult) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeviceAllocationResult: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceClassList: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceAllocationResult: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceClassList: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6565,14 +8362,13 @@ func (m *DeviceAllocationResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Results = append(m.Results, DeviceRequestAllocationResult{}) - if err := m.Results[len(m.Results)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6599,8 +8395,8 @@ func (m *DeviceAllocationResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Config = append(m.Config, DeviceAllocationConfiguration{}) - if err := m.Config[len(m.Config)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Items = append(m.Items, DeviceClass{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -6625,7 +8421,7 @@ func (m *DeviceAllocationResult) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeviceAttribute) Unmarshal(dAtA []byte) error { +func (m *DeviceClassSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6648,58 +8444,17 @@ func (m *DeviceAttribute) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeviceAttribute: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceClassSpec: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceAttribute: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceClassSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IntValue", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IntValue = &v - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BoolValue", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.BoolValue = &b - case 4: + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StringValue", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Selectors", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -6709,209 +8464,31 @@ func (m *DeviceAttribute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.StringValue = &s - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VersionValue", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF + m.Selectors = append(m.Selectors, DeviceSelector{}) + if err := m.Selectors[len(m.Selectors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - s := string(dAtA[iNdEx:postIndex]) - m.VersionValue = &s iNdEx = postIndex - case 6: - if wireType == 0 { - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IntValues = append(m.IntValues, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.IntValues) == 0 { - m.IntValues = make([]int64, 0, elementCount) - } - for iNdEx < postIndex { - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IntValues = append(m.IntValues, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field IntValues", wireType) - } - case 7: - if wireType == 0 { - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.BoolValues = append(m.BoolValues, bool(v != 0)) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - elementCount = packedLen - if elementCount != 0 && len(m.BoolValues) == 0 { - m.BoolValues = make([]bool, 0, elementCount) - } - for iNdEx < postIndex { - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.BoolValues = append(m.BoolValues, bool(v != 0)) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field BoolValues", wireType) - } - case 8: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StringValues", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -6921,27 +8498,29 @@ func (m *DeviceAttribute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.StringValues = append(m.StringValues, string(dAtA[iNdEx:postIndex])) + m.Config = append(m.Config, DeviceClassConfiguration{}) + if err := m.Config[len(m.Config)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 9: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VersionValues", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExtendedResourceName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6969,7 +8548,8 @@ func (m *DeviceAttribute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.VersionValues = append(m.VersionValues, string(dAtA[iNdEx:postIndex])) + s := string(dAtA[iNdEx:postIndex]) + m.ExtendedResourceName = &s iNdEx = postIndex default: iNdEx = preIndex @@ -6992,7 +8572,7 @@ func (m *DeviceAttribute) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeviceCapacity) Unmarshal(dAtA []byte) error { +func (m *DeviceConfiguration) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7015,48 +8595,15 @@ func (m *DeviceCapacity) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeviceCapacity: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceConfiguration: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceCapacity: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestPolicy", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Opaque", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7083,10 +8630,10 @@ func (m *DeviceCapacity) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.RequestPolicy == nil { - m.RequestPolicy = &CapacityRequestPolicy{} + if m.Opaque == nil { + m.Opaque = &OpaqueDeviceConfiguration{} } - if err := m.RequestPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Opaque.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7111,7 +8658,7 @@ func (m *DeviceCapacity) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeviceClaim) Unmarshal(dAtA []byte) error { +func (m *DeviceConstraint) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7134,17 +8681,17 @@ func (m *DeviceClaim) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeviceClaim: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceConstraint: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceClaim: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceConstraint: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -7154,31 +8701,29 @@ func (m *DeviceClaim) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Requests = append(m.Requests, DeviceRequest{}) - if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Requests = append(m.Requests, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Constraints", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MatchAttribute", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -7188,31 +8733,30 @@ func (m *DeviceClaim) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Constraints = append(m.Constraints, DeviceConstraint{}) - if err := m.Constraints[len(m.Constraints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + s := FullyQualifiedName(dAtA[iNdEx:postIndex]) + m.MatchAttribute = &s iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DistinctAttribute", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -7222,25 +8766,24 @@ func (m *DeviceClaim) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Config = append(m.Config, DeviceClaimConfiguration{}) - if err := m.Config[len(m.Config)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + s := FullyQualifiedName(dAtA[iNdEx:postIndex]) + m.DistinctAttribute = &s iNdEx = postIndex default: iNdEx = preIndex @@ -7263,7 +8806,7 @@ func (m *DeviceClaim) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeviceClaimConfiguration) Unmarshal(dAtA []byte) error { +func (m *DeviceCounterConsumption) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7286,15 +8829,15 @@ func (m *DeviceClaimConfiguration) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeviceClaimConfiguration: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceCounterConsumption: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceClaimConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceCounterConsumption: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CounterSet", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7322,13 +8865,142 @@ func (m *DeviceClaimConfiguration) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Requests = append(m.Requests, string(dAtA[iNdEx:postIndex])) + m.CounterSet = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Counters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Counters == nil { + m.Counters = make(map[string]Counter) + } + var mapkey string + mapvalue := &Counter{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &Counter{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Counters[mapkey] = *mapvalue iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeviceConfiguration", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CompatibilityGroups", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -7338,24 +9010,23 @@ func (m *DeviceClaimConfiguration) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.DeviceConfiguration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.CompatibilityGroups = append(m.CompatibilityGroups, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -7378,7 +9049,7 @@ func (m *DeviceClaimConfiguration) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeviceClass) Unmarshal(dAtA []byte) error { +func (m *DeviceDerivedAttribute) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7401,17 +9072,17 @@ func (m *DeviceClass) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeviceClass: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceDerivedAttribute: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceClass: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceDerivedAttribute: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -7421,30 +9092,29 @@ func (m *DeviceClass) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Name = FullyQualifiedName(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Expression", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -7454,24 +9124,23 @@ func (m *DeviceClass) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Expression = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -7494,7 +9163,7 @@ func (m *DeviceClass) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeviceClassConfiguration) Unmarshal(dAtA []byte) error { +func (m *DeviceRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7517,17 +9186,17 @@ func (m *DeviceClassConfiguration) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeviceClassConfiguration: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceClassConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeviceConfiguration", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -7537,78 +9206,27 @@ func (m *DeviceClassConfiguration) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.DeviceConfiguration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DeviceClassList) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DeviceClassList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceClassList: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Exactly", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7635,13 +9253,16 @@ func (m *DeviceClassList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Exactly == nil { + m.Exactly = &ExactDeviceRequest{} + } + if err := m.Exactly.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FirstAvailable", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7668,8 +9289,8 @@ func (m *DeviceClassList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, DeviceClass{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.FirstAvailable = append(m.FirstAvailable, DeviceSubRequest{}) + if err := m.FirstAvailable[len(m.FirstAvailable)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7694,7 +9315,7 @@ func (m *DeviceClassList) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeviceClassSpec) Unmarshal(dAtA []byte) error { +func (m *DeviceRequestAllocationResult) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7717,17 +9338,17 @@ func (m *DeviceClassSpec) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeviceClassSpec: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceRequestAllocationResult: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceClassSpec: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceRequestAllocationResult: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Selectors", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -7737,31 +9358,29 @@ func (m *DeviceClassSpec) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Selectors = append(m.Selectors, DeviceSelector{}) - if err := m.Selectors[len(m.Selectors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Request = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -7771,29 +9390,27 @@ func (m *DeviceClassSpec) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Config = append(m.Config, DeviceClassConfiguration{}) - if err := m.Config[len(m.Config)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Driver = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExtendedResourceName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pool", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7821,64 +9438,45 @@ func (m *DeviceClassSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.ExtendedResourceName = &s + m.Pool = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Device", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DeviceConfiguration) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DeviceConfiguration: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Opaque", wireType) + m.Device = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AdminAccess", wireType) } - var msglen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -7888,83 +9486,18 @@ func (m *DeviceConfiguration) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Opaque == nil { - m.Opaque = &OpaqueDeviceConfiguration{} - } - if err := m.Opaque.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DeviceConstraint) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DeviceConstraint: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceConstraint: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + b := bool(v != 0) + m.AdminAccess = &b + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Tolerations", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -7974,27 +9507,29 @@ func (m *DeviceConstraint) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Requests = append(m.Requests, string(dAtA[iNdEx:postIndex])) + m.Tolerations = append(m.Tolerations, DeviceToleration{}) + if err := m.Tolerations[len(m.Tolerations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MatchAttribute", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BindingConditions", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8022,12 +9557,11 @@ func (m *DeviceConstraint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := FullyQualifiedName(dAtA[iNdEx:postIndex]) - m.MatchAttribute = &s + m.BindingConditions = append(m.BindingConditions, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 3: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistinctAttribute", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BindingFailureConditions", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8055,62 +9589,11 @@ func (m *DeviceConstraint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := FullyQualifiedName(dAtA[iNdEx:postIndex]) - m.DistinctAttribute = &s + m.BindingFailureConditions = append(m.BindingFailureConditions, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DeviceCounterConsumption) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DeviceCounterConsumption: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceCounterConsumption: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CounterSet", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ShareID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8138,11 +9621,12 @@ func (m *DeviceCounterConsumption) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.CounterSet = string(dAtA[iNdEx:postIndex]) + s := k8s_io_apimachinery_pkg_types.UID(dAtA[iNdEx:postIndex]) + m.ShareID = &s iNdEx = postIndex - case 2: + case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Counters", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsumedCapacity", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8169,11 +9653,11 @@ func (m *DeviceCounterConsumption) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Counters == nil { - m.Counters = make(map[string]Counter) + if m.ConsumedCapacity == nil { + m.ConsumedCapacity = make(map[QualifiedName]resource.Quantity) } - var mapkey string - mapvalue := &Counter{} + var mapkey QualifiedName + mapvalue := &resource.Quantity{} for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 @@ -8219,7 +9703,7 @@ func (m *DeviceCounterConsumption) Unmarshal(dAtA []byte) error { if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + mapkey = QualifiedName(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var mapmsglen int @@ -8247,7 +9731,7 @@ func (m *DeviceCounterConsumption) Unmarshal(dAtA []byte) error { if postmsgIndex > l { return io.ErrUnexpectedEOF } - mapvalue = &Counter{} + mapvalue = &resource.Quantity{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } @@ -8267,7 +9751,125 @@ func (m *DeviceCounterConsumption) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - m.Counters[mapkey] = *mapvalue + m.ConsumedCapacity[QualifiedName(mapkey)] = *mapvalue + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipNodeOperations", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SkipNodeOperations = append(m.SkipNodeOperations, SkipNodeOperation(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceSelector) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceSelector: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceSelector: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CEL", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CEL == nil { + m.CEL = &CELDeviceSelector{} + } + if err := m.CEL.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -8290,7 +9892,7 @@ func (m *DeviceCounterConsumption) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeviceRequest) Unmarshal(dAtA []byte) error { +func (m *DeviceSubRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8313,10 +9915,10 @@ func (m *DeviceRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeviceRequest: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceSubRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceSubRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -8353,9 +9955,9 @@ func (m *DeviceRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Exactly", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DeviceClassName", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -8365,31 +9967,27 @@ func (m *DeviceRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Exactly == nil { - m.Exactly = &ExactDeviceRequest{} - } - if err := m.Exactly.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.DeviceClassName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FirstAvailable", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Selectors", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8416,66 +10014,67 @@ func (m *DeviceRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.FirstAvailable = append(m.FirstAvailable, DeviceSubRequest{}) - if err := m.FirstAvailable[len(m.FirstAvailable)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Selectors = append(m.Selectors, DeviceSelector{}) + if err := m.Selectors[len(m.Selectors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllocationMode", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DeviceRequestAllocationResult) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.AllocationMode = DeviceAllocationMode(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DeviceRequestAllocationResult: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceRequestAllocationResult: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.Count = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Count |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Tolerations", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -8485,29 +10084,31 @@ func (m *DeviceRequestAllocationResult) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Request = string(dAtA[iNdEx:postIndex]) + m.Tolerations = append(m.Tolerations, DeviceToleration{}) + if err := m.Tolerations[len(m.Tolerations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -8517,29 +10118,33 @@ func (m *DeviceRequestAllocationResult) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Driver = string(dAtA[iNdEx:postIndex]) + if m.Capacity == nil { + m.Capacity = &CapacityRequirements{} + } + if err := m.Capacity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 3: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pool", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DerivedAttributes", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -8549,27 +10154,79 @@ func (m *DeviceRequestAllocationResult) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Pool = string(dAtA[iNdEx:postIndex]) + m.DerivedAttributes = append(m.DerivedAttributes, DeviceDerivedAttribute{}) + if err := m.DerivedAttributes[len(m.DerivedAttributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 4: + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceTaint) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceTaint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceTaint: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Device", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8597,34 +10254,13 @@ func (m *DeviceRequestAllocationResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Device = string(dAtA[iNdEx:postIndex]) + m.Key = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AdminAccess", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.AdminAccess = &b - case 6: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tolerations", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -8634,29 +10270,27 @@ func (m *DeviceRequestAllocationResult) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Tolerations = append(m.Tolerations, DeviceToleration{}) - if err := m.Tolerations[len(m.Tolerations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Value = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BindingConditions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Effect", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8684,13 +10318,13 @@ func (m *DeviceRequestAllocationResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.BindingConditions = append(m.BindingConditions, string(dAtA[iNdEx:postIndex])) + m.Effect = DeviceTaintEffect(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BindingFailureConditions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TimeAdded", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -8700,29 +10334,83 @@ func (m *DeviceRequestAllocationResult) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.BindingFailureConditions = append(m.BindingFailureConditions, string(dAtA[iNdEx:postIndex])) + if m.TimeAdded == nil { + m.TimeAdded = &v1.Time{} + } + if err := m.TimeAdded.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 9: + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceTaintRule) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceTaintRule: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceTaintRule: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShareID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -8732,28 +10420,28 @@ func (m *DeviceRequestAllocationResult) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - s := k8s_io_apimachinery_pkg_types.UID(dAtA[iNdEx:postIndex]) - m.ShareID = &s + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 10: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsumedCapacity", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8765,120 +10453,57 @@ func (m *DeviceRequestAllocationResult) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ConsumedCapacity == nil { - m.ConsumedCapacity = make(map[QualifiedName]resource.Quantity) - } - var mapkey QualifiedName - mapvalue := &resource.Quantity{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthGenerated - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthGenerated - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = QualifiedName(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthGenerated - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthGenerated - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &resource.Quantity{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break } } - m.ConsumedCapacity[QualifiedName(mapkey)] = *mapvalue + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -8901,7 +10526,7 @@ func (m *DeviceRequestAllocationResult) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeviceSelector) Unmarshal(dAtA []byte) error { +func (m *DeviceTaintRuleList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8924,15 +10549,15 @@ func (m *DeviceSelector) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeviceSelector: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceTaintRuleList: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceSelector: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceTaintRuleList: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CEL", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8959,10 +10584,41 @@ func (m *DeviceSelector) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.CEL == nil { - m.CEL = &CELDeviceSelector{} + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - if err := m.CEL.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, DeviceTaintRule{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -8987,7 +10643,7 @@ func (m *DeviceSelector) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeviceSubRequest) Unmarshal(dAtA []byte) error { +func (m *DeviceTaintRuleSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9010,17 +10666,17 @@ func (m *DeviceSubRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeviceSubRequest: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceTaintRuleSpec: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceSubRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceTaintRuleSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DeviceSelector", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9030,29 +10686,33 @@ func (m *DeviceSubRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + if m.DeviceSelector == nil { + m.DeviceSelector = &DeviceTaintSelector{} + } + if err := m.DeviceSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeviceClassName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Taint", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9062,27 +10722,78 @@ func (m *DeviceSubRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.DeviceClassName = string(dAtA[iNdEx:postIndex]) + if err := m.Taint.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 3: + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceTaintRuleStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceTaintRuleStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceTaintRuleStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Selectors", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9109,48 +10820,66 @@ func (m *DeviceSubRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Selectors = append(m.Selectors, DeviceSelector{}) - if err := m.Selectors[len(m.Selectors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Conditions = append(m.Conditions, v1.Condition{}) + if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AllocationMode", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err } - intStringLen := int(stringLen) - if intStringLen < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - if postIndex > l { + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceTaintSelector) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { return io.ErrUnexpectedEOF } - m.AllocationMode = DeviceAllocationMode(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - m.Count = 0 + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceTaintSelector: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceTaintSelector: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) + } + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9160,16 +10889,30 @@ func (m *DeviceSubRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Count |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 6: + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Driver = &s + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tolerations", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pool", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9179,31 +10922,30 @@ func (m *DeviceSubRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Tolerations = append(m.Tolerations, DeviceToleration{}) - if err := m.Tolerations[len(m.Tolerations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + s := string(dAtA[iNdEx:postIndex]) + m.Pool = &s iNdEx = postIndex - case 7: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Device", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9213,27 +10955,24 @@ func (m *DeviceSubRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Capacity == nil { - m.Capacity = &CapacityRequirements{} - } - if err := m.Capacity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + s := string(dAtA[iNdEx:postIndex]) + m.Device = &s iNdEx = postIndex default: iNdEx = preIndex @@ -9256,7 +10995,7 @@ func (m *DeviceSubRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeviceTaint) Unmarshal(dAtA []byte) error { +func (m *DeviceToleration) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9279,10 +11018,10 @@ func (m *DeviceTaint) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeviceTaint: wiretype end group for non-group") + return fmt.Errorf("proto: DeviceToleration: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceTaint: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeviceToleration: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -9319,7 +11058,7 @@ func (m *DeviceTaint) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9347,11 +11086,11 @@ func (m *DeviceTaint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Value = string(dAtA[iNdEx:postIndex]) + m.Operator = DeviceTolerationOperator(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Effect", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9379,13 +11118,13 @@ func (m *DeviceTaint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Effect = DeviceTaintEffect(dAtA[iNdEx:postIndex]) + m.Value = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeAdded", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Effect", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9395,28 +11134,44 @@ func (m *DeviceTaint) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if m.TimeAdded == nil { - m.TimeAdded = &v1.Time{} + m.Effect = DeviceTaintEffect(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TolerationSeconds", wireType) } - if err := m.TimeAdded.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex + m.TolerationSeconds = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -9438,7 +11193,7 @@ func (m *DeviceTaint) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeviceToleration) Unmarshal(dAtA []byte) error { +func (m *ExactDeviceRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9461,15 +11216,15 @@ func (m *DeviceToleration) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeviceToleration: wiretype end group for non-group") + return fmt.Errorf("proto: ExactDeviceRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceToleration: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ExactDeviceRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DeviceClassName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9497,13 +11252,13 @@ func (m *DeviceToleration) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Key = string(dAtA[iNdEx:postIndex]) + m.DeviceClassName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Selectors", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9513,27 +11268,29 @@ func (m *DeviceToleration) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Operator = DeviceTolerationOperator(dAtA[iNdEx:postIndex]) + m.Selectors = append(m.Selectors, DeviceSelector{}) + if err := m.Selectors[len(m.Selectors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AllocationMode", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9561,13 +11318,53 @@ func (m *DeviceToleration) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Value = string(dAtA[iNdEx:postIndex]) + m.AllocationMode = DeviceAllocationMode(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + m.Count = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Count |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AdminAccess", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.AdminAccess = &b + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Effect", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Tolerations", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9577,29 +11374,31 @@ func (m *DeviceToleration) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Effect = DeviceTaintEffect(dAtA[iNdEx:postIndex]) + m.Tolerations = append(m.Tolerations, DeviceToleration{}) + if err := m.Tolerations[len(m.Tolerations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TolerationSeconds", wireType) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType) } - var v int64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9609,12 +11408,62 @@ func (m *DeviceToleration) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.TolerationSeconds = &v + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Capacity == nil { + m.Capacity = &CapacityRequirements{} + } + if err := m.Capacity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DerivedAttributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DerivedAttributes = append(m.DerivedAttributes, DeviceDerivedAttribute{}) + if err := m.DerivedAttributes[len(m.DerivedAttributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -9636,7 +11485,7 @@ func (m *DeviceToleration) Unmarshal(dAtA []byte) error { } return nil } -func (m *ExactDeviceRequest) Unmarshal(dAtA []byte) error { +func (m *NetworkDeviceData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9659,15 +11508,15 @@ func (m *ExactDeviceRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ExactDeviceRequest: wiretype end group for non-group") + return fmt.Errorf("proto: NetworkDeviceData: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ExactDeviceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: NetworkDeviceData: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeviceClassName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InterfaceName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9695,13 +11544,13 @@ func (m *ExactDeviceRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DeviceClassName = string(dAtA[iNdEx:postIndex]) + m.InterfaceName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Selectors", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IPs", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9711,29 +11560,27 @@ func (m *ExactDeviceRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Selectors = append(m.Selectors, DeviceSelector{}) - if err := m.Selectors[len(m.Selectors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.IPs = append(m.IPs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AllocationMode", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HardwareAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9761,32 +11608,63 @@ func (m *ExactDeviceRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AllocationMode = DeviceAllocationMode(dAtA[iNdEx:postIndex]) + m.HardwareAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err } - m.Count = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Count |= int64(b&0x7F) << shift - if b < 0x80 { - break - } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AdminAccess", wireType) + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - var v int + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NodeAllocatableMapping) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NodeAllocatableMapping: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NodeAllocatableMapping: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CapacityKey", wireType) + } + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9796,16 +11674,28 @@ func (m *ExactDeviceRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - b := bool(v != 0) - m.AdminAccess = &b - case 6: + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := QualifiedName(dAtA[iNdEx:postIndex]) + m.CapacityKey = &s + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tolerations", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CapacityMultiplier", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9832,14 +11722,16 @@ func (m *ExactDeviceRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Tolerations = append(m.Tolerations, DeviceToleration{}) - if err := m.Tolerations[len(m.Tolerations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.CapacityMultiplier == nil { + m.CapacityMultiplier = &resource.Quantity{} + } + if err := m.CapacityMultiplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 7: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DeviceMultiplier", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9866,10 +11758,10 @@ func (m *ExactDeviceRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Capacity == nil { - m.Capacity = &CapacityRequirements{} + if m.DeviceMultiplier == nil { + m.DeviceMultiplier = &resource.Quantity{} } - if err := m.Capacity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.DeviceMultiplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -9894,7 +11786,7 @@ func (m *ExactDeviceRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *NetworkDeviceData) Unmarshal(dAtA []byte) error { +func (m *NodeAllocatableOverhead) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9917,17 +11809,17 @@ func (m *NetworkDeviceData) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: NetworkDeviceData: wiretype end group for non-group") + return fmt.Errorf("proto: NodeAllocatableOverhead: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: NetworkDeviceData: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: NodeAllocatableOverhead: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InterfaceName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PerPod", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9937,29 +11829,33 @@ func (m *NetworkDeviceData) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.InterfaceName = string(dAtA[iNdEx:postIndex]) + if m.PerPod == nil { + m.PerPod = &resource.Quantity{} + } + if err := m.PerPod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IPs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PerContainer", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9969,55 +11865,27 @@ func (m *NetworkDeviceData) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.IPs = append(m.IPs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HardwareAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated + if m.PerContainer == nil { + m.PerContainer = &resource.Quantity{} } - if postIndex > l { - return io.ErrUnexpectedEOF + if err := m.PerContainer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.HardwareAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -10040,7 +11908,7 @@ func (m *NetworkDeviceData) Unmarshal(dAtA []byte) error { } return nil } -func (m *NodeAllocatableResourceMapping) Unmarshal(dAtA []byte) error { +func (m *NodeAllocatableResource) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10063,17 +11931,17 @@ func (m *NodeAllocatableResourceMapping) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: NodeAllocatableResourceMapping: wiretype end group for non-group") + return fmt.Errorf("proto: NodeAllocatableResource: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: NodeAllocatableResourceMapping: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: NodeAllocatableResource: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CapacityKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Mapping", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -10083,28 +11951,31 @@ func (m *NodeAllocatableResourceMapping) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - s := QualifiedName(dAtA[iNdEx:postIndex]) - m.CapacityKey = &s + if m.Mapping == nil { + m.Mapping = &NodeAllocatableMapping{} + } + if err := m.Mapping.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AllocationMultiplier", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Overhead", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -10131,10 +12002,10 @@ func (m *NodeAllocatableResourceMapping) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.AllocationMultiplier == nil { - m.AllocationMultiplier = &resource.Quantity{} + if m.Overhead == nil { + m.Overhead = &NodeAllocatableOverhead{} } - if err := m.AllocationMultiplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Overhead.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -11930,6 +13801,71 @@ func (m *ResourceSliceSpec) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PartitionTypeAttribute", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := FullyQualifiedName(dAtA[iNdEx:postIndex]) + m.PartitionTypeAttribute = &s + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipNodeOperations", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SkipNodeOperations = append(m.SkipNodeOperations, SkipNodeOperation(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/vendor/k8s.io/api/resource/v1/generated.proto b/vendor/k8s.io/api/resource/v1/generated.proto index 8bacfd846f..76559dc94b 100644 --- a/vendor/k8s.io/api/resource/v1/generated.proto +++ b/vendor/k8s.io/api/resource/v1/generated.proto @@ -65,8 +65,8 @@ message AllocatedDeviceStatus { // // +optional // +featureGate=DRAConsumableCapacity - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-uuid optional string shareID = 7; // Conditions contains the latest observation of the device's state. @@ -78,6 +78,9 @@ message AllocatedDeviceStatus { // +optional // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 4; // Data contains arbitrary driver-specific data. @@ -90,7 +93,7 @@ message AllocatedDeviceStatus { // NetworkData contains network-related information specific to the device. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional NetworkDeviceData networkData = 6; } @@ -130,7 +133,7 @@ message CELDeviceSelector { // - driver (string): the name of the driver which defines this device. // - attributes (map[string]object): the device's attributes, grouped by prefix // (e.g. device.attributes["dra.example.com"] evaluates to an object with all - // of the attributes which were prefixed by "dra.example.com". + // of the attributes which were prefixed by "dra.example.com"). // - capacity (map[string]object): the device's capacities, grouped by prefix. // - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device // (v1.34+ with the DRAConsumableCapacity feature enabled). @@ -163,6 +166,15 @@ message CELDeviceSelector { // A robust expression should check for the existence of attributes // before referencing them. // + // Common errors: + // - "no such key": Use optional chaining (.? followed by orValue()) + // or guarding the check with has() for optional fields. + // See CEL Optional Types for details: + // https://pkg.go.dev/github.com/google/cel-go@v0.17.4/cel#OptionalTypes + // + // For more CEL expression syntax and examples, see: + // https://kubernetes.io/docs/reference/using-api/cel/ + // // For ease of use, the cel.bind() function is enabled, and can be used // to simplify expressions that access multiple attributes with the // same domain. For example: @@ -232,6 +244,13 @@ message CapacityRequestPolicy { // CapacityRequestPolicyRange defines a valid range for consumable capacity values. // +// If the DRAFractionalCapacityRange feature gate is +// enabled and at least one of Min, Max, or Step is a fractional quantity (i.e. +// its value is not an integer), milli-unit arithmetic is used instead, +// supporting values with up to 3 decimal places (e.g. 100m = 0.1). +// The largest supported value then is 1000 times smaller compared to using 64-bit integers. +// Otherwise, all comparisons use 64-bit integer arithmetic via resource.Quantity.Value(). +// // - If the requested amount is less than Min, it is rounded up to the Min value. // - If Step is set and the requested amount is between Min and Max but not aligned with Step, // it will be rounded up to the next value equal to Min + (n * Step). @@ -315,8 +334,8 @@ message CounterSet { // It must be a DNS label. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-short-name optional string name = 1; // Counters defines the set of counters for this CounterSet @@ -325,8 +344,8 @@ message CounterSet { // The maximum number of counters is 32. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:eachKey=+k8s:format=k8s-short-name map counters = 2; } @@ -345,7 +364,7 @@ message Device { // The maximum number of attributes and capacities combined is 32. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional map attributes = 2; // Capacity defines the set of capacities for this device. @@ -366,13 +385,13 @@ message Device { // device is 2. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=counterSet + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=counterSet // +featureGate=DRAPartitionableDevices - // +k8s:alpha(since: "1.36")=+k8s:maxItems=2 + // +k8s:beta(since: "1.37")=+k8s:maxItems=2 repeated DeviceCounterConsumption consumesCounters = 4; // NodeName identifies the node where the device is available. @@ -419,7 +438,7 @@ message Device { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated DeviceTaint taints = 8; // BindsToNode indicates if the usage of an allocation involving this device @@ -449,8 +468,8 @@ message Device { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 repeated string bindingConditions = 10; // BindingFailureConditions defines the conditions for binding failure. @@ -467,8 +486,8 @@ message Device { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 repeated string bindingFailureConditions = 11; // AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests. @@ -480,7 +499,7 @@ message Device { // +featureGate=DRAConsumableCapacity optional bool allowMultipleAllocations = 12; - // NodeAllocatableResourceMappings defines the mapping of node resources + // NodeAllocatableResources defines the mapping of node resources // that are managed by the DRA driver exposing this device. This includes resources currently // reported in v1.Node `status.allocatable` that are not extended resources // (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). @@ -492,8 +511,9 @@ message Device { // The keys of this map are the node-allocatable resource names (e.g., "cpu", "memory"). // Extended resource names are not permitted as keys. // +optional + // +k8s:optional // +featureGate=DRANodeAllocatableResources - map nodeAllocatableResourceMappings = 13; + map nodeAllocatableResources = 14; } // DeviceAllocationConfiguration gets embedded in an AllocationResult. @@ -503,7 +523,7 @@ message DeviceAllocationConfiguration { // or from a claim. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string source = 1; // Requests lists the names of requests where the configuration applies. @@ -515,10 +535,10 @@ message DeviceAllocationConfiguration { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated string requests = 2; optional DeviceConfiguration deviceConfiguration = 3; @@ -530,8 +550,8 @@ message DeviceAllocationResult { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceRequestAllocationResult results = 1; // This field is a combination of all the claim and class configuration parameters. @@ -544,8 +564,8 @@ message DeviceAllocationResult { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=64 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=64 repeated DeviceAllocationConfiguration config = 2; } @@ -554,30 +574,30 @@ message DeviceAttribute { // IntValue is a number. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember optional int64 int = 2; // BoolValue is a true/false value. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember optional bool bool = 3; // StringValue is a string. Must not be longer than 64 characters. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember optional string string = 4; // VersionValue is a semantic version according to semver.org spec 2.0.0. // Must not be longer than 64 characters. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember optional string version = 5; // IntValues is a non-empty list of numbers. @@ -587,8 +607,8 @@ message DeviceAttribute { // +optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember // +featureGate=DRAListTypeAttributes repeated int64 ints = 6; @@ -597,8 +617,8 @@ message DeviceAttribute { // +optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember // +featureGate=DRAListTypeAttributes repeated bool bools = 7; @@ -610,8 +630,9 @@ message DeviceAttribute { // +optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember + // +k8s:alpha(since: "1.37")=+k8s:eachVal=+k8s:maxBytes=64 // +featureGate=DRAListTypeAttributes repeated string strings = 8; @@ -623,8 +644,8 @@ message DeviceAttribute { // +optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember // +featureGate=DRAListTypeAttributes repeated string versions = 9; } @@ -662,11 +683,11 @@ message DeviceClaim { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=name - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=name + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceRequest requests = 1; // These constraints must be satisfied by the set of devices that get @@ -674,8 +695,8 @@ message DeviceClaim { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceConstraint constraints = 2; // This field holds configuration for multiple potential drivers which @@ -684,8 +705,8 @@ message DeviceClaim { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceClaimConfiguration config = 3; } @@ -700,10 +721,10 @@ message DeviceClaimConfiguration { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated string requests = 1; optional DeviceConfiguration deviceConfiguration = 2; @@ -716,8 +737,8 @@ message DeviceClaimConfiguration { message DeviceClass { // Standard object metadata // +optional - // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:format=k8s-long-name optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Spec defines what can be allocated and how to configure it. @@ -728,6 +749,7 @@ message DeviceClass { // the time of allocation. // // Changing the spec automatically increments the metadata.generation number. + // +optional optional DeviceClassSpec spec = 2; } @@ -753,8 +775,8 @@ message DeviceClassSpec { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceSelector selectors = 1; // Config defines configuration parameters that apply to each device that is claimed via this class. @@ -765,8 +787,8 @@ message DeviceClassSpec { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceClassConfiguration config = 2; // ExtendedResourceName is the extended resource name for the devices of this class. @@ -778,11 +800,10 @@ message DeviceClassSpec { // If two classes are created at the same time, then the name of the class // lexicographically sorted first is picked. // - // This is a beta field. // +optional // +featureGate=DRAExtendedResource - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-extended-resource-name + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-extended-resource-name optional string extendedResourceName = 4; } @@ -794,7 +815,7 @@ message DeviceConfiguration { // // +optional // +oneOf=ConfigurationType - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional OpaqueDeviceConfiguration opaque = 1; } @@ -812,10 +833,10 @@ message DeviceConstraint { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated string requests = 1; // MatchAttribute requires that all devices in question have this @@ -838,8 +859,8 @@ message DeviceConstraint { // // +optional // +oneOf=ConstraintType - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-fully-qualified-name + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-resource-fully-qualified-name optional string matchAttribute = 2; // DistinctAttribute requires that all devices in question have this @@ -861,6 +882,8 @@ message DeviceConstraint { // +optional // +oneOf=ConstraintType // +featureGate=DRAConsumableCapacity + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-resource-fully-qualified-name optional string distinctAttribute = 3; } @@ -871,8 +894,8 @@ message DeviceCounterConsumption { // counters defined will be consumed. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-short-name optional string counterSet = 1; // Counters defines the counters that will be consumed by the device. @@ -880,9 +903,94 @@ message DeviceCounterConsumption { // The maximum number of counters is 32. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:eachKey=+k8s:format=k8s-short-name map counters = 2; + + // CompatibilityGroups is a list of opaque group names for + // this counter set consumption. + // + // Devices that consume counters from the same counter set may only be + // allocated at the same time ("co-allocated") if they all share at least + // one common group: the intersection of the CompatibilityGroups of all + // co-allocated devices on that counter set must be non-empty. Devices + // that consume from different counter sets are never compared via this + // field. + // + // An unset field, an explicit nil, and an empty list are equivalent and + // mean "no groups": such a device is only co-allocatable with sibling + // devices on the same counter set that also have no groups, and is never + // co-allocatable with a device that declares one or more groups. + // + // Group names are opaque and meaningful only within the + // publishing driver's pool. + // + // The maximum number of groups is 2, and the names must be unique. + // + // +optional + // +listType=atomic + // +featureGate=DRADeviceCompatibilityGroups + // +k8s:listType=atomic + // +k8s:optional + // +k8s:maxItems=2 + // +k8s:unique=set + // +k8s:eachVal=+k8s:format=k8s-short-name + repeated string compatibilityGroups = 3; +} + +// DeviceDerivedAttribute defines a derived attribute computed via CEL. +message DeviceDerivedAttribute { + // Name is the identifier for this derived attribute, used in constraints. + // + // It must be a DNS subdomain followed by a slash ("/") followed by a C identifier + // (e.g. "example.com/numaNode" or "derived/numaNode"). + // + // If the chosen name matches an existing physical attribute from a driver, + // the derived attribute's expression will shadow the physical attribute, + // and its evaluated value will be used in constraints instead. When the goal + // is to define a derived attribute that is only used within the ResourceClaim + // and not meant to shadow an existing attribute, use a domain prefix that + // no DRA driver should be using (e.g. "derived/myAttribute"). + // + // It is not valid to define a derived attribute that isn't used in at least + // one constraint. + // + // +required + // +k8s:required + // +k8s:format=k8s-resource-fully-qualified-name + optional string name = 1; + + // Expression is a CEL expression evaluated against each candidate device. + // The expression must evaluate to a primitive scalar (string, integer, + // boolean, or semver) or a list of these scalars ([]string, []int64, + // []bool, []semver) to act as a virtual grouping key. Any other return type + // is an error and causes CEL evaluation for the device to fail. + // + // The expression's input is an object named "device", which carries the + // same properties as in a CELDeviceSelector. + // + // When pod scheduling encounters CEL runtime errors (such as looking + // up an attribute that isn't defined) for some devices, it will abort + // allocation and fail scheduling for the Pod. Surfacing evaluation + // errors immediately prevents silent topology matching failures that are + // extremely hard to detect. A robust expression should, for example, check + // for the existence of attributes before referencing them to avoid + // runtime evaluation errors. + // + // The expression gets evaluated after a device has passed the other + // selector expressions for the request in which this expression is used. + // This allows writing expressions that are tailored towards the specific + // devices being requested (for example, by assuming the device is from a + // certain vendor and skipping those checks). + // + // The length of the expression must be smaller or equal to 10 Ki. The + // cost of evaluating it is also limited based on the estimated number + // of logical steps; the combined cost of all derived attributes in a + // claim is capped by a shared CEL cost budget. + // + // +required + // +k8s:required + optional string expression = 2; } // DeviceRequest is a request for devices required for a claim. @@ -911,7 +1019,7 @@ message DeviceRequest { // // +optional // +oneOf=deviceRequestType - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional ExactDeviceRequest exactly = 2; // FirstAvailable contains subrequests, of which exactly one will be @@ -932,11 +1040,11 @@ message DeviceRequest { // +oneOf=deviceRequestType // +listType=atomic // +featureGate=DRAPrioritizedList - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=name - // +k8s:alpha(since: "1.36")=+k8s:maxItems=8 + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=name + // +k8s:beta(since: "1.37")=+k8s:maxItems=8 repeated DeviceSubRequest firstAvailable = 3; } @@ -961,9 +1069,9 @@ message DeviceRequestAllocationResult { // vendor of the driver. It should use only lower case characters. // // +required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:maxLength=63 + // +k8s:beta(since: "1.37")=+k8s:format=k8s-long-name-caseless + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:maxLength=63 optional string driver = 2; // This name together with the driver name and the device name field @@ -973,8 +1081,8 @@ message DeviceRequestAllocationResult { // DNS sub-domains separated by slashes. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-pool-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-resource-pool-name optional string pool = 3; // Device references one device instance via its name in the driver's @@ -1005,7 +1113,7 @@ message DeviceRequestAllocationResult { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated DeviceToleration tolerations = 6; // BindingConditions contains a copy of the BindingConditions @@ -1017,8 +1125,8 @@ message DeviceRequestAllocationResult { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 repeated string bindingConditions = 7; // BindingFailureConditions contains a copy of the BindingFailureConditions @@ -1030,8 +1138,8 @@ message DeviceRequestAllocationResult { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 repeated string bindingFailureConditions = 8; // ShareID uniquely identifies an individual allocation share of the device, @@ -1041,8 +1149,8 @@ message DeviceRequestAllocationResult { // // +optional // +featureGate=DRAConsumableCapacity - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-uuid optional string shareID = 9; // ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request. @@ -1057,6 +1165,19 @@ message DeviceRequestAllocationResult { // +optional // +featureGate=DRAConsumableCapacity map consumedCapacity = 10; + + // SkipNodeOperations lists node-local resource operations (gRPC calls) + // that will be skipped for this allocated device when determining whether + // operations are necessary on the node. If all allocated devices for a driver in + // a claim skip an operation, that gRPC call will be skipped. It is a copy of + // the ResourceSlice.spec.skipNodeOperations value at the time when the device was allocated. + // + // +optional + // +listType=set + // +k8s:listType=set + // +featureGate=DRAOptionalNodeOperations + // +k8s:optional + repeated string skipNodeOperations = 11; } // DeviceSelector must have exactly one field set. @@ -1099,8 +1220,8 @@ message DeviceSubRequest { // to reference. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-long-name optional string deviceClassName = 2; // Selectors define criteria which must be satisfied by a specific @@ -1110,8 +1231,8 @@ message DeviceSubRequest { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceSelector selectors = 3; // AllocationMode and its related fields define how devices are allocated @@ -1133,7 +1254,7 @@ message DeviceSubRequest { // requests with unknown modes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional string allocationMode = 4; // Count is used only when the count mode is "ExactCount". Must be greater than zero. @@ -1164,7 +1285,7 @@ message DeviceSubRequest { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated DeviceToleration tolerations = 6; // Capacity define resource requirements against each capacity. @@ -1183,6 +1304,34 @@ message DeviceSubRequest { // +optional // +featureGate=DRAConsumableCapacity optional CapacityRequirements capacity = 7; + + // DerivedAttributes defines a set of virtual attributes computed via CEL expressions + // for each candidate device. These virtual attributes can be referenced in + // `.devices.constraints` to align and match different devices (e.g., co-allocating + // a GPU and a NIC on the same NUMA node) even if their drivers publish different + // attributes. Derived attributes are not available via `device.attributes` + // in the CEL environment when evaluating selector expressions. + // + // Derived attributes allow you to extract, transform, or normalize topology + // information (such as extracting a NUMA index from a complex topology string or + // renaming a vendor-specific attribute) into a common virtual attribute name at + // scheduling time. The scheduler then evaluates these virtual attributes exactly + // like static attributes when matching constraints. + // + // Every derived attribute defined in this list must be referenced by at least one + // MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list. + // + // The maximum number of derived attributes is 32. + // + // This is an alpha field and requires enabling the DRADerivedAttributes + // feature gate. + // + // +optional + // +listType=atomic + // +featureGate=DRADerivedAttributes + // +k8s:optional + // +k8s:maxItems=32 + repeated DeviceDerivedAttribute derivedAttributes = 8; } // The device this taint is attached to has the "effect" on @@ -1211,7 +1360,7 @@ message DeviceTaint { // Consumers must treat unknown effects like None. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string effect = 3; // TimeAdded represents the time at which the taint was added or @@ -1230,6 +1379,119 @@ message DeviceTaint { optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time timeAdded = 4; } +// DeviceTaintRule adds one taint to all devices which match the selector. +// This has the same effect as if the taint was specified directly +// in the ResourceSlice by the DRA driver. +// +k8s:supportsSubresource="/status" +message DeviceTaintRule { + // Standard object metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // Spec specifies the selector and one taint. + // + // Changing the spec automatically increments the metadata.generation number. + // +required + optional DeviceTaintRuleSpec spec = 2; + + // Status provides information about what was requested in the spec. + // + // +optional + optional DeviceTaintRuleStatus status = 3; +} + +// DeviceTaintRuleList is a collection of DeviceTaintRules. +message DeviceTaintRuleList { + // Standard list metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // Items is the list of DeviceTaintRules. + repeated DeviceTaintRule items = 2; +} + +// DeviceTaintRuleSpec specifies the selector and one taint. +message DeviceTaintRuleSpec { + // DeviceSelector defines which device(s) the taint is applied to. + // All selector criteria must be satisfied for a device to + // match. The empty selector matches all devices. Without + // a selector, no devices are matches. + // + // +optional + optional DeviceTaintSelector deviceSelector = 1; + + // The taint that gets applied to matching devices. + // + // +required + optional DeviceTaint taint = 2; +} + +// DeviceTaintRuleStatus provides information about an on-going pod eviction. +message DeviceTaintRuleStatus { + // Conditions provide information about the state of the DeviceTaintRule + // and the cluster at some point in time, + // in a machine-readable and human-readable format. + // + // The following condition is currently defined as part of this API, more may + // get added: + // - Type: EvictionInProgress + // - Status: True if there are currently pods which need to be evicted, False otherwise + // (includes the effects which don't cause eviction). + // - Reason: not specified, may change + // - Message: includes information about number of pending pods and already evicted pods + // in a human-readable format, updated periodically, may change + // + // For `effect: None`, the condition above gets set once for each change to + // the spec, with the message containing information about what would happen + // if the effect was `NoExecute`. This feedback can be used to decide whether + // changing the effect to `NoExecute` will work as intended. It only gets + // set once to avoid having to constantly update the status. + // + // Must have 8 or fewer entries. + // + // +optional + // +listType=map + // +listMapKey=type + // +patchStrategy=merge + // +patchMergeKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type + repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1; +} + +// DeviceTaintSelector defines which device(s) a DeviceTaintRule applies to. +// The empty selector matches all devices. Without a selector, no devices +// are matched. +message DeviceTaintSelector { + // If driver is set, only devices from that driver are selected. + // This fields corresponds to slice.spec.driver. + // + // +optional + optional string driver = 2; + + // If pool is set, only devices in that pool are selected. + // + // Also setting the driver name may be useful to avoid + // ambiguity when different drivers use the same pool name, + // but this is not required because selecting pools from + // different drivers may also be useful, for example when + // drivers with node-local devices use the node name as + // their pool name. + // + // +optional + optional string pool = 3; + + // If device is set, only devices with that name are selected. + // This field corresponds to slice.spec.devices[].name. + // + // Setting also driver and pool may be required to avoid ambiguity, + // but is not required. + // + // +optional + optional string device = 4; +} + // The ResourceClaim this DeviceToleration is attached to tolerates any taint that matches // the triple using the matching operator . message DeviceToleration { @@ -1238,8 +1500,8 @@ message DeviceToleration { // Must be a label name. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-label-key + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-label-key optional string key = 1; // Operator represents a key's relationship to the value. @@ -1249,7 +1511,7 @@ message DeviceToleration { // // +optional // +default="Equal" - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional string operator = 2; // Value is the taint value the toleration matches to. @@ -1263,7 +1525,7 @@ message DeviceToleration { // When specified, allowed values are NoSchedule and NoExecute. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional string effect = 4; // TolerationSeconds represents the period of time the toleration (which must be @@ -1301,8 +1563,8 @@ message ExactDeviceRequest { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceSelector selectors = 2; // AllocationMode and its related fields define how devices are allocated @@ -1325,7 +1587,7 @@ message ExactDeviceRequest { // requests with unknown modes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional string allocationMode = 3; // Count is used only when the count mode is "ExactCount". Must be greater than zero. @@ -1369,7 +1631,7 @@ message ExactDeviceRequest { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated DeviceToleration tolerations = 6; // Capacity define resource requirements against each capacity. @@ -1388,6 +1650,34 @@ message ExactDeviceRequest { // +optional // +featureGate=DRAConsumableCapacity optional CapacityRequirements capacity = 7; + + // DerivedAttributes defines a set of virtual attributes computed via CEL expressions + // for each candidate device. These virtual attributes can be referenced in + // `.devices.constraints` to align and match different devices (e.g., co-allocating + // a GPU and a NIC on the same NUMA node) even if their drivers publish different + // attributes. Derived attributes are not available via `device.attributes` + // in the CEL environment when evaluating selector expressions. + // + // Derived attributes allow you to extract, transform, or normalize topology + // information (such as extracting a NUMA index from a complex topology string or + // renaming a vendor-specific attribute) into a common virtual attribute name at + // scheduling time. The scheduler then evaluates these virtual attributes exactly + // like static attributes when matching constraints. + // + // Every derived attribute defined in this list must be referenced by at least one + // MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list. + // + // The maximum number of derived attributes is 32. + // + // This is an alpha field and requires enabling the DRADerivedAttributes + // feature gate. + // + // +optional + // +listType=atomic + // +featureGate=DRADerivedAttributes + // +k8s:optional + // +k8s:maxItems=32 + repeated DeviceDerivedAttribute derivedAttributes = 8; } // NetworkDeviceData provides network-related details for the allocated device. @@ -1401,8 +1691,8 @@ message NetworkDeviceData { // Must not be longer than 256 bytes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxBytes=256 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxBytes=256 optional string interfaceName = 1; // IPs lists the network addresses assigned to the device's network interface. @@ -1413,10 +1703,10 @@ message NetworkDeviceData { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=16 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=16 repeated string ips = 2; // HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface. @@ -1424,47 +1714,104 @@ message NetworkDeviceData { // Must not be longer than 128 bytes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxBytes=128 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxBytes=128 optional string hardwareAddress = 3; } -// NodeAllocatableResourceMapping defines the translation between the DRA device/capacity -// units requested to the corresponding quantity of the node allocatable resource. -message NodeAllocatableResourceMapping { +// NodeAllocatableMapping defines how a DRA allocation directly translates into a node allocatable resource quantity. +// The mapping can be derived from either the count of allocated devices (via deviceMultiplier) or the specific capacity consumed (via capacityKey and capacityMultiplier). These options are mutually exclusive. +// Kubelet adds this mapped resource quantity from claim to both requests and limits at the pod-level cgroup, and to limits at the container-level cgroup for each container referencing the claim. +message NodeAllocatableMapping { // CapacityKey references a capacity name defined as a key in the // `spec.devices[*].capacity` map. When this field is set, the value associated with // this key in the `status.allocation.devices.results[*].consumedCapacity` map // (for a specific claim allocation) determines the base quantity for - // the node allocatable resource. If `allocationMultiplier` is also set, it is + // the node allocatable resource. `capacityMultiplier` must also be set and is // multiplied with the base quantity. // For example, if `spec.devices[*].capacity` has an entry "dra.example.com/memory": "128Gi", // and this field is set to "dra.example.com/memory", then for a claim allocation // that consumes { "dra.example.com/memory": "4Gi" } the base quantity for the - // node allocatable resource mapping will be "4Gi", and `allocationMultiplier` should - // be omitted or set to "1". + // node allocatable resource mapping will be "4Gi". + // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:alpha(since: "1.37")=+k8s:dependentRequired("capacityMultiplier") optional string capacityKey = 1; - // AllocationMultiplier is used as a multiplier for the allocated device count or the allocated capacity in the claim. - // It defaults to 1 if not specified. How the field is used also depends on whether `capacityKey` is set. - // 1. If `capacityKey` is NOT set: `allocationMultiplier` multiplies the device count allocated to the claim. - // a. A DRA driver representing each CPU core as a device would have - // {ResourceName: "cpu", allocationMultiplier: "2"} in its - // `nodeAllocatableResourceMappings`. If 4 devices are allocated to the claim, - // 4 * 2 CPUs would be considered as allocated and subtracted from the node's capacity. - // b. A GPU device that needs additional node memory per GPU allocation would - // have {ResourceName: "memory", allocationMultiplier: "2Gi"}. Each allocated - // GPU device instance of this type will account for 2Gi of memory. - // - // 2. If `capacityKey` IS set: `allocationMultiplier` is multiplied by the amount of that capacity consumed. - // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `allocationMultiplier`. - // For example, if a Device's capacity "dra.example.com/cores" is consumed, - // and each "core" provides 2 "cpu"s, the mapping would be: - // {ResourceName: "cpu", capacityKey: "dra.example.com/cores", allocationMultiplier: "2"}. - // If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16. - // +optional - optional .k8s.io.apimachinery.pkg.api.resource.Quantity allocationMultiplier = 2; + // CapacityMultiplier is used as a multiplier for the allocated capacity consumed. + // It is only valid if `capacityKey` is set. + // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. + // For example, if a Device's capacity "dra.example.com/cores" is consumed, + // and each "core" provides 2 "cpu"s, the mapping would be: + // {ResourceName: "cpu", capacityKey: "dra.example.com/cores", capacityMultiplier: "2"}. + // If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16. + // +optional + // +k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:dependentRequired("capacityKey") + optional .k8s.io.apimachinery.pkg.api.resource.Quantity capacityMultiplier = 2; + + // DeviceMultiplier is used as a multiplier for the allocated device count in the claim. + // The final node allocatable resource amount is `deviceCount` * `deviceMultiplier`. + // For example, a DRA driver representing each cache complex (CCX) as a device would have + // {ResourceName: "cpu", deviceMultiplier: "8"} in its `nodeAllocatableResources`. + // If 2 devices (CCX) are allocated to the claim, 2 * 8 = 16 CPUs would be considered as allocated. + // It is only valid when `capacityKey` and `capacityMultiplier` are not set. + // +optional + // +k8s:optional + // +k8s:unionMember + optional .k8s.io.apimachinery.pkg.api.resource.Quantity deviceMultiplier = 3; +} + +// NodeAllocatableOverhead defines auxiliary resource overheads incurred when allocating a device. +// Overheads can be specified as a fixed cost per pod referencing the claim, a variable cost per container reference, or both. +// Kubelet accounts for this overhead by adding it to both the pod-level and container-level cgroups of referencing containers. +message NodeAllocatableOverhead { + // PerPod is overhead applied once per pod referencing the claim on this node. + // This is a flat overhead incurred for every pod referencing the claim. + // +optional + // +k8s:optional + optional .k8s.io.apimachinery.pkg.api.resource.Quantity perPod = 1; + + // PerContainer is applied per container reference to the claim. + // This models overhead scaling linearly with the number of containers actively using the device. + // When both PerPod and PerContainer are specified, the total overhead allocated for each pod referencing + // the claim is computed as: + // Quantity = PerPod + (PerContainer * NumReferences) + // Kubelet accounts for this overhead in cgroups: + // - Pod-level cgroup (requests and limits): Kubelet adds PerPod + (PerContainer * NumReferences). + // - Container-level cgroup (limits only): Kubelet adds PerPod + PerContainer for each referencing container. + // This allows any single container to access the pod-level overhead, while the parent cgroup caps the total usage to account for PerPod exactly once. + // +optional + // +k8s:optional + optional .k8s.io.apimachinery.pkg.api.resource.Quantity perContainer = 2; +} + +// NodeAllocatableResource defines the translation between the DRA device/capacity +// units requested to the corresponding quantity of the node allocatable resource. +// At least one of Mapping or Overhead must be specified. Not specifying either is an invalid configuration. +message NodeAllocatableResource { + // Mapping is used when the device directly models a node allocatable resource like standard CPU or memory + // (e.g., with a CPU DRA driver). The calculated quantity is accounted for exactly once per claim instance + // on the node. To prevent node cgroup isolation friction, the scheduler explicitly + // blocks sharing mapped device claims across multiple pods. + // +optional + // +k8s:optional + optional NodeAllocatableMapping mapping = 3; + + // Overhead contains fields for modeling auxiliary overhead incurred on node allocatable resources + // when allocating devices that are not themselves modeling a node allocatable resource (e.g., host memory overhead for GPUs). + // Sharing overhead-mapped claims across multiple pods is allowed. The node allocatable overhead is accounted + // for individually for each pod referencing the claim. + // Overhead is always subtracted from the node's allocatable capacity for the resource, even when mapping + // is specified for the same resource. + // Eg: If a device models memory capacity per socket as a consumable capacity pool via Mapping (with CapacityKey), + // any overhead specified for the same resource will be subtracted from the node's general allocatable capacity + // and not from the per-socket capacity pool in Mapping. + // +optional + // +k8s:optional + optional NodeAllocatableOverhead overhead = 4; } // OpaqueDeviceConfiguration contains configuration parameters for a driver @@ -1480,9 +1827,9 @@ message OpaqueDeviceConfiguration { // vendor of the driver. It should use only lower case characters. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless - // +k8s:alpha(since: "1.36")=+k8s:maxLength=63 + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-long-name-caseless + // +k8s:beta(since: "1.37")=+k8s:maxLength=63 optional string driver = 1; // Parameters can contain arbitrary data. It is the responsibility of @@ -1508,7 +1855,8 @@ message ResourceClaim { // Spec describes what is being requested and how to configure it. // The spec is immutable. - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:immutable + // +optional optional ResourceClaimSpec spec = 2; // Status describes whether the claim is ready to use and what has been allocated. @@ -1563,8 +1911,8 @@ message ResourceClaimStatus { // Allocation is set once the claim has been allocated successfully. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:update=NoModify + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:update=NoModify optional AllocationResult allocation = 1; // ReservedFor indicates which entities are currently allowed to use @@ -1592,10 +1940,10 @@ message ResourceClaimStatus { // +listMapKey=uid // +patchStrategy=merge // +patchMergeKey=uid - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:listType=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=uid - // +k8s:alpha(since: "1.36")=+k8s:maxItems=256 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:listType=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=uid + // +k8s:beta(since: "1.37")=+k8s:maxItems=256 repeated ResourceClaimConsumerReference reservedFor = 2; // Devices contains the status of each device allocated for this @@ -1603,18 +1951,18 @@ message ResourceClaimStatus { // information. Entries are owned by their respective drivers. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +listType=map // +listMapKey=driver // +listMapKey=device // +listMapKey=pool // +listMapKey=shareID // +featureGate=DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:listType=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=driver - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=device - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=pool - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=shareID + // +k8s:beta(since: "1.37")=+k8s:listType=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=driver + // +k8s:beta(since: "1.37")=+k8s:listMapKey=device + // +k8s:beta(since: "1.37")=+k8s:listMapKey=pool + // +k8s:beta(since: "1.37")=+k8s:listMapKey=shareID repeated AllocatedDeviceStatus devices = 4; } @@ -1629,6 +1977,7 @@ message ResourceClaimTemplate { // This field is immutable. A ResourceClaim will get created by the // control plane for a Pod when needed and then not get updated // anymore. + // +optional optional ResourceClaimTemplateSpec spec = 2; } @@ -1648,11 +1997,13 @@ message ResourceClaimTemplateSpec { // when creating it. No other fields are allowed and will be rejected during // validation. // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Spec for the ResourceClaim. The entire content is copied unchanged // into the ResourceClaim that gets created from this template. The // same fields as in a ResourceClaim are also valid here. + // +optional optional ResourceClaimSpec spec = 2; } @@ -1660,6 +2011,8 @@ message ResourceClaimTemplateSpec { message ResourcePool { // Name is used to identify the pool. For node-local devices, this // is often the node name, but this is not required. + // A field selector can be used to list only ResourceSlice objects + // belonging to a certain pool. // // It must not be longer than 253 characters and must consist of one or more DNS sub-domains // separated by slashes. This field is immutable. @@ -1797,7 +2150,7 @@ message ResourceSliceSpec { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +zeroOrOneOf=ResourceSliceType repeated Device devices = 6; @@ -1823,14 +2176,50 @@ message ResourceSliceSpec { // The maximum number of counter sets is 8. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=name + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=name // +featureGate=DRAPartitionableDevices // +zeroOrOneOf=ResourceSliceType - // +k8s:alpha(since: "1.36")=+k8s:maxItems=8 + // +k8s:beta(since: "1.37")=+k8s:maxItems=8 repeated CounterSet sharedCounters = 8; + + // PartitionTypeAttribute names a string device attribute (by fully + // qualified name, e.g. "gpu.example.com/profile") whose value labels + // each device with its partition type, such as "Full" or "Half" for a + // MIG-style GPU. + // + // When set, every partitionable device in the slice must carry the attribute + // and devices sharing a value must share the same ConsumesCounters cost. + // + // +optional + // +featureGate=DRAPartitionableDevicesType + // +k8s:ifDisabled(DRAPartitionableDevicesType)=+k8s:forbidden + // +k8s:ifEnabled(DRAPartitionableDevicesType)=+k8s:optional + // +k8s:ifEnabled(DRAPartitionableDevicesType)=+k8s:format=k8s-resource-fully-qualified-name + optional string partitionTypeAttribute = 9; + + // SkipNodeOperations lists node-local resource operations (gRPC calls) + // that will be skipped for the devices in this slice when determining whether + // operations are necessary on the node. If all allocated devices for a driver in + // a claim skip an operation, that gRPC call will be skipped. Valid values are: + // + // - "NodePrepareResources": NodePrepareResources gRPC calls are skipped. This + // value cannot be specified unless "NodeUnprepareResources" is also listed + // (or "*" is specified). + // - "NodeUnprepareResources": NodeUnprepareResources gRPC calls are skipped. + // - "*": All node-local resource operations are skipped. + // + // Other values may be added in the future. The kubelet must ignore unknown + // values. + // + // +optional + // +listType=set + // +k8s:listType=set + // +featureGate=DRAOptionalNodeOperations + // +k8s:optional + repeated string skipNodeOperations = 10; } diff --git a/vendor/k8s.io/api/resource/v1/register.go b/vendor/k8s.io/api/resource/v1/register.go index dca6492256..c634e4c9af 100644 --- a/vendor/k8s.io/api/resource/v1/register.go +++ b/vendor/k8s.io/api/resource/v1/register.go @@ -46,6 +46,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &DeviceClass{}, &DeviceClassList{}, + &DeviceTaintRule{}, + &DeviceTaintRuleList{}, &ResourceClaim{}, &ResourceClaimList{}, &ResourceClaimTemplate{}, diff --git a/vendor/k8s.io/api/resource/v1/types.go b/vendor/k8s.io/api/resource/v1/types.go index 27d5eff29c..580ffc3279 100644 --- a/vendor/k8s.io/api/resource/v1/types.go +++ b/vendor/k8s.io/api/resource/v1/types.go @@ -93,7 +93,7 @@ const ( // For resources that are not local to a node, the node name is not set. Instead, // the driver may use a node selector to specify where the devices are available. type ResourceSlice struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -112,6 +112,9 @@ const ( // ResourceSliceSelectorDriver can be used in a [metav1.ListOptions] // field selector to filter based on [ResourceSliceSpec.Driver]. ResourceSliceSelectorDriver = "spec.driver" + // ResourceSliceSelectorPoolName can be used in a [metav1.ListOptions] + // field selector to filter based on [ResourceSliceSpec.Pool.Name]. + ResourceSliceSelectorPoolName = "spec.pool.name" ) // ResourceSliceSpec contains the information published by the driver in one ResourceSlice. @@ -175,7 +178,7 @@ type ResourceSliceSpec struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +zeroOrOneOf=ResourceSliceType Devices []Device `json:"devices,omitempty" protobuf:"bytes,6,name=devices"` @@ -201,17 +204,68 @@ type ResourceSliceSpec struct { // The maximum number of counter sets is 8. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=name + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=name // +featureGate=DRAPartitionableDevices // +zeroOrOneOf=ResourceSliceType - // +k8s:alpha(since: "1.36")=+k8s:maxItems=8 + // +k8s:beta(since: "1.37")=+k8s:maxItems=8 SharedCounters []CounterSet `json:"sharedCounters,omitempty" protobuf:"bytes,8,name=sharedCounters"` + + // PartitionTypeAttribute names a string device attribute (by fully + // qualified name, e.g. "gpu.example.com/profile") whose value labels + // each device with its partition type, such as "Full" or "Half" for a + // MIG-style GPU. + // + // When set, every partitionable device in the slice must carry the attribute + // and devices sharing a value must share the same ConsumesCounters cost. + // + // +optional + // +featureGate=DRAPartitionableDevicesType + // +k8s:ifDisabled(DRAPartitionableDevicesType)=+k8s:forbidden + // +k8s:ifEnabled(DRAPartitionableDevicesType)=+k8s:optional + // +k8s:ifEnabled(DRAPartitionableDevicesType)=+k8s:format=k8s-resource-fully-qualified-name + PartitionTypeAttribute *FullyQualifiedName `json:"partitionTypeAttribute,omitempty" protobuf:"bytes,9,opt,name=partitionTypeAttribute"` + + // SkipNodeOperations lists node-local resource operations (gRPC calls) + // that will be skipped for the devices in this slice when determining whether + // operations are necessary on the node. If all allocated devices for a driver in + // a claim skip an operation, that gRPC call will be skipped. Valid values are: + // + // - "NodePrepareResources": NodePrepareResources gRPC calls are skipped. This + // value cannot be specified unless "NodeUnprepareResources" is also listed + // (or "*" is specified). + // - "NodeUnprepareResources": NodeUnprepareResources gRPC calls are skipped. + // - "*": All node-local resource operations are skipped. + // + // Other values may be added in the future. The kubelet must ignore unknown + // values. + // + // +optional + // +listType=set + // +k8s:listType=set + // +featureGate=DRAOptionalNodeOperations + // +k8s:optional + SkipNodeOperations []SkipNodeOperation `json:"skipNodeOperations,omitempty" protobuf:"bytes,10,rep,name=skipNodeOperations,casttype=SkipNodeOperation"` } +// +enum +// +k8s:enum +type SkipNodeOperation string + +const ( + // SkipNodeOperationNodePrepareResources indicates that NodePrepareResources gRPC calls are skipped. + SkipNodeOperationNodePrepareResources SkipNodeOperation = "NodePrepareResources" + + // SkipNodeOperationNodeUnprepareResources indicates that NodeUnprepareResources gRPC calls are skipped. + SkipNodeOperationNodeUnprepareResources SkipNodeOperation = "NodeUnprepareResources" + + // SkipNodeOperationAll indicates that all node-local resource operations are skipped. + SkipNodeOperationAll SkipNodeOperation = "*" +) + // CounterSet defines a named set of counters // that are available to be used by devices defined in the // ResourcePool. @@ -225,8 +279,8 @@ type CounterSet struct { // It must be a DNS label. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-short-name Name string `json:"name" protobuf:"bytes,1,name=name"` // Counters defines the set of counters for this CounterSet @@ -235,8 +289,8 @@ type CounterSet struct { // The maximum number of counters is 32. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:eachKey=+k8s:format=k8s-short-name Counters map[string]Counter `json:"counters,omitempty" protobuf:"bytes,2,name=counters"` } @@ -248,6 +302,8 @@ const DriverNameMaxLength = 63 type ResourcePool struct { // Name is used to identify the pool. For node-local devices, this // is often the node name, but this is not required. + // A field selector can be used to list only ResourceSlice objects + // belonging to a certain pool. // // It must not be longer than 253 characters and must consist of one or more DNS sub-domains // separated by slashes. This field is immutable. @@ -312,6 +368,10 @@ const ResourceSliceMaxDeviceCounterConsumptionsPerDevice = 2 // per device counter consumption. const ResourceSliceMaxCountersPerDeviceCounterConsumption = 32 +// Defines the maximum number of compatibility groups that can be +// declared per device counter consumption. +const DeviceCompatibilityGroupsMaxSize = 2 + // Device represents one individual hardware instance that can be selected based // on its attributes. Besides the name, exactly one field must be set. type Device struct { @@ -327,7 +387,7 @@ type Device struct { // The maximum number of attributes and capacities combined is 32. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Attributes map[QualifiedName]DeviceAttribute `json:"attributes,omitempty" protobuf:"bytes,2,rep,name=attributes"` // Capacity defines the set of capacities for this device. @@ -348,13 +408,13 @@ type Device struct { // device is 2. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=counterSet + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=counterSet // +featureGate=DRAPartitionableDevices - // +k8s:alpha(since: "1.36")=+k8s:maxItems=2 + // +k8s:beta(since: "1.37")=+k8s:maxItems=2 ConsumesCounters []DeviceCounterConsumption `json:"consumesCounters,omitempty" protobuf:"bytes,4,rep,name=consumesCounters"` // NodeName identifies the node where the device is available. @@ -401,7 +461,7 @@ type Device struct { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Taints []DeviceTaint `json:"taints,omitempty" protobuf:"bytes,8,rep,name=taints"` // BindsToNode indicates if the usage of an allocation involving this device @@ -431,8 +491,8 @@ type Device struct { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 BindingConditions []string `json:"bindingConditions,omitempty" protobuf:"bytes,10,rep,name=bindingConditions"` // BindingFailureConditions defines the conditions for binding failure. @@ -449,8 +509,8 @@ type Device struct { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 BindingFailureConditions []string `json:"bindingFailureConditions,omitempty" protobuf:"bytes,11,rep,name=bindingFailureConditions"` // AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests. @@ -462,7 +522,10 @@ type Device struct { // +featureGate=DRAConsumableCapacity AllowMultipleAllocations *bool `json:"allowMultipleAllocations,omitempty" protobuf:"bytes,12,opt,name=allowMultipleAllocations"` - // NodeAllocatableResourceMappings defines the mapping of node resources + // NodeAllocatableResourceMappings is tombstoned as it got replaced with NodeAllocatableResources. + // NodeAllocatableResourceMappings map[v1.ResourceName]NodeAllocatableResourceMapping `json:"nodeAllocatableResourceMappings,omitempty" protobuf:"bytes,13,opt,name=nodeAllocatableResourceMappings"` + + // NodeAllocatableResources defines the mapping of node resources // that are managed by the DRA driver exposing this device. This includes resources currently // reported in v1.Node `status.allocatable` that are not extended resources // (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). @@ -474,46 +537,104 @@ type Device struct { // The keys of this map are the node-allocatable resource names (e.g., "cpu", "memory"). // Extended resource names are not permitted as keys. // +optional + // +k8s:optional // +featureGate=DRANodeAllocatableResources - NodeAllocatableResourceMappings map[v1.ResourceName]NodeAllocatableResourceMapping `json:"nodeAllocatableResourceMappings,omitempty" protobuf:"bytes,13,opt,name=nodeAllocatableResourceMappings"` + NodeAllocatableResources map[v1.ResourceName]NodeAllocatableResource `json:"nodeAllocatableResources,omitempty" protobuf:"bytes,14,opt,name=nodeAllocatableResources"` } -// NodeAllocatableResourceMapping defines the translation between the DRA device/capacity +// NodeAllocatableResource defines the translation between the DRA device/capacity // units requested to the corresponding quantity of the node allocatable resource. -type NodeAllocatableResourceMapping struct { +// At least one of Mapping or Overhead must be specified. Not specifying either is an invalid configuration. +type NodeAllocatableResource struct { + // Mapping is used when the device directly models a node allocatable resource like standard CPU or memory + // (e.g., with a CPU DRA driver). The calculated quantity is accounted for exactly once per claim instance + // on the node. To prevent node cgroup isolation friction, the scheduler explicitly + // blocks sharing mapped device claims across multiple pods. + // +optional + // +k8s:optional + Mapping *NodeAllocatableMapping `json:"mapping,omitempty" protobuf:"bytes,3,opt,name=mapping"` + + // Overhead contains fields for modeling auxiliary overhead incurred on node allocatable resources + // when allocating devices that are not themselves modeling a node allocatable resource (e.g., host memory overhead for GPUs). + // Sharing overhead-mapped claims across multiple pods is allowed. The node allocatable overhead is accounted + // for individually for each pod referencing the claim. + // Overhead is always subtracted from the node's allocatable capacity for the resource, even when mapping + // is specified for the same resource. + // Eg: If a device models memory capacity per socket as a consumable capacity pool via Mapping (with CapacityKey), + // any overhead specified for the same resource will be subtracted from the node's general allocatable capacity + // and not from the per-socket capacity pool in Mapping. + // +optional + // +k8s:optional + Overhead *NodeAllocatableOverhead `json:"overhead,omitempty" protobuf:"bytes,4,opt,name=overhead"` +} + +// NodeAllocatableMapping defines how a DRA allocation directly translates into a node allocatable resource quantity. +// The mapping can be derived from either the count of allocated devices (via deviceMultiplier) or the specific capacity consumed (via capacityKey and capacityMultiplier). These options are mutually exclusive. +// Kubelet adds this mapped resource quantity from claim to both requests and limits at the pod-level cgroup, and to limits at the container-level cgroup for each container referencing the claim. +type NodeAllocatableMapping struct { // CapacityKey references a capacity name defined as a key in the // `spec.devices[*].capacity` map. When this field is set, the value associated with // this key in the `status.allocation.devices.results[*].consumedCapacity` map // (for a specific claim allocation) determines the base quantity for - // the node allocatable resource. If `allocationMultiplier` is also set, it is + // the node allocatable resource. `capacityMultiplier` must also be set and is // multiplied with the base quantity. // For example, if `spec.devices[*].capacity` has an entry "dra.example.com/memory": "128Gi", // and this field is set to "dra.example.com/memory", then for a claim allocation // that consumes { "dra.example.com/memory": "4Gi" } the base quantity for the - // node allocatable resource mapping will be "4Gi", and `allocationMultiplier` should - // be omitted or set to "1". + // node allocatable resource mapping will be "4Gi". + // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:alpha(since: "1.37")=+k8s:dependentRequired("capacityMultiplier") CapacityKey *QualifiedName `json:"capacityKey,omitempty" protobuf:"bytes,1,opt,name=capacityKey"` - // AllocationMultiplier is used as a multiplier for the allocated device count or the allocated capacity in the claim. - // It defaults to 1 if not specified. How the field is used also depends on whether `capacityKey` is set. - // 1. If `capacityKey` is NOT set: `allocationMultiplier` multiplies the device count allocated to the claim. - // a. A DRA driver representing each CPU core as a device would have - // {ResourceName: "cpu", allocationMultiplier: "2"} in its - // `nodeAllocatableResourceMappings`. If 4 devices are allocated to the claim, - // 4 * 2 CPUs would be considered as allocated and subtracted from the node's capacity. - // b. A GPU device that needs additional node memory per GPU allocation would - // have {ResourceName: "memory", allocationMultiplier: "2Gi"}. Each allocated - // GPU device instance of this type will account for 2Gi of memory. - // - // 2. If `capacityKey` IS set: `allocationMultiplier` is multiplied by the amount of that capacity consumed. - // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `allocationMultiplier`. - // For example, if a Device's capacity "dra.example.com/cores" is consumed, - // and each "core" provides 2 "cpu"s, the mapping would be: - // {ResourceName: "cpu", capacityKey: "dra.example.com/cores", allocationMultiplier: "2"}. - // If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16. - // +optional - AllocationMultiplier *resource.Quantity `json:"allocationMultiplier,omitempty" protobuf:"bytes,2,opt,name=allocationMultiplier"` + // CapacityMultiplier is used as a multiplier for the allocated capacity consumed. + // It is only valid if `capacityKey` is set. + // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. + // For example, if a Device's capacity "dra.example.com/cores" is consumed, + // and each "core" provides 2 "cpu"s, the mapping would be: + // {ResourceName: "cpu", capacityKey: "dra.example.com/cores", capacityMultiplier: "2"}. + // If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16. + // +optional + // +k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:dependentRequired("capacityKey") + CapacityMultiplier *resource.Quantity `json:"capacityMultiplier,omitempty" protobuf:"bytes,2,opt,name=capacityMultiplier"` + + // DeviceMultiplier is used as a multiplier for the allocated device count in the claim. + // The final node allocatable resource amount is `deviceCount` * `deviceMultiplier`. + // For example, a DRA driver representing each cache complex (CCX) as a device would have + // {ResourceName: "cpu", deviceMultiplier: "8"} in its `nodeAllocatableResources`. + // If 2 devices (CCX) are allocated to the claim, 2 * 8 = 16 CPUs would be considered as allocated. + // It is only valid when `capacityKey` and `capacityMultiplier` are not set. + // +optional + // +k8s:optional + // +k8s:unionMember + DeviceMultiplier *resource.Quantity `json:"deviceMultiplier,omitempty" protobuf:"bytes,3,opt,name=deviceMultiplier"` +} + +// NodeAllocatableOverhead defines auxiliary resource overheads incurred when allocating a device. +// Overheads can be specified as a fixed cost per pod referencing the claim, a variable cost per container reference, or both. +// Kubelet accounts for this overhead by adding it to both the pod-level and container-level cgroups of referencing containers. +type NodeAllocatableOverhead struct { + // PerPod is overhead applied once per pod referencing the claim on this node. + // This is a flat overhead incurred for every pod referencing the claim. + // +optional + // +k8s:optional + PerPod *resource.Quantity `json:"perPod,omitempty" protobuf:"bytes,1,opt,name=perPod"` + + // PerContainer is applied per container reference to the claim. + // This models overhead scaling linearly with the number of containers actively using the device. + // When both PerPod and PerContainer are specified, the total overhead allocated for each pod referencing + // the claim is computed as: + // Quantity = PerPod + (PerContainer * NumReferences) + // Kubelet accounts for this overhead in cgroups: + // - Pod-level cgroup (requests and limits): Kubelet adds PerPod + (PerContainer * NumReferences). + // - Container-level cgroup (limits only): Kubelet adds PerPod + PerContainer for each referencing container. + // This allows any single container to access the pod-level overhead, while the parent cgroup caps the total usage to account for PerPod exactly once. + // +optional + // +k8s:optional + PerContainer *resource.Quantity `json:"perContainer,omitempty" protobuf:"bytes,2,opt,name=perContainer"` } // DeviceCounterConsumption defines a set of counters that @@ -523,8 +644,8 @@ type DeviceCounterConsumption struct { // counters defined will be consumed. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-short-name CounterSet string `json:"counterSet" protobuf:"bytes,1,opt,name=counterSet"` // Counters defines the counters that will be consumed by the device. @@ -532,9 +653,39 @@ type DeviceCounterConsumption struct { // The maximum number of counters is 32. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:eachKey=+k8s:format=k8s-short-name Counters map[string]Counter `json:"counters,omitempty" protobuf:"bytes,2,opt,name=counters"` + + // CompatibilityGroups is a list of opaque group names for + // this counter set consumption. + // + // Devices that consume counters from the same counter set may only be + // allocated at the same time ("co-allocated") if they all share at least + // one common group: the intersection of the CompatibilityGroups of all + // co-allocated devices on that counter set must be non-empty. Devices + // that consume from different counter sets are never compared via this + // field. + // + // An unset field, an explicit nil, and an empty list are equivalent and + // mean "no groups": such a device is only co-allocatable with sibling + // devices on the same counter set that also have no groups, and is never + // co-allocatable with a device that declares one or more groups. + // + // Group names are opaque and meaningful only within the + // publishing driver's pool. + // + // The maximum number of groups is 2, and the names must be unique. + // + // +optional + // +listType=atomic + // +featureGate=DRADeviceCompatibilityGroups + // +k8s:listType=atomic + // +k8s:optional + // +k8s:maxItems=2 + // +k8s:unique=set + // +k8s:eachVal=+k8s:format=k8s-short-name + CompatibilityGroups []string `json:"compatibilityGroups,omitempty" protobuf:"bytes,3,rep,name=compatibilityGroups"` } // DeviceCapacity describes a quantity associated with a device. @@ -618,6 +769,13 @@ type CapacityRequestPolicy struct { // CapacityRequestPolicyRange defines a valid range for consumable capacity values. // +// If the DRAFractionalCapacityRange feature gate is +// enabled and at least one of Min, Max, or Step is a fractional quantity (i.e. +// its value is not an integer), milli-unit arithmetic is used instead, +// supporting values with up to 3 decimal places (e.g. 100m = 0.1). +// The largest supported value then is 1000 times smaller compared to using 64-bit integers. +// Otherwise, all comparisons use 64-bit integer arithmetic via resource.Quantity.Value(). +// // - If the requested amount is less than Min, it is rounded up to the Min value. // - If Step is set and the requested amount is between Min and Max but not aligned with Step, // it will be rounded up to the next value equal to Min + (n * Step). @@ -697,30 +855,30 @@ type DeviceAttribute struct { // IntValue is a number. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember IntValue *int64 `json:"int,omitempty" protobuf:"varint,2,opt,name=int"` // BoolValue is a true/false value. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember BoolValue *bool `json:"bool,omitempty" protobuf:"varint,3,opt,name=bool"` // StringValue is a string. Must not be longer than 64 characters. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember StringValue *string `json:"string,omitempty" protobuf:"bytes,4,opt,name=string"` // VersionValue is a semantic version according to semver.org spec 2.0.0. // Must not be longer than 64 characters. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember VersionValue *string `json:"version,omitempty" protobuf:"bytes,5,opt,name=version"` // IntValues is a non-empty list of numbers. @@ -730,8 +888,8 @@ type DeviceAttribute struct { // +optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember // +featureGate=DRAListTypeAttributes IntValues []int64 `json:"ints,omitempty" protobuf:"varint,6,opt,name=ints"` @@ -740,8 +898,8 @@ type DeviceAttribute struct { // +optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember // +featureGate=DRAListTypeAttributes BoolValues []bool `json:"bools,omitempty" protobuf:"varint,7,opt,name=bools"` @@ -753,8 +911,9 @@ type DeviceAttribute struct { // +optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember + // +k8s:alpha(since: "1.37")=+k8s:eachVal=+k8s:maxBytes=64 // +featureGate=DRAListTypeAttributes StringValues []string `json:"strings,omitempty" protobuf:"bytes,8,opt,name=strings"` @@ -766,8 +925,8 @@ type DeviceAttribute struct { // +optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember // +featureGate=DRAListTypeAttributes VersionValues []string `json:"versions,omitempty" protobuf:"bytes,9,opt,name=versions"` } @@ -804,7 +963,7 @@ type DeviceTaint struct { // Consumers must treat unknown effects like None. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Effect DeviceTaintEffect `json:"effect" protobuf:"bytes,3,name=effect,casttype=DeviceTaintEffect"` // ^^^^ @@ -843,7 +1002,7 @@ type DeviceTaint struct { } // +enum -// +k8s:alpha(since: "1.36")=+k8s:enum +// +k8s:beta(since: "1.37")=+k8s:enum type DeviceTaintEffect string const ( @@ -859,12 +1018,166 @@ const ( DeviceTaintEffectNoExecute DeviceTaintEffect = "NoExecute" ) +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.37 + +// DeviceTaintRule adds one taint to all devices which match the selector. +// This has the same effect as if the taint was specified directly +// in the ResourceSlice by the DRA driver. +// +k8s:supportsSubresource="/status" +type DeviceTaintRule struct { + metav1.TypeMeta `json:""` + // Standard object metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Spec specifies the selector and one taint. + // + // Changing the spec automatically increments the metadata.generation number. + // +required + Spec DeviceTaintRuleSpec `json:"spec" protobuf:"bytes,2,name=spec"` + + // Status provides information about what was requested in the spec. + // + // +optional + Status DeviceTaintRuleStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// DeviceTaintRuleSpec specifies the selector and one taint. +type DeviceTaintRuleSpec struct { + // DeviceSelector defines which device(s) the taint is applied to. + // All selector criteria must be satisfied for a device to + // match. The empty selector matches all devices. Without + // a selector, no devices are matches. + // + // +optional + DeviceSelector *DeviceTaintSelector `json:"deviceSelector,omitempty" protobuf:"bytes,1,opt,name=deviceSelector"` + + // The taint that gets applied to matching devices. + // + // +required + Taint DeviceTaint `json:"taint,omitempty" protobuf:"bytes,2,rep,name=taint"` +} + +// DeviceTaintSelector defines which device(s) a DeviceTaintRule applies to. +// The empty selector matches all devices. Without a selector, no devices +// are matched. +type DeviceTaintSelector struct { + // If DeviceClassName is set, the selectors defined there must be + // satisfied by a device to be selected. This field corresponds + // to class.metadata.name. + // + // +optional + // + // Tombstoned since 1.35 because it turned out that supporting this in all cases + // would depend on copying the device attributes into the ResourceClaim allocation + // result. Without that the eviction controller cannot evaluate these CEL expressions. + // + // DeviceClassName *string `json:"deviceClassName,omitempty" protobuf:"bytes,1,opt,name=deviceClassName"` + + // If driver is set, only devices from that driver are selected. + // This fields corresponds to slice.spec.driver. + // + // +optional + Driver *string `json:"driver,omitempty" protobuf:"bytes,2,opt,name=driver"` + + // If pool is set, only devices in that pool are selected. + // + // Also setting the driver name may be useful to avoid + // ambiguity when different drivers use the same pool name, + // but this is not required because selecting pools from + // different drivers may also be useful, for example when + // drivers with node-local devices use the node name as + // their pool name. + // + // +optional + Pool *string `json:"pool,omitempty" protobuf:"bytes,3,opt,name=pool"` + + // If device is set, only devices with that name are selected. + // This field corresponds to slice.spec.devices[].name. + // + // Setting also driver and pool may be required to avoid ambiguity, + // but is not required. + // + // +optional + Device *string `json:"device,omitempty" protobuf:"bytes,4,opt,name=device"` + + // Selectors contains the same selection criteria as a ResourceClaim. + // Currently, CEL expressions are supported. All of these selectors + // must be satisfied. + // + // +optional + // +listType=atomic + // + // Tombstoned since 1.35 because it turned out that supporting this in all cases + // would depend on copying the device attributes into the ResourceClaim allocation + // result. Without that the eviction controller cannot evaluate these CEL expressions. + // + // Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,5,rep,name=selectors"` +} + +// DeviceTaintRuleStatus provides information about an on-going pod eviction. +type DeviceTaintRuleStatus struct { + // Conditions provide information about the state of the DeviceTaintRule + // and the cluster at some point in time, + // in a machine-readable and human-readable format. + // + // The following condition is currently defined as part of this API, more may + // get added: + // - Type: EvictionInProgress + // - Status: True if there are currently pods which need to be evicted, False otherwise + // (includes the effects which don't cause eviction). + // - Reason: not specified, may change + // - Message: includes information about number of pending pods and already evicted pods + // in a human-readable format, updated periodically, may change + // + // For `effect: None`, the condition above gets set once for each change to + // the spec, with the message containing information about what would happen + // if the effect was `NoExecute`. This feedback can be used to decide whether + // changing the effect to `NoExecute` will work as intended. It only gets + // set once to avoid having to constantly update the status. + // + // Must have 8 or fewer entries. + // + // +optional + // +listType=map + // +listMapKey=type + // +patchStrategy=merge + // +patchMergeKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` +} + +// DeviceTaintRuleStatusMaxConditions is the maximum number of conditions in DeviceTaintRuleStatus. +const DeviceTaintRuleStatusMaxConditions = 8 + +// DeviceTaintConditionEvictionInProgress is the publicly documented condition type for the DeviceTaintRuleStatus. +const DeviceTaintConditionEvictionInProgress = "EvictionInProgress" + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.37 + +// DeviceTaintRuleList is a collection of DeviceTaintRules. +type DeviceTaintRuleList struct { + metav1.TypeMeta `json:""` + // Standard list metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Items is the list of DeviceTaintRules. + Items []DeviceTaintRule `json:"items" protobuf:"bytes,2,rep,name=items"` +} + // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.34 // ResourceSliceList is a collection of ResourceSlices. type ResourceSliceList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -884,14 +1197,15 @@ type ResourceSliceList struct { // stanza tracks whether this claim has been satisfied and what specific // resources have been allocated. type ResourceClaim struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec describes what is being requested and how to configure it. // The spec is immutable. - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:immutable + // +optional Spec ResourceClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"` // Status describes whether the claim is ready to use and what has been allocated. @@ -919,11 +1233,11 @@ type DeviceClaim struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=name - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=name + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Requests []DeviceRequest `json:"requests" protobuf:"bytes,1,name=requests"` // These constraints must be satisfied by the set of devices that get @@ -931,8 +1245,8 @@ type DeviceClaim struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Constraints []DeviceConstraint `json:"constraints,omitempty" protobuf:"bytes,2,opt,name=constraints"` // This field holds configuration for multiple potential drivers which @@ -941,8 +1255,8 @@ type DeviceClaim struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Config []DeviceClaimConfiguration `json:"config,omitempty" protobuf:"bytes,3,opt,name=config"` // Potential future extension, ignored by older schedulers. This is @@ -993,7 +1307,7 @@ type DeviceRequest struct { // // +optional // +oneOf=deviceRequestType - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Exactly *ExactDeviceRequest `json:"exactly,omitempty" protobuf:"bytes,2,name=exactly"` // FirstAvailable contains subrequests, of which exactly one will be @@ -1014,11 +1328,11 @@ type DeviceRequest struct { // +oneOf=deviceRequestType // +listType=atomic // +featureGate=DRAPrioritizedList - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=name - // +k8s:alpha(since: "1.36")=+k8s:maxItems=8 + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=name + // +k8s:beta(since: "1.37")=+k8s:maxItems=8 FirstAvailable []DeviceSubRequest `json:"firstAvailable,omitempty" protobuf:"bytes,3,name=firstAvailable"` } @@ -1046,8 +1360,8 @@ type ExactDeviceRequest struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,2,name=selectors"` // AllocationMode and its related fields define how devices are allocated @@ -1070,7 +1384,7 @@ type ExactDeviceRequest struct { // requests with unknown modes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional AllocationMode DeviceAllocationMode `json:"allocationMode,omitempty" protobuf:"bytes,3,opt,name=allocationMode"` // Count is used only when the count mode is "ExactCount". Must be greater than zero. @@ -1114,7 +1428,7 @@ type ExactDeviceRequest struct { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Tolerations []DeviceToleration `json:"tolerations,omitempty" protobuf:"bytes,6,opt,name=tolerations"` // Capacity define resource requirements against each capacity. @@ -1133,6 +1447,34 @@ type ExactDeviceRequest struct { // +optional // +featureGate=DRAConsumableCapacity Capacity *CapacityRequirements `json:"capacity,omitempty" protobuf:"bytes,7,opt,name=capacity"` + + // DerivedAttributes defines a set of virtual attributes computed via CEL expressions + // for each candidate device. These virtual attributes can be referenced in + // `.devices.constraints` to align and match different devices (e.g., co-allocating + // a GPU and a NIC on the same NUMA node) even if their drivers publish different + // attributes. Derived attributes are not available via `device.attributes` + // in the CEL environment when evaluating selector expressions. + // + // Derived attributes allow you to extract, transform, or normalize topology + // information (such as extracting a NUMA index from a complex topology string or + // renaming a vendor-specific attribute) into a common virtual attribute name at + // scheduling time. The scheduler then evaluates these virtual attributes exactly + // like static attributes when matching constraints. + // + // Every derived attribute defined in this list must be referenced by at least one + // MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list. + // + // The maximum number of derived attributes is 32. + // + // This is an alpha field and requires enabling the DRADerivedAttributes + // feature gate. + // + // +optional + // +listType=atomic + // +featureGate=DRADerivedAttributes + // +k8s:optional + // +k8s:maxItems=32 + DerivedAttributes []DeviceDerivedAttribute `json:"derivedAttributes,omitempty" protobuf:"bytes,8,rep,name=derivedAttributes"` } // DeviceSubRequest describes a request for device provided in the @@ -1166,8 +1508,8 @@ type DeviceSubRequest struct { // to reference. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-long-name DeviceClassName string `json:"deviceClassName" protobuf:"bytes,2,name=deviceClassName"` // Selectors define criteria which must be satisfied by a specific @@ -1177,8 +1519,8 @@ type DeviceSubRequest struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,3,name=selectors"` // AllocationMode and its related fields define how devices are allocated @@ -1200,7 +1542,7 @@ type DeviceSubRequest struct { // requests with unknown modes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional AllocationMode DeviceAllocationMode `json:"allocationMode,omitempty" protobuf:"bytes,4,opt,name=allocationMode"` // Count is used only when the count mode is "ExactCount". Must be greater than zero. @@ -1231,7 +1573,7 @@ type DeviceSubRequest struct { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Tolerations []DeviceToleration `json:"tolerations,omitempty" protobuf:"bytes,6,opt,name=tolerations"` // Capacity define resource requirements against each capacity. @@ -1250,6 +1592,34 @@ type DeviceSubRequest struct { // +optional // +featureGate=DRAConsumableCapacity Capacity *CapacityRequirements `json:"capacity,omitempty" protobuf:"bytes,7,opt,name=capacity"` + + // DerivedAttributes defines a set of virtual attributes computed via CEL expressions + // for each candidate device. These virtual attributes can be referenced in + // `.devices.constraints` to align and match different devices (e.g., co-allocating + // a GPU and a NIC on the same NUMA node) even if their drivers publish different + // attributes. Derived attributes are not available via `device.attributes` + // in the CEL environment when evaluating selector expressions. + // + // Derived attributes allow you to extract, transform, or normalize topology + // information (such as extracting a NUMA index from a complex topology string or + // renaming a vendor-specific attribute) into a common virtual attribute name at + // scheduling time. The scheduler then evaluates these virtual attributes exactly + // like static attributes when matching constraints. + // + // Every derived attribute defined in this list must be referenced by at least one + // MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list. + // + // The maximum number of derived attributes is 32. + // + // This is an alpha field and requires enabling the DRADerivedAttributes + // feature gate. + // + // +optional + // +listType=atomic + // +featureGate=DRADerivedAttributes + // +k8s:optional + // +k8s:maxItems=32 + DerivedAttributes []DeviceDerivedAttribute `json:"derivedAttributes,omitempty" protobuf:"bytes,8,rep,name=derivedAttributes"` } // CapacityRequirements defines the capacity requirements for a specific device request. @@ -1285,10 +1655,11 @@ const ( DeviceSelectorsMaxSize = 32 FirstAvailableDeviceRequestMaxSize = 8 DeviceTolerationsMaxLength = 16 + DeviceDerivedAttributesMaxSize = 32 ) // +enum -// +k8s:alpha(since: "1.36")=+k8s:enum +// +k8s:beta(since: "1.37")=+k8s:enum type DeviceAllocationMode string // Valid [DeviceRequest.CountMode] values. @@ -1318,7 +1689,7 @@ type CELDeviceSelector struct { // - driver (string): the name of the driver which defines this device. // - attributes (map[string]object): the device's attributes, grouped by prefix // (e.g. device.attributes["dra.example.com"] evaluates to an object with all - // of the attributes which were prefixed by "dra.example.com". + // of the attributes which were prefixed by "dra.example.com"). // - capacity (map[string]object): the device's capacities, grouped by prefix. // - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device // (v1.34+ with the DRAConsumableCapacity feature enabled). @@ -1351,6 +1722,15 @@ type CELDeviceSelector struct { // A robust expression should check for the existence of attributes // before referencing them. // + // Common errors: + // - "no such key": Use optional chaining (.? followed by orValue()) + // or guarding the check with has() for optional fields. + // See CEL Optional Types for details: + // https://pkg.go.dev/github.com/google/cel-go@v0.17.4/cel#OptionalTypes + // + // For more CEL expression syntax and examples, see: + // https://kubernetes.io/docs/reference/using-api/cel/ + // // For ease of use, the cel.bind() function is enabled, and can be used // to simplify expressions that access multiple attributes with the // same domain. For example: @@ -1373,6 +1753,61 @@ type CELDeviceSelector struct { Expression string `json:"expression" protobuf:"bytes,1,name=expression"` } +// DeviceDerivedAttribute defines a derived attribute computed via CEL. +type DeviceDerivedAttribute struct { + // Name is the identifier for this derived attribute, used in constraints. + // + // It must be a DNS subdomain followed by a slash ("/") followed by a C identifier + // (e.g. "example.com/numaNode" or "derived/numaNode"). + // + // If the chosen name matches an existing physical attribute from a driver, + // the derived attribute's expression will shadow the physical attribute, + // and its evaluated value will be used in constraints instead. When the goal + // is to define a derived attribute that is only used within the ResourceClaim + // and not meant to shadow an existing attribute, use a domain prefix that + // no DRA driver should be using (e.g. "derived/myAttribute"). + // + // It is not valid to define a derived attribute that isn't used in at least + // one constraint. + // + // +required + // +k8s:required + // +k8s:format=k8s-resource-fully-qualified-name + Name FullyQualifiedName `json:"name" protobuf:"bytes,1,name=name"` + + // Expression is a CEL expression evaluated against each candidate device. + // The expression must evaluate to a primitive scalar (string, integer, + // boolean, or semver) or a list of these scalars ([]string, []int64, + // []bool, []semver) to act as a virtual grouping key. Any other return type + // is an error and causes CEL evaluation for the device to fail. + // + // The expression's input is an object named "device", which carries the + // same properties as in a CELDeviceSelector. + // + // When pod scheduling encounters CEL runtime errors (such as looking + // up an attribute that isn't defined) for some devices, it will abort + // allocation and fail scheduling for the Pod. Surfacing evaluation + // errors immediately prevents silent topology matching failures that are + // extremely hard to detect. A robust expression should, for example, check + // for the existence of attributes before referencing them to avoid + // runtime evaluation errors. + // + // The expression gets evaluated after a device has passed the other + // selector expressions for the request in which this expression is used. + // This allows writing expressions that are tailored towards the specific + // devices being requested (for example, by assuming the device is from a + // certain vendor and skipping those checks). + // + // The length of the expression must be smaller or equal to 10 Ki. The + // cost of evaluating it is also limited based on the estimated number + // of logical steps; the combined cost of all derived attributes in a + // claim is capped by a shared CEL cost budget. + // + // +required + // +k8s:required + Expression string `json:"expression" protobuf:"bytes,2,name=expression"` +} + // CELSelectorExpressionMaxCost specifies the cost limit for a single CEL selector // evaluation. // @@ -1398,6 +1833,25 @@ type CELDeviceSelector struct { // However, this depends on how fast the machine is. const CELSelectorExpressionMaxCost = 1000000 +// DeviceClaimDerivedAttributeCELMaxCost is the maximum combined execution cost +// allowed for all derived attribute CEL expressions within a single DeviceClaim. +// +// During validation, the API server computes the estimated execution cost of each +// derived attribute expression. The sum of these costs across all requests in the +// claim must not exceed this budget. If it does, the claim is rejected. +// +// To stay within the budget, consumers should simplify their CEL expressions, +// avoid computationally expensive operations like deep nesting or iterations +// (such as `.all()` or `.exists()`), and minimize the total number of derived +// attributes in a claim. +// +// This shared budget prevents excessively complex claims from degrading the +// performance of the kube-scheduler. The limit is set to 1,000,000 instruction +// executions (roughly 0.1 seconds of evaluation time), tying the collective +// cost of all derived attributes to the maximum cost allowed for a single +// CEL selector. +const DeviceClaimDerivedAttributeCELMaxCost = 1000000 + // CELSelectorExpressionMaxLength is the maximum length of a CEL selector expression string. const CELSelectorExpressionMaxLength = 10 * 1024 @@ -1415,10 +1869,10 @@ type DeviceConstraint struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Requests []string `json:"requests,omitempty" protobuf:"bytes,1,opt,name=requests"` // MatchAttribute requires that all devices in question have this @@ -1441,8 +1895,8 @@ type DeviceConstraint struct { // // +optional // +oneOf=ConstraintType - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-fully-qualified-name + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-resource-fully-qualified-name MatchAttribute *FullyQualifiedName `json:"matchAttribute,omitempty" protobuf:"bytes,2,opt,name=matchAttribute"` // Potential future extension, not part of the current design: @@ -1474,6 +1928,8 @@ type DeviceConstraint struct { // +optional // +oneOf=ConstraintType // +featureGate=DRAConsumableCapacity + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-resource-fully-qualified-name DistinctAttribute *FullyQualifiedName `json:"distinctAttribute,omitempty" protobuf:"bytes,3,opt,name=distinctAttribute"` } @@ -1488,13 +1944,13 @@ type DeviceClaimConfiguration struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Requests []string `json:"requests,omitempty" protobuf:"bytes,1,opt,name=requests"` - DeviceConfiguration `json:",inline" protobuf:"bytes,2,name=deviceConfiguration"` + DeviceConfiguration `json:"" protobuf:"bytes,2,name=deviceConfiguration"` } // DeviceConfiguration must have exactly one field set. It gets embedded @@ -1505,7 +1961,7 @@ type DeviceConfiguration struct { // // +optional // +oneOf=ConfigurationType - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Opaque *OpaqueDeviceConfiguration `json:"opaque,omitempty" protobuf:"bytes,1,opt,name=opaque"` } @@ -1522,9 +1978,9 @@ type OpaqueDeviceConfiguration struct { // vendor of the driver. It should use only lower case characters. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless - // +k8s:alpha(since: "1.36")=+k8s:maxLength=63 + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-long-name-caseless + // +k8s:beta(since: "1.37")=+k8s:maxLength=63 Driver string `json:"driver" protobuf:"bytes,1,name=driver"` // Parameters can contain arbitrary data. It is the responsibility of @@ -1550,8 +2006,8 @@ type DeviceToleration struct { // Must be a label name. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-label-key + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-label-key Key string `json:"key,omitempty" protobuf:"bytes,1,opt,name=key"` // Operator represents a key's relationship to the value. @@ -1561,7 +2017,7 @@ type DeviceToleration struct { // // +optional // +default="Equal" - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Operator DeviceTolerationOperator `json:"operator,omitempty" protobuf:"bytes,2,opt,name=operator,casttype=DeviceTolerationOperator"` // Value is the taint value the toleration matches to. @@ -1575,7 +2031,7 @@ type DeviceToleration struct { // When specified, allowed values are NoSchedule and NoExecute. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Effect DeviceTaintEffect `json:"effect,omitempty" protobuf:"bytes,4,opt,name=effect,casttype=DeviceTaintEffect"` // TolerationSeconds represents the period of time the toleration (which must be @@ -1592,7 +2048,7 @@ type DeviceToleration struct { // A toleration operator is the set of operators that can be used in a toleration. // // +enum -// +k8s:alpha(since: "1.36")=+k8s:enum +// +k8s:beta(since: "1.37")=+k8s:enum type DeviceTolerationOperator string const ( @@ -1606,8 +2062,8 @@ type ResourceClaimStatus struct { // Allocation is set once the claim has been allocated successfully. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:update=NoModify + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:update=NoModify Allocation *AllocationResult `json:"allocation,omitempty" protobuf:"bytes,1,opt,name=allocation"` // ReservedFor indicates which entities are currently allowed to use @@ -1635,10 +2091,10 @@ type ResourceClaimStatus struct { // +listMapKey=uid // +patchStrategy=merge // +patchMergeKey=uid - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:listType=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=uid - // +k8s:alpha(since: "1.36")=+k8s:maxItems=256 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:listType=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=uid + // +k8s:beta(since: "1.37")=+k8s:maxItems=256 ReservedFor []ResourceClaimConsumerReference `json:"reservedFor,omitempty" protobuf:"bytes,2,opt,name=reservedFor" patchStrategy:"merge" patchMergeKey:"uid"` // DeallocationRequested is tombstoned since Kubernetes 1.32 where @@ -1651,18 +2107,18 @@ type ResourceClaimStatus struct { // information. Entries are owned by their respective drivers. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +listType=map // +listMapKey=driver // +listMapKey=device // +listMapKey=pool // +listMapKey=shareID // +featureGate=DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:listType=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=driver - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=device - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=pool - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=shareID + // +k8s:beta(since: "1.37")=+k8s:listType=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=driver + // +k8s:beta(since: "1.37")=+k8s:listMapKey=device + // +k8s:beta(since: "1.37")=+k8s:listMapKey=pool + // +k8s:beta(since: "1.37")=+k8s:listMapKey=shareID Devices []AllocatedDeviceStatus `json:"devices,omitempty" protobuf:"bytes,4,opt,name=devices"` } @@ -1725,8 +2181,8 @@ type DeviceAllocationResult struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Results []DeviceRequestAllocationResult `json:"results,omitempty" protobuf:"bytes,1,opt,name=results"` // This field is a combination of all the claim and class configuration parameters. @@ -1739,8 +2195,8 @@ type DeviceAllocationResult struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=64 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=64 Config []DeviceAllocationConfiguration `json:"config,omitempty" protobuf:"bytes,2,opt,name=config"` } @@ -1769,9 +2225,9 @@ type DeviceRequestAllocationResult struct { // vendor of the driver. It should use only lower case characters. // // +required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:maxLength=63 + // +k8s:beta(since: "1.37")=+k8s:format=k8s-long-name-caseless + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:maxLength=63 Driver string `json:"driver" protobuf:"bytes,2,name=driver"` // This name together with the driver name and the device name field @@ -1781,8 +2237,8 @@ type DeviceRequestAllocationResult struct { // DNS sub-domains separated by slashes. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-pool-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-resource-pool-name Pool string `json:"pool" protobuf:"bytes,3,name=pool"` // Device references one device instance via its name in the driver's @@ -1813,7 +2269,7 @@ type DeviceRequestAllocationResult struct { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Tolerations []DeviceToleration `json:"tolerations,omitempty" protobuf:"bytes,6,opt,name=tolerations"` // BindingConditions contains a copy of the BindingConditions @@ -1825,8 +2281,8 @@ type DeviceRequestAllocationResult struct { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 BindingConditions []string `json:"bindingConditions,omitempty" protobuf:"bytes,7,rep,name=bindingConditions"` // BindingFailureConditions contains a copy of the BindingFailureConditions @@ -1838,8 +2294,8 @@ type DeviceRequestAllocationResult struct { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 BindingFailureConditions []string `json:"bindingFailureConditions,omitempty" protobuf:"bytes,8,rep,name=bindingFailureConditions"` // ShareID uniquely identifies an individual allocation share of the device, @@ -1849,8 +2305,8 @@ type DeviceRequestAllocationResult struct { // // +optional // +featureGate=DRAConsumableCapacity - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-uuid ShareID *types.UID `json:"shareID,omitempty" protobuf:"bytes,9,opt,name=shareID"` // ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request. @@ -1865,6 +2321,19 @@ type DeviceRequestAllocationResult struct { // +optional // +featureGate=DRAConsumableCapacity ConsumedCapacity map[QualifiedName]resource.Quantity `json:"consumedCapacity,omitempty" protobuf:"bytes,10,rep,name=consumedCapacity"` + + // SkipNodeOperations lists node-local resource operations (gRPC calls) + // that will be skipped for this allocated device when determining whether + // operations are necessary on the node. If all allocated devices for a driver in + // a claim skip an operation, that gRPC call will be skipped. It is a copy of + // the ResourceSlice.spec.skipNodeOperations value at the time when the device was allocated. + // + // +optional + // +listType=set + // +k8s:listType=set + // +featureGate=DRAOptionalNodeOperations + // +k8s:optional + SkipNodeOperations []SkipNodeOperation `json:"skipNodeOperations,omitempty" protobuf:"bytes,11,rep,name=skipNodeOperations,casttype=SkipNodeOperation"` } // DeviceAllocationConfiguration gets embedded in an AllocationResult. @@ -1874,7 +2343,7 @@ type DeviceAllocationConfiguration struct { // or from a claim. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Source AllocationConfigSource `json:"source" protobuf:"bytes,1,name=source"` // Requests lists the names of requests where the configuration applies. @@ -1886,17 +2355,17 @@ type DeviceAllocationConfiguration struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Requests []string `json:"requests,omitempty" protobuf:"bytes,2,opt,name=requests"` - DeviceConfiguration `json:",inline" protobuf:"bytes,3,name=deviceConfiguration"` + DeviceConfiguration `json:"" protobuf:"bytes,3,name=deviceConfiguration"` } // +enum -// +k8s:alpha(since: "1.36")=+k8s:enum +// +k8s:beta(since: "1.37")=+k8s:enum type AllocationConfigSource string // Valid [DeviceAllocationConfiguration.Source] values. @@ -1910,7 +2379,7 @@ const ( // ResourceClaimList is a collection of claims. type ResourceClaimList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -1929,11 +2398,11 @@ type ResourceClaimList struct { // the device requests of a claim to apply these presets. // Cluster scoped. type DeviceClass struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata // +optional - // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:format=k8s-long-name metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec defines what can be allocated and how to configure it. @@ -1944,6 +2413,7 @@ type DeviceClass struct { // the time of allocation. // // Changing the spec automatically increments the metadata.generation number. + // +optional Spec DeviceClassSpec `json:"spec" protobuf:"bytes,2,name=spec"` } @@ -1954,8 +2424,8 @@ type DeviceClassSpec struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,1,opt,name=selectors"` // Config defines configuration parameters that apply to each device that is claimed via this class. @@ -1966,8 +2436,8 @@ type DeviceClassSpec struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Config []DeviceClassConfiguration `json:"config,omitempty" protobuf:"bytes,2,opt,name=config"` // SuitableNodes is tombstoned since Kubernetes 1.32 where @@ -1984,17 +2454,16 @@ type DeviceClassSpec struct { // If two classes are created at the same time, then the name of the class // lexicographically sorted first is picked. // - // This is a beta field. // +optional // +featureGate=DRAExtendedResource - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-extended-resource-name + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-extended-resource-name ExtendedResourceName *string `json:"extendedResourceName,omitempty" protobuf:"bytes,4,opt,name=extendedResourceName"` } // DeviceClassConfiguration is used in DeviceClass. type DeviceClassConfiguration struct { - DeviceConfiguration `json:",inline" protobuf:"bytes,1,opt,name=deviceConfiguration"` + DeviceConfiguration `json:"" protobuf:"bytes,1,opt,name=deviceConfiguration"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -2002,7 +2471,7 @@ type DeviceClassConfiguration struct { // DeviceClassList is a collection of classes. type DeviceClassList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -2017,7 +2486,7 @@ type DeviceClassList struct { // ResourceClaimTemplate is used to produce ResourceClaim objects. type ResourceClaimTemplate struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -2027,6 +2496,7 @@ type ResourceClaimTemplate struct { // This field is immutable. A ResourceClaim will get created by the // control plane for a Pod when needed and then not get updated // anymore. + // +optional Spec ResourceClaimTemplateSpec `json:"spec" protobuf:"bytes,2,name=spec"` } @@ -2036,11 +2506,13 @@ type ResourceClaimTemplateSpec struct { // when creating it. No other fields are allowed and will be rejected during // validation. // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec for the ResourceClaim. The entire content is copied unchanged // into the ResourceClaim that gets created from this template. The // same fields as in a ResourceClaim are also valid here. + // +optional Spec ResourceClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"` } @@ -2049,7 +2521,7 @@ type ResourceClaimTemplateSpec struct { // ResourceClaimTemplateList is a collection of claim templates. type ResourceClaimTemplateList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -2111,8 +2583,8 @@ type AllocatedDeviceStatus struct { // // +optional // +featureGate=DRAConsumableCapacity - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-uuid ShareID *string `json:"shareID,omitempty" protobuf:"bytes,7,opt,name=shareID"` // Conditions contains the latest observation of the device's state. @@ -2124,6 +2596,9 @@ type AllocatedDeviceStatus struct { // +optional // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type Conditions []metav1.Condition `json:"conditions" protobuf:"bytes,4,opt,name=conditions"` // Data contains arbitrary driver-specific data. @@ -2136,7 +2611,7 @@ type AllocatedDeviceStatus struct { // NetworkData contains network-related information specific to the device. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional NetworkData *NetworkDeviceData `json:"networkData,omitempty" protobuf:"bytes,6,opt,name=networkData"` } @@ -2151,8 +2626,8 @@ type NetworkDeviceData struct { // Must not be longer than 256 bytes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxBytes=256 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxBytes=256 InterfaceName string `json:"interfaceName,omitempty" protobuf:"bytes,1,opt,name=interfaceName"` // IPs lists the network addresses assigned to the device's network interface. @@ -2163,10 +2638,10 @@ type NetworkDeviceData struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=16 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=16 IPs []string `json:"ips,omitempty" protobuf:"bytes,2,opt,name=ips"` // HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface. @@ -2174,7 +2649,7 @@ type NetworkDeviceData struct { // Must not be longer than 128 bytes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxBytes=128 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxBytes=128 HardwareAddress string `json:"hardwareAddress,omitempty" protobuf:"bytes,3,opt,name=hardwareAddress"` } diff --git a/vendor/k8s.io/api/resource/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/resource/v1/types_swagger_doc_generated.go index 51915d3e20..2f7c1864d1 100644 --- a/vendor/k8s.io/api/resource/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/resource/v1/types_swagger_doc_generated.go @@ -55,7 +55,7 @@ func (AllocationResult) SwaggerDoc() map[string]string { var map_CELDeviceSelector = map[string]string{ "": "CELDeviceSelector contains a CEL expression for selecting a device.", - "expression": "Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort.\n\nThe expression's input is an object named \"device\", which carries the following properties:\n - driver (string): the name of the driver which defines this device.\n - attributes (map[string]object): the device's attributes, grouped by prefix\n (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all\n of the attributes which were prefixed by \"dra.example.com\".\n - capacity (map[string]object): the device's capacities, grouped by prefix.\n - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device\n (v1.34+ with the DRAConsumableCapacity feature enabled).\n\nExample: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields:\n\n device.driver\n device.attributes[\"dra.example.com\"].model\n device.attributes[\"ext.example.com\"].family\n device.capacity[\"dra.example.com\"].modules\n\nThe device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers.\n\nThe value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity.\n\nIf an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort.\n\nA robust expression should check for the existence of attributes before referencing them.\n\nFor ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example:\n\n cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool)\n\nWhen the DRAListTypeAttributes feature gate is enabled, the includes() helper is available and it can work for both scalar and list-type attributes. It was introduced to support smooth migration from scalar attributes to list-type attributes while keeping CEL expressions simple. For example:\n\n device.attributes[\"dra.example.com\"].models.includes(\"some-model\")\n\nThe length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps.", + "expression": "Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort.\n\nThe expression's input is an object named \"device\", which carries the following properties:\n - driver (string): the name of the driver which defines this device.\n - attributes (map[string]object): the device's attributes, grouped by prefix\n (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all\n of the attributes which were prefixed by \"dra.example.com\").\n - capacity (map[string]object): the device's capacities, grouped by prefix.\n - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device\n (v1.34+ with the DRAConsumableCapacity feature enabled).\n\nExample: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields:\n\n device.driver\n device.attributes[\"dra.example.com\"].model\n device.attributes[\"ext.example.com\"].family\n device.capacity[\"dra.example.com\"].modules\n\nThe device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers.\n\nThe value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity.\n\nIf an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort.\n\nA robust expression should check for the existence of attributes before referencing them.\n\nCommon errors: - \"no such key\": Use optional chaining (.? followed by orValue())\n or guarding the check with has() for optional fields.\n See CEL Optional Types for details:\n https://pkg.go.dev/github.com/google/cel-go@v0.17.4/cel#OptionalTypes\n\nFor more CEL expression syntax and examples, see: https://kubernetes.io/docs/reference/using-api/cel/\n\nFor ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example:\n\n cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool)\n\nWhen the DRAListTypeAttributes feature gate is enabled, the includes() helper is available and it can work for both scalar and list-type attributes. It was introduced to support smooth migration from scalar attributes to list-type attributes while keeping CEL expressions simple. For example:\n\n device.attributes[\"dra.example.com\"].models.includes(\"some-model\")\n\nThe length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps.", } func (CELDeviceSelector) SwaggerDoc() map[string]string { @@ -74,7 +74,7 @@ func (CapacityRequestPolicy) SwaggerDoc() map[string]string { } var map_CapacityRequestPolicyRange = map[string]string{ - "": "CapacityRequestPolicyRange defines a valid range for consumable capacity values.\n\n - If the requested amount is less than Min, it is rounded up to the Min value.\n - If Step is set and the requested amount is between Min and Max but not aligned with Step,\n it will be rounded up to the next value equal to Min + (n * Step).\n - If Step is not set, the requested amount is used as-is if it falls within the range Min to Max (if set).\n - If the requested or rounded amount exceeds Max (if set), the request does not satisfy the policy,\n and the device cannot be allocated.", + "": "CapacityRequestPolicyRange defines a valid range for consumable capacity values.\n\nIf the DRAFractionalCapacityRange feature gate is enabled and at least one of Min, Max, or Step is a fractional quantity (i.e. its value is not an integer), milli-unit arithmetic is used instead, supporting values with up to 3 decimal places (e.g. 100m = 0.1). The largest supported value then is 1000 times smaller compared to using 64-bit integers. Otherwise, all comparisons use 64-bit integer arithmetic via resource.Quantity.Value().\n\n - If the requested amount is less than Min, it is rounded up to the Min value.\n - If Step is set and the requested amount is between Min and Max but not aligned with Step,\n it will be rounded up to the next value equal to Min + (n * Step).\n - If Step is not set, the requested amount is used as-is if it falls within the range Min to Max (if set).\n - If the requested or rounded amount exceeds Max (if set), the request does not satisfy the policy,\n and the device cannot be allocated.", "min": "Min specifies the minimum capacity allowed for a consumption request.\n\nMin must be greater than or equal to zero, and less than or equal to the capacity value. requestPolicy.default must be more than or equal to the minimum.", "max": "Max defines the upper limit for capacity that can be requested.\n\nMax must be less than or equal to the capacity value. Min and requestPolicy.default must be less than or equal to the maximum.", "step": "Step defines the step size between valid capacity amounts within the range.\n\nMax (if set) and requestPolicy.default must be a multiple of Step. Min + Step must be less than or equal to the capacity value.", @@ -113,20 +113,20 @@ func (CounterSet) SwaggerDoc() map[string]string { } var map_Device = map[string]string{ - "": "Device represents one individual hardware instance that can be selected based on its attributes. Besides the name, exactly one field must be set.", - "name": "Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label.", - "attributes": "Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.", - "capacity": "Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.", - "consumesCounters": "ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets.\n\nThere can only be a single entry per counterSet.\n\nThe maximum number of device counter consumptions per device is 2.", - "nodeName": "NodeName identifies the node where the device is available.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", - "nodeSelector": "NodeSelector defines the nodes where the device is available.\n\nMust use exactly one term.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", - "allNodes": "AllNodes indicates that all nodes have access to the device.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", - "taints": "If specified, these are the driver-defined taints.\n\nThe maximum number of taints is 16. If taints are set for any device in a ResourceSlice, then the maximum number of allowed devices per ResourceSlice is 64 instead of 128.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.", - "bindsToNode": "BindsToNode indicates if the usage of an allocation involving this device has to be limited to exactly the node that was chosen when allocating the claim. If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector to match the node where the allocation was made.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", - "bindingConditions": "BindingConditions defines the conditions for proceeding with binding. All of these conditions must be set in the per-device status conditions with a value of True to proceed with binding the pod to the node while scheduling the pod.\n\nThe maximum number of binding conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", - "bindingFailureConditions": "BindingFailureConditions defines the conditions for binding failure. They may be set in the per-device status conditions. If any is set to \"True\", a binding failure occurred.\n\nThe maximum number of binding failure conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", - "allowMultipleAllocations": "AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.\n\nIf AllowMultipleAllocations is set to true, the device can be allocated more than once, and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not.", - "nodeAllocatableResourceMappings": "NodeAllocatableResourceMappings defines the mapping of node resources that are managed by the DRA driver exposing this device. This includes resources currently reported in v1.Node `status.allocatable` that are not extended resources (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). Examples include \"cpu\", \"memory\", \"ephemeral-storage\", and hugepages. In addition to standard requests made through the Pod `spec`, these resources can also be requested through claims and allocated by the DRA driver. For example, a CPU DRA driver might allocate exclusive CPUs or auxiliary node memory dependencies of an accelerator device. The keys of this map are the node-allocatable resource names (e.g., \"cpu\", \"memory\"). Extended resource names are not permitted as keys.", + "": "Device represents one individual hardware instance that can be selected based on its attributes. Besides the name, exactly one field must be set.", + "name": "Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label.", + "attributes": "Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.", + "capacity": "Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.", + "consumesCounters": "ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets.\n\nThere can only be a single entry per counterSet.\n\nThe maximum number of device counter consumptions per device is 2.", + "nodeName": "NodeName identifies the node where the device is available.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", + "nodeSelector": "NodeSelector defines the nodes where the device is available.\n\nMust use exactly one term.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", + "allNodes": "AllNodes indicates that all nodes have access to the device.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", + "taints": "If specified, these are the driver-defined taints.\n\nThe maximum number of taints is 16. If taints are set for any device in a ResourceSlice, then the maximum number of allowed devices per ResourceSlice is 64 instead of 128.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.", + "bindsToNode": "BindsToNode indicates if the usage of an allocation involving this device has to be limited to exactly the node that was chosen when allocating the claim. If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector to match the node where the allocation was made.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", + "bindingConditions": "BindingConditions defines the conditions for proceeding with binding. All of these conditions must be set in the per-device status conditions with a value of True to proceed with binding the pod to the node while scheduling the pod.\n\nThe maximum number of binding conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", + "bindingFailureConditions": "BindingFailureConditions defines the conditions for binding failure. They may be set in the per-device status conditions. If any is set to \"True\", a binding failure occurred.\n\nThe maximum number of binding failure conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", + "allowMultipleAllocations": "AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.\n\nIf AllowMultipleAllocations is set to true, the device can be allocated more than once, and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not.", + "nodeAllocatableResources": "NodeAllocatableResources defines the mapping of node resources that are managed by the DRA driver exposing this device. This includes resources currently reported in v1.Node `status.allocatable` that are not extended resources (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). Examples include \"cpu\", \"memory\", \"ephemeral-storage\", and hugepages. In addition to standard requests made through the Pod `spec`, these resources can also be requested through claims and allocated by the DRA driver. For example, a CPU DRA driver might allocate exclusive CPUs or auxiliary node memory dependencies of an accelerator device. The keys of this map are the node-allocatable resource names (e.g., \"cpu\", \"memory\"). Extended resource names are not permitted as keys.", } func (Device) SwaggerDoc() map[string]string { @@ -231,7 +231,7 @@ var map_DeviceClassSpec = map[string]string{ "": "DeviceClassSpec is used in a [DeviceClass] to define what can be allocated and how to configure it.", "selectors": "Each selector must be satisfied by a device which is claimed via this class.", "config": "Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver.\n\nThey are passed to the driver, but are not considered while allocating the claim.", - "extendedResourceName": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.\n\nThis is a beta field.", + "extendedResourceName": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.", } func (DeviceClassSpec) SwaggerDoc() map[string]string { @@ -259,15 +259,26 @@ func (DeviceConstraint) SwaggerDoc() map[string]string { } var map_DeviceCounterConsumption = map[string]string{ - "": "DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet.", - "counterSet": "CounterSet is the name of the set from which the counters defined will be consumed.", - "counters": "Counters defines the counters that will be consumed by the device.\n\nThe maximum number of counters is 32.", + "": "DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet.", + "counterSet": "CounterSet is the name of the set from which the counters defined will be consumed.", + "counters": "Counters defines the counters that will be consumed by the device.\n\nThe maximum number of counters is 32.", + "compatibilityGroups": "CompatibilityGroups is a list of opaque group names for this counter set consumption.\n\nDevices that consume counters from the same counter set may only be allocated at the same time (\"co-allocated\") if they all share at least one common group: the intersection of the CompatibilityGroups of all co-allocated devices on that counter set must be non-empty. Devices that consume from different counter sets are never compared via this field.\n\nAn unset field, an explicit nil, and an empty list are equivalent and mean \"no groups\": such a device is only co-allocatable with sibling devices on the same counter set that also have no groups, and is never co-allocatable with a device that declares one or more groups.\n\nGroup names are opaque and meaningful only within the publishing driver's pool.\n\nThe maximum number of groups is 2, and the names must be unique.", } func (DeviceCounterConsumption) SwaggerDoc() map[string]string { return map_DeviceCounterConsumption } +var map_DeviceDerivedAttribute = map[string]string{ + "": "DeviceDerivedAttribute defines a derived attribute computed via CEL.", + "name": "Name is the identifier for this derived attribute, used in constraints.\n\nIt must be a DNS subdomain followed by a slash (\"/\") followed by a C identifier (e.g. \"example.com/numaNode\" or \"derived/numaNode\").\n\nIf the chosen name matches an existing physical attribute from a driver, the derived attribute's expression will shadow the physical attribute, and its evaluated value will be used in constraints instead. When the goal is to define a derived attribute that is only used within the ResourceClaim and not meant to shadow an existing attribute, use a domain prefix that no DRA driver should be using (e.g. \"derived/myAttribute\").\n\nIt is not valid to define a derived attribute that isn't used in at least one constraint.", + "expression": "Expression is a CEL expression evaluated against each candidate device. The expression must evaluate to a primitive scalar (string, integer, boolean, or semver) or a list of these scalars ([]string, []int64, []bool, []semver) to act as a virtual grouping key. Any other return type is an error and causes CEL evaluation for the device to fail.\n\nThe expression's input is an object named \"device\", which carries the same properties as in a CELDeviceSelector.\n\nWhen pod scheduling encounters CEL runtime errors (such as looking up an attribute that isn't defined) for some devices, it will abort allocation and fail scheduling for the Pod. Surfacing evaluation errors immediately prevents silent topology matching failures that are extremely hard to detect. A robust expression should, for example, check for the existence of attributes before referencing them to avoid runtime evaluation errors.\n\nThe expression gets evaluated after a device has passed the other selector expressions for the request in which this expression is used. This allows writing expressions that are tailored towards the specific devices being requested (for example, by assuming the device is from a certain vendor and skipping those checks).\n\nThe length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps; the combined cost of all derived attributes in a claim is capped by a shared CEL cost budget.", +} + +func (DeviceDerivedAttribute) SwaggerDoc() map[string]string { + return map_DeviceDerivedAttribute +} + var map_DeviceRequest = map[string]string{ "": "DeviceRequest is a request for devices required for a claim. This is typically a request for a single resource like a device, but can also ask for several identical devices. With FirstAvailable it is also possible to provide a prioritized list of requests.", "name": "Name can be used to reference this request in a pod.spec.containers[].resources.claims entry and in a constraint of the claim.\n\nReferences using the name in the DeviceRequest will uniquely identify a request when the Exactly field is set. When the FirstAvailable field is set, a reference to the name of the DeviceRequest will match whatever subrequest is chosen by the scheduler.\n\nMust be a DNS label.", @@ -291,6 +302,7 @@ var map_DeviceRequestAllocationResult = map[string]string{ "bindingFailureConditions": "BindingFailureConditions contains a copy of the BindingFailureConditions from the corresponding ResourceSlice at the time of allocation.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", "shareID": "ShareID uniquely identifies an individual allocation share of the device, used when the device supports multiple simultaneous allocations. It serves as an additional map key to differentiate concurrent shares of the same device.", "consumedCapacity": "ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request. The consumed amount may differ from the requested amount: it is rounded up to the nearest valid value based on the device’s requestPolicy if applicable (i.e., may not be less than the requested amount).\n\nThe total consumed capacity for each device must not exceed the DeviceCapacity's Value.\n\nThis field is populated only for devices that allow multiple allocations. All capacity entries are included, even if the consumed amount is zero.", + "skipNodeOperations": "SkipNodeOperations lists node-local resource operations (gRPC calls) that will be skipped for this allocated device when determining whether operations are necessary on the node. If all allocated devices for a driver in a claim skip an operation, that gRPC call will be skipped. It is a copy of the ResourceSlice.spec.skipNodeOperations value at the time when the device was allocated.", } func (DeviceRequestAllocationResult) SwaggerDoc() map[string]string { @@ -307,14 +319,15 @@ func (DeviceSelector) SwaggerDoc() map[string]string { } var map_DeviceSubRequest = map[string]string{ - "": "DeviceSubRequest describes a request for device provided in the claim.spec.devices.requests[].firstAvailable array. Each is typically a request for a single resource like a device, but can also ask for several identical devices.\n\nDeviceSubRequest is similar to ExactDeviceRequest, but doesn't expose the AdminAccess field as that one is only supported when requesting a specific device.", - "name": "Name can be used to reference this subrequest in the list of constraints or the list of configurations for the claim. References must use the format
/.\n\nMust be a DNS label.", - "deviceClassName": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this subrequest.\n\nA class is required. Which classes are available depends on the cluster.\n\nAdministrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference.", - "selectors": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this subrequest. All selectors must be satisfied for a device to be considered.", - "allocationMode": "AllocationMode and its related fields define how devices are allocated to satisfy this subrequest. Supported values are:\n\n- ExactCount: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This subrequest is for all of the matching devices in a pool.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other subrequests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", - "count": "Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one.", - "tolerations": "If specified, the request's tolerations.\n\nTolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute.\n\nIn addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated.\n\nThe maximum number of tolerations is 16.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.", - "capacity": "Capacity define resource requirements against each capacity.\n\nIf this field is unset and the device supports multiple allocations, the default value will be applied to each capacity according to requestPolicy. For the capacity that has no requestPolicy, default is the full capacity value.\n\nApplies to each device allocation. If Count > 1, the request fails if there aren't enough devices that meet the requirements. If AllocationMode is set to All, the request fails if there are devices that otherwise match the request, and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request.", + "": "DeviceSubRequest describes a request for device provided in the claim.spec.devices.requests[].firstAvailable array. Each is typically a request for a single resource like a device, but can also ask for several identical devices.\n\nDeviceSubRequest is similar to ExactDeviceRequest, but doesn't expose the AdminAccess field as that one is only supported when requesting a specific device.", + "name": "Name can be used to reference this subrequest in the list of constraints or the list of configurations for the claim. References must use the format
/.\n\nMust be a DNS label.", + "deviceClassName": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this subrequest.\n\nA class is required. Which classes are available depends on the cluster.\n\nAdministrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference.", + "selectors": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this subrequest. All selectors must be satisfied for a device to be considered.", + "allocationMode": "AllocationMode and its related fields define how devices are allocated to satisfy this subrequest. Supported values are:\n\n- ExactCount: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This subrequest is for all of the matching devices in a pool.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other subrequests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", + "count": "Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one.", + "tolerations": "If specified, the request's tolerations.\n\nTolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute.\n\nIn addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated.\n\nThe maximum number of tolerations is 16.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.", + "capacity": "Capacity define resource requirements against each capacity.\n\nIf this field is unset and the device supports multiple allocations, the default value will be applied to each capacity according to requestPolicy. For the capacity that has no requestPolicy, default is the full capacity value.\n\nApplies to each device allocation. If Count > 1, the request fails if there aren't enough devices that meet the requirements. If AllocationMode is set to All, the request fails if there are devices that otherwise match the request, and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request.", + "derivedAttributes": "DerivedAttributes defines a set of virtual attributes computed via CEL expressions for each candidate device. These virtual attributes can be referenced in `.devices.constraints` to align and match different devices (e.g., co-allocating a GPU and a NIC on the same NUMA node) even if their drivers publish different attributes. Derived attributes are not available via `device.attributes` in the CEL environment when evaluating selector expressions.\n\nDerived attributes allow you to extract, transform, or normalize topology information (such as extracting a NUMA index from a complex topology string or renaming a vendor-specific attribute) into a common virtual attribute name at scheduling time. The scheduler then evaluates these virtual attributes exactly like static attributes when matching constraints.\n\nEvery derived attribute defined in this list must be referenced by at least one MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list.\n\nThe maximum number of derived attributes is 32.\n\nThis is an alpha field and requires enabling the DRADerivedAttributes feature gate.", } func (DeviceSubRequest) SwaggerDoc() map[string]string { @@ -333,6 +346,57 @@ func (DeviceTaint) SwaggerDoc() map[string]string { return map_DeviceTaint } +var map_DeviceTaintRule = map[string]string{ + "": "DeviceTaintRule adds one taint to all devices which match the selector. This has the same effect as if the taint was specified directly in the ResourceSlice by the DRA driver.", + "metadata": "Standard object metadata", + "spec": "Spec specifies the selector and one taint.\n\nChanging the spec automatically increments the metadata.generation number.", + "status": "Status provides information about what was requested in the spec.", +} + +func (DeviceTaintRule) SwaggerDoc() map[string]string { + return map_DeviceTaintRule +} + +var map_DeviceTaintRuleList = map[string]string{ + "": "DeviceTaintRuleList is a collection of DeviceTaintRules.", + "metadata": "Standard list metadata", + "items": "Items is the list of DeviceTaintRules.", +} + +func (DeviceTaintRuleList) SwaggerDoc() map[string]string { + return map_DeviceTaintRuleList +} + +var map_DeviceTaintRuleSpec = map[string]string{ + "": "DeviceTaintRuleSpec specifies the selector and one taint.", + "deviceSelector": "DeviceSelector defines which device(s) the taint is applied to. All selector criteria must be satisfied for a device to match. The empty selector matches all devices. Without a selector, no devices are matches.", + "taint": "The taint that gets applied to matching devices.", +} + +func (DeviceTaintRuleSpec) SwaggerDoc() map[string]string { + return map_DeviceTaintRuleSpec +} + +var map_DeviceTaintRuleStatus = map[string]string{ + "": "DeviceTaintRuleStatus provides information about an on-going pod eviction.", + "conditions": "Conditions provide information about the state of the DeviceTaintRule and the cluster at some point in time, in a machine-readable and human-readable format.\n\nThe following condition is currently defined as part of this API, more may get added: - Type: EvictionInProgress - Status: True if there are currently pods which need to be evicted, False otherwise\n (includes the effects which don't cause eviction).\n- Reason: not specified, may change - Message: includes information about number of pending pods and already evicted pods\n in a human-readable format, updated periodically, may change\n\nFor `effect: None`, the condition above gets set once for each change to the spec, with the message containing information about what would happen if the effect was `NoExecute`. This feedback can be used to decide whether changing the effect to `NoExecute` will work as intended. It only gets set once to avoid having to constantly update the status.\n\nMust have 8 or fewer entries.", +} + +func (DeviceTaintRuleStatus) SwaggerDoc() map[string]string { + return map_DeviceTaintRuleStatus +} + +var map_DeviceTaintSelector = map[string]string{ + "": "DeviceTaintSelector defines which device(s) a DeviceTaintRule applies to. The empty selector matches all devices. Without a selector, no devices are matched.", + "driver": "If driver is set, only devices from that driver are selected. This fields corresponds to slice.spec.driver.", + "pool": "If pool is set, only devices in that pool are selected.\n\nAlso setting the driver name may be useful to avoid ambiguity when different drivers use the same pool name, but this is not required because selecting pools from different drivers may also be useful, for example when drivers with node-local devices use the node name as their pool name.", + "device": "If device is set, only devices with that name are selected. This field corresponds to slice.spec.devices[].name.\n\nSetting also driver and pool may be required to avoid ambiguity, but is not required.", +} + +func (DeviceTaintSelector) SwaggerDoc() map[string]string { + return map_DeviceTaintSelector +} + var map_DeviceToleration = map[string]string{ "": "The ResourceClaim this DeviceToleration is attached to tolerates any taint that matches the triple using the matching operator .", "key": "Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. Must be a label name.", @@ -347,14 +411,15 @@ func (DeviceToleration) SwaggerDoc() map[string]string { } var map_ExactDeviceRequest = map[string]string{ - "": "ExactDeviceRequest is a request for one or more identical devices.", - "deviceClassName": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this request.\n\nA DeviceClassName is required.\n\nAdministrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference.", - "selectors": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this request. All selectors must be satisfied for a device to be considered.", - "allocationMode": "AllocationMode and its related fields define how devices are allocated to satisfy this request. Supported values are:\n\n- ExactCount: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This request is for all of the matching devices in a pool.\n At least one device must exist on the node for the allocation to succeed.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other requests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", - "count": "Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one.", - "adminAccess": "AdminAccess indicates that this is a claim for administrative access to the device(s). Claims with AdminAccess are expected to be used for monitoring or other management services for a device. They ignore all ordinary claims to the device with respect to access modes and any resource allocations.\n\nAdmin access is disabled if this field is unset or set to false, otherwise it is enabled.", - "tolerations": "If specified, the request's tolerations.\n\nTolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute.\n\nIn addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated.\n\nThe maximum number of tolerations is 16.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.", - "capacity": "Capacity define resource requirements against each capacity.\n\nIf this field is unset and the device supports multiple allocations, the default value will be applied to each capacity according to requestPolicy. For the capacity that has no requestPolicy, default is the full capacity value.\n\nApplies to each device allocation. If Count > 1, the request fails if there aren't enough devices that meet the requirements. If AllocationMode is set to All, the request fails if there are devices that otherwise match the request, and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request.", + "": "ExactDeviceRequest is a request for one or more identical devices.", + "deviceClassName": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this request.\n\nA DeviceClassName is required.\n\nAdministrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference.", + "selectors": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this request. All selectors must be satisfied for a device to be considered.", + "allocationMode": "AllocationMode and its related fields define how devices are allocated to satisfy this request. Supported values are:\n\n- ExactCount: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This request is for all of the matching devices in a pool.\n At least one device must exist on the node for the allocation to succeed.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other requests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", + "count": "Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one.", + "adminAccess": "AdminAccess indicates that this is a claim for administrative access to the device(s). Claims with AdminAccess are expected to be used for monitoring or other management services for a device. They ignore all ordinary claims to the device with respect to access modes and any resource allocations.\n\nAdmin access is disabled if this field is unset or set to false, otherwise it is enabled.", + "tolerations": "If specified, the request's tolerations.\n\nTolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute.\n\nIn addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated.\n\nThe maximum number of tolerations is 16.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.", + "capacity": "Capacity define resource requirements against each capacity.\n\nIf this field is unset and the device supports multiple allocations, the default value will be applied to each capacity according to requestPolicy. For the capacity that has no requestPolicy, default is the full capacity value.\n\nApplies to each device allocation. If Count > 1, the request fails if there aren't enough devices that meet the requirements. If AllocationMode is set to All, the request fails if there are devices that otherwise match the request, and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request.", + "derivedAttributes": "DerivedAttributes defines a set of virtual attributes computed via CEL expressions for each candidate device. These virtual attributes can be referenced in `.devices.constraints` to align and match different devices (e.g., co-allocating a GPU and a NIC on the same NUMA node) even if their drivers publish different attributes. Derived attributes are not available via `device.attributes` in the CEL environment when evaluating selector expressions.\n\nDerived attributes allow you to extract, transform, or normalize topology information (such as extracting a NUMA index from a complex topology string or renaming a vendor-specific attribute) into a common virtual attribute name at scheduling time. The scheduler then evaluates these virtual attributes exactly like static attributes when matching constraints.\n\nEvery derived attribute defined in this list must be referenced by at least one MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list.\n\nThe maximum number of derived attributes is 32.\n\nThis is an alpha field and requires enabling the DRADerivedAttributes feature gate.", } func (ExactDeviceRequest) SwaggerDoc() map[string]string { @@ -372,14 +437,35 @@ func (NetworkDeviceData) SwaggerDoc() map[string]string { return map_NetworkDeviceData } -var map_NodeAllocatableResourceMapping = map[string]string{ - "": "NodeAllocatableResourceMapping defines the translation between the DRA device/capacity units requested to the corresponding quantity of the node allocatable resource.", - "capacityKey": "CapacityKey references a capacity name defined as a key in the `spec.devices[*].capacity` map. When this field is set, the value associated with this key in the `status.allocation.devices.results[*].consumedCapacity` map (for a specific claim allocation) determines the base quantity for the node allocatable resource. If `allocationMultiplier` is also set, it is multiplied with the base quantity. For example, if `spec.devices[*].capacity` has an entry \"dra.example.com/memory\": \"128Gi\", and this field is set to \"dra.example.com/memory\", then for a claim allocation that consumes { \"dra.example.com/memory\": \"4Gi\" } the base quantity for the node allocatable resource mapping will be \"4Gi\", and `allocationMultiplier` should be omitted or set to \"1\".", - "allocationMultiplier": "AllocationMultiplier is used as a multiplier for the allocated device count or the allocated capacity in the claim. It defaults to 1 if not specified. How the field is used also depends on whether `capacityKey` is set. 1. If `capacityKey` is NOT set: `allocationMultiplier` multiplies the device count allocated to the claim.\n\t a. A DRA driver representing each CPU core as a device would have\n {ResourceName: \"cpu\", allocationMultiplier: \"2\"} in its\n `nodeAllocatableResourceMappings`. If 4 devices are allocated to the claim,\n\t\t 4 * 2 CPUs would be considered as allocated and subtracted from the node's capacity.\n b. A GPU device that needs additional node memory per GPU allocation would\n have {ResourceName: \"memory\", allocationMultiplier: \"2Gi\"}. Each allocated\n\t\t GPU device instance of this type will account for 2Gi of memory.\n\n2. If `capacityKey` IS set: `allocationMultiplier` is multiplied by the amount of that capacity consumed.\n\t The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `allocationMultiplier`.\n For example, if a Device's capacity \"dra.example.com/cores\" is consumed,\n and each \"core\" provides 2 \"cpu\"s, the mapping would be:\n {ResourceName: \"cpu\", capacityKey: \"dra.example.com/cores\", allocationMultiplier: \"2\"}.\n If a claim consumes 8 \"dra.example.com/cores\", the CPU footprint is 8 * 2 = 16.", +var map_NodeAllocatableMapping = map[string]string{ + "": "NodeAllocatableMapping defines how a DRA allocation directly translates into a node allocatable resource quantity. The mapping can be derived from either the count of allocated devices (via deviceMultiplier) or the specific capacity consumed (via capacityKey and capacityMultiplier). These options are mutually exclusive. Kubelet adds this mapped resource quantity from claim to both requests and limits at the pod-level cgroup, and to limits at the container-level cgroup for each container referencing the claim.", + "capacityKey": "CapacityKey references a capacity name defined as a key in the `spec.devices[*].capacity` map. When this field is set, the value associated with this key in the `status.allocation.devices.results[*].consumedCapacity` map (for a specific claim allocation) determines the base quantity for the node allocatable resource. `capacityMultiplier` must also be set and is multiplied with the base quantity. For example, if `spec.devices[*].capacity` has an entry \"dra.example.com/memory\": \"128Gi\", and this field is set to \"dra.example.com/memory\", then for a claim allocation that consumes { \"dra.example.com/memory\": \"4Gi\" } the base quantity for the node allocatable resource mapping will be \"4Gi\". The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`.", + "capacityMultiplier": "CapacityMultiplier is used as a multiplier for the allocated capacity consumed. It is only valid if `capacityKey` is set. The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. For example, if a Device's capacity \"dra.example.com/cores\" is consumed, and each \"core\" provides 2 \"cpu\"s, the mapping would be: {ResourceName: \"cpu\", capacityKey: \"dra.example.com/cores\", capacityMultiplier: \"2\"}. If a claim consumes 8 \"dra.example.com/cores\", the CPU footprint is 8 * 2 = 16.", + "deviceMultiplier": "DeviceMultiplier is used as a multiplier for the allocated device count in the claim. The final node allocatable resource amount is `deviceCount` * `deviceMultiplier`. For example, a DRA driver representing each cache complex (CCX) as a device would have {ResourceName: \"cpu\", deviceMultiplier: \"8\"} in its `nodeAllocatableResources`. If 2 devices (CCX) are allocated to the claim, 2 * 8 = 16 CPUs would be considered as allocated. It is only valid when `capacityKey` and `capacityMultiplier` are not set.", +} + +func (NodeAllocatableMapping) SwaggerDoc() map[string]string { + return map_NodeAllocatableMapping +} + +var map_NodeAllocatableOverhead = map[string]string{ + "": "NodeAllocatableOverhead defines auxiliary resource overheads incurred when allocating a device. Overheads can be specified as a fixed cost per pod referencing the claim, a variable cost per container reference, or both. Kubelet accounts for this overhead by adding it to both the pod-level and container-level cgroups of referencing containers.", + "perPod": "PerPod is overhead applied once per pod referencing the claim on this node. This is a flat overhead incurred for every pod referencing the claim.", + "perContainer": "PerContainer is applied per container reference to the claim. This models overhead scaling linearly with the number of containers actively using the device. When both PerPod and PerContainer are specified, the total overhead allocated for each pod referencing the claim is computed as: Quantity = PerPod + (PerContainer * NumReferences) Kubelet accounts for this overhead in cgroups: - Pod-level cgroup (requests and limits): Kubelet adds PerPod + (PerContainer * NumReferences). - Container-level cgroup (limits only): Kubelet adds PerPod + PerContainer for each referencing container. This allows any single container to access the pod-level overhead, while the parent cgroup caps the total usage to account for PerPod exactly once.", +} + +func (NodeAllocatableOverhead) SwaggerDoc() map[string]string { + return map_NodeAllocatableOverhead +} + +var map_NodeAllocatableResource = map[string]string{ + "": "NodeAllocatableResource defines the translation between the DRA device/capacity units requested to the corresponding quantity of the node allocatable resource. At least one of Mapping or Overhead must be specified. Not specifying either is an invalid configuration.", + "mapping": "Mapping is used when the device directly models a node allocatable resource like standard CPU or memory (e.g., with a CPU DRA driver). The calculated quantity is accounted for exactly once per claim instance on the node. To prevent node cgroup isolation friction, the scheduler explicitly blocks sharing mapped device claims across multiple pods.", + "overhead": "Overhead contains fields for modeling auxiliary overhead incurred on node allocatable resources when allocating devices that are not themselves modeling a node allocatable resource (e.g., host memory overhead for GPUs). Sharing overhead-mapped claims across multiple pods is allowed. The node allocatable overhead is accounted for individually for each pod referencing the claim. Overhead is always subtracted from the node's allocatable capacity for the resource, even when mapping is specified for the same resource. Eg: If a device models memory capacity per socket as a consumable capacity pool via Mapping (with CapacityKey), any overhead specified for the same resource will be subtracted from the node's general allocatable capacity and not from the per-socket capacity pool in Mapping.", } -func (NodeAllocatableResourceMapping) SwaggerDoc() map[string]string { - return map_NodeAllocatableResourceMapping +func (NodeAllocatableResource) SwaggerDoc() map[string]string { + return map_NodeAllocatableResource } var map_OpaqueDeviceConfiguration = map[string]string{ @@ -477,7 +563,7 @@ func (ResourceClaimTemplateSpec) SwaggerDoc() map[string]string { var map_ResourcePool = map[string]string{ "": "ResourcePool describes the pool that ResourceSlices belong to.", - "name": "Name is used to identify the pool. For node-local devices, this is often the node name, but this is not required.\n\nIt must not be longer than 253 characters and must consist of one or more DNS sub-domains separated by slashes. This field is immutable.", + "name": "Name is used to identify the pool. For node-local devices, this is often the node name, but this is not required. A field selector can be used to list only ResourceSlice objects belonging to a certain pool.\n\nIt must not be longer than 253 characters and must consist of one or more DNS sub-domains separated by slashes. This field is immutable.", "generation": "Generation tracks the change in a pool over time. Whenever a driver changes something about one or more of the resources in a pool, it must change the generation in all ResourceSlices which are part of that pool. Consumers of ResourceSlices should only consider resources from the pool with the highest generation number. The generation may be reset by drivers, which should be fine for consumers, assuming that all ResourceSlices in a pool are updated to match or deleted.\n\nCombined with ResourceSliceCount, this mechanism enables consumers to detect pools which are comprised of multiple ResourceSlices and are in an incomplete state.", "resourceSliceCount": "ResourceSliceCount is the total number of ResourceSlices in the pool at this generation number. Must be greater than zero.\n\nConsumers can use this to check whether they have seen all ResourceSlices belonging to the same pool.", } @@ -516,6 +602,8 @@ var map_ResourceSliceSpec = map[string]string{ "devices": "Devices lists some or all of the devices in this pool.\n\nMust not have more than 128 entries. If any device uses taints or consumes counters the limit is 64.\n\nOnly one of Devices and SharedCounters can be set in a ResourceSlice.", "perDeviceNodeSelection": "PerDeviceNodeSelection defines whether the access from nodes to resources in the pool is set on the ResourceSlice level or on each device. If it is set to true, every device defined the ResourceSlice must specify this individually.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.", "sharedCounters": "SharedCounters defines a list of counter sets, each of which has a name and a list of counters available.\n\nThe names of the counter sets must be unique in the ResourcePool.\n\nOnly one of Devices and SharedCounters can be set in a ResourceSlice.\n\nThe maximum number of counter sets is 8.", + "partitionTypeAttribute": "PartitionTypeAttribute names a string device attribute (by fully qualified name, e.g. \"gpu.example.com/profile\") whose value labels each device with its partition type, such as \"Full\" or \"Half\" for a MIG-style GPU.\n\nWhen set, every partitionable device in the slice must carry the attribute and devices sharing a value must share the same ConsumesCounters cost.", + "skipNodeOperations": "SkipNodeOperations lists node-local resource operations (gRPC calls) that will be skipped for the devices in this slice when determining whether operations are necessary on the node. If all allocated devices for a driver in a claim skip an operation, that gRPC call will be skipped. Valid values are:\n\n- \"NodePrepareResources\": NodePrepareResources gRPC calls are skipped. This\n value cannot be specified unless \"NodeUnprepareResources\" is also listed\n (or \"*\" is specified).\n- \"NodeUnprepareResources\": NodeUnprepareResources gRPC calls are skipped. - \"*\": All node-local resource operations are skipped.\n\nOther values may be added in the future. The kubelet must ignore unknown values.", } func (ResourceSliceSpec) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/resource/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/resource/v1/zz_generated.deepcopy.go index 0c488a05ae..9231934844 100644 --- a/vendor/k8s.io/api/resource/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/resource/v1/zz_generated.deepcopy.go @@ -302,9 +302,9 @@ func (in *Device) DeepCopyInto(out *Device) { *out = new(bool) **out = **in } - if in.NodeAllocatableResourceMappings != nil { - in, out := &in.NodeAllocatableResourceMappings, &out.NodeAllocatableResourceMappings - *out = make(map[corev1.ResourceName]NodeAllocatableResourceMapping, len(*in)) + if in.NodeAllocatableResources != nil { + in, out := &in.NodeAllocatableResources, &out.NodeAllocatableResources + *out = make(map[corev1.ResourceName]NodeAllocatableResource, len(*in)) for key, val := range *in { (*out)[key] = *val.DeepCopy() } @@ -685,6 +685,11 @@ func (in *DeviceCounterConsumption) DeepCopyInto(out *DeviceCounterConsumption) (*out)[key] = *val.DeepCopy() } } + if in.CompatibilityGroups != nil { + in, out := &in.CompatibilityGroups, &out.CompatibilityGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } return } @@ -698,6 +703,22 @@ func (in *DeviceCounterConsumption) DeepCopy() *DeviceCounterConsumption { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceDerivedAttribute) DeepCopyInto(out *DeviceDerivedAttribute) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceDerivedAttribute. +func (in *DeviceDerivedAttribute) DeepCopy() *DeviceDerivedAttribute { + if in == nil { + return nil + } + out := new(DeviceDerivedAttribute) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeviceRequest) DeepCopyInto(out *DeviceRequest) { *out = *in @@ -763,6 +784,11 @@ func (in *DeviceRequestAllocationResult) DeepCopyInto(out *DeviceRequestAllocati (*out)[key] = val.DeepCopy() } } + if in.SkipNodeOperations != nil { + in, out := &in.SkipNodeOperations, &out.SkipNodeOperations + *out = make([]SkipNodeOperation, len(*in)) + copy(*out, *in) + } return } @@ -819,6 +845,11 @@ func (in *DeviceSubRequest) DeepCopyInto(out *DeviceSubRequest) { *out = new(CapacityRequirements) (*in).DeepCopyInto(*out) } + if in.DerivedAttributes != nil { + in, out := &in.DerivedAttributes, &out.DerivedAttributes + *out = make([]DeviceDerivedAttribute, len(*in)) + copy(*out, *in) + } return } @@ -852,6 +883,143 @@ func (in *DeviceTaint) DeepCopy() *DeviceTaint { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceTaintRule) DeepCopyInto(out *DeviceTaintRule) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceTaintRule. +func (in *DeviceTaintRule) DeepCopy() *DeviceTaintRule { + if in == nil { + return nil + } + out := new(DeviceTaintRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DeviceTaintRule) 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 *DeviceTaintRuleList) DeepCopyInto(out *DeviceTaintRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DeviceTaintRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceTaintRuleList. +func (in *DeviceTaintRuleList) DeepCopy() *DeviceTaintRuleList { + if in == nil { + return nil + } + out := new(DeviceTaintRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DeviceTaintRuleList) 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 *DeviceTaintRuleSpec) DeepCopyInto(out *DeviceTaintRuleSpec) { + *out = *in + if in.DeviceSelector != nil { + in, out := &in.DeviceSelector, &out.DeviceSelector + *out = new(DeviceTaintSelector) + (*in).DeepCopyInto(*out) + } + in.Taint.DeepCopyInto(&out.Taint) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceTaintRuleSpec. +func (in *DeviceTaintRuleSpec) DeepCopy() *DeviceTaintRuleSpec { + if in == nil { + return nil + } + out := new(DeviceTaintRuleSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceTaintRuleStatus) DeepCopyInto(out *DeviceTaintRuleStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceTaintRuleStatus. +func (in *DeviceTaintRuleStatus) DeepCopy() *DeviceTaintRuleStatus { + if in == nil { + return nil + } + out := new(DeviceTaintRuleStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceTaintSelector) DeepCopyInto(out *DeviceTaintSelector) { + *out = *in + if in.Driver != nil { + in, out := &in.Driver, &out.Driver + *out = new(string) + **out = **in + } + if in.Pool != nil { + in, out := &in.Pool, &out.Pool + *out = new(string) + **out = **in + } + if in.Device != nil { + in, out := &in.Device, &out.Device + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceTaintSelector. +func (in *DeviceTaintSelector) DeepCopy() *DeviceTaintSelector { + if in == nil { + return nil + } + out := new(DeviceTaintSelector) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeviceToleration) DeepCopyInto(out *DeviceToleration) { *out = *in @@ -900,6 +1068,11 @@ func (in *ExactDeviceRequest) DeepCopyInto(out *ExactDeviceRequest) { *out = new(CapacityRequirements) (*in).DeepCopyInto(*out) } + if in.DerivedAttributes != nil { + in, out := &in.DerivedAttributes, &out.DerivedAttributes + *out = make([]DeviceDerivedAttribute, len(*in)) + copy(*out, *in) + } return } @@ -935,27 +1108,84 @@ func (in *NetworkDeviceData) DeepCopy() *NetworkDeviceData { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeAllocatableResourceMapping) DeepCopyInto(out *NodeAllocatableResourceMapping) { +func (in *NodeAllocatableMapping) DeepCopyInto(out *NodeAllocatableMapping) { *out = *in if in.CapacityKey != nil { in, out := &in.CapacityKey, &out.CapacityKey *out = new(QualifiedName) **out = **in } - if in.AllocationMultiplier != nil { - in, out := &in.AllocationMultiplier, &out.AllocationMultiplier + if in.CapacityMultiplier != nil { + in, out := &in.CapacityMultiplier, &out.CapacityMultiplier + x := (*in).DeepCopy() + *out = &x + } + if in.DeviceMultiplier != nil { + in, out := &in.DeviceMultiplier, &out.DeviceMultiplier x := (*in).DeepCopy() *out = &x } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocatableResourceMapping. -func (in *NodeAllocatableResourceMapping) DeepCopy() *NodeAllocatableResourceMapping { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocatableMapping. +func (in *NodeAllocatableMapping) DeepCopy() *NodeAllocatableMapping { if in == nil { return nil } - out := new(NodeAllocatableResourceMapping) + out := new(NodeAllocatableMapping) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeAllocatableOverhead) DeepCopyInto(out *NodeAllocatableOverhead) { + *out = *in + if in.PerPod != nil { + in, out := &in.PerPod, &out.PerPod + x := (*in).DeepCopy() + *out = &x + } + if in.PerContainer != nil { + in, out := &in.PerContainer, &out.PerContainer + x := (*in).DeepCopy() + *out = &x + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocatableOverhead. +func (in *NodeAllocatableOverhead) DeepCopy() *NodeAllocatableOverhead { + if in == nil { + return nil + } + out := new(NodeAllocatableOverhead) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeAllocatableResource) DeepCopyInto(out *NodeAllocatableResource) { + *out = *in + if in.Mapping != nil { + in, out := &in.Mapping, &out.Mapping + *out = new(NodeAllocatableMapping) + (*in).DeepCopyInto(*out) + } + if in.Overhead != nil { + in, out := &in.Overhead, &out.Overhead + *out = new(NodeAllocatableOverhead) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocatableResource. +func (in *NodeAllocatableResource) DeepCopy() *NodeAllocatableResource { + if in == nil { + return nil + } + out := new(NodeAllocatableResource) in.DeepCopyInto(out) return out } @@ -1296,6 +1526,16 @@ func (in *ResourceSliceSpec) DeepCopyInto(out *ResourceSliceSpec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.PartitionTypeAttribute != nil { + in, out := &in.PartitionTypeAttribute, &out.PartitionTypeAttribute + *out = new(FullyQualifiedName) + **out = **in + } + if in.SkipNodeOperations != nil { + in, out := &in.SkipNodeOperations, &out.SkipNodeOperations + *out = make([]SkipNodeOperation, len(*in)) + copy(*out, *in) + } return } diff --git a/vendor/k8s.io/api/resource/v1/zz_generated.model_name.go b/vendor/k8s.io/api/resource/v1/zz_generated.model_name.go index f163c61ed1..aa13541c20 100644 --- a/vendor/k8s.io/api/resource/v1/zz_generated.model_name.go +++ b/vendor/k8s.io/api/resource/v1/zz_generated.model_name.go @@ -131,6 +131,11 @@ func (in DeviceCounterConsumption) OpenAPIModelName() string { return "io.k8s.api.resource.v1.DeviceCounterConsumption" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DeviceDerivedAttribute) OpenAPIModelName() string { + return "io.k8s.api.resource.v1.DeviceDerivedAttribute" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in DeviceRequest) OpenAPIModelName() string { return "io.k8s.api.resource.v1.DeviceRequest" @@ -156,6 +161,31 @@ func (in DeviceTaint) OpenAPIModelName() string { return "io.k8s.api.resource.v1.DeviceTaint" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DeviceTaintRule) OpenAPIModelName() string { + return "io.k8s.api.resource.v1.DeviceTaintRule" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DeviceTaintRuleList) OpenAPIModelName() string { + return "io.k8s.api.resource.v1.DeviceTaintRuleList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DeviceTaintRuleSpec) OpenAPIModelName() string { + return "io.k8s.api.resource.v1.DeviceTaintRuleSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DeviceTaintRuleStatus) OpenAPIModelName() string { + return "io.k8s.api.resource.v1.DeviceTaintRuleStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DeviceTaintSelector) OpenAPIModelName() string { + return "io.k8s.api.resource.v1.DeviceTaintSelector" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in DeviceToleration) OpenAPIModelName() string { return "io.k8s.api.resource.v1.DeviceToleration" @@ -172,8 +202,18 @@ func (in NetworkDeviceData) OpenAPIModelName() string { } // OpenAPIModelName returns the OpenAPI model name for this type. -func (in NodeAllocatableResourceMapping) OpenAPIModelName() string { - return "io.k8s.api.resource.v1.NodeAllocatableResourceMapping" +func (in NodeAllocatableMapping) OpenAPIModelName() string { + return "io.k8s.api.resource.v1.NodeAllocatableMapping" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeAllocatableOverhead) OpenAPIModelName() string { + return "io.k8s.api.resource.v1.NodeAllocatableOverhead" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeAllocatableResource) OpenAPIModelName() string { + return "io.k8s.api.resource.v1.NodeAllocatableResource" } // OpenAPIModelName returns the OpenAPI model name for this type. diff --git a/vendor/k8s.io/api/resource/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/resource/v1/zz_generated.prerelease-lifecycle.go index dbf5b3ccde..4c36f2715c 100644 --- a/vendor/k8s.io/api/resource/v1/zz_generated.prerelease-lifecycle.go +++ b/vendor/k8s.io/api/resource/v1/zz_generated.prerelease-lifecycle.go @@ -33,6 +33,18 @@ func (in *DeviceClassList) APILifecycleIntroduced() (major, minor int) { return 1, 34 } +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *DeviceTaintRule) APILifecycleIntroduced() (major, minor int) { + return 1, 37 +} + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *DeviceTaintRuleList) APILifecycleIntroduced() (major, minor int) { + return 1, 37 +} + // APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. func (in *ResourceClaim) APILifecycleIntroduced() (major, minor int) { diff --git a/vendor/k8s.io/api/resource/v1/zz_generated.validations.go b/vendor/k8s.io/api/resource/v1/zz_generated.validations.go new file mode 100644 index 0000000000..b771d5b92a --- /dev/null +++ b/vendor/k8s.io/api/resource/v1/zz_generated.validations.go @@ -0,0 +1,3348 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by validation-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + corev1 "k8s.io/api/core/v1" + equality "k8s.io/apimachinery/pkg/api/equality" + operation "k8s.io/apimachinery/pkg/api/operation" + resource "k8s.io/apimachinery/pkg/api/resource" + safe "k8s.io/apimachinery/pkg/api/safe" + validate "k8s.io/apimachinery/pkg/api/validate" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" + types "k8s.io/apimachinery/pkg/types" + sets "k8s.io/apimachinery/pkg/util/sets" + field "k8s.io/apimachinery/pkg/util/validation/field" +) + +// Validate_AllocatedDeviceStatus validates an instance of AllocatedDeviceStatus according +// to declarative validation rules in the API schema. +func Validate_AllocatedDeviceStatus( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *AllocatedDeviceStatus) (errs field.ErrorList) { + + // field AllocatedDeviceStatus.Driver has no validation + // field AllocatedDeviceStatus.Pool has no validation + // field AllocatedDeviceStatus.Device has no validation + + { // field AllocatedDeviceStatus.ShareID + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.UUID(ctx, op, fldPath, obj, oldObj).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *AllocatedDeviceStatus) *string { + return oldObj.ShareID + }) + errs = append(errs, fn(fldPath.Child("shareID"), obj.ShareID, oldVal, oldObj != nil)...) + } + + { // field AllocatedDeviceStatus.Conditions + fn := func( + fldPath *field.Path, + obj, oldObj []metav1.Condition, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with map semantics require unique keys + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, + func(a *metav1.Condition, b *metav1.Condition) bool { return a.Type == b.Type }).MarkAlpha(); len(e) != 0 { + errs = append(errs, e...) + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, + func(a *metav1.Condition, b *metav1.Condition) bool { return a.Type == b.Type }, validate.SemanticDeepEqual, validation.Validate_Condition); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *AllocatedDeviceStatus) []metav1.Condition { + return oldObj.Conditions + }) + errs = append(errs, fn(fldPath.Child("conditions"), obj.Conditions, oldVal, oldObj != nil)...) + } + + // field AllocatedDeviceStatus.Data has no validation + + { // field AllocatedDeviceStatus.NetworkData + fn := func( + fldPath *field.Path, + obj, oldObj *NetworkDeviceData, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_NetworkDeviceData(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *AllocatedDeviceStatus) *NetworkDeviceData { + return oldObj.NetworkData + }) + errs = append(errs, fn(fldPath.Child("networkData"), obj.NetworkData, oldVal, oldObj != nil)...) + } + + return errs +} + +var symbolsForAllocationConfigSource = sets.New(AllocationConfigSourceClaim, AllocationConfigSourceClass) + +// Validate_AllocationConfigSource validates an instance of AllocationConfigSource according +// to declarative validation rules in the API schema. +func Validate_AllocationConfigSource( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *AllocationConfigSource) (errs field.ErrorList) { + + if e := validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForAllocationConfigSource, nil).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + + return errs +} + +// Validate_AllocationResult validates an instance of AllocationResult according +// to declarative validation rules in the API schema. +func Validate_AllocationResult( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *AllocationResult) (errs field.ErrorList) { + + { // field AllocationResult.Devices + fn := func( + fldPath *field.Path, + obj, oldObj *DeviceAllocationResult, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call the type's validation function + errs = append(errs, Validate_DeviceAllocationResult(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *AllocationResult) *DeviceAllocationResult { + return &oldObj.Devices + }) + errs = append(errs, fn(fldPath.Child("devices"), &obj.Devices, oldVal, oldObj != nil)...) + } + + // field AllocationResult.NodeSelector has no validation + // field AllocationResult.AllocationTimestamp has no validation + return errs +} + +// Validate_CounterSet validates an instance of CounterSet according +// to declarative validation rules in the API schema. +func Validate_CounterSet( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *CounterSet) (errs field.ErrorList) { + + { // field CounterSet.Name + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.ShortName(ctx, op, fldPath, obj, oldObj).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CounterSet) *string { + return &oldObj.Name + }) + errs = append(errs, fn(fldPath.Child("name"), &obj.Name, oldVal, oldObj != nil)...) + } + + { // field CounterSet.Counters + fn := func( + fldPath *field.Path, + obj, oldObj map[string]Counter, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredMap(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.EachMapKey(ctx, op, fldPath, obj, oldObj, validate.ShortName).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CounterSet) map[string]Counter { + return oldObj.Counters + }) + errs = append(errs, fn(fldPath.Child("counters"), obj.Counters, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_Device validates an instance of Device according +// to declarative validation rules in the API schema. +func Validate_Device( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *Device) (errs field.ErrorList) { + + // field Device.Name has no validation + + { // field Device.Attributes + fn := func( + fldPath *field.Path, + obj, oldObj map[QualifiedName]DeviceAttribute, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalMap(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the map and call the value type's validation function + if e := validate.EachMapVal(ctx, op, fldPath, obj, oldObj, validate.SemanticDeepEqual, Validate_DeviceAttribute); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *Device) map[QualifiedName]DeviceAttribute { + return oldObj.Attributes + }) + errs = append(errs, fn(fldPath.Child("attributes"), obj.Attributes, oldVal, oldObj != nil)...) + } + + // field Device.Capacity has no validation + + { // field Device.ConsumesCounters + fn := func( + fldPath *field.Path, + obj, oldObj []DeviceCounterConsumption, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 2).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with map semantics require unique keys + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, + func(a *DeviceCounterConsumption, b *DeviceCounterConsumption) bool { + return a.CounterSet == b.CounterSet + }).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, + func(a *DeviceCounterConsumption, b *DeviceCounterConsumption) bool { + return a.CounterSet == b.CounterSet + }, validate.SemanticDeepEqual, Validate_DeviceCounterConsumption); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *Device) []DeviceCounterConsumption { + return oldObj.ConsumesCounters + }) + errs = append(errs, fn(fldPath.Child("consumesCounters"), obj.ConsumesCounters, oldVal, oldObj != nil)...) + } + + // field Device.NodeName has no validation + // field Device.NodeSelector has no validation + // field Device.AllNodes has no validation + + { // field Device.Taints + fn := func( + fldPath *field.Path, + obj, oldObj []DeviceTaint, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceTaint); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *Device) []DeviceTaint { + return oldObj.Taints + }) + errs = append(errs, fn(fldPath.Child("taints"), obj.Taints, oldVal, oldObj != nil)...) + } + + // field Device.BindsToNode has no validation + + { // field Device.BindingConditions + fn := func( + fldPath *field.Path, + obj, oldObj []string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *Device) []string { + return oldObj.BindingConditions + }) + errs = append(errs, fn(fldPath.Child("bindingConditions"), obj.BindingConditions, oldVal, oldObj != nil)...) + } + + { // field Device.BindingFailureConditions + fn := func( + fldPath *field.Path, + obj, oldObj []string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *Device) []string { + return oldObj.BindingFailureConditions + }) + errs = append(errs, fn(fldPath.Child("bindingFailureConditions"), obj.BindingFailureConditions, oldVal, oldObj != nil)...) + } + + // field Device.AllowMultipleAllocations has no validation + + { // field Device.NodeAllocatableResources + fn := func( + fldPath *field.Path, + obj, oldObj map[corev1.ResourceName]NodeAllocatableResource, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalMap(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the map and call the value type's validation function + if e := validate.EachMapVal(ctx, op, fldPath, obj, oldObj, validate.SemanticDeepEqual, Validate_NodeAllocatableResource); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *Device) map[corev1.ResourceName]NodeAllocatableResource { + return oldObj.NodeAllocatableResources + }) + errs = append(errs, fn(fldPath.Child("nodeAllocatableResources"), obj.NodeAllocatableResources, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_DeviceAllocationConfiguration validates an instance of DeviceAllocationConfiguration according +// to declarative validation rules in the API schema. +func Validate_DeviceAllocationConfiguration( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceAllocationConfiguration) (errs field.ErrorList) { + + { // field DeviceAllocationConfiguration.Source + fn := func( + fldPath *field.Path, + obj, oldObj *AllocationConfigSource, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_AllocationConfigSource(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceAllocationConfiguration) *AllocationConfigSource { + return &oldObj.Source + }) + errs = append(errs, fn(fldPath.Child("source"), &obj.Source, oldVal, oldObj != nil)...) + } + + { // field DeviceAllocationConfiguration.Requests + fn := func( + fldPath *field.Path, + obj, oldObj []string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with set semantics require unique values + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceAllocationConfiguration) []string { + return oldObj.Requests + }) + errs = append(errs, fn(fldPath.Child("requests"), obj.Requests, oldVal, oldObj != nil)...) + } + + { // field DeviceAllocationConfiguration.DeviceConfiguration + fn := func( + fldPath *field.Path, + obj, oldObj *DeviceConfiguration, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call the type's validation function + errs = append(errs, Validate_DeviceConfiguration(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceAllocationConfiguration) *DeviceConfiguration { + return &oldObj.DeviceConfiguration + }) + errs = append(errs, fn(safe.Value(fldPath, func() *field.Path { return fldPath.Child("DeviceConfiguration") }), &obj.DeviceConfiguration, oldVal, oldObj != nil)...) + } + + return errs +} + +var symbolsForDeviceAllocationMode = sets.New(DeviceAllocationModeAll, DeviceAllocationModeExactCount) + +// Validate_DeviceAllocationMode validates an instance of DeviceAllocationMode according +// to declarative validation rules in the API schema. +func Validate_DeviceAllocationMode( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceAllocationMode) (errs field.ErrorList) { + + if e := validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceAllocationMode, nil).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + + return errs +} + +// Validate_DeviceAllocationResult validates an instance of DeviceAllocationResult according +// to declarative validation rules in the API schema. +func Validate_DeviceAllocationResult( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceAllocationResult) (errs field.ErrorList) { + + { // field DeviceAllocationResult.Results + fn := func( + fldPath *field.Path, + obj, oldObj []DeviceRequestAllocationResult, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceRequestAllocationResult); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceAllocationResult) []DeviceRequestAllocationResult { + return oldObj.Results + }) + errs = append(errs, fn(fldPath.Child("results"), obj.Results, oldVal, oldObj != nil)...) + } + + { // field DeviceAllocationResult.Config + fn := func( + fldPath *field.Path, + obj, oldObj []DeviceAllocationConfiguration, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 64).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceAllocationConfiguration); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceAllocationResult) []DeviceAllocationConfiguration { + return oldObj.Config + }) + errs = append(errs, fn(fldPath.Child("config"), obj.Config, oldVal, oldObj != nil)...) + } + + return errs +} + +var unionMembershipFor_k8s_io_api_resource_v1_DeviceAttribute_ = validate.NewUnionMembership(validate.NewUnionMember("int"), validate.NewUnionMember("bool"), validate.NewUnionMember("string"), validate.NewUnionMember("version"), validate.NewUnionMember("ints"), validate.NewUnionMember("bools"), validate.NewUnionMember("strings"), validate.NewUnionMember("versions")) + +// Validate_DeviceAttribute validates an instance of DeviceAttribute according +// to declarative validation rules in the API schema. +func Validate_DeviceAttribute( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceAttribute) (errs field.ErrorList) { + + if e := validate.Union(ctx, op, fldPath, obj, oldObj, unionMembershipFor_k8s_io_api_resource_v1_DeviceAttribute_, + func(obj *DeviceAttribute) bool { + if obj == nil { + return false + } + return obj.IntValue != nil + }, + func(obj *DeviceAttribute) bool { + if obj == nil { + return false + } + return obj.BoolValue != nil + }, + func(obj *DeviceAttribute) bool { + if obj == nil { + return false + } + return obj.StringValue != nil + }, + func(obj *DeviceAttribute) bool { + if obj == nil { + return false + } + return obj.VersionValue != nil + }, + func(obj *DeviceAttribute) bool { + if obj == nil { + return false + } + return len(obj.IntValues) != 0 + }, + func(obj *DeviceAttribute) bool { + if obj == nil { + return false + } + return len(obj.BoolValues) != 0 + }, + func(obj *DeviceAttribute) bool { + if obj == nil { + return false + } + return len(obj.StringValues) != 0 + }, + func(obj *DeviceAttribute) bool { + if obj == nil { + return false + } + return len(obj.VersionValues) != 0 + }).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + + { // field DeviceAttribute.IntValue + fn := func( + fldPath *field.Path, + obj, oldObj *int64, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceAttribute) *int64 { + return oldObj.IntValue + }) + errs = append(errs, fn(fldPath.Child("int"), obj.IntValue, oldVal, oldObj != nil)...) + } + + { // field DeviceAttribute.BoolValue + fn := func( + fldPath *field.Path, + obj, oldObj *bool, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceAttribute) *bool { + return oldObj.BoolValue + }) + errs = append(errs, fn(fldPath.Child("bool"), obj.BoolValue, oldVal, oldObj != nil)...) + } + + { // field DeviceAttribute.StringValue + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceAttribute) *string { + return oldObj.StringValue + }) + errs = append(errs, fn(fldPath.Child("string"), obj.StringValue, oldVal, oldObj != nil)...) + } + + { // field DeviceAttribute.VersionValue + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceAttribute) *string { + return oldObj.VersionValue + }) + errs = append(errs, fn(fldPath.Child("version"), obj.VersionValue, oldVal, oldObj != nil)...) + } + + { // field DeviceAttribute.IntValues + fn := func( + fldPath *field.Path, + obj, oldObj []int64, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceAttribute) []int64 { + return oldObj.IntValues + }) + errs = append(errs, fn(fldPath.Child("ints"), obj.IntValues, oldVal, oldObj != nil)...) + } + + { // field DeviceAttribute.BoolValues + fn := func( + fldPath *field.Path, + obj, oldObj []bool, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceAttribute) []bool { + return oldObj.BoolValues + }) + errs = append(errs, fn(fldPath.Child("bools"), obj.BoolValues, oldVal, oldObj != nil)...) + } + + { // field DeviceAttribute.StringValues + fn := func( + fldPath *field.Path, + obj, oldObj []string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, + func(ctx context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *string) field.ErrorList { + return validate.MaxBytes(ctx, op, fldPath, obj, oldObj, 64) + }).MarkAlpha(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceAttribute) []string { + return oldObj.StringValues + }) + errs = append(errs, fn(fldPath.Child("strings"), obj.StringValues, oldVal, oldObj != nil)...) + } + + { // field DeviceAttribute.VersionValues + fn := func( + fldPath *field.Path, + obj, oldObj []string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceAttribute) []string { + return oldObj.VersionValues + }) + errs = append(errs, fn(fldPath.Child("versions"), obj.VersionValues, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_DeviceClaim validates an instance of DeviceClaim according +// to declarative validation rules in the API schema. +func Validate_DeviceClaim( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceClaim) (errs field.ErrorList) { + + { // field DeviceClaim.Requests + fn := func( + fldPath *field.Path, + obj, oldObj []DeviceRequest, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with map semantics require unique keys + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, + func(a *DeviceRequest, b *DeviceRequest) bool { return a.Name == b.Name }).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, + func(a *DeviceRequest, b *DeviceRequest) bool { return a.Name == b.Name }, validate.SemanticDeepEqual, Validate_DeviceRequest); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceClaim) []DeviceRequest { + return oldObj.Requests + }) + errs = append(errs, fn(fldPath.Child("requests"), obj.Requests, oldVal, oldObj != nil)...) + } + + { // field DeviceClaim.Constraints + fn := func( + fldPath *field.Path, + obj, oldObj []DeviceConstraint, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceConstraint); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceClaim) []DeviceConstraint { + return oldObj.Constraints + }) + errs = append(errs, fn(fldPath.Child("constraints"), obj.Constraints, oldVal, oldObj != nil)...) + } + + { // field DeviceClaim.Config + fn := func( + fldPath *field.Path, + obj, oldObj []DeviceClaimConfiguration, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceClaimConfiguration); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceClaim) []DeviceClaimConfiguration { + return oldObj.Config + }) + errs = append(errs, fn(fldPath.Child("config"), obj.Config, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_DeviceClaimConfiguration validates an instance of DeviceClaimConfiguration according +// to declarative validation rules in the API schema. +func Validate_DeviceClaimConfiguration( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceClaimConfiguration) (errs field.ErrorList) { + + { // field DeviceClaimConfiguration.Requests + fn := func( + fldPath *field.Path, + obj, oldObj []string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with set semantics require unique values + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceClaimConfiguration) []string { + return oldObj.Requests + }) + errs = append(errs, fn(fldPath.Child("requests"), obj.Requests, oldVal, oldObj != nil)...) + } + + { // field DeviceClaimConfiguration.DeviceConfiguration + fn := func( + fldPath *field.Path, + obj, oldObj *DeviceConfiguration, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call the type's validation function + errs = append(errs, Validate_DeviceConfiguration(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceClaimConfiguration) *DeviceConfiguration { + return &oldObj.DeviceConfiguration + }) + errs = append(errs, fn(safe.Value(fldPath, func() *field.Path { return fldPath.Child("DeviceConfiguration") }), &obj.DeviceConfiguration, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_DeviceClassConfiguration validates an instance of DeviceClassConfiguration according +// to declarative validation rules in the API schema. +func Validate_DeviceClassConfiguration( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceClassConfiguration) (errs field.ErrorList) { + + { // field DeviceClassConfiguration.DeviceConfiguration + fn := func( + fldPath *field.Path, + obj, oldObj *DeviceConfiguration, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call the type's validation function + errs = append(errs, Validate_DeviceConfiguration(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceClassConfiguration) *DeviceConfiguration { + return &oldObj.DeviceConfiguration + }) + errs = append(errs, fn(safe.Value(fldPath, func() *field.Path { return fldPath.Child("DeviceConfiguration") }), &obj.DeviceConfiguration, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_DeviceClassSpec validates an instance of DeviceClassSpec according +// to declarative validation rules in the API schema. +func Validate_DeviceClassSpec( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceClassSpec) (errs field.ErrorList) { + + { // field DeviceClassSpec.Selectors + fn := func( + fldPath *field.Path, + obj, oldObj []DeviceSelector, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceClassSpec) []DeviceSelector { + return oldObj.Selectors + }) + errs = append(errs, fn(fldPath.Child("selectors"), obj.Selectors, oldVal, oldObj != nil)...) + } + + { // field DeviceClassSpec.Config + fn := func( + fldPath *field.Path, + obj, oldObj []DeviceClassConfiguration, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceClassConfiguration); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceClassSpec) []DeviceClassConfiguration { + return oldObj.Config + }) + errs = append(errs, fn(fldPath.Child("config"), obj.Config, oldVal, oldObj != nil)...) + } + + { // field DeviceClassSpec.ExtendedResourceName + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.ExtendedResourceName(ctx, op, fldPath, obj, oldObj).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceClassSpec) *string { + return oldObj.ExtendedResourceName + }) + errs = append(errs, fn(fldPath.Child("extendedResourceName"), obj.ExtendedResourceName, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_DeviceConfiguration validates an instance of DeviceConfiguration according +// to declarative validation rules in the API schema. +func Validate_DeviceConfiguration( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceConfiguration) (errs field.ErrorList) { + + { // field DeviceConfiguration.Opaque + fn := func( + fldPath *field.Path, + obj, oldObj *OpaqueDeviceConfiguration, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_OpaqueDeviceConfiguration(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceConfiguration) *OpaqueDeviceConfiguration { + return oldObj.Opaque + }) + errs = append(errs, fn(fldPath.Child("opaque"), obj.Opaque, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_DeviceConstraint validates an instance of DeviceConstraint according +// to declarative validation rules in the API schema. +func Validate_DeviceConstraint( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceConstraint) (errs field.ErrorList) { + + { // field DeviceConstraint.Requests + fn := func( + fldPath *field.Path, + obj, oldObj []string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with set semantics require unique values + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceConstraint) []string { + return oldObj.Requests + }) + errs = append(errs, fn(fldPath.Child("requests"), obj.Requests, oldVal, oldObj != nil)...) + } + + { // field DeviceConstraint.MatchAttribute + fn := func( + fldPath *field.Path, + obj, oldObj *FullyQualifiedName, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.ResourceFullyQualifiedName(ctx, op, fldPath, obj, oldObj).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceConstraint) *FullyQualifiedName { + return oldObj.MatchAttribute + }) + errs = append(errs, fn(fldPath.Child("matchAttribute"), obj.MatchAttribute, oldVal, oldObj != nil)...) + } + + { // field DeviceConstraint.DistinctAttribute + fn := func( + fldPath *field.Path, + obj, oldObj *FullyQualifiedName, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.ResourceFullyQualifiedName(ctx, op, fldPath, obj, oldObj).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceConstraint) *FullyQualifiedName { + return oldObj.DistinctAttribute + }) + errs = append(errs, fn(fldPath.Child("distinctAttribute"), obj.DistinctAttribute, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_DeviceCounterConsumption validates an instance of DeviceCounterConsumption according +// to declarative validation rules in the API schema. +func Validate_DeviceCounterConsumption( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceCounterConsumption) (errs field.ErrorList) { + + { // field DeviceCounterConsumption.CounterSet + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.ShortName(ctx, op, fldPath, obj, oldObj).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceCounterConsumption) *string { + return &oldObj.CounterSet + }) + errs = append(errs, fn(fldPath.Child("counterSet"), &obj.CounterSet, oldVal, oldObj != nil)...) + } + + { // field DeviceCounterConsumption.Counters + fn := func( + fldPath *field.Path, + obj, oldObj map[string]Counter, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredMap(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.EachMapKey(ctx, op, fldPath, obj, oldObj, validate.ShortName).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceCounterConsumption) map[string]Counter { + return oldObj.Counters + }) + errs = append(errs, fn(fldPath.Child("counters"), obj.Counters, oldVal, oldObj != nil)...) + } + + { // field DeviceCounterConsumption.CompatibilityGroups + fn := func( + fldPath *field.Path, + obj, oldObj []string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 2).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, validate.DirectEqual, nil, validate.ShortName); len(e) != 0 { + errs = append(errs, e...) + } + // lists with set semantics require unique values + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceCounterConsumption) []string { + return oldObj.CompatibilityGroups + }) + errs = append(errs, fn(fldPath.Child("compatibilityGroups"), obj.CompatibilityGroups, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_DeviceDerivedAttribute validates an instance of DeviceDerivedAttribute according +// to declarative validation rules in the API schema. +func Validate_DeviceDerivedAttribute( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceDerivedAttribute) (errs field.ErrorList) { + + { // field DeviceDerivedAttribute.Name + fn := func( + fldPath *field.Path, + obj, oldObj *FullyQualifiedName, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.ResourceFullyQualifiedName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceDerivedAttribute) *FullyQualifiedName { + return &oldObj.Name + }) + errs = append(errs, fn(fldPath.Child("name"), &obj.Name, oldVal, oldObj != nil)...) + } + + { // field DeviceDerivedAttribute.Expression + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceDerivedAttribute) *string { + return &oldObj.Expression + }) + errs = append(errs, fn(fldPath.Child("expression"), &obj.Expression, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_DeviceRequest validates an instance of DeviceRequest according +// to declarative validation rules in the API schema. +func Validate_DeviceRequest( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceRequest) (errs field.ErrorList) { + + // field DeviceRequest.Name has no validation + + { // field DeviceRequest.Exactly + fn := func( + fldPath *field.Path, + obj, oldObj *ExactDeviceRequest, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_ExactDeviceRequest(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceRequest) *ExactDeviceRequest { + return oldObj.Exactly + }) + errs = append(errs, fn(fldPath.Child("exactly"), obj.Exactly, oldVal, oldObj != nil)...) + } + + { // field DeviceRequest.FirstAvailable + fn := func( + fldPath *field.Path, + obj, oldObj []DeviceSubRequest, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with map semantics require unique keys + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, + func(a *DeviceSubRequest, b *DeviceSubRequest) bool { return a.Name == b.Name }).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, + func(a *DeviceSubRequest, b *DeviceSubRequest) bool { return a.Name == b.Name }, validate.SemanticDeepEqual, Validate_DeviceSubRequest); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceRequest) []DeviceSubRequest { + return oldObj.FirstAvailable + }) + errs = append(errs, fn(fldPath.Child("firstAvailable"), obj.FirstAvailable, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_DeviceRequestAllocationResult validates an instance of DeviceRequestAllocationResult according +// to declarative validation rules in the API schema. +func Validate_DeviceRequestAllocationResult( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceRequestAllocationResult) (errs field.ErrorList) { + + // field DeviceRequestAllocationResult.Request has no validation + + { // field DeviceRequestAllocationResult.Driver + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + if e := validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceRequestAllocationResult) *string { + return &oldObj.Driver + }) + errs = append(errs, fn(fldPath.Child("driver"), &obj.Driver, oldVal, oldObj != nil)...) + } + + { // field DeviceRequestAllocationResult.Pool + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.ResourcePoolName(ctx, op, fldPath, obj, oldObj).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceRequestAllocationResult) *string { + return &oldObj.Pool + }) + errs = append(errs, fn(fldPath.Child("pool"), &obj.Pool, oldVal, oldObj != nil)...) + } + + // field DeviceRequestAllocationResult.Device has no validation + // field DeviceRequestAllocationResult.AdminAccess has no validation + + { // field DeviceRequestAllocationResult.Tolerations + fn := func( + fldPath *field.Path, + obj, oldObj []DeviceToleration, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceToleration); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceRequestAllocationResult) []DeviceToleration { + return oldObj.Tolerations + }) + errs = append(errs, fn(fldPath.Child("tolerations"), obj.Tolerations, oldVal, oldObj != nil)...) + } + + { // field DeviceRequestAllocationResult.BindingConditions + fn := func( + fldPath *field.Path, + obj, oldObj []string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceRequestAllocationResult) []string { + return oldObj.BindingConditions + }) + errs = append(errs, fn(fldPath.Child("bindingConditions"), obj.BindingConditions, oldVal, oldObj != nil)...) + } + + { // field DeviceRequestAllocationResult.BindingFailureConditions + fn := func( + fldPath *field.Path, + obj, oldObj []string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceRequestAllocationResult) []string { + return oldObj.BindingFailureConditions + }) + errs = append(errs, fn(fldPath.Child("bindingFailureConditions"), obj.BindingFailureConditions, oldVal, oldObj != nil)...) + } + + { // field DeviceRequestAllocationResult.ShareID + fn := func( + fldPath *field.Path, + obj, oldObj *types.UID, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.UUID(ctx, op, fldPath, obj, oldObj).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceRequestAllocationResult) *types.UID { + return oldObj.ShareID + }) + errs = append(errs, fn(fldPath.Child("shareID"), obj.ShareID, oldVal, oldObj != nil)...) + } + + // field DeviceRequestAllocationResult.ConsumedCapacity has no validation + + { // field DeviceRequestAllocationResult.SkipNodeOperations + fn := func( + fldPath *field.Path, + obj, oldObj []SkipNodeOperation, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with set semantics require unique values + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual); len(e) != 0 { + errs = append(errs, e...) + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, validate.DirectEqual, nil, Validate_SkipNodeOperation); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceRequestAllocationResult) []SkipNodeOperation { + return oldObj.SkipNodeOperations + }) + errs = append(errs, fn(fldPath.Child("skipNodeOperations"), obj.SkipNodeOperations, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_DeviceSubRequest validates an instance of DeviceSubRequest according +// to declarative validation rules in the API schema. +func Validate_DeviceSubRequest( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceSubRequest) (errs field.ErrorList) { + + // field DeviceSubRequest.Name has no validation + + { // field DeviceSubRequest.DeviceClassName + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.LongName(ctx, op, fldPath, obj, oldObj).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceSubRequest) *string { + return &oldObj.DeviceClassName + }) + errs = append(errs, fn(fldPath.Child("deviceClassName"), &obj.DeviceClassName, oldVal, oldObj != nil)...) + } + + { // field DeviceSubRequest.Selectors + fn := func( + fldPath *field.Path, + obj, oldObj []DeviceSelector, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceSubRequest) []DeviceSelector { + return oldObj.Selectors + }) + errs = append(errs, fn(fldPath.Child("selectors"), obj.Selectors, oldVal, oldObj != nil)...) + } + + { // field DeviceSubRequest.AllocationMode + fn := func( + fldPath *field.Path, + obj, oldObj *DeviceAllocationMode, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_DeviceAllocationMode(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceSubRequest) *DeviceAllocationMode { + return &oldObj.AllocationMode + }) + errs = append(errs, fn(fldPath.Child("allocationMode"), &obj.AllocationMode, oldVal, oldObj != nil)...) + } + + // field DeviceSubRequest.Count has no validation + + { // field DeviceSubRequest.Tolerations + fn := func( + fldPath *field.Path, + obj, oldObj []DeviceToleration, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceToleration); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceSubRequest) []DeviceToleration { + return oldObj.Tolerations + }) + errs = append(errs, fn(fldPath.Child("tolerations"), obj.Tolerations, oldVal, oldObj != nil)...) + } + + // field DeviceSubRequest.Capacity has no validation + + { // field DeviceSubRequest.DerivedAttributes + fn := func( + fldPath *field.Path, + obj, oldObj []DeviceDerivedAttribute, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceDerivedAttribute); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceSubRequest) []DeviceDerivedAttribute { + return oldObj.DerivedAttributes + }) + errs = append(errs, fn(fldPath.Child("derivedAttributes"), obj.DerivedAttributes, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_DeviceTaint validates an instance of DeviceTaint according +// to declarative validation rules in the API schema. +func Validate_DeviceTaint( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceTaint) (errs field.ErrorList) { + + // field DeviceTaint.Key has no validation + // field DeviceTaint.Value has no validation + + { // field DeviceTaint.Effect + fn := func( + fldPath *field.Path, + obj, oldObj *DeviceTaintEffect, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_DeviceTaintEffect(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceTaint) *DeviceTaintEffect { + return &oldObj.Effect + }) + errs = append(errs, fn(fldPath.Child("effect"), &obj.Effect, oldVal, oldObj != nil)...) + } + + // field DeviceTaint.TimeAdded has no validation + return errs +} + +var symbolsForDeviceTaintEffect = sets.New(DeviceTaintEffectNoExecute, DeviceTaintEffectNoSchedule, DeviceTaintEffectNone) + +// Validate_DeviceTaintEffect validates an instance of DeviceTaintEffect according +// to declarative validation rules in the API schema. +func Validate_DeviceTaintEffect( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceTaintEffect) (errs field.ErrorList) { + + if e := validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceTaintEffect, nil).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + + return errs +} + +// Validate_DeviceTaintRuleSpec validates an instance of DeviceTaintRuleSpec according +// to declarative validation rules in the API schema. +func Validate_DeviceTaintRuleSpec( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceTaintRuleSpec) (errs field.ErrorList) { + + // field DeviceTaintRuleSpec.DeviceSelector has no validation + + { // field DeviceTaintRuleSpec.Taint + fn := func( + fldPath *field.Path, + obj, oldObj *DeviceTaint, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call the type's validation function + errs = append(errs, Validate_DeviceTaint(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceTaintRuleSpec) *DeviceTaint { + return &oldObj.Taint + }) + errs = append(errs, fn(fldPath.Child("taint"), &obj.Taint, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_DeviceTaintRuleStatus validates an instance of DeviceTaintRuleStatus according +// to declarative validation rules in the API schema. +func Validate_DeviceTaintRuleStatus( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceTaintRuleStatus) (errs field.ErrorList) { + + { // field DeviceTaintRuleStatus.Conditions + fn := func( + fldPath *field.Path, + obj, oldObj []metav1.Condition, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with map semantics require unique keys + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, + func(a *metav1.Condition, b *metav1.Condition) bool { return a.Type == b.Type }).MarkAlpha(); len(e) != 0 { + errs = append(errs, e...) + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, + func(a *metav1.Condition, b *metav1.Condition) bool { return a.Type == b.Type }, validate.SemanticDeepEqual, validation.Validate_Condition); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceTaintRuleStatus) []metav1.Condition { + return oldObj.Conditions + }) + errs = append(errs, fn(fldPath.Child("conditions"), obj.Conditions, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_DeviceToleration validates an instance of DeviceToleration according +// to declarative validation rules in the API schema. +func Validate_DeviceToleration( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceToleration) (errs field.ErrorList) { + + { // field DeviceToleration.Key + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.LabelKey(ctx, op, fldPath, obj, oldObj).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceToleration) *string { + return &oldObj.Key + }) + errs = append(errs, fn(fldPath.Child("key"), &obj.Key, oldVal, oldObj != nil)...) + } + + { // field DeviceToleration.Operator + fn := func( + fldPath *field.Path, + obj, oldObj *DeviceTolerationOperator, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + // optional fields with default values are effectively required + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_DeviceTolerationOperator(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceToleration) *DeviceTolerationOperator { + return &oldObj.Operator + }) + errs = append(errs, fn(fldPath.Child("operator"), &obj.Operator, oldVal, oldObj != nil)...) + } + + // field DeviceToleration.Value has no validation + + { // field DeviceToleration.Effect + fn := func( + fldPath *field.Path, + obj, oldObj *DeviceTaintEffect, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_DeviceTaintEffect(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DeviceToleration) *DeviceTaintEffect { + return &oldObj.Effect + }) + errs = append(errs, fn(fldPath.Child("effect"), &obj.Effect, oldVal, oldObj != nil)...) + } + + // field DeviceToleration.TolerationSeconds has no validation + return errs +} + +var symbolsForDeviceTolerationOperator = sets.New(DeviceTolerationOpEqual, DeviceTolerationOpExists) + +// Validate_DeviceTolerationOperator validates an instance of DeviceTolerationOperator according +// to declarative validation rules in the API schema. +func Validate_DeviceTolerationOperator( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DeviceTolerationOperator) (errs field.ErrorList) { + + if e := validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForDeviceTolerationOperator, nil).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + + return errs +} + +// Validate_ExactDeviceRequest validates an instance of ExactDeviceRequest according +// to declarative validation rules in the API schema. +func Validate_ExactDeviceRequest( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *ExactDeviceRequest) (errs field.ErrorList) { + + // field ExactDeviceRequest.DeviceClassName has no validation + + { // field ExactDeviceRequest.Selectors + fn := func( + fldPath *field.Path, + obj, oldObj []DeviceSelector, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *ExactDeviceRequest) []DeviceSelector { + return oldObj.Selectors + }) + errs = append(errs, fn(fldPath.Child("selectors"), obj.Selectors, oldVal, oldObj != nil)...) + } + + { // field ExactDeviceRequest.AllocationMode + fn := func( + fldPath *field.Path, + obj, oldObj *DeviceAllocationMode, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_DeviceAllocationMode(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *ExactDeviceRequest) *DeviceAllocationMode { + return &oldObj.AllocationMode + }) + errs = append(errs, fn(fldPath.Child("allocationMode"), &obj.AllocationMode, oldVal, oldObj != nil)...) + } + + // field ExactDeviceRequest.Count has no validation + // field ExactDeviceRequest.AdminAccess has no validation + + { // field ExactDeviceRequest.Tolerations + fn := func( + fldPath *field.Path, + obj, oldObj []DeviceToleration, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceToleration); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *ExactDeviceRequest) []DeviceToleration { + return oldObj.Tolerations + }) + errs = append(errs, fn(fldPath.Child("tolerations"), obj.Tolerations, oldVal, oldObj != nil)...) + } + + // field ExactDeviceRequest.Capacity has no validation + + { // field ExactDeviceRequest.DerivedAttributes + fn := func( + fldPath *field.Path, + obj, oldObj []DeviceDerivedAttribute, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 32).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_DeviceDerivedAttribute); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *ExactDeviceRequest) []DeviceDerivedAttribute { + return oldObj.DerivedAttributes + }) + errs = append(errs, fn(fldPath.Child("derivedAttributes"), obj.DerivedAttributes, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_NetworkDeviceData validates an instance of NetworkDeviceData according +// to declarative validation rules in the API schema. +func Validate_NetworkDeviceData( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *NetworkDeviceData) (errs field.ErrorList) { + + { // field NetworkDeviceData.InterfaceName + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.MaxBytes(ctx, op, fldPath, obj, oldObj, 256).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *NetworkDeviceData) *string { + return &oldObj.InterfaceName + }) + errs = append(errs, fn(fldPath.Child("interfaceName"), &obj.InterfaceName, oldVal, oldObj != nil)...) + } + + { // field NetworkDeviceData.IPs + fn := func( + fldPath *field.Path, + obj, oldObj []string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 16).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with set semantics require unique values + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *NetworkDeviceData) []string { + return oldObj.IPs + }) + errs = append(errs, fn(fldPath.Child("ips"), obj.IPs, oldVal, oldObj != nil)...) + } + + { // field NetworkDeviceData.HardwareAddress + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.MaxBytes(ctx, op, fldPath, obj, oldObj, 128).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *NetworkDeviceData) *string { + return &oldObj.HardwareAddress + }) + errs = append(errs, fn(fldPath.Child("hardwareAddress"), &obj.HardwareAddress, oldVal, oldObj != nil)...) + } + + return errs +} + +var unionMembershipFor_k8s_io_api_resource_v1_NodeAllocatableMapping_ = validate.NewUnionMembership(validate.NewUnionMember("capacityKey"), validate.NewUnionMember("deviceMultiplier")) + +// Validate_NodeAllocatableMapping validates an instance of NodeAllocatableMapping according +// to declarative validation rules in the API schema. +func Validate_NodeAllocatableMapping( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *NodeAllocatableMapping) (errs field.ErrorList) { + + if e := validate.DependentRequired(ctx, op, fldPath, obj, oldObj, "capacityKey", + func(obj *NodeAllocatableMapping) bool { + if obj == nil { + return false + } + return obj.CapacityKey != nil + }, "capacityMultiplier", + func(obj *NodeAllocatableMapping) bool { + if obj == nil { + return false + } + return obj.CapacityMultiplier != nil + }).MarkAlpha(); len(e) != 0 { + errs = append(errs, e...) + } + if e := validate.Union(ctx, op, fldPath, obj, oldObj, unionMembershipFor_k8s_io_api_resource_v1_NodeAllocatableMapping_, + func(obj *NodeAllocatableMapping) bool { + if obj == nil { + return false + } + return obj.CapacityKey != nil + }, + func(obj *NodeAllocatableMapping) bool { + if obj == nil { + return false + } + return obj.DeviceMultiplier != nil + }); len(e) != 0 { + errs = append(errs, e...) + } + if e := validate.DependentRequired(ctx, op, fldPath, obj, oldObj, "capacityMultiplier", + func(obj *NodeAllocatableMapping) bool { + if obj == nil { + return false + } + return obj.CapacityMultiplier != nil + }, "capacityKey", + func(obj *NodeAllocatableMapping) bool { + if obj == nil { + return false + } + return obj.CapacityKey != nil + }).MarkAlpha(); len(e) != 0 { + errs = append(errs, e...) + } + + { // field NodeAllocatableMapping.CapacityKey + fn := func( + fldPath *field.Path, + obj, oldObj *QualifiedName, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *NodeAllocatableMapping) *QualifiedName { + return oldObj.CapacityKey + }) + errs = append(errs, fn(fldPath.Child("capacityKey"), obj.CapacityKey, oldVal, oldObj != nil)...) + } + + { // field NodeAllocatableMapping.CapacityMultiplier + fn := func( + fldPath *field.Path, + obj, oldObj *resource.Quantity, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *NodeAllocatableMapping) *resource.Quantity { + return oldObj.CapacityMultiplier + }) + errs = append(errs, fn(fldPath.Child("capacityMultiplier"), obj.CapacityMultiplier, oldVal, oldObj != nil)...) + } + + { // field NodeAllocatableMapping.DeviceMultiplier + fn := func( + fldPath *field.Path, + obj, oldObj *resource.Quantity, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *NodeAllocatableMapping) *resource.Quantity { + return oldObj.DeviceMultiplier + }) + errs = append(errs, fn(fldPath.Child("deviceMultiplier"), obj.DeviceMultiplier, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_NodeAllocatableOverhead validates an instance of NodeAllocatableOverhead according +// to declarative validation rules in the API schema. +func Validate_NodeAllocatableOverhead( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *NodeAllocatableOverhead) (errs field.ErrorList) { + + { // field NodeAllocatableOverhead.PerPod + fn := func( + fldPath *field.Path, + obj, oldObj *resource.Quantity, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *NodeAllocatableOverhead) *resource.Quantity { + return oldObj.PerPod + }) + errs = append(errs, fn(fldPath.Child("perPod"), obj.PerPod, oldVal, oldObj != nil)...) + } + + { // field NodeAllocatableOverhead.PerContainer + fn := func( + fldPath *field.Path, + obj, oldObj *resource.Quantity, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *NodeAllocatableOverhead) *resource.Quantity { + return oldObj.PerContainer + }) + errs = append(errs, fn(fldPath.Child("perContainer"), obj.PerContainer, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_NodeAllocatableResource validates an instance of NodeAllocatableResource according +// to declarative validation rules in the API schema. +func Validate_NodeAllocatableResource( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *NodeAllocatableResource) (errs field.ErrorList) { + + { // field NodeAllocatableResource.Mapping + fn := func( + fldPath *field.Path, + obj, oldObj *NodeAllocatableMapping, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_NodeAllocatableMapping(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *NodeAllocatableResource) *NodeAllocatableMapping { + return oldObj.Mapping + }) + errs = append(errs, fn(fldPath.Child("mapping"), obj.Mapping, oldVal, oldObj != nil)...) + } + + { // field NodeAllocatableResource.Overhead + fn := func( + fldPath *field.Path, + obj, oldObj *NodeAllocatableOverhead, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_NodeAllocatableOverhead(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *NodeAllocatableResource) *NodeAllocatableOverhead { + return oldObj.Overhead + }) + errs = append(errs, fn(fldPath.Child("overhead"), obj.Overhead, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_OpaqueDeviceConfiguration validates an instance of OpaqueDeviceConfiguration according +// to declarative validation rules in the API schema. +func Validate_OpaqueDeviceConfiguration( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *OpaqueDeviceConfiguration) (errs field.ErrorList) { + + { // field OpaqueDeviceConfiguration.Driver + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.LongNameCaseless(ctx, op, fldPath, obj, oldObj).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + if e := validate.MaxLength(ctx, op, fldPath, obj, oldObj, 63).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *OpaqueDeviceConfiguration) *string { + return &oldObj.Driver + }) + errs = append(errs, fn(fldPath.Child("driver"), &obj.Driver, oldVal, oldObj != nil)...) + } + + // field OpaqueDeviceConfiguration.Parameters has no validation + return errs +} + +// Validate_ResourceClaimSpec validates an instance of ResourceClaimSpec according +// to declarative validation rules in the API schema. +func Validate_ResourceClaimSpec( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *ResourceClaimSpec) (errs field.ErrorList) { + + { // field ResourceClaimSpec.Devices + fn := func( + fldPath *field.Path, + obj, oldObj *DeviceClaim, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call the type's validation function + errs = append(errs, Validate_DeviceClaim(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *ResourceClaimSpec) *DeviceClaim { + return &oldObj.Devices + }) + errs = append(errs, fn(fldPath.Child("devices"), &obj.Devices, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_ResourceClaimStatus validates an instance of ResourceClaimStatus according +// to declarative validation rules in the API schema. +func Validate_ResourceClaimStatus( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *ResourceClaimStatus) (errs field.ErrorList) { + + { // field ResourceClaimStatus.Allocation + fn := func( + fldPath *field.Path, + obj, oldObj *AllocationResult, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.UpdatePointer(ctx, op, fldPath, obj, oldObj, validate.NoModify).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_AllocationResult(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *ResourceClaimStatus) *AllocationResult { + return oldObj.Allocation + }) + errs = append(errs, fn(fldPath.Child("allocation"), obj.Allocation, oldVal, oldObj != nil)...) + } + + { // field ResourceClaimStatus.ReservedFor + fn := func( + fldPath *field.Path, + obj, oldObj []ResourceClaimConsumerReference, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 256).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with map semantics require unique keys + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, + func(a *ResourceClaimConsumerReference, b *ResourceClaimConsumerReference) bool { return a.UID == b.UID }).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *ResourceClaimStatus) []ResourceClaimConsumerReference { + return oldObj.ReservedFor + }) + errs = append(errs, fn(fldPath.Child("reservedFor"), obj.ReservedFor, oldVal, oldObj != nil)...) + } + + { // field ResourceClaimStatus.Devices + fn := func( + fldPath *field.Path, + obj, oldObj []AllocatedDeviceStatus, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with map semantics require unique keys + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, + func(a *AllocatedDeviceStatus, b *AllocatedDeviceStatus) bool { + return a.Driver == b.Driver && a.Device == b.Device && a.Pool == b.Pool && ((a.ShareID == nil && b.ShareID == nil) || (a.ShareID != nil && b.ShareID != nil && *a.ShareID == *b.ShareID)) + }).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, + func(a *AllocatedDeviceStatus, b *AllocatedDeviceStatus) bool { + return a.Driver == b.Driver && a.Device == b.Device && a.Pool == b.Pool && ((a.ShareID == nil && b.ShareID == nil) || (a.ShareID != nil && b.ShareID != nil && *a.ShareID == *b.ShareID)) + }, validate.SemanticDeepEqual, Validate_AllocatedDeviceStatus); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *ResourceClaimStatus) []AllocatedDeviceStatus { + return oldObj.Devices + }) + errs = append(errs, fn(fldPath.Child("devices"), obj.Devices, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_ResourceClaimTemplateSpec validates an instance of ResourceClaimTemplateSpec according +// to declarative validation rules in the API schema. +func Validate_ResourceClaimTemplateSpec( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *ResourceClaimTemplateSpec) (errs field.ErrorList) { + + // field ResourceClaimTemplateSpec.ObjectMeta has no validation + + { // field ResourceClaimTemplateSpec.Spec + fn := func( + fldPath *field.Path, + obj, oldObj *ResourceClaimSpec, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call the type's validation function + errs = append(errs, Validate_ResourceClaimSpec(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *ResourceClaimTemplateSpec) *ResourceClaimSpec { + return &oldObj.Spec + }) + errs = append(errs, fn(fldPath.Child("spec"), &obj.Spec, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_ResourceSliceSpec validates an instance of ResourceSliceSpec according +// to declarative validation rules in the API schema. +func Validate_ResourceSliceSpec( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *ResourceSliceSpec) (errs field.ErrorList) { + + // field ResourceSliceSpec.Driver has no validation + // field ResourceSliceSpec.Pool has no validation + // field ResourceSliceSpec.NodeName has no validation + // field ResourceSliceSpec.NodeSelector has no validation + // field ResourceSliceSpec.AllNodes has no validation + + { // field ResourceSliceSpec.Devices + fn := func( + fldPath *field.Path, + obj, oldObj []Device, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_Device); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *ResourceSliceSpec) []Device { + return oldObj.Devices + }) + errs = append(errs, fn(fldPath.Child("devices"), obj.Devices, oldVal, oldObj != nil)...) + } + + // field ResourceSliceSpec.PerDeviceNodeSelection has no validation + + { // field ResourceSliceSpec.SharedCounters + fn := func( + fldPath *field.Path, + obj, oldObj []CounterSet, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkBeta().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8).MarkBeta().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with map semantics require unique keys + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, + func(a *CounterSet, b *CounterSet) bool { return a.Name == b.Name }).MarkBeta(); len(e) != 0 { + errs = append(errs, e...) + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, + func(a *CounterSet, b *CounterSet) bool { return a.Name == b.Name }, validate.SemanticDeepEqual, Validate_CounterSet); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *ResourceSliceSpec) []CounterSet { + return oldObj.SharedCounters + }) + errs = append(errs, fn(fldPath.Child("sharedCounters"), obj.SharedCounters, oldVal, oldObj != nil)...) + } + + { // field ResourceSliceSpec.PartitionTypeAttribute + fn := func( + fldPath *field.Path, + obj, oldObj *FullyQualifiedName, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "DRAPartitionableDevicesType", false, validate.ForbiddenPointer).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "DRAPartitionableDevicesType", false, validate.OptionalPointer).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "DRAPartitionableDevicesType", true, validate.OptionalPointer).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "DRAPartitionableDevicesType", true, validate.ResourceFullyQualifiedName); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *ResourceSliceSpec) *FullyQualifiedName { + return oldObj.PartitionTypeAttribute + }) + errs = append(errs, fn(fldPath.Child("partitionTypeAttribute"), obj.PartitionTypeAttribute, oldVal, oldObj != nil)...) + } + + { // field ResourceSliceSpec.SkipNodeOperations + fn := func( + fldPath *field.Path, + obj, oldObj []SkipNodeOperation, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with set semantics require unique values + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, validate.DirectEqual); len(e) != 0 { + errs = append(errs, e...) + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, validate.DirectEqual, nil, Validate_SkipNodeOperation); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *ResourceSliceSpec) []SkipNodeOperation { + return oldObj.SkipNodeOperations + }) + errs = append(errs, fn(fldPath.Child("skipNodeOperations"), obj.SkipNodeOperations, oldVal, oldObj != nil)...) + } + + return errs +} + +var symbolsForSkipNodeOperation = sets.New(SkipNodeOperationAll, SkipNodeOperationNodePrepareResources, SkipNodeOperationNodeUnprepareResources) + +// Validate_SkipNodeOperation validates an instance of SkipNodeOperation according +// to declarative validation rules in the API schema. +func Validate_SkipNodeOperation( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *SkipNodeOperation) (errs field.ErrorList) { + + if e := validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForSkipNodeOperation, nil); len(e) != 0 { + errs = append(errs, e...) + } + + return errs +} diff --git a/vendor/k8s.io/api/resource/v1alpha3/generated.pb.go b/vendor/k8s.io/api/resource/v1alpha3/generated.pb.go index fa1f5f4710..77199b046d 100644 --- a/vendor/k8s.io/api/resource/v1alpha3/generated.pb.go +++ b/vendor/k8s.io/api/resource/v1alpha3/generated.pb.go @@ -24,6 +24,7 @@ import ( io "io" + resource "k8s.io/apimachinery/pkg/api/resource" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" math_bits "math/bits" @@ -47,6 +48,8 @@ func (m *DeviceTaintRuleStatus) Reset() { *m = DeviceTaintRuleStatus{} } func (m *DeviceTaintSelector) Reset() { *m = DeviceTaintSelector{} } +func (m *PartitionTypeStatus) Reset() { *m = PartitionTypeStatus{} } + func (m *PoolStatus) Reset() { *m = PoolStatus{} } func (m *ResourcePoolStatusRequest) Reset() { *m = ResourcePoolStatusRequest{} } @@ -57,6 +60,10 @@ func (m *ResourcePoolStatusRequestSpec) Reset() { *m = ResourcePoolStatusRequest func (m *ResourcePoolStatusRequestStatus) Reset() { *m = ResourcePoolStatusRequestStatus{} } +func (m *ShareableCapacityStatus) Reset() { *m = ShareableCapacityStatus{} } + +func (m *ShareableSummaryStatus) Reset() { *m = ShareableSummaryStatus{} } + func (m *CELDeviceSelector) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -396,6 +403,49 @@ func (m *DeviceTaintSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *PartitionTypeStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PartitionTypeStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PartitionTypeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Attribute) + copy(dAtA[i:], m.Attribute) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Attribute))) + i-- + dAtA[i] = 0x22 + if m.Allocatable != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Allocatable)) + i-- + dAtA[i] = 0x18 + } + if m.Total != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Total)) + i-- + dAtA[i] = 0x10 + } + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *PoolStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -416,6 +466,32 @@ func (m *PoolStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.ShareableSummary != nil { + { + size, err := m.ShareableSummary.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + if len(m.PartitionSummary) > 0 { + for iNdEx := len(m.PartitionSummary) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PartitionSummary[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + } if m.ValidationError != nil { i -= len(*m.ValidationError) copy(dAtA[i:], *m.ValidationError) @@ -593,6 +669,13 @@ func (m *ResourcePoolStatusRequestSpec) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l + if m.DefaultPartitionTypeAttribute != nil { + i -= len(*m.DefaultPartitionTypeAttribute) + copy(dAtA[i:], *m.DefaultPartitionTypeAttribute) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.DefaultPartitionTypeAttribute))) + i-- + dAtA[i] = 0x22 + } if m.Limit != nil { i = encodeVarintGenerated(dAtA, i, uint64(*m.Limit)) i-- @@ -669,6 +752,117 @@ func (m *ResourcePoolStatusRequestStatus) MarshalToSizedBuffer(dAtA []byte) (int return len(dAtA) - i, nil } +func (m *ShareableCapacityStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ShareableCapacityStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ShareableCapacityStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Available != nil { + { + size, err := m.Available.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Consumed != nil { + { + size, err := m.Consumed.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Total != nil { + { + size, err := m.Total.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ShareableSummaryStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ShareableSummaryStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ShareableSummaryStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Capacity) > 0 { + for iNdEx := len(m.Capacity) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Capacity[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.PartiallyAvailableDevices != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.PartiallyAvailableDevices)) + i-- + dAtA[i] = 0x10 + } + if m.FullyAvailableDevices != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.FullyAvailableDevices)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { offset -= sovGenerated(v) base := offset @@ -806,6 +1000,25 @@ func (m *DeviceTaintSelector) Size() (n int) { return n } +func (m *PartitionTypeStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + if m.Total != nil { + n += 1 + sovGenerated(uint64(*m.Total)) + } + if m.Allocatable != nil { + n += 1 + sovGenerated(uint64(*m.Allocatable)) + } + l = len(m.Attribute) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m *PoolStatus) Size() (n int) { if m == nil { return 0 @@ -840,6 +1053,16 @@ func (m *PoolStatus) Size() (n int) { l = len(*m.ValidationError) n += 1 + l + sovGenerated(uint64(l)) } + if len(m.PartitionSummary) > 0 { + for _, e := range m.PartitionSummary { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.ShareableSummary != nil { + l = m.ShareableSummary.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -892,6 +1115,10 @@ func (m *ResourcePoolStatusRequestSpec) Size() (n int) { if m.Limit != nil { n += 1 + sovGenerated(uint64(*m.Limit)) } + if m.DefaultPartitionTypeAttribute != nil { + l = len(*m.DefaultPartitionTypeAttribute) + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -919,6 +1146,50 @@ func (m *ResourcePoolStatusRequestStatus) Size() (n int) { return n } +func (m *ShareableCapacityStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if m.Total != nil { + l = m.Total.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Consumed != nil { + l = m.Consumed.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Available != nil { + l = m.Available.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *ShareableSummaryStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.FullyAvailableDevices != nil { + n += 1 + sovGenerated(uint64(*m.FullyAvailableDevices)) + } + if m.PartiallyAvailableDevices != nil { + n += 1 + sovGenerated(uint64(*m.PartiallyAvailableDevices)) + } + if len(m.Capacity) > 0 { + for _, e := range m.Capacity { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + func sovGenerated(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1011,10 +1282,28 @@ func (this *DeviceTaintSelector) String() string { }, "") return s } +func (this *PartitionTypeStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PartitionTypeStatus{`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Total:` + valueToStringGenerated(this.Total) + `,`, + `Allocatable:` + valueToStringGenerated(this.Allocatable) + `,`, + `Attribute:` + fmt.Sprintf("%v", this.Attribute) + `,`, + `}`, + }, "") + return s +} func (this *PoolStatus) String() string { if this == nil { return "nil" } + repeatedStringForPartitionSummary := "[]PartitionTypeStatus{" + for _, f := range this.PartitionSummary { + repeatedStringForPartitionSummary += strings.Replace(strings.Replace(f.String(), "PartitionTypeStatus", "PartitionTypeStatus", 1), `&`, ``, 1) + "," + } + repeatedStringForPartitionSummary += "}" s := strings.Join([]string{`&PoolStatus{`, `Driver:` + fmt.Sprintf("%v", this.Driver) + `,`, `PoolName:` + fmt.Sprintf("%v", this.PoolName) + `,`, @@ -1026,6 +1315,8 @@ func (this *PoolStatus) String() string { `ResourceSliceCount:` + valueToStringGenerated(this.ResourceSliceCount) + `,`, `Generation:` + fmt.Sprintf("%v", this.Generation) + `,`, `ValidationError:` + valueToStringGenerated(this.ValidationError) + `,`, + `PartitionSummary:` + repeatedStringForPartitionSummary + `,`, + `ShareableSummary:` + strings.Replace(this.ShareableSummary.String(), "ShareableSummaryStatus", "ShareableSummaryStatus", 1) + `,`, `}`, }, "") return s @@ -1066,6 +1357,7 @@ func (this *ResourcePoolStatusRequestSpec) String() string { `Driver:` + fmt.Sprintf("%v", this.Driver) + `,`, `PoolName:` + valueToStringGenerated(this.PoolName) + `,`, `Limit:` + valueToStringGenerated(this.Limit) + `,`, + `DefaultPartitionTypeAttribute:` + valueToStringGenerated(this.DefaultPartitionTypeAttribute) + `,`, `}`, }, "") return s @@ -1092,6 +1384,36 @@ func (this *ResourcePoolStatusRequestStatus) String() string { }, "") return s } +func (this *ShareableCapacityStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ShareableCapacityStatus{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Total:` + strings.Replace(fmt.Sprintf("%v", this.Total), "Quantity", "resource.Quantity", 1) + `,`, + `Consumed:` + strings.Replace(fmt.Sprintf("%v", this.Consumed), "Quantity", "resource.Quantity", 1) + `,`, + `Available:` + strings.Replace(fmt.Sprintf("%v", this.Available), "Quantity", "resource.Quantity", 1) + `,`, + `}`, + }, "") + return s +} +func (this *ShareableSummaryStatus) String() string { + if this == nil { + return "nil" + } + repeatedStringForCapacity := "[]ShareableCapacityStatus{" + for _, f := range this.Capacity { + repeatedStringForCapacity += strings.Replace(strings.Replace(f.String(), "ShareableCapacityStatus", "ShareableCapacityStatus", 1), `&`, ``, 1) + "," + } + repeatedStringForCapacity += "}" + s := strings.Join([]string{`&ShareableSummaryStatus{`, + `FullyAvailableDevices:` + valueToStringGenerated(this.FullyAvailableDevices) + `,`, + `PartiallyAvailableDevices:` + valueToStringGenerated(this.PartiallyAvailableDevices) + `,`, + `Capacity:` + repeatedStringForCapacity + `,`, + `}`, + }, "") + return s +} func valueToStringGenerated(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -2068,7 +2390,7 @@ func (m *DeviceTaintSelector) Unmarshal(dAtA []byte) error { } return nil } -func (m *PoolStatus) Unmarshal(dAtA []byte) error { +func (m *PartitionTypeStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2091,15 +2413,15 @@ func (m *PoolStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PoolStatus: wiretype end group for non-group") + return fmt.Errorf("proto: PartitionTypeStatus: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PoolStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PartitionTypeStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2127,13 +2449,13 @@ func (m *PoolStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Driver = string(dAtA[iNdEx:postIndex]) + m.Type = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolName", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) } - var stringLen uint64 + var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -2143,27 +2465,35 @@ func (m *PoolStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + v |= int32(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated + m.Total = &v + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Allocatable", wireType) } - if postIndex > l { - return io.ErrUnexpectedEOF + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } } - m.PoolName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: + m.Allocatable = &v + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Attribute", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2191,8 +2521,154 @@ func (m *PoolStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.NodeName = &s + m.Attribute = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PoolStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PoolStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PoolStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Driver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Driver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PoolName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.NodeName = &s iNdEx = postIndex case 4: if wireType != 0 { @@ -2346,6 +2822,76 @@ func (m *PoolStatus) Unmarshal(dAtA []byte) error { s := string(dAtA[iNdEx:postIndex]) m.ValidationError = &s iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PartitionSummary", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PartitionSummary = append(m.PartitionSummary, PartitionTypeStatus{}) + if err := m.PartitionSummary[len(m.PartitionSummary)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShareableSummary", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ShareableSummary == nil { + m.ShareableSummary = &ShareableSummaryStatus{} + } + if err := m.ShareableSummary.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -2750,6 +3296,39 @@ func (m *ResourcePoolStatusRequestSpec) Unmarshal(dAtA []byte) error { } } m.Limit = &v + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultPartitionTypeAttribute", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.DefaultPartitionTypeAttribute = &s + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -2909,6 +3488,320 @@ func (m *ResourcePoolStatusRequestStatus) Unmarshal(dAtA []byte) error { } return nil } +func (m *ShareableCapacityStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ShareableCapacityStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ShareableCapacityStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Total == nil { + m.Total = &resource.Quantity{} + } + if err := m.Total.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Consumed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Consumed == nil { + m.Consumed = &resource.Quantity{} + } + if err := m.Consumed.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Available", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Available == nil { + m.Available = &resource.Quantity{} + } + if err := m.Available.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ShareableSummaryStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ShareableSummaryStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ShareableSummaryStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FullyAvailableDevices", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.FullyAvailableDevices = &v + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartiallyAvailableDevices", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PartiallyAvailableDevices = &v + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Capacity = append(m.Capacity, ShareableCapacityStatus{}) + if err := m.Capacity[len(m.Capacity)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipGenerated(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/vendor/k8s.io/api/resource/v1alpha3/generated.proto b/vendor/k8s.io/api/resource/v1alpha3/generated.proto index d6ee310806..daa969018c 100644 --- a/vendor/k8s.io/api/resource/v1alpha3/generated.proto +++ b/vendor/k8s.io/api/resource/v1alpha3/generated.proto @@ -21,6 +21,7 @@ syntax = "proto2"; package k8s.io.api.resource.v1alpha3; +import "k8s.io/apimachinery/pkg/api/resource/generated.proto"; import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; import "k8s.io/apimachinery/pkg/runtime/generated.proto"; import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; @@ -40,7 +41,7 @@ message CELDeviceSelector { // - driver (string): the name of the driver which defines this device. // - attributes (map[string]object): the device's attributes, grouped by prefix // (e.g. device.attributes["dra.example.com"] evaluates to an object with all - // of the attributes which were prefixed by "dra.example.com". + // of the attributes which were prefixed by "dra.example.com"). // - capacity (map[string]object): the device's capacities, grouped by prefix. // // Example: Consider a device with driver="dra.example.com", which exposes @@ -71,6 +72,15 @@ message CELDeviceSelector { // A robust expression should check for the existence of attributes // before referencing them. // + // Common errors: + // - "no such key": Use optional chaining (.? followed by orValue()) + // or guarding the check with has() for optional fields. + // See CEL Optional Types for details: + // https://pkg.go.dev/github.com/google/cel-go@v0.17.4/cel#OptionalTypes + // + // For more CEL expression syntax and examples, see: + // https://kubernetes.io/docs/reference/using-api/cel/ + // // For ease of use, the cel.bind() function is enabled, and can be used // to simplify expressions that access multiple attributes with the // same domain. For example: @@ -120,7 +130,7 @@ message DeviceTaint { // Consumers must treat unknown effects like None. // // +required - // +k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string effect = 3; // TimeAdded represents the time at which the taint was added or @@ -142,6 +152,7 @@ message DeviceTaint { // DeviceTaintRule adds one taint to all devices which match the selector. // This has the same effect as if the taint was specified directly // in the ResourceSlice by the DRA driver. +// +k8s:supportsSubresource="/status" message DeviceTaintRule { // Standard object metadata // +optional @@ -213,6 +224,9 @@ message DeviceTaintRuleStatus { // +listMapKey=type // +patchStrategy=merge // +patchMergeKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1; } @@ -248,6 +262,40 @@ message DeviceTaintSelector { optional string device = 4; } +// PartitionTypeStatus reports allocatability for a single partition type, +// identified by the value of a grouping attribute. +message PartitionTypeStatus { + // Attribute is the fully qualified name of the device attribute whose value + // groups this entry. It is the PartitionTypeAttribute declared by the + // devices' own slice, or the default named in the request when their slice + // declares none. + // + // +required + // +k8s:required + optional string attribute = 4; + + // Type is the partition type value (e.g. "Full" or "Half"). + // + // +required + // +k8s:required + optional string type = 1; + + // Total is the number of devices of this partition type in the pool. + // + // +required + // +k8s:required + // +k8s:minimum=0 + optional int32 total = 2; + + // Allocatable is the number of additional devices of this partition type + // that could still be allocated given current shared-counter consumption. + // + // +required + // +k8s:required + // +k8s:minimum=0 + optional int32 allocatable = 3; +} + // PoolStatus contains status information for a single resource pool. message PoolStatus { // Driver is the DRA driver name for this pool. @@ -339,6 +387,33 @@ message PoolStatus { // +k8s:optional // +k8s:maxBytes=256 optional string validationError = 10; + + // PartitionSummary reports allocatability per (attribute, partition type) + // for a partitionable pool that publishes SharedCounters. Each entry names + // the grouping attribute it was resolved from: the PartitionTypeAttribute + // declared by a device's own slice, or for devices whose slice declares + // none, the default named in the request. A pool that mixes partitions + // declared under different attributes reports each independently. When no + // slice declares an attribute and the request names no default, the pool + // reports no partition summary. + // + // +optional + // +k8s:optional + // +listType=atomic + // +k8s:listType=atomic + // +k8s:unique=map + // +k8s:listMapKey=attribute + // +k8s:listMapKey=type + // +k8s:maxItems=32 + repeated PartitionTypeStatus partitionSummary = 11; + + // ShareableSummary reports aggregate capacity for a pool that contains + // devices with AllowMultipleAllocations. It is populated only when at + // least one device in the pool is shareable. + // + // +optional + // +k8s:optional + optional ShareableSummaryStatus shareableSummary = 13; } // ResourcePoolStatusRequest triggers a one-time calculation of resource pool status @@ -410,6 +485,26 @@ message ResourcePoolStatusRequestSpec { // +k8s:minimum=1 // +k8s:maximum=1000 optional int32 limit = 3; + + // DefaultPartitionTypeAttribute optionally names a device attribute (by its + // fully qualified name, e.g. "gpu.example.com/profile") to use as the default + // grouping attribute for partitionable devices whose slice has not declared + // one themselves. + // + // A slice's own PartitionTypeAttribute always takes precedence. This default + // applies only to devices whose slice does not declare one, so that a request + // can still get an accurate partitionSummary from a driver that has not + // been updated to declare it. When neither the slice nor this default names + // an attribute, a partitionable pool reports no partitionSummary. + // + // Must include the domain qualifier. + // + // +optional + // +featureGate=DRAPartitionableDevicesType + // +k8s:ifDisabled(DRAPartitionableDevicesType)=+k8s:forbidden + // +k8s:ifEnabled(DRAPartitionableDevicesType)=+k8s:optional + // +k8s:ifEnabled(DRAPartitionableDevicesType)=+k8s:format=k8s-resource-fully-qualified-name + optional string defaultPartitionTypeAttribute = 4; } // ResourcePoolStatusRequestStatus contains the calculated pool status information. @@ -446,12 +541,69 @@ message ResourcePoolStatusRequestStatus { // +optional // +k8s:optional // +listType=map - // +k8s:listType=map // +listMapKey=type - // +k8s:listMapKey=type // +patchStrategy=merge // +patchMergeKey=type // +k8s:maxItems=10 + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 3; } +// ShareableCapacityStatus reports aggregate amounts for a single shareable +// capacity key. +message ShareableCapacityStatus { + // Name is the capacity name. + // + // +required + // +k8s:required + optional string name = 1; + + // Total is the sum of this capacity across shareable devices in the pool. + // + // +required + // +k8s:required + optional .k8s.io.apimachinery.pkg.api.resource.Quantity total = 2; + + // Consumed is the amount drawn by current allocations. + // + // +required + // +k8s:required + optional .k8s.io.apimachinery.pkg.api.resource.Quantity consumed = 3; + + // Available is Total minus Consumed, never negative. + // + // +required + // +k8s:required + optional .k8s.io.apimachinery.pkg.api.resource.Quantity available = 4; +} + +// ShareableSummaryStatus reports aggregate capacity for a pool that contains +// devices with AllowMultipleAllocations. +message ShareableSummaryStatus { + // FullyAvailableDevices is the number of shareable devices with no + // capacity consumed. + // + // +required + // +k8s:required + // +k8s:minimum=0 + optional int32 fullyAvailableDevices = 1; + + // PartiallyAvailableDevices is the number of shareable devices with some + // but not all capacity consumed. + // + // +required + // +k8s:required + // +k8s:minimum=0 + optional int32 partiallyAvailableDevices = 2; + + // Capacity reports aggregate total, consumed, and available amounts per + // shareable capacity key across the pool. + // + // +optional + // +k8s:optional + // +listType=atomic + // +k8s:maxItems=32 + repeated ShareableCapacityStatus capacity = 3; +} + diff --git a/vendor/k8s.io/api/resource/v1alpha3/types.go b/vendor/k8s.io/api/resource/v1alpha3/types.go index 1757c86150..8e1e884504 100644 --- a/vendor/k8s.io/api/resource/v1alpha3/types.go +++ b/vendor/k8s.io/api/resource/v1alpha3/types.go @@ -17,6 +17,7 @@ limitations under the License. package v1alpha3 import ( + resource "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -41,7 +42,7 @@ type CELDeviceSelector struct { // - driver (string): the name of the driver which defines this device. // - attributes (map[string]object): the device's attributes, grouped by prefix // (e.g. device.attributes["dra.example.com"] evaluates to an object with all - // of the attributes which were prefixed by "dra.example.com". + // of the attributes which were prefixed by "dra.example.com"). // - capacity (map[string]object): the device's capacities, grouped by prefix. // // Example: Consider a device with driver="dra.example.com", which exposes @@ -72,6 +73,15 @@ type CELDeviceSelector struct { // A robust expression should check for the existence of attributes // before referencing them. // + // Common errors: + // - "no such key": Use optional chaining (.? followed by orValue()) + // or guarding the check with has() for optional fields. + // See CEL Optional Types for details: + // https://pkg.go.dev/github.com/google/cel-go@v0.17.4/cel#OptionalTypes + // + // For more CEL expression syntax and examples, see: + // https://kubernetes.io/docs/reference/using-api/cel/ + // // For ease of use, the cel.bind() function is enabled, and can be used // to simplify expressions that access multiple attributes with the // same domain. For example: @@ -140,7 +150,7 @@ type DeviceTaint struct { // Consumers must treat unknown effects like None. // // +required - // +k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Effect DeviceTaintEffect `json:"effect" protobuf:"bytes,3,name=effect,casttype=DeviceTaintEffect"` // ^^^^ @@ -179,7 +189,7 @@ type DeviceTaint struct { } // +enum -// +k8s:enum +// +k8s:beta(since: "1.37")=+k8s:enum type DeviceTaintEffect string const ( @@ -203,8 +213,9 @@ const ( // DeviceTaintRule adds one taint to all devices which match the selector. // This has the same effect as if the taint was specified directly // in the ResourceSlice by the DRA driver. +// +k8s:supportsSubresource="/status" type DeviceTaintRule struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -322,6 +333,9 @@ type DeviceTaintRuleStatus struct { // +listMapKey=type // +patchStrategy=merge // +patchMergeKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` } @@ -336,7 +350,7 @@ const DeviceTaintConditionEvictionInProgress = "EvictionInProgress" // DeviceTaintRuleList is a collection of DeviceTaintRules. type DeviceTaintRuleList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -355,7 +369,7 @@ type DeviceTaintRuleList struct { // based on the provided filters. Once status is set, the request is considered complete and will not be reprocessed. // Users should delete and recreate requests to get updated information. type ResourcePoolStatusRequest struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata // +required metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -411,6 +425,26 @@ type ResourcePoolStatusRequestSpec struct { // +k8s:minimum=1 // +k8s:maximum=1000 Limit *int32 `json:"limit,omitempty" protobuf:"varint,3,opt,name=limit"` + + // DefaultPartitionTypeAttribute optionally names a device attribute (by its + // fully qualified name, e.g. "gpu.example.com/profile") to use as the default + // grouping attribute for partitionable devices whose slice has not declared + // one themselves. + // + // A slice's own PartitionTypeAttribute always takes precedence. This default + // applies only to devices whose slice does not declare one, so that a request + // can still get an accurate partitionSummary from a driver that has not + // been updated to declare it. When neither the slice nor this default names + // an attribute, a partitionable pool reports no partitionSummary. + // + // Must include the domain qualifier. + // + // +optional + // +featureGate=DRAPartitionableDevicesType + // +k8s:ifDisabled(DRAPartitionableDevicesType)=+k8s:forbidden + // +k8s:ifEnabled(DRAPartitionableDevicesType)=+k8s:optional + // +k8s:ifEnabled(DRAPartitionableDevicesType)=+k8s:format=k8s-resource-fully-qualified-name + DefaultPartitionTypeAttribute *string `json:"defaultPartitionTypeAttribute,omitempty" protobuf:"bytes,4,opt,name=defaultPartitionTypeAttribute"` } // ResourcePoolStatusRequestLimitDefault is the default value for spec.limit. @@ -453,12 +487,12 @@ type ResourcePoolStatusRequestStatus struct { // +optional // +k8s:optional // +listType=map - // +k8s:listType=map // +listMapKey=type - // +k8s:listMapKey=type // +patchStrategy=merge // +patchMergeKey=type // +k8s:maxItems=10 + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,3,rep,name=conditions"` } @@ -553,6 +587,124 @@ type PoolStatus struct { // +k8s:optional // +k8s:maxBytes=256 ValidationError *string `json:"validationError,omitempty" protobuf:"bytes,10,opt,name=validationError"` + + // PartitionSummary reports allocatability per (attribute, partition type) + // for a partitionable pool that publishes SharedCounters. Each entry names + // the grouping attribute it was resolved from: the PartitionTypeAttribute + // declared by a device's own slice, or for devices whose slice declares + // none, the default named in the request. A pool that mixes partitions + // declared under different attributes reports each independently. When no + // slice declares an attribute and the request names no default, the pool + // reports no partition summary. + // + // +optional + // +k8s:optional + // +listType=atomic + // +k8s:listType=atomic + // +k8s:unique=map + // +k8s:listMapKey=attribute + // +k8s:listMapKey=type + // +k8s:maxItems=32 + PartitionSummary []PartitionTypeStatus `json:"partitionSummary,omitempty" protobuf:"bytes,11,rep,name=partitionSummary"` + + // ShareableSummary reports aggregate capacity for a pool that contains + // devices with AllowMultipleAllocations. It is populated only when at + // least one device in the pool is shareable. + // + // +optional + // +k8s:optional + ShareableSummary *ShareableSummaryStatus `json:"shareableSummary,omitempty" protobuf:"bytes,13,opt,name=shareableSummary"` +} + +// PartitionTypeStatus reports allocatability for a single partition type, +// identified by the value of a grouping attribute. +type PartitionTypeStatus struct { + // Attribute is the fully qualified name of the device attribute whose value + // groups this entry. It is the PartitionTypeAttribute declared by the + // devices' own slice, or the default named in the request when their slice + // declares none. + // + // +required + // +k8s:required + Attribute string `json:"attribute,omitempty" protobuf:"bytes,4,name=attribute"` + + // Type is the partition type value (e.g. "Full" or "Half"). + // + // +required + // +k8s:required + Type string `json:"type,omitempty" protobuf:"bytes,1,name=type"` + + // Total is the number of devices of this partition type in the pool. + // + // +required + // +k8s:required + // +k8s:minimum=0 + Total *int32 `json:"total,omitempty" protobuf:"varint,2,opt,name=total"` + + // Allocatable is the number of additional devices of this partition type + // that could still be allocated given current shared-counter consumption. + // + // +required + // +k8s:required + // +k8s:minimum=0 + Allocatable *int32 `json:"allocatable,omitempty" protobuf:"varint,3,opt,name=allocatable"` +} + +// ShareableSummaryStatus reports aggregate capacity for a pool that contains +// devices with AllowMultipleAllocations. +type ShareableSummaryStatus struct { + // FullyAvailableDevices is the number of shareable devices with no + // capacity consumed. + // + // +required + // +k8s:required + // +k8s:minimum=0 + FullyAvailableDevices *int32 `json:"fullyAvailableDevices,omitempty" protobuf:"varint,1,opt,name=fullyAvailableDevices"` + + // PartiallyAvailableDevices is the number of shareable devices with some + // but not all capacity consumed. + // + // +required + // +k8s:required + // +k8s:minimum=0 + PartiallyAvailableDevices *int32 `json:"partiallyAvailableDevices,omitempty" protobuf:"varint,2,opt,name=partiallyAvailableDevices"` + + // Capacity reports aggregate total, consumed, and available amounts per + // shareable capacity key across the pool. + // + // +optional + // +k8s:optional + // +listType=atomic + // +k8s:maxItems=32 + Capacity []ShareableCapacityStatus `json:"capacity,omitempty" protobuf:"bytes,3,rep,name=capacity"` +} + +// ShareableCapacityStatus reports aggregate amounts for a single shareable +// capacity key. +type ShareableCapacityStatus struct { + // Name is the capacity name. + // + // +required + // +k8s:required + Name string `json:"name,omitempty" protobuf:"bytes,1,name=name"` + + // Total is the sum of this capacity across shareable devices in the pool. + // + // +required + // +k8s:required + Total *resource.Quantity `json:"total,omitempty" protobuf:"bytes,2,opt,name=total"` + + // Consumed is the amount drawn by current allocations. + // + // +required + // +k8s:required + Consumed *resource.Quantity `json:"consumed,omitempty" protobuf:"bytes,3,opt,name=consumed"` + + // Available is Total minus Consumed, never negative. + // + // +required + // +k8s:required + Available *resource.Quantity `json:"available,omitempty" protobuf:"bytes,4,opt,name=available"` } // ResourcePoolStatusRequestConditionComplete is the condition type for completed requests. @@ -566,7 +718,7 @@ const ResourcePoolStatusRequestConditionFailed = "Failed" // ResourcePoolStatusRequestList is a collection of ResourcePoolStatusRequests. type ResourcePoolStatusRequestList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` diff --git a/vendor/k8s.io/api/resource/v1alpha3/types_swagger_doc_generated.go b/vendor/k8s.io/api/resource/v1alpha3/types_swagger_doc_generated.go index 49ff642fea..4fddc16bc1 100644 --- a/vendor/k8s.io/api/resource/v1alpha3/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/resource/v1alpha3/types_swagger_doc_generated.go @@ -29,7 +29,7 @@ package v1alpha3 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_CELDeviceSelector = map[string]string{ "": "CELDeviceSelector contains a CEL expression for selecting a device.", - "expression": "Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort.\n\nThe expression's input is an object named \"device\", which carries the following properties:\n - driver (string): the name of the driver which defines this device.\n - attributes (map[string]object): the device's attributes, grouped by prefix\n (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all\n of the attributes which were prefixed by \"dra.example.com\".\n - capacity (map[string]object): the device's capacities, grouped by prefix.\n\nExample: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields:\n\n device.driver\n device.attributes[\"dra.example.com\"].model\n device.attributes[\"ext.example.com\"].family\n device.capacity[\"dra.example.com\"].modules\n\nThe device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers.\n\nThe value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity.\n\nIf an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort.\n\nA robust expression should check for the existence of attributes before referencing them.\n\nFor ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example:\n\n cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool)\n\nThe length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps.", + "expression": "Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort.\n\nThe expression's input is an object named \"device\", which carries the following properties:\n - driver (string): the name of the driver which defines this device.\n - attributes (map[string]object): the device's attributes, grouped by prefix\n (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all\n of the attributes which were prefixed by \"dra.example.com\").\n - capacity (map[string]object): the device's capacities, grouped by prefix.\n\nExample: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields:\n\n device.driver\n device.attributes[\"dra.example.com\"].model\n device.attributes[\"ext.example.com\"].family\n device.capacity[\"dra.example.com\"].modules\n\nThe device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers.\n\nThe value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity.\n\nIf an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort.\n\nA robust expression should check for the existence of attributes before referencing them.\n\nCommon errors: - \"no such key\": Use optional chaining (.? followed by orValue())\n or guarding the check with has() for optional fields.\n See CEL Optional Types for details:\n https://pkg.go.dev/github.com/google/cel-go@v0.17.4/cel#OptionalTypes\n\nFor more CEL expression syntax and examples, see: https://kubernetes.io/docs/reference/using-api/cel/\n\nFor ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example:\n\n cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool)\n\nThe length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps.", } func (CELDeviceSelector) SwaggerDoc() map[string]string { @@ -108,6 +108,18 @@ func (DeviceTaintSelector) SwaggerDoc() map[string]string { return map_DeviceTaintSelector } +var map_PartitionTypeStatus = map[string]string{ + "": "PartitionTypeStatus reports allocatability for a single partition type, identified by the value of a grouping attribute.", + "attribute": "Attribute is the fully qualified name of the device attribute whose value groups this entry. It is the PartitionTypeAttribute declared by the devices' own slice, or the default named in the request when their slice declares none.", + "type": "Type is the partition type value (e.g. \"Full\" or \"Half\").", + "total": "Total is the number of devices of this partition type in the pool.", + "allocatable": "Allocatable is the number of additional devices of this partition type that could still be allocated given current shared-counter consumption.", +} + +func (PartitionTypeStatus) SwaggerDoc() map[string]string { + return map_PartitionTypeStatus +} + var map_PoolStatus = map[string]string{ "": "PoolStatus contains status information for a single resource pool.", "driver": "Driver is the DRA driver name for this pool. Must be a DNS subdomain (e.g., \"gpu.example.com\").", @@ -120,6 +132,8 @@ var map_PoolStatus = map[string]string{ "unavailableDevices": "UnavailableDevices is the number of devices that are not available due to taints or other conditions, but are not allocated. A value of 0 means all unallocated devices are available. May be unset when validationError is set.", "nodeName": "NodeName is the node this pool is associated with. When omitted, the pool is not associated with a specific node. Must be a valid DNS subdomain name (RFC1123).", "validationError": "ValidationError is set when the pool's data could not be fully validated (e.g., incomplete slice publication). When set, device count fields and ResourceSliceCount may be unset.", + "partitionSummary": "PartitionSummary reports allocatability per (attribute, partition type) for a partitionable pool that publishes SharedCounters. Each entry names the grouping attribute it was resolved from: the PartitionTypeAttribute declared by a device's own slice, or for devices whose slice declares none, the default named in the request. A pool that mixes partitions declared under different attributes reports each independently. When no slice declares an attribute and the request names no default, the pool reports no partition summary.", + "shareableSummary": "ShareableSummary reports aggregate capacity for a pool that contains devices with AllowMultipleAllocations. It is populated only when at least one device in the pool is shareable.", } func (PoolStatus) SwaggerDoc() map[string]string { @@ -148,10 +162,11 @@ func (ResourcePoolStatusRequestList) SwaggerDoc() map[string]string { } var map_ResourcePoolStatusRequestSpec = map[string]string{ - "": "ResourcePoolStatusRequestSpec defines the filters for the pool status request.", - "driver": "Driver specifies the DRA driver name to filter pools. Only pools from ResourceSlices with this driver will be included. Must be a DNS subdomain (e.g., \"gpu.example.com\").", - "poolName": "PoolName optionally filters to a specific pool name. If not specified, all pools from the specified driver are included. When specified, must be a non-empty valid resource pool name (DNS subdomains separated by \"/\").", - "limit": "Limit optionally specifies the maximum number of pools to return in the status. If more pools match the filter criteria, the response will be truncated (i.e., len(status.pools) < status.poolCount).\n\nDefault: 100 Minimum: 1 Maximum: 1000", + "": "ResourcePoolStatusRequestSpec defines the filters for the pool status request.", + "driver": "Driver specifies the DRA driver name to filter pools. Only pools from ResourceSlices with this driver will be included. Must be a DNS subdomain (e.g., \"gpu.example.com\").", + "poolName": "PoolName optionally filters to a specific pool name. If not specified, all pools from the specified driver are included. When specified, must be a non-empty valid resource pool name (DNS subdomains separated by \"/\").", + "limit": "Limit optionally specifies the maximum number of pools to return in the status. If more pools match the filter criteria, the response will be truncated (i.e., len(status.pools) < status.poolCount).\n\nDefault: 100 Minimum: 1 Maximum: 1000", + "defaultPartitionTypeAttribute": "DefaultPartitionTypeAttribute optionally names a device attribute (by its fully qualified name, e.g. \"gpu.example.com/profile\") to use as the default grouping attribute for partitionable devices whose slice has not declared one themselves.\n\nA slice's own PartitionTypeAttribute always takes precedence. This default applies only to devices whose slice does not declare one, so that a request can still get an accurate partitionSummary from a driver that has not been updated to declare it. When neither the slice nor this default names an attribute, a partitionable pool reports no partitionSummary.\n\nMust include the domain qualifier.", } func (ResourcePoolStatusRequestSpec) SwaggerDoc() map[string]string { @@ -169,4 +184,27 @@ func (ResourcePoolStatusRequestStatus) SwaggerDoc() map[string]string { return map_ResourcePoolStatusRequestStatus } +var map_ShareableCapacityStatus = map[string]string{ + "": "ShareableCapacityStatus reports aggregate amounts for a single shareable capacity key.", + "name": "Name is the capacity name.", + "total": "Total is the sum of this capacity across shareable devices in the pool.", + "consumed": "Consumed is the amount drawn by current allocations.", + "available": "Available is Total minus Consumed, never negative.", +} + +func (ShareableCapacityStatus) SwaggerDoc() map[string]string { + return map_ShareableCapacityStatus +} + +var map_ShareableSummaryStatus = map[string]string{ + "": "ShareableSummaryStatus reports aggregate capacity for a pool that contains devices with AllowMultipleAllocations.", + "fullyAvailableDevices": "FullyAvailableDevices is the number of shareable devices with no capacity consumed.", + "partiallyAvailableDevices": "PartiallyAvailableDevices is the number of shareable devices with some but not all capacity consumed.", + "capacity": "Capacity reports aggregate total, consumed, and available amounts per shareable capacity key across the pool.", +} + +func (ShareableSummaryStatus) SwaggerDoc() map[string]string { + return map_ShareableSummaryStatus +} + // AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/k8s.io/api/resource/v1alpha3/zz_generated.deepcopy.go b/vendor/k8s.io/api/resource/v1alpha3/zz_generated.deepcopy.go index 32ec2ad8e2..b3ec2e6c78 100644 --- a/vendor/k8s.io/api/resource/v1alpha3/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/resource/v1alpha3/zz_generated.deepcopy.go @@ -220,6 +220,32 @@ func (in *DeviceTaintSelector) DeepCopy() *DeviceTaintSelector { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PartitionTypeStatus) DeepCopyInto(out *PartitionTypeStatus) { + *out = *in + if in.Total != nil { + in, out := &in.Total, &out.Total + *out = new(int32) + **out = **in + } + if in.Allocatable != nil { + in, out := &in.Allocatable, &out.Allocatable + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PartitionTypeStatus. +func (in *PartitionTypeStatus) DeepCopy() *PartitionTypeStatus { + if in == nil { + return nil + } + out := new(PartitionTypeStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PoolStatus) DeepCopyInto(out *PoolStatus) { *out = *in @@ -258,6 +284,18 @@ func (in *PoolStatus) DeepCopyInto(out *PoolStatus) { *out = new(string) **out = **in } + if in.PartitionSummary != nil { + in, out := &in.PartitionSummary, &out.PartitionSummary + *out = make([]PartitionTypeStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ShareableSummary != nil { + in, out := &in.ShareableSummary, &out.ShareableSummary + *out = new(ShareableSummaryStatus) + (*in).DeepCopyInto(*out) + } return } @@ -349,6 +387,11 @@ func (in *ResourcePoolStatusRequestSpec) DeepCopyInto(out *ResourcePoolStatusReq *out = new(int32) **out = **in } + if in.DefaultPartitionTypeAttribute != nil { + in, out := &in.DefaultPartitionTypeAttribute, &out.DefaultPartitionTypeAttribute + *out = new(string) + **out = **in + } return } @@ -396,3 +439,67 @@ func (in *ResourcePoolStatusRequestStatus) DeepCopy() *ResourcePoolStatusRequest in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ShareableCapacityStatus) DeepCopyInto(out *ShareableCapacityStatus) { + *out = *in + if in.Total != nil { + in, out := &in.Total, &out.Total + x := (*in).DeepCopy() + *out = &x + } + if in.Consumed != nil { + in, out := &in.Consumed, &out.Consumed + x := (*in).DeepCopy() + *out = &x + } + if in.Available != nil { + in, out := &in.Available, &out.Available + x := (*in).DeepCopy() + *out = &x + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShareableCapacityStatus. +func (in *ShareableCapacityStatus) DeepCopy() *ShareableCapacityStatus { + if in == nil { + return nil + } + out := new(ShareableCapacityStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ShareableSummaryStatus) DeepCopyInto(out *ShareableSummaryStatus) { + *out = *in + if in.FullyAvailableDevices != nil { + in, out := &in.FullyAvailableDevices, &out.FullyAvailableDevices + *out = new(int32) + **out = **in + } + if in.PartiallyAvailableDevices != nil { + in, out := &in.PartiallyAvailableDevices, &out.PartiallyAvailableDevices + *out = new(int32) + **out = **in + } + if in.Capacity != nil { + in, out := &in.Capacity, &out.Capacity + *out = make([]ShareableCapacityStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShareableSummaryStatus. +func (in *ShareableSummaryStatus) DeepCopy() *ShareableSummaryStatus { + if in == nil { + return nil + } + out := new(ShareableSummaryStatus) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/k8s.io/api/resource/v1alpha3/zz_generated.model_name.go b/vendor/k8s.io/api/resource/v1alpha3/zz_generated.model_name.go index 3ef712c223..255ca1dda5 100644 --- a/vendor/k8s.io/api/resource/v1alpha3/zz_generated.model_name.go +++ b/vendor/k8s.io/api/resource/v1alpha3/zz_generated.model_name.go @@ -61,6 +61,11 @@ func (in DeviceTaintSelector) OpenAPIModelName() string { return "io.k8s.api.resource.v1alpha3.DeviceTaintSelector" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PartitionTypeStatus) OpenAPIModelName() string { + return "io.k8s.api.resource.v1alpha3.PartitionTypeStatus" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in PoolStatus) OpenAPIModelName() string { return "io.k8s.api.resource.v1alpha3.PoolStatus" @@ -85,3 +90,13 @@ func (in ResourcePoolStatusRequestSpec) OpenAPIModelName() string { func (in ResourcePoolStatusRequestStatus) OpenAPIModelName() string { return "io.k8s.api.resource.v1alpha3.ResourcePoolStatusRequestStatus" } + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ShareableCapacityStatus) OpenAPIModelName() string { + return "io.k8s.api.resource.v1alpha3.ShareableCapacityStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ShareableSummaryStatus) OpenAPIModelName() string { + return "io.k8s.api.resource.v1alpha3.ShareableSummaryStatus" +} diff --git a/vendor/k8s.io/api/resource/v1beta1/generated.pb.go b/vendor/k8s.io/api/resource/v1beta1/generated.pb.go index 4170f77802..c279e0cc16 100644 --- a/vendor/k8s.io/api/resource/v1beta1/generated.pb.go +++ b/vendor/k8s.io/api/resource/v1beta1/generated.pb.go @@ -84,6 +84,8 @@ func (m *DeviceConstraint) Reset() { *m = DeviceConstraint{} } func (m *DeviceCounterConsumption) Reset() { *m = DeviceCounterConsumption{} } +func (m *DeviceDerivedAttribute) Reset() { *m = DeviceDerivedAttribute{} } + func (m *DeviceRequest) Reset() { *m = DeviceRequest{} } func (m *DeviceRequestAllocationResult) Reset() { *m = DeviceRequestAllocationResult{} } @@ -98,7 +100,11 @@ func (m *DeviceToleration) Reset() { *m = DeviceToleration{} } func (m *NetworkDeviceData) Reset() { *m = NetworkDeviceData{} } -func (m *NodeAllocatableResourceMapping) Reset() { *m = NodeAllocatableResourceMapping{} } +func (m *NodeAllocatableMapping) Reset() { *m = NodeAllocatableMapping{} } + +func (m *NodeAllocatableOverhead) Reset() { *m = NodeAllocatableOverhead{} } + +func (m *NodeAllocatableResource) Reset() { *m = NodeAllocatableResource{} } func (m *OpaqueDeviceConfiguration) Reset() { *m = OpaqueDeviceConfiguration{} } @@ -286,14 +292,14 @@ func (m *BasicDevice) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.NodeAllocatableResourceMappings) > 0 { - keysForNodeAllocatableResourceMappings := make([]string, 0, len(m.NodeAllocatableResourceMappings)) - for k := range m.NodeAllocatableResourceMappings { - keysForNodeAllocatableResourceMappings = append(keysForNodeAllocatableResourceMappings, string(k)) - } - sort.Strings(keysForNodeAllocatableResourceMappings) - for iNdEx := len(keysForNodeAllocatableResourceMappings) - 1; iNdEx >= 0; iNdEx-- { - v := m.NodeAllocatableResourceMappings[k8s_io_api_core_v1.ResourceName(keysForNodeAllocatableResourceMappings[iNdEx])] + if len(m.NodeAllocatableResources) > 0 { + keysForNodeAllocatableResources := make([]string, 0, len(m.NodeAllocatableResources)) + for k := range m.NodeAllocatableResources { + keysForNodeAllocatableResources = append(keysForNodeAllocatableResources, string(k)) + } + sort.Strings(keysForNodeAllocatableResources) + for iNdEx := len(keysForNodeAllocatableResources) - 1; iNdEx >= 0; iNdEx-- { + v := m.NodeAllocatableResources[k8s_io_api_core_v1.ResourceName(keysForNodeAllocatableResources[iNdEx])] baseI := i { size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) @@ -305,14 +311,14 @@ func (m *BasicDevice) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x12 - i -= len(keysForNodeAllocatableResourceMappings[iNdEx]) - copy(dAtA[i:], keysForNodeAllocatableResourceMappings[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(keysForNodeAllocatableResourceMappings[iNdEx]))) + i -= len(keysForNodeAllocatableResources[iNdEx]) + copy(dAtA[i:], keysForNodeAllocatableResources[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForNodeAllocatableResources[iNdEx]))) i-- dAtA[i] = 0xa i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) i-- - dAtA[i] = 0x62 + dAtA[i] = 0x72 } } if m.AllowMultipleAllocations != nil { @@ -1422,6 +1428,15 @@ func (m *DeviceCounterConsumption) MarshalToSizedBuffer(dAtA []byte) (int, error _ = i var l int _ = l + if len(m.CompatibilityGroups) > 0 { + for iNdEx := len(m.CompatibilityGroups) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CompatibilityGroups[iNdEx]) + copy(dAtA[i:], m.CompatibilityGroups[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.CompatibilityGroups[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } if len(m.Counters) > 0 { keysForCounters := make([]string, 0, len(m.Counters)) for k := range m.Counters { @@ -1459,6 +1474,39 @@ func (m *DeviceCounterConsumption) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *DeviceDerivedAttribute) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeviceDerivedAttribute) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeviceDerivedAttribute) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Expression) + copy(dAtA[i:], m.Expression) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Expression))) + i-- + dAtA[i] = 0x12 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *DeviceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1479,6 +1527,20 @@ func (m *DeviceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.DerivedAttributes) > 0 { + for iNdEx := len(m.DerivedAttributes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DerivedAttributes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + } if m.Capacity != nil { { size, err := m.Capacity.MarshalToSizedBuffer(dAtA[:i]) @@ -1584,6 +1646,15 @@ func (m *DeviceRequestAllocationResult) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l + if len(m.SkipNodeOperations) > 0 { + for iNdEx := len(m.SkipNodeOperations) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SkipNodeOperations[iNdEx]) + copy(dAtA[i:], m.SkipNodeOperations[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SkipNodeOperations[iNdEx]))) + i-- + dAtA[i] = 0x5a + } + } if len(m.ConsumedCapacity) > 0 { keysForConsumedCapacity := make([]string, 0, len(m.ConsumedCapacity)) for k := range m.ConsumedCapacity { @@ -1740,6 +1811,20 @@ func (m *DeviceSubRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.DerivedAttributes) > 0 { + for iNdEx := len(m.DerivedAttributes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DerivedAttributes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } if m.Capacity != nil { { size, err := m.Capacity.MarshalToSizedBuffer(dAtA[:i]) @@ -1941,7 +2026,7 @@ func (m *NetworkDeviceData) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *NodeAllocatableResourceMapping) Marshal() (dAtA []byte, err error) { +func (m *NodeAllocatableMapping) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1951,19 +2036,31 @@ func (m *NodeAllocatableResourceMapping) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *NodeAllocatableResourceMapping) MarshalTo(dAtA []byte) (int, error) { +func (m *NodeAllocatableMapping) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *NodeAllocatableResourceMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *NodeAllocatableMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.AllocationMultiplier != nil { + if m.DeviceMultiplier != nil { + { + size, err := m.DeviceMultiplier.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.CapacityMultiplier != nil { { - size, err := m.AllocationMultiplier.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.CapacityMultiplier.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1983,6 +2080,100 @@ func (m *NodeAllocatableResourceMapping) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *NodeAllocatableOverhead) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NodeAllocatableOverhead) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeAllocatableOverhead) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PerContainer != nil { + { + size, err := m.PerContainer.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.PerPod != nil { + { + size, err := m.PerPod.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NodeAllocatableResource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NodeAllocatableResource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeAllocatableResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Overhead != nil { + { + size, err := m.Overhead.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Mapping != nil { + { + size, err := m.Mapping.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} + func (m *OpaqueDeviceConfiguration) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2537,6 +2728,22 @@ func (m *ResourceSliceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.SkipNodeOperations) > 0 { + for iNdEx := len(m.SkipNodeOperations) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SkipNodeOperations[iNdEx]) + copy(dAtA[i:], m.SkipNodeOperations[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SkipNodeOperations[iNdEx]))) + i-- + dAtA[i] = 0x52 + } + } + if m.PartitionTypeAttribute != nil { + i -= len(*m.PartitionTypeAttribute) + copy(dAtA[i:], *m.PartitionTypeAttribute) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PartitionTypeAttribute))) + i-- + dAtA[i] = 0x4a + } if len(m.SharedCounters) > 0 { for iNdEx := len(m.SharedCounters) - 1; iNdEx >= 0; iNdEx-- { { @@ -2746,8 +2953,8 @@ func (m *BasicDevice) Size() (n int) { if m.AllowMultipleAllocations != nil { n += 2 } - if len(m.NodeAllocatableResourceMappings) > 0 { - for k, v := range m.NodeAllocatableResourceMappings { + if len(m.NodeAllocatableResources) > 0 { + for k, v := range m.NodeAllocatableResources { _ = k _ = v l = v.Size() @@ -3138,6 +3345,25 @@ func (m *DeviceCounterConsumption) Size() (n int) { n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) } } + if len(m.CompatibilityGroups) > 0 { + for _, s := range m.CompatibilityGroups { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *DeviceDerivedAttribute) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Expression) + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -3179,6 +3405,12 @@ func (m *DeviceRequest) Size() (n int) { l = m.Capacity.Size() n += 1 + l + sovGenerated(uint64(l)) } + if len(m.DerivedAttributes) > 0 { + for _, e := range m.DerivedAttributes { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -3230,6 +3462,12 @@ func (m *DeviceRequestAllocationResult) Size() (n int) { n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) } } + if len(m.SkipNodeOperations) > 0 { + for _, s := range m.SkipNodeOperations { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -3275,6 +3513,12 @@ func (m *DeviceSubRequest) Size() (n int) { l = m.Capacity.Size() n += 1 + l + sovGenerated(uint64(l)) } + if len(m.DerivedAttributes) > 0 { + for _, e := range m.DerivedAttributes { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -3336,7 +3580,7 @@ func (m *NetworkDeviceData) Size() (n int) { return n } -func (m *NodeAllocatableResourceMapping) Size() (n int) { +func (m *NodeAllocatableMapping) Size() (n int) { if m == nil { return 0 } @@ -3346,8 +3590,46 @@ func (m *NodeAllocatableResourceMapping) Size() (n int) { l = len(*m.CapacityKey) n += 1 + l + sovGenerated(uint64(l)) } - if m.AllocationMultiplier != nil { - l = m.AllocationMultiplier.Size() + if m.CapacityMultiplier != nil { + l = m.CapacityMultiplier.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.DeviceMultiplier != nil { + l = m.DeviceMultiplier.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NodeAllocatableOverhead) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PerPod != nil { + l = m.PerPod.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.PerContainer != nil { + l = m.PerContainer.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NodeAllocatableResource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Mapping != nil { + l = m.Mapping.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Overhead != nil { + l = m.Overhead.Size() n += 1 + l + sovGenerated(uint64(l)) } return n @@ -3569,6 +3851,16 @@ func (m *ResourceSliceSpec) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } + if m.PartitionTypeAttribute != nil { + l = len(*m.PartitionTypeAttribute) + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.SkipNodeOperations) > 0 { + for _, s := range m.SkipNodeOperations { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -3645,16 +3937,16 @@ func (this *BasicDevice) String() string { mapStringForCapacity += fmt.Sprintf("%v: %v,", k, this.Capacity[QualifiedName(k)]) } mapStringForCapacity += "}" - keysForNodeAllocatableResourceMappings := make([]string, 0, len(this.NodeAllocatableResourceMappings)) - for k := range this.NodeAllocatableResourceMappings { - keysForNodeAllocatableResourceMappings = append(keysForNodeAllocatableResourceMappings, string(k)) + keysForNodeAllocatableResources := make([]string, 0, len(this.NodeAllocatableResources)) + for k := range this.NodeAllocatableResources { + keysForNodeAllocatableResources = append(keysForNodeAllocatableResources, string(k)) } - sort.Strings(keysForNodeAllocatableResourceMappings) - mapStringForNodeAllocatableResourceMappings := "map[k8s_io_api_core_v1.ResourceName]NodeAllocatableResourceMapping{" - for _, k := range keysForNodeAllocatableResourceMappings { - mapStringForNodeAllocatableResourceMappings += fmt.Sprintf("%v: %v,", k, this.NodeAllocatableResourceMappings[k8s_io_api_core_v1.ResourceName(k)]) + sort.Strings(keysForNodeAllocatableResources) + mapStringForNodeAllocatableResources := "map[k8s_io_api_core_v1.ResourceName]NodeAllocatableResource{" + for _, k := range keysForNodeAllocatableResources { + mapStringForNodeAllocatableResources += fmt.Sprintf("%v: %v,", k, this.NodeAllocatableResources[k8s_io_api_core_v1.ResourceName(k)]) } - mapStringForNodeAllocatableResourceMappings += "}" + mapStringForNodeAllocatableResources += "}" s := strings.Join([]string{`&BasicDevice{`, `Attributes:` + mapStringForAttributes + `,`, `Capacity:` + mapStringForCapacity + `,`, @@ -3667,7 +3959,7 @@ func (this *BasicDevice) String() string { `BindingConditions:` + fmt.Sprintf("%v", this.BindingConditions) + `,`, `BindingFailureConditions:` + fmt.Sprintf("%v", this.BindingFailureConditions) + `,`, `AllowMultipleAllocations:` + valueToStringGenerated(this.AllowMultipleAllocations) + `,`, - `NodeAllocatableResourceMappings:` + mapStringForNodeAllocatableResourceMappings + `,`, + `NodeAllocatableResources:` + mapStringForNodeAllocatableResources + `,`, `}`, }, "") return s @@ -3970,6 +4262,18 @@ func (this *DeviceCounterConsumption) String() string { s := strings.Join([]string{`&DeviceCounterConsumption{`, `CounterSet:` + fmt.Sprintf("%v", this.CounterSet) + `,`, `Counters:` + mapStringForCounters + `,`, + `CompatibilityGroups:` + fmt.Sprintf("%v", this.CompatibilityGroups) + `,`, + `}`, + }, "") + return s +} +func (this *DeviceDerivedAttribute) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeviceDerivedAttribute{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Expression:` + fmt.Sprintf("%v", this.Expression) + `,`, `}`, }, "") return s @@ -3993,6 +4297,11 @@ func (this *DeviceRequest) String() string { repeatedStringForTolerations += strings.Replace(strings.Replace(f.String(), "DeviceToleration", "DeviceToleration", 1), `&`, ``, 1) + "," } repeatedStringForTolerations += "}" + repeatedStringForDerivedAttributes := "[]DeviceDerivedAttribute{" + for _, f := range this.DerivedAttributes { + repeatedStringForDerivedAttributes += strings.Replace(strings.Replace(f.String(), "DeviceDerivedAttribute", "DeviceDerivedAttribute", 1), `&`, ``, 1) + "," + } + repeatedStringForDerivedAttributes += "}" s := strings.Join([]string{`&DeviceRequest{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `DeviceClassName:` + fmt.Sprintf("%v", this.DeviceClassName) + `,`, @@ -4003,6 +4312,7 @@ func (this *DeviceRequest) String() string { `FirstAvailable:` + repeatedStringForFirstAvailable + `,`, `Tolerations:` + repeatedStringForTolerations + `,`, `Capacity:` + strings.Replace(this.Capacity.String(), "CapacityRequirements", "CapacityRequirements", 1) + `,`, + `DerivedAttributes:` + repeatedStringForDerivedAttributes + `,`, `}`, }, "") return s @@ -4037,6 +4347,7 @@ func (this *DeviceRequestAllocationResult) String() string { `BindingFailureConditions:` + fmt.Sprintf("%v", this.BindingFailureConditions) + `,`, `ShareID:` + valueToStringGenerated(this.ShareID) + `,`, `ConsumedCapacity:` + mapStringForConsumedCapacity + `,`, + `SkipNodeOperations:` + fmt.Sprintf("%v", this.SkipNodeOperations) + `,`, `}`, }, "") return s @@ -4065,6 +4376,11 @@ func (this *DeviceSubRequest) String() string { repeatedStringForTolerations += strings.Replace(strings.Replace(f.String(), "DeviceToleration", "DeviceToleration", 1), `&`, ``, 1) + "," } repeatedStringForTolerations += "}" + repeatedStringForDerivedAttributes := "[]DeviceDerivedAttribute{" + for _, f := range this.DerivedAttributes { + repeatedStringForDerivedAttributes += strings.Replace(strings.Replace(f.String(), "DeviceDerivedAttribute", "DeviceDerivedAttribute", 1), `&`, ``, 1) + "," + } + repeatedStringForDerivedAttributes += "}" s := strings.Join([]string{`&DeviceSubRequest{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `DeviceClassName:` + fmt.Sprintf("%v", this.DeviceClassName) + `,`, @@ -4073,6 +4389,7 @@ func (this *DeviceSubRequest) String() string { `Count:` + fmt.Sprintf("%v", this.Count) + `,`, `Tolerations:` + repeatedStringForTolerations + `,`, `Capacity:` + strings.Replace(this.Capacity.String(), "CapacityRequirements", "CapacityRequirements", 1) + `,`, + `DerivedAttributes:` + repeatedStringForDerivedAttributes + `,`, `}`, }, "") return s @@ -4103,13 +4420,36 @@ func (this *NetworkDeviceData) String() string { }, "") return s } -func (this *NodeAllocatableResourceMapping) String() string { +func (this *NodeAllocatableMapping) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&NodeAllocatableResourceMapping{`, + s := strings.Join([]string{`&NodeAllocatableMapping{`, `CapacityKey:` + valueToStringGenerated(this.CapacityKey) + `,`, - `AllocationMultiplier:` + strings.Replace(fmt.Sprintf("%v", this.AllocationMultiplier), "Quantity", "resource.Quantity", 1) + `,`, + `CapacityMultiplier:` + strings.Replace(fmt.Sprintf("%v", this.CapacityMultiplier), "Quantity", "resource.Quantity", 1) + `,`, + `DeviceMultiplier:` + strings.Replace(fmt.Sprintf("%v", this.DeviceMultiplier), "Quantity", "resource.Quantity", 1) + `,`, + `}`, + }, "") + return s +} +func (this *NodeAllocatableOverhead) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NodeAllocatableOverhead{`, + `PerPod:` + strings.Replace(fmt.Sprintf("%v", this.PerPod), "Quantity", "resource.Quantity", 1) + `,`, + `PerContainer:` + strings.Replace(fmt.Sprintf("%v", this.PerContainer), "Quantity", "resource.Quantity", 1) + `,`, + `}`, + }, "") + return s +} +func (this *NodeAllocatableResource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NodeAllocatableResource{`, + `Mapping:` + strings.Replace(this.Mapping.String(), "NodeAllocatableMapping", "NodeAllocatableMapping", 1) + `,`, + `Overhead:` + strings.Replace(this.Overhead.String(), "NodeAllocatableOverhead", "NodeAllocatableOverhead", 1) + `,`, `}`, }, "") return s @@ -4298,6 +4638,8 @@ func (this *ResourceSliceSpec) String() string { `Devices:` + repeatedStringForDevices + `,`, `PerDeviceNodeSelection:` + valueToStringGenerated(this.PerDeviceNodeSelection) + `,`, `SharedCounters:` + repeatedStringForSharedCounters + `,`, + `PartitionTypeAttribute:` + valueToStringGenerated(this.PartitionTypeAttribute) + `,`, + `SkipNodeOperations:` + fmt.Sprintf("%v", this.SkipNodeOperations) + `,`, `}`, }, "") return s @@ -5301,9 +5643,9 @@ func (m *BasicDevice) Unmarshal(dAtA []byte) error { } b := bool(v != 0) m.AllowMultipleAllocations = &b - case 12: + case 14: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeAllocatableResourceMappings", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NodeAllocatableResources", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5330,11 +5672,11 @@ func (m *BasicDevice) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.NodeAllocatableResourceMappings == nil { - m.NodeAllocatableResourceMappings = make(map[k8s_io_api_core_v1.ResourceName]NodeAllocatableResourceMapping) + if m.NodeAllocatableResources == nil { + m.NodeAllocatableResources = make(map[k8s_io_api_core_v1.ResourceName]NodeAllocatableResource) } var mapkey k8s_io_api_core_v1.ResourceName - mapvalue := &NodeAllocatableResourceMapping{} + mapvalue := &NodeAllocatableResource{} for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 @@ -5408,7 +5750,7 @@ func (m *BasicDevice) Unmarshal(dAtA []byte) error { if postmsgIndex > l { return io.ErrUnexpectedEOF } - mapvalue = &NodeAllocatableResourceMapping{} + mapvalue = &NodeAllocatableResource{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } @@ -5428,7 +5770,7 @@ func (m *BasicDevice) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - m.NodeAllocatableResourceMappings[k8s_io_api_core_v1.ResourceName(mapkey)] = *mapvalue + m.NodeAllocatableResources[k8s_io_api_core_v1.ResourceName(mapkey)] = *mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -8347,17 +8689,163 @@ func (m *DeviceCounterConsumption) Unmarshal(dAtA []byte) error { } m.Counters[mapkey] = *mapvalue iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompatibilityGroups", wireType) } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CompatibilityGroups = append(m.CompatibilityGroups, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceDerivedAttribute) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceDerivedAttribute: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceDerivedAttribute: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = FullyQualifiedName(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expression", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Expression = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } iNdEx += skippy } @@ -8671,6 +9159,40 @@ func (m *DeviceRequest) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DerivedAttributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DerivedAttributes = append(m.DerivedAttributes, DeviceDerivedAttribute{}) + if err := m.DerivedAttributes[len(m.DerivedAttributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -9130,6 +9652,38 @@ func (m *DeviceRequestAllocationResult) Unmarshal(dAtA []byte) error { } m.ConsumedCapacity[QualifiedName(mapkey)] = *mapvalue iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipNodeOperations", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SkipNodeOperations = append(m.SkipNodeOperations, SkipNodeOperation(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -9485,6 +10039,40 @@ func (m *DeviceSubRequest) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DerivedAttributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DerivedAttributes = append(m.DerivedAttributes, DeviceDerivedAttribute{}) + if err := m.DerivedAttributes[len(m.DerivedAttributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -9569,7 +10157,355 @@ func (m *DeviceTaint) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Effect", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Effect = DeviceTaintEffect(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeAdded", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TimeAdded == nil { + m.TimeAdded = &v1.Time{} + } + if err := m.TimeAdded.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceToleration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceToleration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceToleration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operator = DeviceTolerationOperator(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Effect", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Effect = DeviceTaintEffect(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TolerationSeconds", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TolerationSeconds = &v + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NetworkDeviceData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NetworkDeviceData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NetworkDeviceData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InterfaceName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9597,11 +10533,11 @@ func (m *DeviceTaint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Value = string(dAtA[iNdEx:postIndex]) + m.InterfaceName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Effect", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IPs", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9629,13 +10565,13 @@ func (m *DeviceTaint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Effect = DeviceTaintEffect(dAtA[iNdEx:postIndex]) + m.IPs = append(m.IPs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 4: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeAdded", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HardwareAddress", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9645,27 +10581,23 @@ func (m *DeviceTaint) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if m.TimeAdded == nil { - m.TimeAdded = &v1.Time{} - } - if err := m.TimeAdded.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.HardwareAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -9688,7 +10620,7 @@ func (m *DeviceTaint) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeviceToleration) Unmarshal(dAtA []byte) error { +func (m *NodeAllocatableMapping) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9711,15 +10643,15 @@ func (m *DeviceToleration) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeviceToleration: wiretype end group for non-group") + return fmt.Errorf("proto: NodeAllocatableMapping: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeviceToleration: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: NodeAllocatableMapping: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CapacityKey", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9747,13 +10679,14 @@ func (m *DeviceToleration) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Key = string(dAtA[iNdEx:postIndex]) + s := QualifiedName(dAtA[iNdEx:postIndex]) + m.CapacityKey = &s iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CapacityMultiplier", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9763,61 +10696,33 @@ func (m *DeviceToleration) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Operator = DeviceTolerationOperator(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated + if m.CapacityMultiplier == nil { + m.CapacityMultiplier = &resource.Quantity{} } - if postIndex > l { - return io.ErrUnexpectedEOF + if err := m.CapacityMultiplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Value = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Effect", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DeviceMultiplier", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9827,44 +10732,28 @@ func (m *DeviceToleration) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Effect = DeviceTaintEffect(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TolerationSeconds", wireType) + if m.DeviceMultiplier == nil { + m.DeviceMultiplier = &resource.Quantity{} } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } + if err := m.DeviceMultiplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.TolerationSeconds = &v + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -9886,7 +10775,7 @@ func (m *DeviceToleration) Unmarshal(dAtA []byte) error { } return nil } -func (m *NetworkDeviceData) Unmarshal(dAtA []byte) error { +func (m *NodeAllocatableOverhead) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9909,17 +10798,17 @@ func (m *NetworkDeviceData) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: NetworkDeviceData: wiretype end group for non-group") + return fmt.Errorf("proto: NodeAllocatableOverhead: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: NetworkDeviceData: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: NodeAllocatableOverhead: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InterfaceName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PerPod", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9929,29 +10818,33 @@ func (m *NetworkDeviceData) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.InterfaceName = string(dAtA[iNdEx:postIndex]) + if m.PerPod == nil { + m.PerPod = &resource.Quantity{} + } + if err := m.PerPod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IPs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PerContainer", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9961,55 +10854,27 @@ func (m *NetworkDeviceData) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.IPs = append(m.IPs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HardwareAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated + if m.PerContainer == nil { + m.PerContainer = &resource.Quantity{} } - if postIndex > l { - return io.ErrUnexpectedEOF + if err := m.PerContainer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.HardwareAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -10032,7 +10897,7 @@ func (m *NetworkDeviceData) Unmarshal(dAtA []byte) error { } return nil } -func (m *NodeAllocatableResourceMapping) Unmarshal(dAtA []byte) error { +func (m *NodeAllocatableResource) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10055,17 +10920,17 @@ func (m *NodeAllocatableResourceMapping) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: NodeAllocatableResourceMapping: wiretype end group for non-group") + return fmt.Errorf("proto: NodeAllocatableResource: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: NodeAllocatableResourceMapping: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: NodeAllocatableResource: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CapacityKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Mapping", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -10075,28 +10940,31 @@ func (m *NodeAllocatableResourceMapping) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - s := QualifiedName(dAtA[iNdEx:postIndex]) - m.CapacityKey = &s + if m.Mapping == nil { + m.Mapping = &NodeAllocatableMapping{} + } + if err := m.Mapping.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AllocationMultiplier", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Overhead", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -10123,10 +10991,10 @@ func (m *NodeAllocatableResourceMapping) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.AllocationMultiplier == nil { - m.AllocationMultiplier = &resource.Quantity{} + if m.Overhead == nil { + m.Overhead = &NodeAllocatableOverhead{} } - if err := m.AllocationMultiplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Overhead.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -11920,6 +12788,71 @@ func (m *ResourceSliceSpec) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PartitionTypeAttribute", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := FullyQualifiedName(dAtA[iNdEx:postIndex]) + m.PartitionTypeAttribute = &s + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipNodeOperations", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SkipNodeOperations = append(m.SkipNodeOperations, SkipNodeOperation(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/vendor/k8s.io/api/resource/v1beta1/generated.proto b/vendor/k8s.io/api/resource/v1beta1/generated.proto index 79a51ee2c8..874a34db39 100644 --- a/vendor/k8s.io/api/resource/v1beta1/generated.proto +++ b/vendor/k8s.io/api/resource/v1beta1/generated.proto @@ -65,8 +65,8 @@ message AllocatedDeviceStatus { // // +optional // +featureGate=DRAConsumableCapacity - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-uuid optional string shareID = 7; // Conditions contains the latest observation of the device's state. @@ -78,6 +78,9 @@ message AllocatedDeviceStatus { // +optional // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 4; // Data contains arbitrary driver-specific data. @@ -90,7 +93,7 @@ message AllocatedDeviceStatus { // NetworkData contains network-related information specific to the device. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional NetworkDeviceData networkData = 6; } @@ -126,7 +129,7 @@ message BasicDevice { // The maximum number of attributes and capacities combined is 32. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional map attributes = 1; // Capacity defines the set of capacities for this device. @@ -147,13 +150,13 @@ message BasicDevice { // device is 2. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=counterSet + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=counterSet // +featureGate=DRAPartitionableDevices - // +k8s:alpha(since: "1.36")=+k8s:maxItems=2 + // +k8s:beta(since: "1.37")=+k8s:maxItems=2 repeated DeviceCounterConsumption consumesCounters = 3; // NodeName identifies the node where the device is available. @@ -199,7 +202,7 @@ message BasicDevice { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated DeviceTaint taints = 7; // BindsToNode indicates if the usage of an allocation involving this device @@ -229,8 +232,8 @@ message BasicDevice { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 repeated string bindingConditions = 9; // BindingFailureConditions defines the conditions for binding failure. @@ -247,8 +250,8 @@ message BasicDevice { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 repeated string bindingFailureConditions = 10; // AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests. @@ -260,7 +263,7 @@ message BasicDevice { // +featureGate=DRAConsumableCapacity optional bool allowMultipleAllocations = 11; - // NodeAllocatableResourceMappings defines the mapping of node resources + // NodeAllocatableResources defines the mapping of node resources // that are managed by the DRA driver exposing this device. This includes resources currently // reported in v1.Node `status.allocatable` that are not extended resources // (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). @@ -272,8 +275,9 @@ message BasicDevice { // The keys of this map are the node-allocatable resource names (e.g., "cpu", "memory"). // Extended resource names are not permitted as keys. // +optional + // +k8s:optional // +featureGate=DRANodeAllocatableResources - map nodeAllocatableResourceMappings = 12; + map nodeAllocatableResources = 14; } // CELDeviceSelector contains a CEL expression for selecting a device. @@ -288,7 +292,7 @@ message CELDeviceSelector { // - driver (string): the name of the driver which defines this device. // - attributes (map[string]object): the device's attributes, grouped by prefix // (e.g. device.attributes["dra.example.com"] evaluates to an object with all - // of the attributes which were prefixed by "dra.example.com". + // of the attributes which were prefixed by "dra.example.com"). // - capacity (map[string]object): the device's capacities, grouped by prefix. // - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device // (v1.34+ with the DRAConsumableCapacity feature enabled). @@ -321,6 +325,15 @@ message CELDeviceSelector { // A robust expression should check for the existence of attributes // before referencing them. // + // Common errors: + // - "no such key": Use optional chaining (.? followed by orValue()) + // or guarding the check with has() for optional fields. + // See CEL Optional Types for details: + // https://pkg.go.dev/github.com/google/cel-go@v0.17.4/cel#OptionalTypes + // + // For more CEL expression syntax and examples, see: + // https://kubernetes.io/docs/reference/using-api/cel/ + // // For ease of use, the cel.bind() function is enabled, and can be used // to simplify expressions that access multiple attributes with the // same domain. For example: @@ -390,6 +403,13 @@ message CapacityRequestPolicy { // CapacityRequestPolicyRange defines a valid range for consumable capacity values. // +// If the DRAFractionalCapacityRange feature gate is +// enabled and at least one of Min, Max, or Step is a fractional quantity (i.e. +// its value is not an integer), milli-unit arithmetic is used instead, +// supporting values with up to 3 decimal places (e.g. 100m = 0.1). +// The largest supported value then is 1000 times smaller compared to using 64-bit integers. +// Otherwise, all comparisons use 64-bit integer arithmetic via resource.Quantity.Value(). +// // - If the requested amount is less than Min, it is rounded up to the Min value. // - If Step is set and the requested amount is between Min and Max but not aligned with Step, // it will be rounded up to the next value equal to Min + (n * Step). @@ -473,8 +493,8 @@ message CounterSet { // It must be a DNS label. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-short-name optional string name = 1; // Counters defines the set of counters for this CounterSet @@ -483,8 +503,8 @@ message CounterSet { // The maximum number of counters is 32. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:eachKey=+k8s:format=k8s-short-name map counters = 2; } @@ -501,7 +521,7 @@ message Device { // // +optional // +oneOf=deviceType - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional BasicDevice basic = 2; } @@ -512,7 +532,7 @@ message DeviceAllocationConfiguration { // or from a claim. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string source = 1; // Requests lists the names of requests where the configuration applies. @@ -524,10 +544,10 @@ message DeviceAllocationConfiguration { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated string requests = 2; optional DeviceConfiguration deviceConfiguration = 3; @@ -539,8 +559,8 @@ message DeviceAllocationResult { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceRequestAllocationResult results = 1; // This field is a combination of all the claim and class configuration parameters. @@ -553,8 +573,8 @@ message DeviceAllocationResult { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=64 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=64 repeated DeviceAllocationConfiguration config = 2; } @@ -563,30 +583,30 @@ message DeviceAttribute { // IntValue is a number. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember optional int64 int = 2; // BoolValue is a true/false value. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember optional bool bool = 3; // StringValue is a string. Must not be longer than 64 characters. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember optional string string = 4; // VersionValue is a semantic version according to semver.org spec 2.0.0. // Must not be longer than 64 characters. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember optional string version = 5; // IntValues is a non-empty list of numbers. @@ -595,8 +615,8 @@ message DeviceAttribute { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember // +featureGate=DRAListTypeAttributes repeated int64 ints = 6; @@ -604,8 +624,8 @@ message DeviceAttribute { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember // +featureGate=DRAListTypeAttributes repeated bool bools = 7; @@ -616,8 +636,9 @@ message DeviceAttribute { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember + // +k8s:alpha(since: "1.37")=+k8s:eachVal=+k8s:maxBytes=64 // +featureGate=DRAListTypeAttributes repeated string strings = 8; @@ -628,8 +649,8 @@ message DeviceAttribute { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember // +featureGate=DRAListTypeAttributes repeated string versions = 9; } @@ -667,11 +688,11 @@ message DeviceClaim { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=name - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=name + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceRequest requests = 1; // These constraints must be satisfied by the set of devices that get @@ -679,8 +700,8 @@ message DeviceClaim { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceConstraint constraints = 2; // This field holds configuration for multiple potential drivers which @@ -689,8 +710,8 @@ message DeviceClaim { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceClaimConfiguration config = 3; } @@ -705,10 +726,10 @@ message DeviceClaimConfiguration { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated string requests = 1; optional DeviceConfiguration deviceConfiguration = 2; @@ -724,8 +745,8 @@ message DeviceClaimConfiguration { message DeviceClass { // Standard object metadata // +optional - // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:format=k8s-long-name optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Spec defines what can be allocated and how to configure it. @@ -736,6 +757,7 @@ message DeviceClass { // the time of allocation. // // Changing the spec automatically increments the metadata.generation number. + // +optional optional DeviceClassSpec spec = 2; } @@ -761,8 +783,8 @@ message DeviceClassSpec { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceSelector selectors = 1; // Config defines configuration parameters that apply to each device that is claimed via this class. @@ -773,8 +795,8 @@ message DeviceClassSpec { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceClassConfiguration config = 2; // ExtendedResourceName is the extended resource name for the devices of this class. @@ -786,11 +808,10 @@ message DeviceClassSpec { // If two classes are created at the same time, then the name of the class // lexicographically sorted first is picked. // - // This is a beta field. // +optional // +featureGate=DRAExtendedResource - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-extended-resource-name + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-extended-resource-name optional string extendedResourceName = 4; } @@ -802,7 +823,7 @@ message DeviceConfiguration { // // +optional // +oneOf=ConfigurationType - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional OpaqueDeviceConfiguration opaque = 1; } @@ -820,10 +841,10 @@ message DeviceConstraint { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated string requests = 1; // MatchAttribute requires that all devices in question have this @@ -846,8 +867,8 @@ message DeviceConstraint { // // +optional // +oneOf=ConstraintType - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-fully-qualified-name + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-resource-fully-qualified-name optional string matchAttribute = 2; // DistinctAttribute requires that all devices in question have this @@ -869,6 +890,8 @@ message DeviceConstraint { // +optional // +oneOf=ConstraintType // +featureGate=DRAConsumableCapacity + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-resource-fully-qualified-name optional string distinctAttribute = 3; } @@ -879,8 +902,8 @@ message DeviceCounterConsumption { // counters defined will be consumed. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-short-name optional string counterSet = 1; // Counters defines the counters that will be consumed by the device. @@ -888,9 +911,94 @@ message DeviceCounterConsumption { // The maximum number of counters is 32. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:eachKey=+k8s:format=k8s-short-name map counters = 2; + + // CompatibilityGroups is a list of opaque group names for + // this counter set consumption. + // + // Devices that consume counters from the same counter set may only be + // allocated at the same time ("co-allocated") if they all share at least + // one common group: the intersection of the CompatibilityGroups of all + // co-allocated devices on that counter set must be non-empty. Devices + // that consume from different counter sets are never compared via this + // field. + // + // An unset field, an explicit nil, and an empty list are equivalent and + // mean "no groups": such a device is only co-allocatable with sibling + // devices on the same counter set that also have no groups, and is never + // co-allocatable with a device that declares one or more groups. + // + // Group names are opaque and meaningful only within the + // publishing driver's pool. + // + // The maximum number of groups is 2, and the names must be unique. + // + // +optional + // +listType=atomic + // +featureGate=DRADeviceCompatibilityGroups + // +k8s:listType=atomic + // +k8s:optional + // +k8s:maxItems=2 + // +k8s:unique=set + // +k8s:eachVal=+k8s:format=k8s-short-name + repeated string compatibilityGroups = 3; +} + +// DeviceDerivedAttribute defines a derived attribute computed via CEL. +message DeviceDerivedAttribute { + // Name is the identifier for this derived attribute, used in constraints. + // + // It must be a DNS subdomain followed by a slash ("/") followed by a C identifier + // (e.g. "example.com/numaNode" or "derived/numaNode"). + // + // If the chosen name matches an existing physical attribute from a driver, + // the derived attribute's expression will shadow the physical attribute, + // and its evaluated value will be used in constraints instead. When the goal + // is to define a derived attribute that is only used within the ResourceClaim + // and not meant to shadow an existing attribute, use a domain prefix that + // no DRA driver should be using (e.g. "derived/myAttribute"). + // + // It is not valid to define a derived attribute that isn't used in at least + // one constraint. + // + // +required + // +k8s:required + // +k8s:format=k8s-resource-fully-qualified-name + optional string name = 1; + + // Expression is a CEL expression evaluated against each candidate device. + // The expression must evaluate to a primitive scalar (string, integer, + // boolean, or semver) or a list of these scalars ([]string, []int64, + // []bool, []semver) to act as a virtual grouping key. Any other return type + // is an error and causes CEL evaluation for the device to fail. + // + // The expression's input is an object named "device", which carries the + // same properties as in a CELDeviceSelector. + // + // When pod scheduling encounters CEL runtime errors (such as looking + // up an attribute that isn't defined) for some devices, it will abort + // allocation and fail scheduling for the Pod. Surfacing evaluation + // errors immediately prevents silent topology matching failures that are + // extremely hard to detect. A robust expression should, for example, check + // for the existence of attributes before referencing them to avoid + // runtime evaluation errors. + // + // The expression gets evaluated after a device has passed the other + // selector expressions for the request in which this expression is used. + // This allows writing expressions that are tailored towards the specific + // devices being requested (for example, by assuming the device is from a + // certain vendor and skipping those checks). + // + // The length of the expression must be smaller or equal to 10 Ki. The + // cost of evaluating it is also limited based on the estimated number + // of logical steps; the combined cost of all derived attributes in a + // claim is capped by a shared CEL cost budget. + // + // +required + // +k8s:required + optional string expression = 2; } // DeviceRequest is a request for devices required for a claim. @@ -935,8 +1043,8 @@ message DeviceRequest { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceSelector selectors = 3; // AllocationMode and its related fields define how devices are allocated @@ -962,7 +1070,7 @@ message DeviceRequest { // requests with unknown modes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional string allocationMode = 4; // Count is used only when the count mode is "ExactCount". Must be greater than zero. @@ -1012,11 +1120,11 @@ message DeviceRequest { // +oneOf=deviceRequestType // +listType=atomic // +featureGate=DRAPrioritizedList - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=name - // +k8s:alpha(since: "1.36")=+k8s:maxItems=8 + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=name + // +k8s:beta(since: "1.37")=+k8s:maxItems=8 repeated DeviceSubRequest firstAvailable = 7; // If specified, the request's tolerations. @@ -1043,7 +1151,7 @@ message DeviceRequest { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated DeviceToleration tolerations = 8; // Capacity define resource requirements against each capacity. @@ -1062,6 +1170,34 @@ message DeviceRequest { // +optional // +featureGate=DRAConsumableCapacity optional CapacityRequirements capacity = 9; + + // DerivedAttributes defines a set of virtual attributes computed via CEL expressions + // for each candidate device. These virtual attributes can be referenced in + // `.devices.constraints` to align and match different devices (e.g., co-allocating + // a GPU and a NIC on the same NUMA node) even if their drivers publish different + // attributes. Derived attributes are not available via `device.attributes` + // in the CEL environment when evaluating selector expressions. + // + // Derived attributes allow you to extract, transform, or normalize topology + // information (such as extracting a NUMA index from a complex topology string or + // renaming a vendor-specific attribute) into a common virtual attribute name at + // scheduling time. The scheduler then evaluates these virtual attributes exactly + // like static attributes when matching constraints. + // + // Every derived attribute defined in this list must be referenced by at least one + // MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list. + // + // The maximum number of derived attributes is 32. + // + // This is an alpha field and requires enabling the DRADerivedAttributes + // feature gate. + // + // +optional + // +listType=atomic + // +featureGate=DRADerivedAttributes + // +k8s:optional + // +k8s:maxItems=32 + repeated DeviceDerivedAttribute derivedAttributes = 10; } // DeviceRequestAllocationResult contains the allocation result for one request. @@ -1085,9 +1221,9 @@ message DeviceRequestAllocationResult { // vendor of the driver. It should use only lower case characters. // // +required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:maxLength=63 + // +k8s:beta(since: "1.37")=+k8s:format=k8s-long-name-caseless + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:maxLength=63 optional string driver = 2; // This name together with the driver name and the device name field @@ -1097,8 +1233,8 @@ message DeviceRequestAllocationResult { // DNS sub-domains separated by slashes. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-pool-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-resource-pool-name optional string pool = 3; // Device references one device instance via its name in the driver's @@ -1130,8 +1266,7 @@ message DeviceRequestAllocationResult { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=16 + // +k8s:beta(since: "1.37")=+k8s:optional repeated DeviceToleration tolerations = 6; // BindingConditions contains a copy of the BindingConditions @@ -1143,8 +1278,8 @@ message DeviceRequestAllocationResult { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 repeated string bindingConditions = 7; // BindingFailureConditions contains a copy of the BindingFailureConditions @@ -1156,8 +1291,8 @@ message DeviceRequestAllocationResult { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 repeated string bindingFailureConditions = 8; // ShareID uniquely identifies an individual allocation share of the device, @@ -1167,8 +1302,8 @@ message DeviceRequestAllocationResult { // // +optional // +featureGate=DRAConsumableCapacity - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-uuid optional string shareID = 9; // ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request. @@ -1183,6 +1318,19 @@ message DeviceRequestAllocationResult { // +optional // +featureGate=DRAConsumableCapacity map consumedCapacity = 10; + + // SkipNodeOperations lists node-local resource operations (gRPC calls) + // that will be skipped for this allocated device when determining whether + // operations are necessary on the node. If all allocated devices for a driver in + // a claim skip an operation, that gRPC call will be skipped. It is a copy of + // the ResourceSlice.spec.skipNodeOperations value at the time when the device was allocated. + // + // +optional + // +listType=set + // +k8s:listType=set + // +featureGate=DRAOptionalNodeOperations + // +k8s:optional + repeated string skipNodeOperations = 11; } // DeviceSelector must have exactly one field set. @@ -1226,8 +1374,8 @@ message DeviceSubRequest { // to reference. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-long-name optional string deviceClassName = 2; // Selectors define criteria which must be satisfied by a specific @@ -1237,8 +1385,8 @@ message DeviceSubRequest { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional repeated DeviceSelector selectors = 3; // AllocationMode and its related fields define how devices are allocated @@ -1260,7 +1408,7 @@ message DeviceSubRequest { // requests with unknown modes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional string allocationMode = 4; // Count is used only when the count mode is "ExactCount". Must be greater than zero. @@ -1291,7 +1439,7 @@ message DeviceSubRequest { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated DeviceToleration tolerations = 7; // Capacity define resource requirements against each capacity. @@ -1310,6 +1458,34 @@ message DeviceSubRequest { // +optional // +featureGate=DRAConsumableCapacity optional CapacityRequirements capacity = 8; + + // DerivedAttributes defines a set of virtual attributes computed via CEL expressions + // for each candidate device. These virtual attributes can be referenced in + // `.devices.constraints` to align and match different devices (e.g., co-allocating + // a GPU and a NIC on the same NUMA node) even if their drivers publish different + // attributes. Derived attributes are not available via `device.attributes` + // in the CEL environment when evaluating selector expressions. + // + // Derived attributes allow you to extract, transform, or normalize topology + // information (such as extracting a NUMA index from a complex topology string or + // renaming a vendor-specific attribute) into a common virtual attribute name at + // scheduling time. The scheduler then evaluates these virtual attributes exactly + // like static attributes when matching constraints. + // + // Every derived attribute defined in this list must be referenced by at least one + // MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list. + // + // The maximum number of derived attributes is 32. + // + // This is an alpha field and requires enabling the DRADerivedAttributes + // feature gate. + // + // +optional + // +listType=atomic + // +featureGate=DRADerivedAttributes + // +k8s:optional + // +k8s:maxItems=32 + repeated DeviceDerivedAttribute derivedAttributes = 9; } // The device this taint is attached to has the "effect" on @@ -1338,7 +1514,7 @@ message DeviceTaint { // Consumers must treat unknown effects like None. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string effect = 3; // TimeAdded represents the time at which the taint was added or @@ -1365,8 +1541,8 @@ message DeviceToleration { // Must be a label name. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-label-key + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-label-key optional string key = 1; // Operator represents a key's relationship to the value. @@ -1376,7 +1552,7 @@ message DeviceToleration { // // +optional // +default="Equal" - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional string operator = 2; // Value is the taint value the toleration matches to. @@ -1390,7 +1566,7 @@ message DeviceToleration { // When specified, allowed values are NoSchedule and NoExecute. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional string effect = 4; // TolerationSeconds represents the period of time the toleration (which must be @@ -1415,8 +1591,8 @@ message NetworkDeviceData { // Must not be longer than 256 bytes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxBytes=256 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxBytes=256 optional string interfaceName = 1; // IPs lists the network addresses assigned to the device's network interface. @@ -1429,10 +1605,10 @@ message NetworkDeviceData { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=16 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=16 repeated string ips = 2; // HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface. @@ -1440,47 +1616,104 @@ message NetworkDeviceData { // Must not be longer than 128 bytes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxBytes=128 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxBytes=128 optional string hardwareAddress = 3; } -// NodeAllocatableResourceMapping defines the translation between the DRA device/capacity -// units requested to the corresponding quantity of the node allocatable resource. -message NodeAllocatableResourceMapping { +// NodeAllocatableMapping defines how a DRA allocation directly translates into a node allocatable resource quantity. +// The mapping can be derived from either the count of allocated devices or the specific capacity consumed. These options are mutually exclusive. +// Kubelet adds this mapped resource quantity from claim to both requests and limits at the pod-level cgroup, and to limits at the container-level cgroup for each container referencing the claim. +message NodeAllocatableMapping { // CapacityKey references a capacity name defined as a key in the // `spec.devices[*].capacity` map. When this field is set, the value associated with // this key in the `status.allocation.devices.results[*].consumedCapacity` map // (for a specific claim allocation) determines the base quantity for - // the node allocatable resource. If `allocationMultiplier` is also set, it is + // the node allocatable resource. `capacityMultiplier` must also be set and is // multiplied with the base quantity. // For example, if `spec.devices[*].capacity` has an entry "dra.example.com/memory": "128Gi", // and this field is set to "dra.example.com/memory", then for a claim allocation // that consumes { "dra.example.com/memory": "4Gi" } the base quantity for the - // node allocatable resource mapping will be "4Gi", and `allocationMultiplier` should - // be omitted or set to "1". + // node allocatable resource mapping will be "4Gi". + // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:alpha(since: "1.37")=+k8s:dependentRequired("capacityMultiplier") optional string capacityKey = 1; - // AllocationMultiplier is used as a multiplier for the allocated device count or the allocated capacity in the claim. - // It defaults to 1 if not specified. How the field is used also depends on whether `capacityKey` is set. - // 1. If `capacityKey` is NOT set: `allocationMultiplier` multiplies the device count allocated to the claim. - // a. A DRA driver representing each CPU core as a device would have - // {ResourceName: "cpu", allocationMultiplier: "2"} in its - // `nodeAllocatableResourceMappings`. If 4 devices are allocated to the claim, - // 4 * 2 CPUs would be considered as allocated and subtracted from the node's capacity. - // b. A GPU device that needs additional node memory per GPU allocation would - // have {ResourceName: "memory", allocationMultiplier: "2Gi"}. Each allocated - // GPU device instance of this type will account for 2Gi of memory. - // - // 2. If `capacityKey` IS set: `allocationMultiplier` is multiplied by the amount of that capacity consumed. - // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `allocationMultiplier`. - // For example, if a Device's capacity "dra.example.com/cores" is consumed, - // and each "core" provides 2 "cpu"s, the mapping would be: - // {ResourceName: "cpu", capacityKey: "dra.example.com/cores", allocationMultiplier: "2"}. - // If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16. - // +optional - optional .k8s.io.apimachinery.pkg.api.resource.Quantity allocationMultiplier = 2; + // CapacityMultiplier is used as a multiplier for the allocated capacity consumed. + // It is only valid if `capacityKey` is set. + // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. + // For example, if a Device's capacity "dra.example.com/cores" is consumed, + // and each "core" provides 2 "cpu"s, the mapping would be: + // {ResourceName: "cpu", capacityKey: "dra.example.com/cores", capacityMultiplier: "2"}. + // If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16. + // +optional + // +k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:dependentRequired("capacityKey") + optional .k8s.io.apimachinery.pkg.api.resource.Quantity capacityMultiplier = 2; + + // DeviceMultiplier is used as a multiplier for the allocated device count in the claim. + // The final node allocatable resource amount is `deviceCount` * `deviceMultiplier`. + // For example, a DRA driver representing each cache complex (CCX) as a device would have + // {ResourceName: "cpu", deviceMultiplier: "8"} in its `nodeAllocatableResources`. + // If 2 devices (CCX) are allocated to the claim, 2 * 8 = 16 CPUs would be considered as allocated. + // It is only valid when `capacityKey` and `capacityMultiplier` are not set. + // +optional + // +k8s:optional + // +k8s:unionMember + optional .k8s.io.apimachinery.pkg.api.resource.Quantity deviceMultiplier = 3; +} + +// NodeAllocatableOverhead defines auxiliary resource overheads incurred when allocating a device. +// Overheads can be specified as a fixed cost per pod referencing the claim, a variable cost per container reference, or both. +// Kubelet accounts for this overhead by adding it to both the pod-level and container-level cgroups of referencing containers. +message NodeAllocatableOverhead { + // PerPod is overhead applied once per pod referencing the claim on this node. + // This is a flat overhead incurred for every pod referencing the claim. + // +optional + // +k8s:optional + optional .k8s.io.apimachinery.pkg.api.resource.Quantity perPod = 1; + + // PerContainer is applied per container reference to the claim. + // This models overhead scaling linearly with the number of containers actively using the device. + // When both PerPod and PerContainer are specified, the total overhead allocated for each pod referencing + // the claim is computed as: + // Quantity = PerPod + (PerContainer * NumReferences) + // Kubelet accounts for this overhead in cgroups: + // - Pod-level cgroup (requests and limits): Kubelet adds PerPod + (PerContainer * NumReferences). + // - Container-level cgroup (limits only): Kubelet adds PerPod + PerContainer for each referencing container. + // This allows any single container to access the pod-level overhead, while the parent cgroup caps the total usage to account for PerPod exactly once. + // +optional + // +k8s:optional + optional .k8s.io.apimachinery.pkg.api.resource.Quantity perContainer = 2; +} + +// NodeAllocatableResource defines the translation between the DRA device/capacity +// units requested to the corresponding quantity of the node allocatable resource. +// At least one of Mapping or Overhead must be specified. Not specifying either is an invalid configuration. +message NodeAllocatableResource { + // Mapping is used when the device directly models a node allocatable resource like standard CPU or memory + // (e.g., with a CPU DRA driver). The calculated quantity is accounted for exactly once per claim instance + // on the node. To prevent node cgroup isolation friction, the scheduler explicitly + // blocks sharing mapped device claims across multiple pods. + // +optional + // +k8s:optional + optional NodeAllocatableMapping mapping = 3; + + // Overhead contains fields for modeling auxiliary overhead incurred on node allocatable resources + // when allocating devices that are not themselves modeling a node allocatable resource (e.g., host memory overhead for GPUs). + // Sharing overhead-mapped claims across multiple pods is allowed. The node allocatable overhead is accounted + // for individually for each pod referencing the claim. + // Overhead is always subtracted from the node's allocatable capacity for the resource, even when mapping + // is specified for the same resource. + // Eg: If a device models memory capacity per socket as a consumable capacity pool via Mapping (with CapacityKey), + // any overhead specified for the same resource will be subtracted from the node's general allocatable capacity + // and not from the per-socket capacity pool in Mapping. + // +optional + // +k8s:optional + optional NodeAllocatableOverhead overhead = 4; } // OpaqueDeviceConfiguration contains configuration parameters for a driver @@ -1496,9 +1729,9 @@ message OpaqueDeviceConfiguration { // vendor of the driver. It should use only lower case characters. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:maxLength=63 - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:maxLength=63 + // +k8s:beta(since: "1.37")=+k8s:format=k8s-long-name-caseless optional string driver = 1; // Parameters can contain arbitrary data. It is the responsibility of @@ -1527,7 +1760,8 @@ message ResourceClaim { // Spec describes what is being requested and how to configure it. // The spec is immutable. - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:immutable + // +optional optional ResourceClaimSpec spec = 2; // Status describes whether the claim is ready to use and what has been allocated. @@ -1582,8 +1816,8 @@ message ResourceClaimStatus { // Allocation is set once the claim has been allocated successfully. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:update=NoModify + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:update=NoModify optional AllocationResult allocation = 1; // ReservedFor indicates which entities are currently allowed to use @@ -1611,10 +1845,10 @@ message ResourceClaimStatus { // +listMapKey=uid // +patchStrategy=merge // +patchMergeKey=uid - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:listType=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=uid - // +k8s:alpha(since: "1.36")=+k8s:maxItems=256 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:listType=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=uid + // +k8s:beta(since: "1.37")=+k8s:maxItems=256 repeated ResourceClaimConsumerReference reservedFor = 2; // Devices contains the status of each device allocated for this @@ -1622,18 +1856,18 @@ message ResourceClaimStatus { // information. Entries are owned by their respective drivers. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +listType=map // +listMapKey=driver // +listMapKey=device // +listMapKey=pool // +listMapKey=shareID // +featureGate=DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:listType=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=driver - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=device - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=pool - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=shareID + // +k8s:beta(since: "1.37")=+k8s:listType=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=driver + // +k8s:beta(since: "1.37")=+k8s:listMapKey=device + // +k8s:beta(since: "1.37")=+k8s:listMapKey=pool + // +k8s:beta(since: "1.37")=+k8s:listMapKey=shareID repeated AllocatedDeviceStatus devices = 4; } @@ -1651,6 +1885,7 @@ message ResourceClaimTemplate { // This field is immutable. A ResourceClaim will get created by the // control plane for a Pod when needed and then not get updated // anymore. + // +optional optional ResourceClaimTemplateSpec spec = 2; } @@ -1670,11 +1905,13 @@ message ResourceClaimTemplateSpec { // when creating it. No other fields are allowed and will be rejected during // validation. // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Spec for the ResourceClaim. The entire content is copied unchanged // into the ResourceClaim that gets created from this template. The // same fields as in a ResourceClaim are also valid here. + // +optional optional ResourceClaimSpec spec = 2; } @@ -1682,6 +1919,8 @@ message ResourceClaimTemplateSpec { message ResourcePool { // Name is used to identify the pool. For node-local devices, this // is often the node name, but this is not required. + // A field selector can be used to list only ResourceSlice objects + // belonging to a certain pool. // // It must not be longer than 253 characters and must consist of one or more DNS sub-domains // separated by slashes. This field is immutable. @@ -1822,7 +2061,7 @@ message ResourceSliceSpec { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +zeroOrOneOf=ResourceSliceType repeated Device devices = 6; @@ -1848,14 +2087,50 @@ message ResourceSliceSpec { // The maximum number of counter sets is 8. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=name + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=name // +featureGate=DRAPartitionableDevices // +zeroOrOneOf=ResourceSliceType - // +k8s:alpha(since: "1.36")=+k8s:maxItems=8 + // +k8s:beta(since: "1.37")=+k8s:maxItems=8 repeated CounterSet sharedCounters = 8; + + // PartitionTypeAttribute names a string device attribute (by fully + // qualified name, e.g. "gpu.example.com/profile") whose value labels + // each device with its partition type, such as "Full" or "Half" for a + // MIG-style GPU. + // + // When set, every partitionable device in the slice must carry the attribute + // and devices sharing a value must share the same ConsumesCounters cost. + // + // +optional + // +featureGate=DRAPartitionableDevicesType + // +k8s:ifDisabled(DRAPartitionableDevicesType)=+k8s:forbidden + // +k8s:ifEnabled(DRAPartitionableDevicesType)=+k8s:optional + // +k8s:ifEnabled(DRAPartitionableDevicesType)=+k8s:format=k8s-resource-fully-qualified-name + optional string partitionTypeAttribute = 9; + + // SkipNodeOperations lists node-local resource operations (gRPC calls) + // that will be skipped for the devices in this slice when determining whether + // operations are necessary on the node. If all allocated devices for a driver in + // a claim skip an operation, that gRPC call will be skipped. Valid values are: + // + // - "NodePrepareResources": NodePrepareResources gRPC calls are skipped. This + // value cannot be specified unless "NodeUnprepareResources" is also listed + // (or "*" is specified). + // - "NodeUnprepareResources": NodeUnprepareResources gRPC calls are skipped. + // - "*": All node-local resource operations are skipped. + // + // Other values may be added in the future. The kubelet must ignore unknown + // values. + // + // +optional + // +listType=set + // +k8s:listType=set + // +featureGate=DRAOptionalNodeOperations + // +k8s:optional + repeated string skipNodeOperations = 10; } diff --git a/vendor/k8s.io/api/resource/v1beta1/types.go b/vendor/k8s.io/api/resource/v1beta1/types.go index 0d35ac9895..f35e230ceb 100644 --- a/vendor/k8s.io/api/resource/v1beta1/types.go +++ b/vendor/k8s.io/api/resource/v1beta1/types.go @@ -78,7 +78,7 @@ const ( // This is an alpha type and requires enabling the DynamicResourceAllocation // feature gate. type ResourceSlice struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -97,6 +97,9 @@ const ( // ResourceSliceSelectorDriver can be used in a [metav1.ListOptions] // field selector to filter based on [ResourceSliceSpec.Driver]. ResourceSliceSelectorDriver = "spec.driver" + // ResourceSliceSelectorPoolName can be used in a [metav1.ListOptions] + // field selector to filter based on [ResourceSliceSpec.Pool.Name]. + ResourceSliceSelectorPoolName = "spec.pool.name" ) // ResourceSliceSpec contains the information published by the driver in one ResourceSlice. @@ -160,7 +163,7 @@ type ResourceSliceSpec struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +zeroOrOneOf=ResourceSliceType Devices []Device `json:"devices,omitempty" protobuf:"bytes,6,name=devices"` @@ -186,17 +189,68 @@ type ResourceSliceSpec struct { // The maximum number of counter sets is 8. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=name + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=name // +featureGate=DRAPartitionableDevices // +zeroOrOneOf=ResourceSliceType - // +k8s:alpha(since: "1.36")=+k8s:maxItems=8 + // +k8s:beta(since: "1.37")=+k8s:maxItems=8 SharedCounters []CounterSet `json:"sharedCounters,omitempty" protobuf:"bytes,8,name=sharedCounters"` + + // PartitionTypeAttribute names a string device attribute (by fully + // qualified name, e.g. "gpu.example.com/profile") whose value labels + // each device with its partition type, such as "Full" or "Half" for a + // MIG-style GPU. + // + // When set, every partitionable device in the slice must carry the attribute + // and devices sharing a value must share the same ConsumesCounters cost. + // + // +optional + // +featureGate=DRAPartitionableDevicesType + // +k8s:ifDisabled(DRAPartitionableDevicesType)=+k8s:forbidden + // +k8s:ifEnabled(DRAPartitionableDevicesType)=+k8s:optional + // +k8s:ifEnabled(DRAPartitionableDevicesType)=+k8s:format=k8s-resource-fully-qualified-name + PartitionTypeAttribute *FullyQualifiedName `json:"partitionTypeAttribute,omitempty" protobuf:"bytes,9,opt,name=partitionTypeAttribute"` + + // SkipNodeOperations lists node-local resource operations (gRPC calls) + // that will be skipped for the devices in this slice when determining whether + // operations are necessary on the node. If all allocated devices for a driver in + // a claim skip an operation, that gRPC call will be skipped. Valid values are: + // + // - "NodePrepareResources": NodePrepareResources gRPC calls are skipped. This + // value cannot be specified unless "NodeUnprepareResources" is also listed + // (or "*" is specified). + // - "NodeUnprepareResources": NodeUnprepareResources gRPC calls are skipped. + // - "*": All node-local resource operations are skipped. + // + // Other values may be added in the future. The kubelet must ignore unknown + // values. + // + // +optional + // +listType=set + // +k8s:listType=set + // +featureGate=DRAOptionalNodeOperations + // +k8s:optional + SkipNodeOperations []SkipNodeOperation `json:"skipNodeOperations,omitempty" protobuf:"bytes,10,rep,name=skipNodeOperations,casttype=SkipNodeOperation"` } +// +enum +// +k8s:enum +type SkipNodeOperation string + +const ( + // SkipNodeOperationNodePrepareResources indicates that NodePrepareResources gRPC calls are skipped. + SkipNodeOperationNodePrepareResources SkipNodeOperation = "NodePrepareResources" + + // SkipNodeOperationNodeUnprepareResources indicates that NodeUnprepareResources gRPC calls are skipped. + SkipNodeOperationNodeUnprepareResources SkipNodeOperation = "NodeUnprepareResources" + + // SkipNodeOperationAll indicates that all node-local resource operations are skipped. + SkipNodeOperationAll SkipNodeOperation = "*" +) + // CounterSet defines a named set of counters // that are available to be used by devices defined in the // ResourcePool. @@ -210,8 +264,8 @@ type CounterSet struct { // It must be a DNS label. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-short-name Name string `json:"name" protobuf:"bytes,1,name=name"` // Counters defines the set of counters for this CounterSet @@ -220,8 +274,8 @@ type CounterSet struct { // The maximum number of counters is 32. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:eachKey=+k8s:format=k8s-short-name Counters map[string]Counter `json:"counters,omitempty" protobuf:"bytes,2,name=counters"` } @@ -241,6 +295,8 @@ const DriverNameMaxLength = 63 type ResourcePool struct { // Name is used to identify the pool. For node-local devices, this // is often the node name, but this is not required. + // A field selector can be used to list only ResourceSlice objects + // belonging to a certain pool. // // It must not be longer than 253 characters and must consist of one or more DNS sub-domains // separated by slashes. This field is immutable. @@ -305,6 +361,10 @@ const ResourceSliceMaxDeviceCounterConsumptionsPerDevice = 2 // per device counter consumption. const ResourceSliceMaxCountersPerDeviceCounterConsumption = 32 +// Defines the maximum number of compatibility groups that can be +// declared per device counter consumption. +const DeviceCompatibilityGroupsMaxSize = 2 + // Device represents one individual hardware instance that can be selected based // on its attributes. Besides the name, exactly one field must be set. type Device struct { @@ -318,7 +378,7 @@ type Device struct { // // +optional // +oneOf=deviceType - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Basic *BasicDevice `json:"basic,omitempty" protobuf:"bytes,2,opt,name=basic"` } @@ -330,7 +390,7 @@ type BasicDevice struct { // The maximum number of attributes and capacities combined is 32. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Attributes map[QualifiedName]DeviceAttribute `json:"attributes,omitempty" protobuf:"bytes,1,rep,name=attributes"` // Capacity defines the set of capacities for this device. @@ -351,13 +411,13 @@ type BasicDevice struct { // device is 2. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=counterSet + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=counterSet // +featureGate=DRAPartitionableDevices - // +k8s:alpha(since: "1.36")=+k8s:maxItems=2 + // +k8s:beta(since: "1.37")=+k8s:maxItems=2 ConsumesCounters []DeviceCounterConsumption `json:"consumesCounters,omitempty" protobuf:"bytes,3,rep,name=consumesCounters"` // NodeName identifies the node where the device is available. @@ -403,7 +463,7 @@ type BasicDevice struct { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Taints []DeviceTaint `json:"taints,omitempty" protobuf:"bytes,7,rep,name=taints"` // BindsToNode indicates if the usage of an allocation involving this device @@ -433,8 +493,8 @@ type BasicDevice struct { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 BindingConditions []string `json:"bindingConditions,omitempty" protobuf:"bytes,9,rep,name=bindingConditions"` // BindingFailureConditions defines the conditions for binding failure. @@ -451,8 +511,8 @@ type BasicDevice struct { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 BindingFailureConditions []string `json:"bindingFailureConditions,omitempty" protobuf:"bytes,10,rep,name=bindingFailureConditions"` // AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests. @@ -464,7 +524,10 @@ type BasicDevice struct { // +featureGate=DRAConsumableCapacity AllowMultipleAllocations *bool `json:"allowMultipleAllocations,omitempty" protobuf:"bytes,11,opt,name=allowMultipleAllocations"` - // NodeAllocatableResourceMappings defines the mapping of node resources + // NodeAllocatableResourceMappings is tombstoned as it got replaced with NodeAllocatableResources. + // NodeAllocatableResourceMappings map[v1.ResourceName]NodeAllocatableResourceMapping `json:"nodeAllocatableResourceMappings,omitempty" protobuf:"bytes,12,opt,name=nodeAllocatableResourceMappings"` + + // NodeAllocatableResources defines the mapping of node resources // that are managed by the DRA driver exposing this device. This includes resources currently // reported in v1.Node `status.allocatable` that are not extended resources // (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). @@ -476,46 +539,104 @@ type BasicDevice struct { // The keys of this map are the node-allocatable resource names (e.g., "cpu", "memory"). // Extended resource names are not permitted as keys. // +optional + // +k8s:optional // +featureGate=DRANodeAllocatableResources - NodeAllocatableResourceMappings map[v1.ResourceName]NodeAllocatableResourceMapping `json:"nodeAllocatableResourceMappings,omitempty" protobuf:"bytes,12,opt,name=nodeAllocatableResourceMappings"` + NodeAllocatableResources map[v1.ResourceName]NodeAllocatableResource `json:"nodeAllocatableResources,omitempty" protobuf:"bytes,14,opt,name=nodeAllocatableResources"` } -// NodeAllocatableResourceMapping defines the translation between the DRA device/capacity +// NodeAllocatableResource defines the translation between the DRA device/capacity // units requested to the corresponding quantity of the node allocatable resource. -type NodeAllocatableResourceMapping struct { +// At least one of Mapping or Overhead must be specified. Not specifying either is an invalid configuration. +type NodeAllocatableResource struct { + // Mapping is used when the device directly models a node allocatable resource like standard CPU or memory + // (e.g., with a CPU DRA driver). The calculated quantity is accounted for exactly once per claim instance + // on the node. To prevent node cgroup isolation friction, the scheduler explicitly + // blocks sharing mapped device claims across multiple pods. + // +optional + // +k8s:optional + Mapping *NodeAllocatableMapping `json:"mapping,omitempty" protobuf:"bytes,3,opt,name=mapping"` + + // Overhead contains fields for modeling auxiliary overhead incurred on node allocatable resources + // when allocating devices that are not themselves modeling a node allocatable resource (e.g., host memory overhead for GPUs). + // Sharing overhead-mapped claims across multiple pods is allowed. The node allocatable overhead is accounted + // for individually for each pod referencing the claim. + // Overhead is always subtracted from the node's allocatable capacity for the resource, even when mapping + // is specified for the same resource. + // Eg: If a device models memory capacity per socket as a consumable capacity pool via Mapping (with CapacityKey), + // any overhead specified for the same resource will be subtracted from the node's general allocatable capacity + // and not from the per-socket capacity pool in Mapping. + // +optional + // +k8s:optional + Overhead *NodeAllocatableOverhead `json:"overhead,omitempty" protobuf:"bytes,4,opt,name=overhead"` +} + +// NodeAllocatableMapping defines how a DRA allocation directly translates into a node allocatable resource quantity. +// The mapping can be derived from either the count of allocated devices or the specific capacity consumed. These options are mutually exclusive. +// Kubelet adds this mapped resource quantity from claim to both requests and limits at the pod-level cgroup, and to limits at the container-level cgroup for each container referencing the claim. +type NodeAllocatableMapping struct { // CapacityKey references a capacity name defined as a key in the // `spec.devices[*].capacity` map. When this field is set, the value associated with // this key in the `status.allocation.devices.results[*].consumedCapacity` map // (for a specific claim allocation) determines the base quantity for - // the node allocatable resource. If `allocationMultiplier` is also set, it is + // the node allocatable resource. `capacityMultiplier` must also be set and is // multiplied with the base quantity. // For example, if `spec.devices[*].capacity` has an entry "dra.example.com/memory": "128Gi", // and this field is set to "dra.example.com/memory", then for a claim allocation // that consumes { "dra.example.com/memory": "4Gi" } the base quantity for the - // node allocatable resource mapping will be "4Gi", and `allocationMultiplier` should - // be omitted or set to "1". + // node allocatable resource mapping will be "4Gi". + // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:alpha(since: "1.37")=+k8s:dependentRequired("capacityMultiplier") CapacityKey *QualifiedName `json:"capacityKey,omitempty" protobuf:"bytes,1,opt,name=capacityKey"` - // AllocationMultiplier is used as a multiplier for the allocated device count or the allocated capacity in the claim. - // It defaults to 1 if not specified. How the field is used also depends on whether `capacityKey` is set. - // 1. If `capacityKey` is NOT set: `allocationMultiplier` multiplies the device count allocated to the claim. - // a. A DRA driver representing each CPU core as a device would have - // {ResourceName: "cpu", allocationMultiplier: "2"} in its - // `nodeAllocatableResourceMappings`. If 4 devices are allocated to the claim, - // 4 * 2 CPUs would be considered as allocated and subtracted from the node's capacity. - // b. A GPU device that needs additional node memory per GPU allocation would - // have {ResourceName: "memory", allocationMultiplier: "2Gi"}. Each allocated - // GPU device instance of this type will account for 2Gi of memory. - // - // 2. If `capacityKey` IS set: `allocationMultiplier` is multiplied by the amount of that capacity consumed. - // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `allocationMultiplier`. - // For example, if a Device's capacity "dra.example.com/cores" is consumed, - // and each "core" provides 2 "cpu"s, the mapping would be: - // {ResourceName: "cpu", capacityKey: "dra.example.com/cores", allocationMultiplier: "2"}. - // If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16. - // +optional - AllocationMultiplier *resource.Quantity `json:"allocationMultiplier,omitempty" protobuf:"bytes,2,opt,name=allocationMultiplier"` + // CapacityMultiplier is used as a multiplier for the allocated capacity consumed. + // It is only valid if `capacityKey` is set. + // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. + // For example, if a Device's capacity "dra.example.com/cores" is consumed, + // and each "core" provides 2 "cpu"s, the mapping would be: + // {ResourceName: "cpu", capacityKey: "dra.example.com/cores", capacityMultiplier: "2"}. + // If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16. + // +optional + // +k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:dependentRequired("capacityKey") + CapacityMultiplier *resource.Quantity `json:"capacityMultiplier,omitempty" protobuf:"bytes,2,opt,name=capacityMultiplier"` + + // DeviceMultiplier is used as a multiplier for the allocated device count in the claim. + // The final node allocatable resource amount is `deviceCount` * `deviceMultiplier`. + // For example, a DRA driver representing each cache complex (CCX) as a device would have + // {ResourceName: "cpu", deviceMultiplier: "8"} in its `nodeAllocatableResources`. + // If 2 devices (CCX) are allocated to the claim, 2 * 8 = 16 CPUs would be considered as allocated. + // It is only valid when `capacityKey` and `capacityMultiplier` are not set. + // +optional + // +k8s:optional + // +k8s:unionMember + DeviceMultiplier *resource.Quantity `json:"deviceMultiplier,omitempty" protobuf:"bytes,3,opt,name=deviceMultiplier"` +} + +// NodeAllocatableOverhead defines auxiliary resource overheads incurred when allocating a device. +// Overheads can be specified as a fixed cost per pod referencing the claim, a variable cost per container reference, or both. +// Kubelet accounts for this overhead by adding it to both the pod-level and container-level cgroups of referencing containers. +type NodeAllocatableOverhead struct { + // PerPod is overhead applied once per pod referencing the claim on this node. + // This is a flat overhead incurred for every pod referencing the claim. + // +optional + // +k8s:optional + PerPod *resource.Quantity `json:"perPod,omitempty" protobuf:"bytes,1,opt,name=perPod"` + + // PerContainer is applied per container reference to the claim. + // This models overhead scaling linearly with the number of containers actively using the device. + // When both PerPod and PerContainer are specified, the total overhead allocated for each pod referencing + // the claim is computed as: + // Quantity = PerPod + (PerContainer * NumReferences) + // Kubelet accounts for this overhead in cgroups: + // - Pod-level cgroup (requests and limits): Kubelet adds PerPod + (PerContainer * NumReferences). + // - Container-level cgroup (limits only): Kubelet adds PerPod + PerContainer for each referencing container. + // This allows any single container to access the pod-level overhead, while the parent cgroup caps the total usage to account for PerPod exactly once. + // +optional + // +k8s:optional + PerContainer *resource.Quantity `json:"perContainer,omitempty" protobuf:"bytes,2,opt,name=perContainer"` } // DeviceCounterConsumption defines a set of counters that @@ -525,8 +646,8 @@ type DeviceCounterConsumption struct { // counters defined will be consumed. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-short-name CounterSet string `json:"counterSet" protobuf:"bytes,1,opt,name=counterSet"` // Counters defines the counters that will be consumed by the device. @@ -534,9 +655,39 @@ type DeviceCounterConsumption struct { // The maximum number of counters is 32. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:eachKey=+k8s:format=k8s-short-name Counters map[string]Counter `json:"counters,omitempty" protobuf:"bytes,2,opt,name=counters"` + + // CompatibilityGroups is a list of opaque group names for + // this counter set consumption. + // + // Devices that consume counters from the same counter set may only be + // allocated at the same time ("co-allocated") if they all share at least + // one common group: the intersection of the CompatibilityGroups of all + // co-allocated devices on that counter set must be non-empty. Devices + // that consume from different counter sets are never compared via this + // field. + // + // An unset field, an explicit nil, and an empty list are equivalent and + // mean "no groups": such a device is only co-allocatable with sibling + // devices on the same counter set that also have no groups, and is never + // co-allocatable with a device that declares one or more groups. + // + // Group names are opaque and meaningful only within the + // publishing driver's pool. + // + // The maximum number of groups is 2, and the names must be unique. + // + // +optional + // +listType=atomic + // +featureGate=DRADeviceCompatibilityGroups + // +k8s:listType=atomic + // +k8s:optional + // +k8s:maxItems=2 + // +k8s:unique=set + // +k8s:eachVal=+k8s:format=k8s-short-name + CompatibilityGroups []string `json:"compatibilityGroups,omitempty" protobuf:"bytes,3,rep,name=compatibilityGroups"` } // DeviceCapacity describes a quantity associated with a device. @@ -612,6 +763,13 @@ type CapacityRequestPolicy struct { // CapacityRequestPolicyRange defines a valid range for consumable capacity values. // +// If the DRAFractionalCapacityRange feature gate is +// enabled and at least one of Min, Max, or Step is a fractional quantity (i.e. +// its value is not an integer), milli-unit arithmetic is used instead, +// supporting values with up to 3 decimal places (e.g. 100m = 0.1). +// The largest supported value then is 1000 times smaller compared to using 64-bit integers. +// Otherwise, all comparisons use 64-bit integer arithmetic via resource.Quantity.Value(). +// // - If the requested amount is less than Min, it is rounded up to the Min value. // - If Step is set and the requested amount is between Min and Max but not aligned with Step, // it will be rounded up to the next value equal to Min + (n * Step). @@ -691,30 +849,30 @@ type DeviceAttribute struct { // IntValue is a number. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember IntValue *int64 `json:"int,omitempty" protobuf:"varint,2,opt,name=int"` // BoolValue is a true/false value. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember BoolValue *bool `json:"bool,omitempty" protobuf:"varint,3,opt,name=bool"` // StringValue is a string. Must not be longer than 64 characters. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember StringValue *string `json:"string,omitempty" protobuf:"bytes,4,opt,name=string"` // VersionValue is a semantic version according to semver.org spec 2.0.0. // Must not be longer than 64 characters. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember VersionValue *string `json:"version,omitempty" protobuf:"bytes,5,opt,name=version"` // IntValues is a non-empty list of numbers. @@ -723,8 +881,8 @@ type DeviceAttribute struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember // +featureGate=DRAListTypeAttributes IntValues []int64 `json:"ints,omitempty" protobuf:"varint,6,opt,name=ints"` @@ -732,8 +890,8 @@ type DeviceAttribute struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember // +featureGate=DRAListTypeAttributes BoolValues []bool `json:"bools,omitempty" protobuf:"varint,7,opt,name=bools"` @@ -744,8 +902,9 @@ type DeviceAttribute struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember + // +k8s:alpha(since: "1.37")=+k8s:eachVal=+k8s:maxBytes=64 // +featureGate=DRAListTypeAttributes StringValues []string `json:"strings,omitempty" protobuf:"bytes,8,opt,name=strings"` @@ -756,8 +915,8 @@ type DeviceAttribute struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember // +featureGate=DRAListTypeAttributes VersionValues []string `json:"versions,omitempty" protobuf:"bytes,9,opt,name=versions"` } @@ -794,7 +953,7 @@ type DeviceTaint struct { // Consumers must treat unknown effects like None. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Effect DeviceTaintEffect `json:"effect" protobuf:"bytes,3,name=effect,casttype=DeviceTaintEffect"` // ^^^^ @@ -833,7 +992,7 @@ type DeviceTaint struct { } // +enum -// +k8s:alpha(since: "1.36")=+k8s:enum +// +k8s:beta(since: "1.37")=+k8s:enum type DeviceTaintEffect string const ( @@ -854,7 +1013,7 @@ const ( // ResourceSliceList is a collection of ResourceSlices. type ResourceSliceList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -877,14 +1036,15 @@ type ResourceSliceList struct { // This is an alpha type and requires enabling the DynamicResourceAllocation // feature gate. type ResourceClaim struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec describes what is being requested and how to configure it. // The spec is immutable. - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:immutable + // +optional Spec ResourceClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"` // Status describes whether the claim is ready to use and what has been allocated. @@ -912,11 +1072,11 @@ type DeviceClaim struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=name - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=name + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Requests []DeviceRequest `json:"requests" protobuf:"bytes,1,name=requests"` // These constraints must be satisfied by the set of devices that get @@ -924,8 +1084,8 @@ type DeviceClaim struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Constraints []DeviceConstraint `json:"constraints,omitempty" protobuf:"bytes,2,opt,name=constraints"` // This field holds configuration for multiple potential drivers which @@ -934,8 +1094,8 @@ type DeviceClaim struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Config []DeviceClaimConfiguration `json:"config,omitempty" protobuf:"bytes,3,opt,name=config"` // Potential future extension, ignored by older schedulers. This is @@ -1002,8 +1162,8 @@ type DeviceRequest struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,3,name=selectors"` // AllocationMode and its related fields define how devices are allocated @@ -1029,7 +1189,7 @@ type DeviceRequest struct { // requests with unknown modes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional AllocationMode DeviceAllocationMode `json:"allocationMode,omitempty" protobuf:"bytes,4,opt,name=allocationMode"` // Count is used only when the count mode is "ExactCount". Must be greater than zero. @@ -1079,11 +1239,11 @@ type DeviceRequest struct { // +oneOf=deviceRequestType // +listType=atomic // +featureGate=DRAPrioritizedList - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=name - // +k8s:alpha(since: "1.36")=+k8s:maxItems=8 + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=name + // +k8s:beta(since: "1.37")=+k8s:maxItems=8 FirstAvailable []DeviceSubRequest `json:"firstAvailable,omitempty" protobuf:"bytes,7,name=firstAvailable"` // If specified, the request's tolerations. @@ -1110,7 +1270,7 @@ type DeviceRequest struct { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Tolerations []DeviceToleration `json:"tolerations,omitempty" protobuf:"bytes,8,opt,name=tolerations"` // Capacity define resource requirements against each capacity. @@ -1129,6 +1289,34 @@ type DeviceRequest struct { // +optional // +featureGate=DRAConsumableCapacity Capacity *CapacityRequirements `json:"capacity,omitempty" protobuf:"bytes,9,opt,name=capacity"` + + // DerivedAttributes defines a set of virtual attributes computed via CEL expressions + // for each candidate device. These virtual attributes can be referenced in + // `.devices.constraints` to align and match different devices (e.g., co-allocating + // a GPU and a NIC on the same NUMA node) even if their drivers publish different + // attributes. Derived attributes are not available via `device.attributes` + // in the CEL environment when evaluating selector expressions. + // + // Derived attributes allow you to extract, transform, or normalize topology + // information (such as extracting a NUMA index from a complex topology string or + // renaming a vendor-specific attribute) into a common virtual attribute name at + // scheduling time. The scheduler then evaluates these virtual attributes exactly + // like static attributes when matching constraints. + // + // Every derived attribute defined in this list must be referenced by at least one + // MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list. + // + // The maximum number of derived attributes is 32. + // + // This is an alpha field and requires enabling the DRADerivedAttributes + // feature gate. + // + // +optional + // +listType=atomic + // +featureGate=DRADerivedAttributes + // +k8s:optional + // +k8s:maxItems=32 + DerivedAttributes []DeviceDerivedAttribute `json:"derivedAttributes,omitempty" protobuf:"bytes,10,rep,name=derivedAttributes"` } // DeviceSubRequest describes a request for device provided in the @@ -1163,8 +1351,8 @@ type DeviceSubRequest struct { // to reference. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-long-name DeviceClassName string `json:"deviceClassName" protobuf:"bytes,2,name=deviceClassName"` // Selectors define criteria which must be satisfied by a specific @@ -1174,8 +1362,8 @@ type DeviceSubRequest struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,3,name=selectors"` // AllocationMode and its related fields define how devices are allocated @@ -1197,7 +1385,7 @@ type DeviceSubRequest struct { // requests with unknown modes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional AllocationMode DeviceAllocationMode `json:"allocationMode,omitempty" protobuf:"bytes,4,opt,name=allocationMode"` // Count is used only when the count mode is "ExactCount". Must be greater than zero. @@ -1228,7 +1416,7 @@ type DeviceSubRequest struct { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Tolerations []DeviceToleration `json:"tolerations,omitempty" protobuf:"bytes,7,opt,name=tolerations"` // Capacity define resource requirements against each capacity. @@ -1247,6 +1435,34 @@ type DeviceSubRequest struct { // +optional // +featureGate=DRAConsumableCapacity Capacity *CapacityRequirements `json:"capacity,omitempty" protobuf:"bytes,8,opt,name=capacity"` + + // DerivedAttributes defines a set of virtual attributes computed via CEL expressions + // for each candidate device. These virtual attributes can be referenced in + // `.devices.constraints` to align and match different devices (e.g., co-allocating + // a GPU and a NIC on the same NUMA node) even if their drivers publish different + // attributes. Derived attributes are not available via `device.attributes` + // in the CEL environment when evaluating selector expressions. + // + // Derived attributes allow you to extract, transform, or normalize topology + // information (such as extracting a NUMA index from a complex topology string or + // renaming a vendor-specific attribute) into a common virtual attribute name at + // scheduling time. The scheduler then evaluates these virtual attributes exactly + // like static attributes when matching constraints. + // + // Every derived attribute defined in this list must be referenced by at least one + // MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list. + // + // The maximum number of derived attributes is 32. + // + // This is an alpha field and requires enabling the DRADerivedAttributes + // feature gate. + // + // +optional + // +listType=atomic + // +featureGate=DRADerivedAttributes + // +k8s:optional + // +k8s:maxItems=32 + DerivedAttributes []DeviceDerivedAttribute `json:"derivedAttributes,omitempty" protobuf:"bytes,9,rep,name=derivedAttributes"` } // CapacityRequirements defines the capacity requirements for a specific device request. @@ -1278,14 +1494,70 @@ type CapacityRequirements struct { Requests map[QualifiedName]resource.Quantity `json:"requests,omitempty" protobuf:"bytes,1,rep,name=requests,castkey=QualifiedName"` } +// DeviceDerivedAttribute defines a derived attribute computed via CEL. +type DeviceDerivedAttribute struct { + // Name is the identifier for this derived attribute, used in constraints. + // + // It must be a DNS subdomain followed by a slash ("/") followed by a C identifier + // (e.g. "example.com/numaNode" or "derived/numaNode"). + // + // If the chosen name matches an existing physical attribute from a driver, + // the derived attribute's expression will shadow the physical attribute, + // and its evaluated value will be used in constraints instead. When the goal + // is to define a derived attribute that is only used within the ResourceClaim + // and not meant to shadow an existing attribute, use a domain prefix that + // no DRA driver should be using (e.g. "derived/myAttribute"). + // + // It is not valid to define a derived attribute that isn't used in at least + // one constraint. + // + // +required + // +k8s:required + // +k8s:format=k8s-resource-fully-qualified-name + Name FullyQualifiedName `json:"name" protobuf:"bytes,1,name=name"` + + // Expression is a CEL expression evaluated against each candidate device. + // The expression must evaluate to a primitive scalar (string, integer, + // boolean, or semver) or a list of these scalars ([]string, []int64, + // []bool, []semver) to act as a virtual grouping key. Any other return type + // is an error and causes CEL evaluation for the device to fail. + // + // The expression's input is an object named "device", which carries the + // same properties as in a CELDeviceSelector. + // + // When pod scheduling encounters CEL runtime errors (such as looking + // up an attribute that isn't defined) for some devices, it will abort + // allocation and fail scheduling for the Pod. Surfacing evaluation + // errors immediately prevents silent topology matching failures that are + // extremely hard to detect. A robust expression should, for example, check + // for the existence of attributes before referencing them to avoid + // runtime evaluation errors. + // + // The expression gets evaluated after a device has passed the other + // selector expressions for the request in which this expression is used. + // This allows writing expressions that are tailored towards the specific + // devices being requested (for example, by assuming the device is from a + // certain vendor and skipping those checks). + // + // The length of the expression must be smaller or equal to 10 Ki. The + // cost of evaluating it is also limited based on the estimated number + // of logical steps; the combined cost of all derived attributes in a + // claim is capped by a shared CEL cost budget. + // + // +required + // +k8s:required + Expression string `json:"expression" protobuf:"bytes,2,name=expression"` +} + const ( DeviceSelectorsMaxSize = 32 FirstAvailableDeviceRequestMaxSize = 8 DeviceTolerationsMaxLength = 16 + DeviceDerivedAttributesMaxSize = 32 ) // +enum -// +k8s:alpha(since: "1.36")=+k8s:enum +// +k8s:beta(since: "1.37")=+k8s:enum type DeviceAllocationMode string // Valid [DeviceRequest.CountMode] values. @@ -1315,7 +1587,7 @@ type CELDeviceSelector struct { // - driver (string): the name of the driver which defines this device. // - attributes (map[string]object): the device's attributes, grouped by prefix // (e.g. device.attributes["dra.example.com"] evaluates to an object with all - // of the attributes which were prefixed by "dra.example.com". + // of the attributes which were prefixed by "dra.example.com"). // - capacity (map[string]object): the device's capacities, grouped by prefix. // - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device // (v1.34+ with the DRAConsumableCapacity feature enabled). @@ -1348,6 +1620,15 @@ type CELDeviceSelector struct { // A robust expression should check for the existence of attributes // before referencing them. // + // Common errors: + // - "no such key": Use optional chaining (.? followed by orValue()) + // or guarding the check with has() for optional fields. + // See CEL Optional Types for details: + // https://pkg.go.dev/github.com/google/cel-go@v0.17.4/cel#OptionalTypes + // + // For more CEL expression syntax and examples, see: + // https://kubernetes.io/docs/reference/using-api/cel/ + // // For ease of use, the cel.bind() function is enabled, and can be used // to simplify expressions that access multiple attributes with the // same domain. For example: @@ -1395,6 +1676,25 @@ type CELDeviceSelector struct { // However, this depends on how fast the machine is. const CELSelectorExpressionMaxCost = 1000000 +// DeviceClaimDerivedAttributeCELMaxCost is the maximum combined execution cost +// allowed for all derived attribute CEL expressions within a single DeviceClaim. +// +// During validation, the API server computes the estimated execution cost of each +// derived attribute expression. The sum of these costs across all requests in the +// claim must not exceed this budget. If it does, the claim is rejected. +// +// To stay within the budget, consumers should simplify their CEL expressions, +// avoid computationally expensive operations like deep nesting or iterations +// (such as `.all()` or `.exists()`), and minimize the total number of derived +// attributes in a claim. +// +// This shared budget prevents excessively complex claims from degrading the +// performance of the kube-scheduler. The limit is set to 1,000,000 instruction +// executions (roughly 0.1 seconds of evaluation time), tying the collective +// cost of all derived attributes to the maximum cost allowed for a single +// CEL selector. +const DeviceClaimDerivedAttributeCELMaxCost = 1000000 + // CELSelectorExpressionMaxLength is the maximum length of a CEL selector expression string. const CELSelectorExpressionMaxLength = 10 * 1024 @@ -1412,10 +1712,10 @@ type DeviceConstraint struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Requests []string `json:"requests,omitempty" protobuf:"bytes,1,opt,name=requests"` // MatchAttribute requires that all devices in question have this @@ -1438,8 +1738,8 @@ type DeviceConstraint struct { // // +optional // +oneOf=ConstraintType - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-fully-qualified-name + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-resource-fully-qualified-name MatchAttribute *FullyQualifiedName `json:"matchAttribute,omitempty" protobuf:"bytes,2,opt,name=matchAttribute"` // Potential future extension, not part of the current design: @@ -1471,6 +1771,8 @@ type DeviceConstraint struct { // +optional // +oneOf=ConstraintType // +featureGate=DRAConsumableCapacity + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-resource-fully-qualified-name DistinctAttribute *FullyQualifiedName `json:"distinctAttribute,omitempty" protobuf:"bytes,3,opt,name=distinctAttribute"` } @@ -1485,13 +1787,13 @@ type DeviceClaimConfiguration struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Requests []string `json:"requests,omitempty" protobuf:"bytes,1,opt,name=requests"` - DeviceConfiguration `json:",inline" protobuf:"bytes,2,name=deviceConfiguration"` + DeviceConfiguration `json:"" protobuf:"bytes,2,name=deviceConfiguration"` } // DeviceConfiguration must have exactly one field set. It gets embedded @@ -1502,7 +1804,7 @@ type DeviceConfiguration struct { // // +optional // +oneOf=ConfigurationType - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Opaque *OpaqueDeviceConfiguration `json:"opaque,omitempty" protobuf:"bytes,1,opt,name=opaque"` } @@ -1519,9 +1821,9 @@ type OpaqueDeviceConfiguration struct { // vendor of the driver. It should use only lower case characters. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:maxLength=63 - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:maxLength=63 + // +k8s:beta(since: "1.37")=+k8s:format=k8s-long-name-caseless Driver string `json:"driver" protobuf:"bytes,1,name=driver"` // Parameters can contain arbitrary data. It is the responsibility of @@ -1547,8 +1849,8 @@ type DeviceToleration struct { // Must be a label name. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-label-key + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-label-key Key string `json:"key,omitempty" protobuf:"bytes,1,opt,name=key"` // Operator represents a key's relationship to the value. @@ -1558,7 +1860,7 @@ type DeviceToleration struct { // // +optional // +default="Equal" - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Operator DeviceTolerationOperator `json:"operator,omitempty" protobuf:"bytes,2,opt,name=operator,casttype=DeviceTolerationOperator"` // Value is the taint value the toleration matches to. @@ -1572,7 +1874,7 @@ type DeviceToleration struct { // When specified, allowed values are NoSchedule and NoExecute. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Effect DeviceTaintEffect `json:"effect,omitempty" protobuf:"bytes,4,opt,name=effect,casttype=DeviceTaintEffect"` // TolerationSeconds represents the period of time the toleration (which must be @@ -1589,7 +1891,7 @@ type DeviceToleration struct { // A toleration operator is the set of operators that can be used in a toleration. // // +enum -// +k8s:alpha(since: "1.36")=+k8s:enum +// +k8s:beta(since: "1.37")=+k8s:enum type DeviceTolerationOperator string const ( @@ -1603,8 +1905,8 @@ type ResourceClaimStatus struct { // Allocation is set once the claim has been allocated successfully. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:update=NoModify + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:update=NoModify Allocation *AllocationResult `json:"allocation,omitempty" protobuf:"bytes,1,opt,name=allocation"` // ReservedFor indicates which entities are currently allowed to use @@ -1632,10 +1934,10 @@ type ResourceClaimStatus struct { // +listMapKey=uid // +patchStrategy=merge // +patchMergeKey=uid - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:listType=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=uid - // +k8s:alpha(since: "1.36")=+k8s:maxItems=256 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:listType=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=uid + // +k8s:beta(since: "1.37")=+k8s:maxItems=256 ReservedFor []ResourceClaimConsumerReference `json:"reservedFor,omitempty" protobuf:"bytes,2,opt,name=reservedFor" patchStrategy:"merge" patchMergeKey:"uid"` // DeallocationRequested is tombstoned since Kubernetes 1.32 where @@ -1648,18 +1950,18 @@ type ResourceClaimStatus struct { // information. Entries are owned by their respective drivers. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +listType=map // +listMapKey=driver // +listMapKey=device // +listMapKey=pool // +listMapKey=shareID // +featureGate=DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:listType=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=driver - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=device - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=pool - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=shareID + // +k8s:beta(since: "1.37")=+k8s:listType=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=driver + // +k8s:beta(since: "1.37")=+k8s:listMapKey=device + // +k8s:beta(since: "1.37")=+k8s:listMapKey=pool + // +k8s:beta(since: "1.37")=+k8s:listMapKey=shareID Devices []AllocatedDeviceStatus `json:"devices,omitempty" protobuf:"bytes,4,opt,name=devices"` } @@ -1722,8 +2024,8 @@ type DeviceAllocationResult struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Results []DeviceRequestAllocationResult `json:"results,omitempty" protobuf:"bytes,1,opt,name=results"` // This field is a combination of all the claim and class configuration parameters. @@ -1736,8 +2038,8 @@ type DeviceAllocationResult struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=64 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=64 Config []DeviceAllocationConfiguration `json:"config,omitempty" protobuf:"bytes,2,opt,name=config"` } @@ -1766,9 +2068,9 @@ type DeviceRequestAllocationResult struct { // vendor of the driver. It should use only lower case characters. // // +required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:maxLength=63 + // +k8s:beta(since: "1.37")=+k8s:format=k8s-long-name-caseless + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:maxLength=63 Driver string `json:"driver" protobuf:"bytes,2,name=driver"` // This name together with the driver name and the device name field @@ -1778,8 +2080,8 @@ type DeviceRequestAllocationResult struct { // DNS sub-domains separated by slashes. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-pool-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-resource-pool-name Pool string `json:"pool" protobuf:"bytes,3,name=pool"` // Device references one device instance via its name in the driver's @@ -1811,8 +2113,7 @@ type DeviceRequestAllocationResult struct { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=16 + // +k8s:beta(since: "1.37")=+k8s:optional Tolerations []DeviceToleration `json:"tolerations,omitempty" protobuf:"bytes,6,opt,name=tolerations"` // BindingConditions contains a copy of the BindingConditions @@ -1824,8 +2125,8 @@ type DeviceRequestAllocationResult struct { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 BindingConditions []string `json:"bindingConditions,omitempty" protobuf:"bytes,7,rep,name=bindingConditions"` // BindingFailureConditions contains a copy of the BindingFailureConditions @@ -1837,8 +2138,8 @@ type DeviceRequestAllocationResult struct { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 BindingFailureConditions []string `json:"bindingFailureConditions,omitempty" protobuf:"bytes,8,rep,name=bindingFailureConditions"` // ShareID uniquely identifies an individual allocation share of the device, @@ -1848,8 +2149,8 @@ type DeviceRequestAllocationResult struct { // // +optional // +featureGate=DRAConsumableCapacity - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-uuid ShareID *types.UID `json:"shareID,omitempty" protobuf:"bytes,9,opt,name=shareID"` // ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request. @@ -1864,6 +2165,19 @@ type DeviceRequestAllocationResult struct { // +optional // +featureGate=DRAConsumableCapacity ConsumedCapacity map[QualifiedName]resource.Quantity `json:"consumedCapacity,omitempty" protobuf:"bytes,10,rep,name=consumedCapacity"` + + // SkipNodeOperations lists node-local resource operations (gRPC calls) + // that will be skipped for this allocated device when determining whether + // operations are necessary on the node. If all allocated devices for a driver in + // a claim skip an operation, that gRPC call will be skipped. It is a copy of + // the ResourceSlice.spec.skipNodeOperations value at the time when the device was allocated. + // + // +optional + // +listType=set + // +k8s:listType=set + // +featureGate=DRAOptionalNodeOperations + // +k8s:optional + SkipNodeOperations []SkipNodeOperation `json:"skipNodeOperations,omitempty" protobuf:"bytes,11,rep,name=skipNodeOperations,casttype=SkipNodeOperation"` } // DeviceAllocationConfiguration gets embedded in an AllocationResult. @@ -1873,7 +2187,7 @@ type DeviceAllocationConfiguration struct { // or from a claim. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Source AllocationConfigSource `json:"source" protobuf:"bytes,1,name=source"` // Requests lists the names of requests where the configuration applies. @@ -1885,17 +2199,17 @@ type DeviceAllocationConfiguration struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Requests []string `json:"requests,omitempty" protobuf:"bytes,2,opt,name=requests"` - DeviceConfiguration `json:",inline" protobuf:"bytes,3,name=deviceConfiguration"` + DeviceConfiguration `json:"" protobuf:"bytes,3,name=deviceConfiguration"` } // +enum -// +k8s:alpha(since: "1.36")=+k8s:enum +// +k8s:beta(since: "1.37")=+k8s:enum type AllocationConfigSource string // Valid [DeviceAllocationConfiguration.Source] values. @@ -1909,7 +2223,7 @@ const ( // ResourceClaimList is a collection of claims. type ResourceClaimList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -1931,11 +2245,11 @@ type ResourceClaimList struct { // This is an alpha type and requires enabling the DynamicResourceAllocation // feature gate. type DeviceClass struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata // +optional - // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:format=k8s-long-name metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec defines what can be allocated and how to configure it. @@ -1946,6 +2260,7 @@ type DeviceClass struct { // the time of allocation. // // Changing the spec automatically increments the metadata.generation number. + // +optional Spec DeviceClassSpec `json:"spec" protobuf:"bytes,2,name=spec"` } @@ -1956,8 +2271,8 @@ type DeviceClassSpec struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,1,opt,name=selectors"` // Config defines configuration parameters that apply to each device that is claimed via this class. @@ -1968,8 +2283,8 @@ type DeviceClassSpec struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Config []DeviceClassConfiguration `json:"config,omitempty" protobuf:"bytes,2,opt,name=config"` // SuitableNodes is tombstoned since Kubernetes 1.32 where @@ -1986,17 +2301,16 @@ type DeviceClassSpec struct { // If two classes are created at the same time, then the name of the class // lexicographically sorted first is picked. // - // This is a beta field. // +optional // +featureGate=DRAExtendedResource - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-extended-resource-name + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-extended-resource-name ExtendedResourceName *string `json:"extendedResourceName,omitempty" protobuf:"bytes,4,opt,name=extendedResourceName"` } // DeviceClassConfiguration is used in DeviceClass. type DeviceClassConfiguration struct { - DeviceConfiguration `json:",inline" protobuf:"bytes,1,opt,name=deviceConfiguration"` + DeviceConfiguration `json:"" protobuf:"bytes,1,opt,name=deviceConfiguration"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -2004,7 +2318,7 @@ type DeviceClassConfiguration struct { // DeviceClassList is a collection of classes. type DeviceClassList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -2022,7 +2336,7 @@ type DeviceClassList struct { // This is an alpha type and requires enabling the DynamicResourceAllocation // feature gate. type ResourceClaimTemplate struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -2032,6 +2346,7 @@ type ResourceClaimTemplate struct { // This field is immutable. A ResourceClaim will get created by the // control plane for a Pod when needed and then not get updated // anymore. + // +optional Spec ResourceClaimTemplateSpec `json:"spec" protobuf:"bytes,2,name=spec"` } @@ -2041,11 +2356,13 @@ type ResourceClaimTemplateSpec struct { // when creating it. No other fields are allowed and will be rejected during // validation. // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec for the ResourceClaim. The entire content is copied unchanged // into the ResourceClaim that gets created from this template. The // same fields as in a ResourceClaim are also valid here. + // +optional Spec ResourceClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"` } @@ -2054,7 +2371,7 @@ type ResourceClaimTemplateSpec struct { // ResourceClaimTemplateList is a collection of claim templates. type ResourceClaimTemplateList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -2116,8 +2433,8 @@ type AllocatedDeviceStatus struct { // // +optional // +featureGate=DRAConsumableCapacity - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-uuid ShareID *string `json:"shareID,omitempty" protobuf:"bytes,7,opt,name=shareID"` // Conditions contains the latest observation of the device's state. @@ -2129,6 +2446,9 @@ type AllocatedDeviceStatus struct { // +optional // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type Conditions []metav1.Condition `json:"conditions" protobuf:"bytes,4,opt,name=conditions"` // Data contains arbitrary driver-specific data. @@ -2141,7 +2461,7 @@ type AllocatedDeviceStatus struct { // NetworkData contains network-related information specific to the device. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional NetworkData *NetworkDeviceData `json:"networkData,omitempty" protobuf:"bytes,6,opt,name=networkData"` } @@ -2156,8 +2476,8 @@ type NetworkDeviceData struct { // Must not be longer than 256 bytes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxBytes=256 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxBytes=256 InterfaceName string `json:"interfaceName,omitempty" protobuf:"bytes,1,opt,name=interfaceName"` // IPs lists the network addresses assigned to the device's network interface. @@ -2170,10 +2490,10 @@ type NetworkDeviceData struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=16 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=16 IPs []string `json:"ips,omitempty" protobuf:"bytes,2,opt,name=ips"` // HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface. @@ -2181,7 +2501,7 @@ type NetworkDeviceData struct { // Must not be longer than 128 bytes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxBytes=128 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxBytes=128 HardwareAddress string `json:"hardwareAddress,omitempty" protobuf:"bytes,3,opt,name=hardwareAddress"` } diff --git a/vendor/k8s.io/api/resource/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/resource/v1beta1/types_swagger_doc_generated.go index 4b147a3f3e..d1485ad84a 100644 --- a/vendor/k8s.io/api/resource/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/resource/v1beta1/types_swagger_doc_generated.go @@ -54,19 +54,19 @@ func (AllocationResult) SwaggerDoc() map[string]string { } var map_BasicDevice = map[string]string{ - "": "BasicDevice defines one device instance.", - "attributes": "Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.", - "capacity": "Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.", - "consumesCounters": "ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets.\n\nThere can only be a single entry per counterSet.\n\nThe maximum number of device counter consumptions per device is 2.", - "nodeName": "NodeName identifies the node where the device is available.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", - "nodeSelector": "NodeSelector defines the nodes where the device is available.\n\nMust use exactly one term.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", - "allNodes": "AllNodes indicates that all nodes have access to the device.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", - "taints": "If specified, these are the driver-defined taints.\n\nThe maximum number of taints is 16. If taints are set for any device in a ResourceSlice, then the maximum number of allowed devices per ResourceSlice is 64 instead of 128.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.", - "bindsToNode": "BindsToNode indicates if the usage of an allocation involving this device has to be limited to exactly the node that was chosen when allocating the claim. If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector to match the node where the allocation was made.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", - "bindingConditions": "BindingConditions defines the conditions for proceeding with binding. All of these conditions must be set in the per-device status conditions with a value of True to proceed with binding the pod to the node while scheduling the pod.\n\nThe maximum number of binding conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", - "bindingFailureConditions": "BindingFailureConditions defines the conditions for binding failure. They may be set in the per-device status conditions. If any is true, a binding failure occurred.\n\nThe maximum number of binding failure conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", - "allowMultipleAllocations": "AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.\n\nIf AllowMultipleAllocations is set to true, the device can be allocated more than once, and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not.", - "nodeAllocatableResourceMappings": "NodeAllocatableResourceMappings defines the mapping of node resources that are managed by the DRA driver exposing this device. This includes resources currently reported in v1.Node `status.allocatable` that are not extended resources (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). Examples include \"cpu\", \"memory\", \"ephemeral-storage\", and hugepages. In addition to standard requests made through the Pod `spec`, these resources can also be requested through claims and allocated by the DRA driver. For example, a CPU DRA driver might allocate exclusive CPUs or auxiliary node memory dependencies of an accelerator device. The keys of this map are the node-allocatable resource names (e.g., \"cpu\", \"memory\"). Extended resource names are not permitted as keys.", + "": "BasicDevice defines one device instance.", + "attributes": "Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.", + "capacity": "Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.", + "consumesCounters": "ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets.\n\nThere can only be a single entry per counterSet.\n\nThe maximum number of device counter consumptions per device is 2.", + "nodeName": "NodeName identifies the node where the device is available.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", + "nodeSelector": "NodeSelector defines the nodes where the device is available.\n\nMust use exactly one term.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", + "allNodes": "AllNodes indicates that all nodes have access to the device.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", + "taints": "If specified, these are the driver-defined taints.\n\nThe maximum number of taints is 16. If taints are set for any device in a ResourceSlice, then the maximum number of allowed devices per ResourceSlice is 64 instead of 128.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.", + "bindsToNode": "BindsToNode indicates if the usage of an allocation involving this device has to be limited to exactly the node that was chosen when allocating the claim. If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector to match the node where the allocation was made.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", + "bindingConditions": "BindingConditions defines the conditions for proceeding with binding. All of these conditions must be set in the per-device status conditions with a value of True to proceed with binding the pod to the node while scheduling the pod.\n\nThe maximum number of binding conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", + "bindingFailureConditions": "BindingFailureConditions defines the conditions for binding failure. They may be set in the per-device status conditions. If any is true, a binding failure occurred.\n\nThe maximum number of binding failure conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", + "allowMultipleAllocations": "AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.\n\nIf AllowMultipleAllocations is set to true, the device can be allocated more than once, and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not.", + "nodeAllocatableResources": "NodeAllocatableResources defines the mapping of node resources that are managed by the DRA driver exposing this device. This includes resources currently reported in v1.Node `status.allocatable` that are not extended resources (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). Examples include \"cpu\", \"memory\", \"ephemeral-storage\", and hugepages. In addition to standard requests made through the Pod `spec`, these resources can also be requested through claims and allocated by the DRA driver. For example, a CPU DRA driver might allocate exclusive CPUs or auxiliary node memory dependencies of an accelerator device. The keys of this map are the node-allocatable resource names (e.g., \"cpu\", \"memory\"). Extended resource names are not permitted as keys.", } func (BasicDevice) SwaggerDoc() map[string]string { @@ -75,7 +75,7 @@ func (BasicDevice) SwaggerDoc() map[string]string { var map_CELDeviceSelector = map[string]string{ "": "CELDeviceSelector contains a CEL expression for selecting a device.", - "expression": "Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort.\n\nThe expression's input is an object named \"device\", which carries the following properties:\n - driver (string): the name of the driver which defines this device.\n - attributes (map[string]object): the device's attributes, grouped by prefix\n (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all\n of the attributes which were prefixed by \"dra.example.com\".\n - capacity (map[string]object): the device's capacities, grouped by prefix.\n - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device\n (v1.34+ with the DRAConsumableCapacity feature enabled).\n\nExample: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields:\n\n device.driver\n device.attributes[\"dra.example.com\"].model\n device.attributes[\"ext.example.com\"].family\n device.capacity[\"dra.example.com\"].modules\n\nThe device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers.\n\nThe value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity.\n\nIf an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort.\n\nA robust expression should check for the existence of attributes before referencing them.\n\nFor ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example:\n\n cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool)\n\nWhen the DRAListTypeAttributes feature gate is enabled, the includes() helper is available and it can work for both scalar and list-type attributes. It was introduced to support smooth migration from scalar attributes to list-type attributes while keeping CEL expressions simple. For example:\n\n device.attributes[\"dra.example.com\"].models.includes(\"some-model\")\n\nThe length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps.", + "expression": "Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort.\n\nThe expression's input is an object named \"device\", which carries the following properties:\n - driver (string): the name of the driver which defines this device.\n - attributes (map[string]object): the device's attributes, grouped by prefix\n (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all\n of the attributes which were prefixed by \"dra.example.com\").\n - capacity (map[string]object): the device's capacities, grouped by prefix.\n - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device\n (v1.34+ with the DRAConsumableCapacity feature enabled).\n\nExample: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields:\n\n device.driver\n device.attributes[\"dra.example.com\"].model\n device.attributes[\"ext.example.com\"].family\n device.capacity[\"dra.example.com\"].modules\n\nThe device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers.\n\nThe value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity.\n\nIf an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort.\n\nA robust expression should check for the existence of attributes before referencing them.\n\nCommon errors: - \"no such key\": Use optional chaining (.? followed by orValue())\n or guarding the check with has() for optional fields.\n See CEL Optional Types for details:\n https://pkg.go.dev/github.com/google/cel-go@v0.17.4/cel#OptionalTypes\n\nFor more CEL expression syntax and examples, see: https://kubernetes.io/docs/reference/using-api/cel/\n\nFor ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example:\n\n cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool)\n\nWhen the DRAListTypeAttributes feature gate is enabled, the includes() helper is available and it can work for both scalar and list-type attributes. It was introduced to support smooth migration from scalar attributes to list-type attributes while keeping CEL expressions simple. For example:\n\n device.attributes[\"dra.example.com\"].models.includes(\"some-model\")\n\nThe length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps.", } func (CELDeviceSelector) SwaggerDoc() map[string]string { @@ -94,7 +94,7 @@ func (CapacityRequestPolicy) SwaggerDoc() map[string]string { } var map_CapacityRequestPolicyRange = map[string]string{ - "": "CapacityRequestPolicyRange defines a valid range for consumable capacity values.\n\n - If the requested amount is less than Min, it is rounded up to the Min value.\n - If Step is set and the requested amount is between Min and Max but not aligned with Step,\n it will be rounded up to the next value equal to Min + (n * Step).\n - If Step is not set, the requested amount is used as-is if it falls within the range Min to Max (if set).\n - If the requested or rounded amount exceeds Max (if set), the request does not satisfy the policy,\n and the device cannot be allocated.", + "": "CapacityRequestPolicyRange defines a valid range for consumable capacity values.\n\nIf the DRAFractionalCapacityRange feature gate is enabled and at least one of Min, Max, or Step is a fractional quantity (i.e. its value is not an integer), milli-unit arithmetic is used instead, supporting values with up to 3 decimal places (e.g. 100m = 0.1). The largest supported value then is 1000 times smaller compared to using 64-bit integers. Otherwise, all comparisons use 64-bit integer arithmetic via resource.Quantity.Value().\n\n - If the requested amount is less than Min, it is rounded up to the Min value.\n - If Step is set and the requested amount is between Min and Max but not aligned with Step,\n it will be rounded up to the next value equal to Min + (n * Step).\n - If Step is not set, the requested amount is used as-is if it falls within the range Min to Max (if set).\n - If the requested or rounded amount exceeds Max (if set), the request does not satisfy the policy,\n and the device cannot be allocated.", "min": "Min specifies the minimum capacity allowed for a consumption request.\n\nMin must be greater than or equal to zero, and less than or equal to the capacity value. requestPolicy.default must be more than or equal to the minimum.", "max": "Max defines the upper limit for capacity that can be requested.\n\nMax must be less than or equal to the capacity value. Min and requestPolicy.default must be less than or equal to the maximum.", "step": "Step defines the step size between valid capacity amounts within the range.\n\nMax (if set) and requestPolicy.default must be a multiple of Step. Min + Step must be less than or equal to the capacity value.", @@ -240,7 +240,7 @@ var map_DeviceClassSpec = map[string]string{ "": "DeviceClassSpec is used in a [DeviceClass] to define what can be allocated and how to configure it.", "selectors": "Each selector must be satisfied by a device which is claimed via this class.", "config": "Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver.\n\nThey are passed to the driver, but are not considered while allocating the claim.", - "extendedResourceName": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.\n\nThis is a beta field.", + "extendedResourceName": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.", } func (DeviceClassSpec) SwaggerDoc() map[string]string { @@ -268,26 +268,38 @@ func (DeviceConstraint) SwaggerDoc() map[string]string { } var map_DeviceCounterConsumption = map[string]string{ - "": "DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet.", - "counterSet": "CounterSet is the name of the set from which the counters defined will be consumed.", - "counters": "Counters defines the counters that will be consumed by the device.\n\nThe maximum number of counters is 32.", + "": "DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet.", + "counterSet": "CounterSet is the name of the set from which the counters defined will be consumed.", + "counters": "Counters defines the counters that will be consumed by the device.\n\nThe maximum number of counters is 32.", + "compatibilityGroups": "CompatibilityGroups is a list of opaque group names for this counter set consumption.\n\nDevices that consume counters from the same counter set may only be allocated at the same time (\"co-allocated\") if they all share at least one common group: the intersection of the CompatibilityGroups of all co-allocated devices on that counter set must be non-empty. Devices that consume from different counter sets are never compared via this field.\n\nAn unset field, an explicit nil, and an empty list are equivalent and mean \"no groups\": such a device is only co-allocatable with sibling devices on the same counter set that also have no groups, and is never co-allocatable with a device that declares one or more groups.\n\nGroup names are opaque and meaningful only within the publishing driver's pool.\n\nThe maximum number of groups is 2, and the names must be unique.", } func (DeviceCounterConsumption) SwaggerDoc() map[string]string { return map_DeviceCounterConsumption } +var map_DeviceDerivedAttribute = map[string]string{ + "": "DeviceDerivedAttribute defines a derived attribute computed via CEL.", + "name": "Name is the identifier for this derived attribute, used in constraints.\n\nIt must be a DNS subdomain followed by a slash (\"/\") followed by a C identifier (e.g. \"example.com/numaNode\" or \"derived/numaNode\").\n\nIf the chosen name matches an existing physical attribute from a driver, the derived attribute's expression will shadow the physical attribute, and its evaluated value will be used in constraints instead. When the goal is to define a derived attribute that is only used within the ResourceClaim and not meant to shadow an existing attribute, use a domain prefix that no DRA driver should be using (e.g. \"derived/myAttribute\").\n\nIt is not valid to define a derived attribute that isn't used in at least one constraint.", + "expression": "Expression is a CEL expression evaluated against each candidate device. The expression must evaluate to a primitive scalar (string, integer, boolean, or semver) or a list of these scalars ([]string, []int64, []bool, []semver) to act as a virtual grouping key. Any other return type is an error and causes CEL evaluation for the device to fail.\n\nThe expression's input is an object named \"device\", which carries the same properties as in a CELDeviceSelector.\n\nWhen pod scheduling encounters CEL runtime errors (such as looking up an attribute that isn't defined) for some devices, it will abort allocation and fail scheduling for the Pod. Surfacing evaluation errors immediately prevents silent topology matching failures that are extremely hard to detect. A robust expression should, for example, check for the existence of attributes before referencing them to avoid runtime evaluation errors.\n\nThe expression gets evaluated after a device has passed the other selector expressions for the request in which this expression is used. This allows writing expressions that are tailored towards the specific devices being requested (for example, by assuming the device is from a certain vendor and skipping those checks).\n\nThe length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps; the combined cost of all derived attributes in a claim is capped by a shared CEL cost budget.", +} + +func (DeviceDerivedAttribute) SwaggerDoc() map[string]string { + return map_DeviceDerivedAttribute +} + var map_DeviceRequest = map[string]string{ - "": "DeviceRequest is a request for devices required for a claim. This is typically a request for a single resource like a device, but can also ask for several identical devices.", - "name": "Name can be used to reference this request in a pod.spec.containers[].resources.claims entry and in a constraint of the claim.\n\nMust be a DNS label and unique among all DeviceRequests in a ResourceClaim.", - "deviceClassName": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this request.\n\nA class is required if no subrequests are specified in the firstAvailable list and no class can be set if subrequests are specified in the firstAvailable list. Which classes are available depends on the cluster.\n\nAdministrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference.", - "selectors": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this request. All selectors must be satisfied for a device to be considered.\n\nThis field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list.", - "allocationMode": "AllocationMode and its related fields define how devices are allocated to satisfy this request. Supported values are:\n\n- ExactCount: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This request is for all of the matching devices in a pool.\n At least one device must exist on the node for the allocation to succeed.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other requests must specify this field.\n\nThis field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", - "count": "Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one.\n\nThis field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list.", - "adminAccess": "AdminAccess indicates that this is a claim for administrative access to the device(s). Claims with AdminAccess are expected to be used for monitoring or other management services for a device. They ignore all ordinary claims to the device with respect to access modes and any resource allocations.\n\nThis field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list.\n\nThis is an alpha field and requires enabling the DRAAdminAccess feature gate. Admin access is disabled if this field is unset or set to false, otherwise it is enabled.", - "firstAvailable": "FirstAvailable contains subrequests, of which exactly one will be satisfied by the scheduler to satisfy this request. It tries to satisfy them in the order in which they are listed here. So if there are two entries in the list, the scheduler will only check the second one if it determines that the first one cannot be used.\n\nThis field may only be set in the entries of DeviceClaim.Requests.\n\nDRA does not yet implement scoring, so the scheduler will select the first set of devices that satisfies all the requests in the claim. And if the requirements can be satisfied on more than one node, other scheduling features will determine which node is chosen. This means that the set of devices allocated to a claim might not be the optimal set available to the cluster. Scoring will be implemented later.", - "tolerations": "If specified, the request's tolerations.\n\nTolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute.\n\nIn addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated.\n\nThe maximum number of tolerations is 16.\n\nThis field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.", - "capacity": "Capacity define resource requirements against each capacity.\n\nIf this field is unset and the device supports multiple allocations, the default value will be applied to each capacity according to requestPolicy. For the capacity that has no requestPolicy, default is the full capacity value.\n\nApplies to each device allocation. If Count > 1, the request fails if there aren't enough devices that meet the requirements. If AllocationMode is set to All, the request fails if there are devices that otherwise match the request, and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request.", + "": "DeviceRequest is a request for devices required for a claim. This is typically a request for a single resource like a device, but can also ask for several identical devices.", + "name": "Name can be used to reference this request in a pod.spec.containers[].resources.claims entry and in a constraint of the claim.\n\nMust be a DNS label and unique among all DeviceRequests in a ResourceClaim.", + "deviceClassName": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this request.\n\nA class is required if no subrequests are specified in the firstAvailable list and no class can be set if subrequests are specified in the firstAvailable list. Which classes are available depends on the cluster.\n\nAdministrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference.", + "selectors": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this request. All selectors must be satisfied for a device to be considered.\n\nThis field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list.", + "allocationMode": "AllocationMode and its related fields define how devices are allocated to satisfy this request. Supported values are:\n\n- ExactCount: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This request is for all of the matching devices in a pool.\n At least one device must exist on the node for the allocation to succeed.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other requests must specify this field.\n\nThis field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", + "count": "Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one.\n\nThis field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list.", + "adminAccess": "AdminAccess indicates that this is a claim for administrative access to the device(s). Claims with AdminAccess are expected to be used for monitoring or other management services for a device. They ignore all ordinary claims to the device with respect to access modes and any resource allocations.\n\nThis field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list.\n\nThis is an alpha field and requires enabling the DRAAdminAccess feature gate. Admin access is disabled if this field is unset or set to false, otherwise it is enabled.", + "firstAvailable": "FirstAvailable contains subrequests, of which exactly one will be satisfied by the scheduler to satisfy this request. It tries to satisfy them in the order in which they are listed here. So if there are two entries in the list, the scheduler will only check the second one if it determines that the first one cannot be used.\n\nThis field may only be set in the entries of DeviceClaim.Requests.\n\nDRA does not yet implement scoring, so the scheduler will select the first set of devices that satisfies all the requests in the claim. And if the requirements can be satisfied on more than one node, other scheduling features will determine which node is chosen. This means that the set of devices allocated to a claim might not be the optimal set available to the cluster. Scoring will be implemented later.", + "tolerations": "If specified, the request's tolerations.\n\nTolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute.\n\nIn addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated.\n\nThe maximum number of tolerations is 16.\n\nThis field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.", + "capacity": "Capacity define resource requirements against each capacity.\n\nIf this field is unset and the device supports multiple allocations, the default value will be applied to each capacity according to requestPolicy. For the capacity that has no requestPolicy, default is the full capacity value.\n\nApplies to each device allocation. If Count > 1, the request fails if there aren't enough devices that meet the requirements. If AllocationMode is set to All, the request fails if there are devices that otherwise match the request, and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request.", + "derivedAttributes": "DerivedAttributes defines a set of virtual attributes computed via CEL expressions for each candidate device. These virtual attributes can be referenced in `.devices.constraints` to align and match different devices (e.g., co-allocating a GPU and a NIC on the same NUMA node) even if their drivers publish different attributes. Derived attributes are not available via `device.attributes` in the CEL environment when evaluating selector expressions.\n\nDerived attributes allow you to extract, transform, or normalize topology information (such as extracting a NUMA index from a complex topology string or renaming a vendor-specific attribute) into a common virtual attribute name at scheduling time. The scheduler then evaluates these virtual attributes exactly like static attributes when matching constraints.\n\nEvery derived attribute defined in this list must be referenced by at least one MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list.\n\nThe maximum number of derived attributes is 32.\n\nThis is an alpha field and requires enabling the DRADerivedAttributes feature gate.", } func (DeviceRequest) SwaggerDoc() map[string]string { @@ -306,6 +318,7 @@ var map_DeviceRequestAllocationResult = map[string]string{ "bindingFailureConditions": "BindingFailureConditions contains a copy of the BindingFailureConditions from the corresponding ResourceSlice at the time of allocation.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", "shareID": "ShareID uniquely identifies an individual allocation share of the device, used when the device supports multiple simultaneous allocations. It serves as an additional map key to differentiate concurrent shares of the same device.", "consumedCapacity": "ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request. The consumed amount may differ from the requested amount: it is rounded up to the nearest valid value based on the device’s requestPolicy if applicable (i.e., may not be less than the requested amount).\n\nThe total consumed capacity for each device must not exceed the DeviceCapacity's Value.\n\nThis field is populated only for devices that allow multiple allocations. All capacity entries are included, even if the consumed amount is zero.", + "skipNodeOperations": "SkipNodeOperations lists node-local resource operations (gRPC calls) that will be skipped for this allocated device when determining whether operations are necessary on the node. If all allocated devices for a driver in a claim skip an operation, that gRPC call will be skipped. It is a copy of the ResourceSlice.spec.skipNodeOperations value at the time when the device was allocated.", } func (DeviceRequestAllocationResult) SwaggerDoc() map[string]string { @@ -322,14 +335,15 @@ func (DeviceSelector) SwaggerDoc() map[string]string { } var map_DeviceSubRequest = map[string]string{ - "": "DeviceSubRequest describes a request for device provided in the claim.spec.devices.requests[].firstAvailable array. Each is typically a request for a single resource like a device, but can also ask for several identical devices.\n\nDeviceSubRequest is similar to Request, but doesn't expose the AdminAccess or FirstAvailable fields, as those can only be set on the top-level request. AdminAccess is not supported for requests with a prioritized list, and recursive FirstAvailable fields are not supported.", - "name": "Name can be used to reference this subrequest in the list of constraints or the list of configurations for the claim. References must use the format
/.\n\nMust be a DNS label.", - "deviceClassName": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this subrequest.\n\nA class is required. Which classes are available depends on the cluster.\n\nAdministrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference.", - "selectors": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this subrequest. All selectors must be satisfied for a device to be considered.", - "allocationMode": "AllocationMode and its related fields define how devices are allocated to satisfy this subrequest. Supported values are:\n\n- ExactCount: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This subrequest is for all of the matching devices in a pool.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other subrequests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", - "count": "Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one.", - "tolerations": "If specified, the request's tolerations.\n\nTolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute.\n\nIn addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated.\n\nThe maximum number of tolerations is 16.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.", - "capacity": "Capacity define resource requirements against each capacity.\n\nIf this field is unset and the device supports multiple allocations, the default value will be applied to each capacity according to requestPolicy. For the capacity that has no requestPolicy, default is the full capacity value.\n\nApplies to each device allocation. If Count > 1, the request fails if there aren't enough devices that meet the requirements. If AllocationMode is set to All, the request fails if there are devices that otherwise match the request, and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request.", + "": "DeviceSubRequest describes a request for device provided in the claim.spec.devices.requests[].firstAvailable array. Each is typically a request for a single resource like a device, but can also ask for several identical devices.\n\nDeviceSubRequest is similar to Request, but doesn't expose the AdminAccess or FirstAvailable fields, as those can only be set on the top-level request. AdminAccess is not supported for requests with a prioritized list, and recursive FirstAvailable fields are not supported.", + "name": "Name can be used to reference this subrequest in the list of constraints or the list of configurations for the claim. References must use the format
/.\n\nMust be a DNS label.", + "deviceClassName": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this subrequest.\n\nA class is required. Which classes are available depends on the cluster.\n\nAdministrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference.", + "selectors": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this subrequest. All selectors must be satisfied for a device to be considered.", + "allocationMode": "AllocationMode and its related fields define how devices are allocated to satisfy this subrequest. Supported values are:\n\n- ExactCount: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This subrequest is for all of the matching devices in a pool.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other subrequests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", + "count": "Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one.", + "tolerations": "If specified, the request's tolerations.\n\nTolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute.\n\nIn addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated.\n\nThe maximum number of tolerations is 16.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.", + "capacity": "Capacity define resource requirements against each capacity.\n\nIf this field is unset and the device supports multiple allocations, the default value will be applied to each capacity according to requestPolicy. For the capacity that has no requestPolicy, default is the full capacity value.\n\nApplies to each device allocation. If Count > 1, the request fails if there aren't enough devices that meet the requirements. If AllocationMode is set to All, the request fails if there are devices that otherwise match the request, and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request.", + "derivedAttributes": "DerivedAttributes defines a set of virtual attributes computed via CEL expressions for each candidate device. These virtual attributes can be referenced in `.devices.constraints` to align and match different devices (e.g., co-allocating a GPU and a NIC on the same NUMA node) even if their drivers publish different attributes. Derived attributes are not available via `device.attributes` in the CEL environment when evaluating selector expressions.\n\nDerived attributes allow you to extract, transform, or normalize topology information (such as extracting a NUMA index from a complex topology string or renaming a vendor-specific attribute) into a common virtual attribute name at scheduling time. The scheduler then evaluates these virtual attributes exactly like static attributes when matching constraints.\n\nEvery derived attribute defined in this list must be referenced by at least one MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list.\n\nThe maximum number of derived attributes is 32.\n\nThis is an alpha field and requires enabling the DRADerivedAttributes feature gate.", } func (DeviceSubRequest) SwaggerDoc() map[string]string { @@ -372,14 +386,35 @@ func (NetworkDeviceData) SwaggerDoc() map[string]string { return map_NetworkDeviceData } -var map_NodeAllocatableResourceMapping = map[string]string{ - "": "NodeAllocatableResourceMapping defines the translation between the DRA device/capacity units requested to the corresponding quantity of the node allocatable resource.", - "capacityKey": "CapacityKey references a capacity name defined as a key in the `spec.devices[*].capacity` map. When this field is set, the value associated with this key in the `status.allocation.devices.results[*].consumedCapacity` map (for a specific claim allocation) determines the base quantity for the node allocatable resource. If `allocationMultiplier` is also set, it is multiplied with the base quantity. For example, if `spec.devices[*].capacity` has an entry \"dra.example.com/memory\": \"128Gi\", and this field is set to \"dra.example.com/memory\", then for a claim allocation that consumes { \"dra.example.com/memory\": \"4Gi\" } the base quantity for the node allocatable resource mapping will be \"4Gi\", and `allocationMultiplier` should be omitted or set to \"1\".", - "allocationMultiplier": "AllocationMultiplier is used as a multiplier for the allocated device count or the allocated capacity in the claim. It defaults to 1 if not specified. How the field is used also depends on whether `capacityKey` is set. 1. If `capacityKey` is NOT set: `allocationMultiplier` multiplies the device count allocated to the claim.\n\t a. A DRA driver representing each CPU core as a device would have\n {ResourceName: \"cpu\", allocationMultiplier: \"2\"} in its\n `nodeAllocatableResourceMappings`. If 4 devices are allocated to the claim,\n\t\t 4 * 2 CPUs would be considered as allocated and subtracted from the node's capacity.\n b. A GPU device that needs additional node memory per GPU allocation would\n have {ResourceName: \"memory\", allocationMultiplier: \"2Gi\"}. Each allocated\n\t\t GPU device instance of this type will account for 2Gi of memory.\n\n2. If `capacityKey` IS set: `allocationMultiplier` is multiplied by the amount of that capacity consumed.\n\t The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `allocationMultiplier`.\n For example, if a Device's capacity \"dra.example.com/cores\" is consumed,\n and each \"core\" provides 2 \"cpu\"s, the mapping would be:\n {ResourceName: \"cpu\", capacityKey: \"dra.example.com/cores\", allocationMultiplier: \"2\"}.\n If a claim consumes 8 \"dra.example.com/cores\", the CPU footprint is 8 * 2 = 16.", +var map_NodeAllocatableMapping = map[string]string{ + "": "NodeAllocatableMapping defines how a DRA allocation directly translates into a node allocatable resource quantity. The mapping can be derived from either the count of allocated devices or the specific capacity consumed. These options are mutually exclusive. Kubelet adds this mapped resource quantity from claim to both requests and limits at the pod-level cgroup, and to limits at the container-level cgroup for each container referencing the claim.", + "capacityKey": "CapacityKey references a capacity name defined as a key in the `spec.devices[*].capacity` map. When this field is set, the value associated with this key in the `status.allocation.devices.results[*].consumedCapacity` map (for a specific claim allocation) determines the base quantity for the node allocatable resource. `capacityMultiplier` must also be set and is multiplied with the base quantity. For example, if `spec.devices[*].capacity` has an entry \"dra.example.com/memory\": \"128Gi\", and this field is set to \"dra.example.com/memory\", then for a claim allocation that consumes { \"dra.example.com/memory\": \"4Gi\" } the base quantity for the node allocatable resource mapping will be \"4Gi\". The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`.", + "capacityMultiplier": "CapacityMultiplier is used as a multiplier for the allocated capacity consumed. It is only valid if `capacityKey` is set. The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. For example, if a Device's capacity \"dra.example.com/cores\" is consumed, and each \"core\" provides 2 \"cpu\"s, the mapping would be: {ResourceName: \"cpu\", capacityKey: \"dra.example.com/cores\", capacityMultiplier: \"2\"}. If a claim consumes 8 \"dra.example.com/cores\", the CPU footprint is 8 * 2 = 16.", + "deviceMultiplier": "DeviceMultiplier is used as a multiplier for the allocated device count in the claim. The final node allocatable resource amount is `deviceCount` * `deviceMultiplier`. For example, a DRA driver representing each cache complex (CCX) as a device would have {ResourceName: \"cpu\", deviceMultiplier: \"8\"} in its `nodeAllocatableResources`. If 2 devices (CCX) are allocated to the claim, 2 * 8 = 16 CPUs would be considered as allocated. It is only valid when `capacityKey` and `capacityMultiplier` are not set.", +} + +func (NodeAllocatableMapping) SwaggerDoc() map[string]string { + return map_NodeAllocatableMapping +} + +var map_NodeAllocatableOverhead = map[string]string{ + "": "NodeAllocatableOverhead defines auxiliary resource overheads incurred when allocating a device. Overheads can be specified as a fixed cost per pod referencing the claim, a variable cost per container reference, or both. Kubelet accounts for this overhead by adding it to both the pod-level and container-level cgroups of referencing containers.", + "perPod": "PerPod is overhead applied once per pod referencing the claim on this node. This is a flat overhead incurred for every pod referencing the claim.", + "perContainer": "PerContainer is applied per container reference to the claim. This models overhead scaling linearly with the number of containers actively using the device. When both PerPod and PerContainer are specified, the total overhead allocated for each pod referencing the claim is computed as: Quantity = PerPod + (PerContainer * NumReferences) Kubelet accounts for this overhead in cgroups: - Pod-level cgroup (requests and limits): Kubelet adds PerPod + (PerContainer * NumReferences). - Container-level cgroup (limits only): Kubelet adds PerPod + PerContainer for each referencing container. This allows any single container to access the pod-level overhead, while the parent cgroup caps the total usage to account for PerPod exactly once.", +} + +func (NodeAllocatableOverhead) SwaggerDoc() map[string]string { + return map_NodeAllocatableOverhead +} + +var map_NodeAllocatableResource = map[string]string{ + "": "NodeAllocatableResource defines the translation between the DRA device/capacity units requested to the corresponding quantity of the node allocatable resource. At least one of Mapping or Overhead must be specified. Not specifying either is an invalid configuration.", + "mapping": "Mapping is used when the device directly models a node allocatable resource like standard CPU or memory (e.g., with a CPU DRA driver). The calculated quantity is accounted for exactly once per claim instance on the node. To prevent node cgroup isolation friction, the scheduler explicitly blocks sharing mapped device claims across multiple pods.", + "overhead": "Overhead contains fields for modeling auxiliary overhead incurred on node allocatable resources when allocating devices that are not themselves modeling a node allocatable resource (e.g., host memory overhead for GPUs). Sharing overhead-mapped claims across multiple pods is allowed. The node allocatable overhead is accounted for individually for each pod referencing the claim. Overhead is always subtracted from the node's allocatable capacity for the resource, even when mapping is specified for the same resource. Eg: If a device models memory capacity per socket as a consumable capacity pool via Mapping (with CapacityKey), any overhead specified for the same resource will be subtracted from the node's general allocatable capacity and not from the per-socket capacity pool in Mapping.", } -func (NodeAllocatableResourceMapping) SwaggerDoc() map[string]string { - return map_NodeAllocatableResourceMapping +func (NodeAllocatableResource) SwaggerDoc() map[string]string { + return map_NodeAllocatableResource } var map_OpaqueDeviceConfiguration = map[string]string{ @@ -477,7 +512,7 @@ func (ResourceClaimTemplateSpec) SwaggerDoc() map[string]string { var map_ResourcePool = map[string]string{ "": "ResourcePool describes the pool that ResourceSlices belong to.", - "name": "Name is used to identify the pool. For node-local devices, this is often the node name, but this is not required.\n\nIt must not be longer than 253 characters and must consist of one or more DNS sub-domains separated by slashes. This field is immutable.", + "name": "Name is used to identify the pool. For node-local devices, this is often the node name, but this is not required. A field selector can be used to list only ResourceSlice objects belonging to a certain pool.\n\nIt must not be longer than 253 characters and must consist of one or more DNS sub-domains separated by slashes. This field is immutable.", "generation": "Generation tracks the change in a pool over time. Whenever a driver changes something about one or more of the resources in a pool, it must change the generation in all ResourceSlices which are part of that pool. Consumers of ResourceSlices should only consider resources from the pool with the highest generation number. The generation may be reset by drivers, which should be fine for consumers, assuming that all ResourceSlices in a pool are updated to match or deleted.\n\nCombined with ResourceSliceCount, this mechanism enables consumers to detect pools which are comprised of multiple ResourceSlices and are in an incomplete state.", "resourceSliceCount": "ResourceSliceCount is the total number of ResourceSlices in the pool at this generation number. Must be greater than zero.\n\nConsumers can use this to check whether they have seen all ResourceSlices belonging to the same pool.", } @@ -516,6 +551,8 @@ var map_ResourceSliceSpec = map[string]string{ "devices": "Devices lists some or all of the devices in this pool.\n\nMust not have more than 128 entries. If any device uses taints or consumes counters the limit is 64.\n\nOnly one of Devices and SharedCounters can be set in a ResourceSlice.", "perDeviceNodeSelection": "PerDeviceNodeSelection defines whether the access from nodes to resources in the pool is set on the ResourceSlice level or on each device. If it is set to true, every device defined the ResourceSlice must specify this individually.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.", "sharedCounters": "SharedCounters defines a list of counter sets, each of which has a name and a list of counters available.\n\nThe names of the counter sets must be unique in the ResourcePool.\n\nOnly one of Devices and SharedCounters can be set in a ResourceSlice.\n\nThe maximum number of counter sets is 8.", + "partitionTypeAttribute": "PartitionTypeAttribute names a string device attribute (by fully qualified name, e.g. \"gpu.example.com/profile\") whose value labels each device with its partition type, such as \"Full\" or \"Half\" for a MIG-style GPU.\n\nWhen set, every partitionable device in the slice must carry the attribute and devices sharing a value must share the same ConsumesCounters cost.", + "skipNodeOperations": "SkipNodeOperations lists node-local resource operations (gRPC calls) that will be skipped for the devices in this slice when determining whether operations are necessary on the node. If all allocated devices for a driver in a claim skip an operation, that gRPC call will be skipped. Valid values are:\n\n- \"NodePrepareResources\": NodePrepareResources gRPC calls are skipped. This\n value cannot be specified unless \"NodeUnprepareResources\" is also listed\n (or \"*\" is specified).\n- \"NodeUnprepareResources\": NodeUnprepareResources gRPC calls are skipped. - \"*\": All node-local resource operations are skipped.\n\nOther values may be added in the future. The kubelet must ignore unknown values.", } func (ResourceSliceSpec) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/resource/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/resource/v1beta1/zz_generated.deepcopy.go index 78ec7b0d58..85ec2bdf68 100644 --- a/vendor/k8s.io/api/resource/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/resource/v1beta1/zz_generated.deepcopy.go @@ -159,9 +159,9 @@ func (in *BasicDevice) DeepCopyInto(out *BasicDevice) { *out = new(bool) **out = **in } - if in.NodeAllocatableResourceMappings != nil { - in, out := &in.NodeAllocatableResourceMappings, &out.NodeAllocatableResourceMappings - *out = make(map[corev1.ResourceName]NodeAllocatableResourceMapping, len(*in)) + if in.NodeAllocatableResources != nil { + in, out := &in.NodeAllocatableResources, &out.NodeAllocatableResources + *out = make(map[corev1.ResourceName]NodeAllocatableResource, len(*in)) for key, val := range *in { (*out)[key] = *val.DeepCopy() } @@ -706,6 +706,11 @@ func (in *DeviceCounterConsumption) DeepCopyInto(out *DeviceCounterConsumption) (*out)[key] = *val.DeepCopy() } } + if in.CompatibilityGroups != nil { + in, out := &in.CompatibilityGroups, &out.CompatibilityGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } return } @@ -719,6 +724,22 @@ func (in *DeviceCounterConsumption) DeepCopy() *DeviceCounterConsumption { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceDerivedAttribute) DeepCopyInto(out *DeviceDerivedAttribute) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceDerivedAttribute. +func (in *DeviceDerivedAttribute) DeepCopy() *DeviceDerivedAttribute { + if in == nil { + return nil + } + out := new(DeviceDerivedAttribute) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeviceRequest) DeepCopyInto(out *DeviceRequest) { *out = *in @@ -753,6 +774,11 @@ func (in *DeviceRequest) DeepCopyInto(out *DeviceRequest) { *out = new(CapacityRequirements) (*in).DeepCopyInto(*out) } + if in.DerivedAttributes != nil { + in, out := &in.DerivedAttributes, &out.DerivedAttributes + *out = make([]DeviceDerivedAttribute, len(*in)) + copy(*out, *in) + } return } @@ -803,6 +829,11 @@ func (in *DeviceRequestAllocationResult) DeepCopyInto(out *DeviceRequestAllocati (*out)[key] = val.DeepCopy() } } + if in.SkipNodeOperations != nil { + in, out := &in.SkipNodeOperations, &out.SkipNodeOperations + *out = make([]SkipNodeOperation, len(*in)) + copy(*out, *in) + } return } @@ -859,6 +890,11 @@ func (in *DeviceSubRequest) DeepCopyInto(out *DeviceSubRequest) { *out = new(CapacityRequirements) (*in).DeepCopyInto(*out) } + if in.DerivedAttributes != nil { + in, out := &in.DerivedAttributes, &out.DerivedAttributes + *out = make([]DeviceDerivedAttribute, len(*in)) + copy(*out, *in) + } return } @@ -935,27 +971,84 @@ func (in *NetworkDeviceData) DeepCopy() *NetworkDeviceData { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeAllocatableResourceMapping) DeepCopyInto(out *NodeAllocatableResourceMapping) { +func (in *NodeAllocatableMapping) DeepCopyInto(out *NodeAllocatableMapping) { *out = *in if in.CapacityKey != nil { in, out := &in.CapacityKey, &out.CapacityKey *out = new(QualifiedName) **out = **in } - if in.AllocationMultiplier != nil { - in, out := &in.AllocationMultiplier, &out.AllocationMultiplier + if in.CapacityMultiplier != nil { + in, out := &in.CapacityMultiplier, &out.CapacityMultiplier + x := (*in).DeepCopy() + *out = &x + } + if in.DeviceMultiplier != nil { + in, out := &in.DeviceMultiplier, &out.DeviceMultiplier x := (*in).DeepCopy() *out = &x } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocatableResourceMapping. -func (in *NodeAllocatableResourceMapping) DeepCopy() *NodeAllocatableResourceMapping { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocatableMapping. +func (in *NodeAllocatableMapping) DeepCopy() *NodeAllocatableMapping { if in == nil { return nil } - out := new(NodeAllocatableResourceMapping) + out := new(NodeAllocatableMapping) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeAllocatableOverhead) DeepCopyInto(out *NodeAllocatableOverhead) { + *out = *in + if in.PerPod != nil { + in, out := &in.PerPod, &out.PerPod + x := (*in).DeepCopy() + *out = &x + } + if in.PerContainer != nil { + in, out := &in.PerContainer, &out.PerContainer + x := (*in).DeepCopy() + *out = &x + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocatableOverhead. +func (in *NodeAllocatableOverhead) DeepCopy() *NodeAllocatableOverhead { + if in == nil { + return nil + } + out := new(NodeAllocatableOverhead) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeAllocatableResource) DeepCopyInto(out *NodeAllocatableResource) { + *out = *in + if in.Mapping != nil { + in, out := &in.Mapping, &out.Mapping + *out = new(NodeAllocatableMapping) + (*in).DeepCopyInto(*out) + } + if in.Overhead != nil { + in, out := &in.Overhead, &out.Overhead + *out = new(NodeAllocatableOverhead) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocatableResource. +func (in *NodeAllocatableResource) DeepCopy() *NodeAllocatableResource { + if in == nil { + return nil + } + out := new(NodeAllocatableResource) in.DeepCopyInto(out) return out } @@ -1286,6 +1379,16 @@ func (in *ResourceSliceSpec) DeepCopyInto(out *ResourceSliceSpec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.PartitionTypeAttribute != nil { + in, out := &in.PartitionTypeAttribute, &out.PartitionTypeAttribute + *out = new(FullyQualifiedName) + **out = **in + } + if in.SkipNodeOperations != nil { + in, out := &in.SkipNodeOperations, &out.SkipNodeOperations + *out = make([]SkipNodeOperation, len(*in)) + copy(*out, *in) + } return } diff --git a/vendor/k8s.io/api/resource/v1beta1/zz_generated.model_name.go b/vendor/k8s.io/api/resource/v1beta1/zz_generated.model_name.go index a2887e7534..783ec0312d 100644 --- a/vendor/k8s.io/api/resource/v1beta1/zz_generated.model_name.go +++ b/vendor/k8s.io/api/resource/v1beta1/zz_generated.model_name.go @@ -136,6 +136,11 @@ func (in DeviceCounterConsumption) OpenAPIModelName() string { return "io.k8s.api.resource.v1beta1.DeviceCounterConsumption" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DeviceDerivedAttribute) OpenAPIModelName() string { + return "io.k8s.api.resource.v1beta1.DeviceDerivedAttribute" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in DeviceRequest) OpenAPIModelName() string { return "io.k8s.api.resource.v1beta1.DeviceRequest" @@ -172,8 +177,18 @@ func (in NetworkDeviceData) OpenAPIModelName() string { } // OpenAPIModelName returns the OpenAPI model name for this type. -func (in NodeAllocatableResourceMapping) OpenAPIModelName() string { - return "io.k8s.api.resource.v1beta1.NodeAllocatableResourceMapping" +func (in NodeAllocatableMapping) OpenAPIModelName() string { + return "io.k8s.api.resource.v1beta1.NodeAllocatableMapping" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeAllocatableOverhead) OpenAPIModelName() string { + return "io.k8s.api.resource.v1beta1.NodeAllocatableOverhead" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeAllocatableResource) OpenAPIModelName() string { + return "io.k8s.api.resource.v1beta1.NodeAllocatableResource" } // OpenAPIModelName returns the OpenAPI model name for this type. diff --git a/vendor/k8s.io/api/resource/v1beta2/generated.pb.go b/vendor/k8s.io/api/resource/v1beta2/generated.pb.go index 6b59098807..d1aae258ea 100644 --- a/vendor/k8s.io/api/resource/v1beta2/generated.pb.go +++ b/vendor/k8s.io/api/resource/v1beta2/generated.pb.go @@ -82,6 +82,8 @@ func (m *DeviceConstraint) Reset() { *m = DeviceConstraint{} } func (m *DeviceCounterConsumption) Reset() { *m = DeviceCounterConsumption{} } +func (m *DeviceDerivedAttribute) Reset() { *m = DeviceDerivedAttribute{} } + func (m *DeviceRequest) Reset() { *m = DeviceRequest{} } func (m *DeviceRequestAllocationResult) Reset() { *m = DeviceRequestAllocationResult{} } @@ -108,7 +110,11 @@ func (m *ExactDeviceRequest) Reset() { *m = ExactDeviceRequest{} } func (m *NetworkDeviceData) Reset() { *m = NetworkDeviceData{} } -func (m *NodeAllocatableResourceMapping) Reset() { *m = NodeAllocatableResourceMapping{} } +func (m *NodeAllocatableMapping) Reset() { *m = NodeAllocatableMapping{} } + +func (m *NodeAllocatableOverhead) Reset() { *m = NodeAllocatableOverhead{} } + +func (m *NodeAllocatableResource) Reset() { *m = NodeAllocatableResource{} } func (m *OpaqueDeviceConfiguration) Reset() { *m = OpaqueDeviceConfiguration{} } @@ -586,14 +592,14 @@ func (m *Device) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.NodeAllocatableResourceMappings) > 0 { - keysForNodeAllocatableResourceMappings := make([]string, 0, len(m.NodeAllocatableResourceMappings)) - for k := range m.NodeAllocatableResourceMappings { - keysForNodeAllocatableResourceMappings = append(keysForNodeAllocatableResourceMappings, string(k)) - } - sort.Strings(keysForNodeAllocatableResourceMappings) - for iNdEx := len(keysForNodeAllocatableResourceMappings) - 1; iNdEx >= 0; iNdEx-- { - v := m.NodeAllocatableResourceMappings[k8s_io_api_core_v1.ResourceName(keysForNodeAllocatableResourceMappings[iNdEx])] + if len(m.NodeAllocatableResources) > 0 { + keysForNodeAllocatableResources := make([]string, 0, len(m.NodeAllocatableResources)) + for k := range m.NodeAllocatableResources { + keysForNodeAllocatableResources = append(keysForNodeAllocatableResources, string(k)) + } + sort.Strings(keysForNodeAllocatableResources) + for iNdEx := len(keysForNodeAllocatableResources) - 1; iNdEx >= 0; iNdEx-- { + v := m.NodeAllocatableResources[k8s_io_api_core_v1.ResourceName(keysForNodeAllocatableResources[iNdEx])] baseI := i { size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) @@ -605,14 +611,14 @@ func (m *Device) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x12 - i -= len(keysForNodeAllocatableResourceMappings[iNdEx]) - copy(dAtA[i:], keysForNodeAllocatableResourceMappings[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(keysForNodeAllocatableResourceMappings[iNdEx]))) + i -= len(keysForNodeAllocatableResources[iNdEx]) + copy(dAtA[i:], keysForNodeAllocatableResources[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForNodeAllocatableResources[iNdEx]))) i-- dAtA[i] = 0xa i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) i-- - dAtA[i] = 0x6a + dAtA[i] = 0x72 } } if m.AllowMultipleAllocations != nil { @@ -1397,6 +1403,15 @@ func (m *DeviceCounterConsumption) MarshalToSizedBuffer(dAtA []byte) (int, error _ = i var l int _ = l + if len(m.CompatibilityGroups) > 0 { + for iNdEx := len(m.CompatibilityGroups) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CompatibilityGroups[iNdEx]) + copy(dAtA[i:], m.CompatibilityGroups[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.CompatibilityGroups[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } if len(m.Counters) > 0 { keysForCounters := make([]string, 0, len(m.Counters)) for k := range m.Counters { @@ -1434,6 +1449,39 @@ func (m *DeviceCounterConsumption) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *DeviceDerivedAttribute) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeviceDerivedAttribute) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeviceDerivedAttribute) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Expression) + copy(dAtA[i:], m.Expression) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Expression))) + i-- + dAtA[i] = 0x12 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *DeviceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1508,6 +1556,15 @@ func (m *DeviceRequestAllocationResult) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l + if len(m.SkipNodeOperations) > 0 { + for iNdEx := len(m.SkipNodeOperations) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SkipNodeOperations[iNdEx]) + copy(dAtA[i:], m.SkipNodeOperations[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SkipNodeOperations[iNdEx]))) + i-- + dAtA[i] = 0x5a + } + } if len(m.ConsumedCapacity) > 0 { keysForConsumedCapacity := make([]string, 0, len(m.ConsumedCapacity)) for k := range m.ConsumedCapacity { @@ -1664,6 +1721,20 @@ func (m *DeviceSubRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.DerivedAttributes) > 0 { + for iNdEx := len(m.DerivedAttributes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DerivedAttributes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } if m.Capacity != nil { { size, err := m.Capacity.MarshalToSizedBuffer(dAtA[:i]) @@ -2069,6 +2140,20 @@ func (m *ExactDeviceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.DerivedAttributes) > 0 { + for iNdEx := len(m.DerivedAttributes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DerivedAttributes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } if m.Capacity != nil { { size, err := m.Capacity.MarshalToSizedBuffer(dAtA[:i]) @@ -2177,7 +2262,7 @@ func (m *NetworkDeviceData) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *NodeAllocatableResourceMapping) Marshal() (dAtA []byte, err error) { +func (m *NodeAllocatableMapping) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2187,19 +2272,31 @@ func (m *NodeAllocatableResourceMapping) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *NodeAllocatableResourceMapping) MarshalTo(dAtA []byte) (int, error) { +func (m *NodeAllocatableMapping) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *NodeAllocatableResourceMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *NodeAllocatableMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.AllocationMultiplier != nil { + if m.DeviceMultiplier != nil { + { + size, err := m.DeviceMultiplier.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.CapacityMultiplier != nil { { - size, err := m.AllocationMultiplier.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.CapacityMultiplier.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2219,6 +2316,100 @@ func (m *NodeAllocatableResourceMapping) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *NodeAllocatableOverhead) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NodeAllocatableOverhead) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeAllocatableOverhead) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PerContainer != nil { + { + size, err := m.PerContainer.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.PerPod != nil { + { + size, err := m.PerPod.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NodeAllocatableResource) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NodeAllocatableResource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeAllocatableResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Overhead != nil { + { + size, err := m.Overhead.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Mapping != nil { + { + size, err := m.Mapping.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} + func (m *OpaqueDeviceConfiguration) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2773,6 +2964,22 @@ func (m *ResourceSliceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.SkipNodeOperations) > 0 { + for iNdEx := len(m.SkipNodeOperations) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SkipNodeOperations[iNdEx]) + copy(dAtA[i:], m.SkipNodeOperations[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SkipNodeOperations[iNdEx]))) + i-- + dAtA[i] = 0x52 + } + } + if m.PartitionTypeAttribute != nil { + i -= len(*m.PartitionTypeAttribute) + copy(dAtA[i:], *m.PartitionTypeAttribute) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PartitionTypeAttribute))) + i-- + dAtA[i] = 0x4a + } if len(m.SharedCounters) > 0 { for iNdEx := len(m.SharedCounters) - 1; iNdEx >= 0; iNdEx-- { { @@ -3092,8 +3299,8 @@ func (m *Device) Size() (n int) { if m.AllowMultipleAllocations != nil { n += 2 } - if len(m.NodeAllocatableResourceMappings) > 0 { - for k, v := range m.NodeAllocatableResourceMappings { + if len(m.NodeAllocatableResources) > 0 { + for k, v := range m.NodeAllocatableResources { _ = k _ = v l = v.Size() @@ -3365,6 +3572,25 @@ func (m *DeviceCounterConsumption) Size() (n int) { n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) } } + if len(m.CompatibilityGroups) > 0 { + for _, s := range m.CompatibilityGroups { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *DeviceDerivedAttribute) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Expression) + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -3437,6 +3663,12 @@ func (m *DeviceRequestAllocationResult) Size() (n int) { n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) } } + if len(m.SkipNodeOperations) > 0 { + for _, s := range m.SkipNodeOperations { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -3482,6 +3714,12 @@ func (m *DeviceSubRequest) Size() (n int) { l = m.Capacity.Size() n += 1 + l + sovGenerated(uint64(l)) } + if len(m.DerivedAttributes) > 0 { + for _, e := range m.DerivedAttributes { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -3637,6 +3875,12 @@ func (m *ExactDeviceRequest) Size() (n int) { l = m.Capacity.Size() n += 1 + l + sovGenerated(uint64(l)) } + if len(m.DerivedAttributes) > 0 { + for _, e := range m.DerivedAttributes { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -3659,7 +3903,7 @@ func (m *NetworkDeviceData) Size() (n int) { return n } -func (m *NodeAllocatableResourceMapping) Size() (n int) { +func (m *NodeAllocatableMapping) Size() (n int) { if m == nil { return 0 } @@ -3669,8 +3913,46 @@ func (m *NodeAllocatableResourceMapping) Size() (n int) { l = len(*m.CapacityKey) n += 1 + l + sovGenerated(uint64(l)) } - if m.AllocationMultiplier != nil { - l = m.AllocationMultiplier.Size() + if m.CapacityMultiplier != nil { + l = m.CapacityMultiplier.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.DeviceMultiplier != nil { + l = m.DeviceMultiplier.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NodeAllocatableOverhead) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PerPod != nil { + l = m.PerPod.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.PerContainer != nil { + l = m.PerContainer.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *NodeAllocatableResource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Mapping != nil { + l = m.Mapping.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Overhead != nil { + l = m.Overhead.Size() n += 1 + l + sovGenerated(uint64(l)) } return n @@ -3896,6 +4178,16 @@ func (m *ResourceSliceSpec) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } + if m.PartitionTypeAttribute != nil { + l = len(*m.PartitionTypeAttribute) + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.SkipNodeOperations) > 0 { + for _, s := range m.SkipNodeOperations { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } return n } @@ -4062,16 +4354,16 @@ func (this *Device) String() string { mapStringForCapacity += fmt.Sprintf("%v: %v,", k, this.Capacity[QualifiedName(k)]) } mapStringForCapacity += "}" - keysForNodeAllocatableResourceMappings := make([]string, 0, len(this.NodeAllocatableResourceMappings)) - for k := range this.NodeAllocatableResourceMappings { - keysForNodeAllocatableResourceMappings = append(keysForNodeAllocatableResourceMappings, string(k)) + keysForNodeAllocatableResources := make([]string, 0, len(this.NodeAllocatableResources)) + for k := range this.NodeAllocatableResources { + keysForNodeAllocatableResources = append(keysForNodeAllocatableResources, string(k)) } - sort.Strings(keysForNodeAllocatableResourceMappings) - mapStringForNodeAllocatableResourceMappings := "map[k8s_io_api_core_v1.ResourceName]NodeAllocatableResourceMapping{" - for _, k := range keysForNodeAllocatableResourceMappings { - mapStringForNodeAllocatableResourceMappings += fmt.Sprintf("%v: %v,", k, this.NodeAllocatableResourceMappings[k8s_io_api_core_v1.ResourceName(k)]) + sort.Strings(keysForNodeAllocatableResources) + mapStringForNodeAllocatableResources := "map[k8s_io_api_core_v1.ResourceName]NodeAllocatableResource{" + for _, k := range keysForNodeAllocatableResources { + mapStringForNodeAllocatableResources += fmt.Sprintf("%v: %v,", k, this.NodeAllocatableResources[k8s_io_api_core_v1.ResourceName(k)]) } - mapStringForNodeAllocatableResourceMappings += "}" + mapStringForNodeAllocatableResources += "}" s := strings.Join([]string{`&Device{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Attributes:` + mapStringForAttributes + `,`, @@ -4085,7 +4377,7 @@ func (this *Device) String() string { `BindingConditions:` + fmt.Sprintf("%v", this.BindingConditions) + `,`, `BindingFailureConditions:` + fmt.Sprintf("%v", this.BindingFailureConditions) + `,`, `AllowMultipleAllocations:` + valueToStringGenerated(this.AllowMultipleAllocations) + `,`, - `NodeAllocatableResourceMappings:` + mapStringForNodeAllocatableResourceMappings + `,`, + `NodeAllocatableResources:` + mapStringForNodeAllocatableResources + `,`, `}`, }, "") return s @@ -4287,6 +4579,18 @@ func (this *DeviceCounterConsumption) String() string { s := strings.Join([]string{`&DeviceCounterConsumption{`, `CounterSet:` + fmt.Sprintf("%v", this.CounterSet) + `,`, `Counters:` + mapStringForCounters + `,`, + `CompatibilityGroups:` + fmt.Sprintf("%v", this.CompatibilityGroups) + `,`, + `}`, + }, "") + return s +} +func (this *DeviceDerivedAttribute) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DeviceDerivedAttribute{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Expression:` + fmt.Sprintf("%v", this.Expression) + `,`, `}`, }, "") return s @@ -4338,6 +4642,7 @@ func (this *DeviceRequestAllocationResult) String() string { `BindingFailureConditions:` + fmt.Sprintf("%v", this.BindingFailureConditions) + `,`, `ShareID:` + valueToStringGenerated(this.ShareID) + `,`, `ConsumedCapacity:` + mapStringForConsumedCapacity + `,`, + `SkipNodeOperations:` + fmt.Sprintf("%v", this.SkipNodeOperations) + `,`, `}`, }, "") return s @@ -4366,6 +4671,11 @@ func (this *DeviceSubRequest) String() string { repeatedStringForTolerations += strings.Replace(strings.Replace(f.String(), "DeviceToleration", "DeviceToleration", 1), `&`, ``, 1) + "," } repeatedStringForTolerations += "}" + repeatedStringForDerivedAttributes := "[]DeviceDerivedAttribute{" + for _, f := range this.DerivedAttributes { + repeatedStringForDerivedAttributes += strings.Replace(strings.Replace(f.String(), "DeviceDerivedAttribute", "DeviceDerivedAttribute", 1), `&`, ``, 1) + "," + } + repeatedStringForDerivedAttributes += "}" s := strings.Join([]string{`&DeviceSubRequest{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `DeviceClassName:` + fmt.Sprintf("%v", this.DeviceClassName) + `,`, @@ -4374,6 +4684,7 @@ func (this *DeviceSubRequest) String() string { `Count:` + fmt.Sprintf("%v", this.Count) + `,`, `Tolerations:` + repeatedStringForTolerations + `,`, `Capacity:` + strings.Replace(this.Capacity.String(), "CapacityRequirements", "CapacityRequirements", 1) + `,`, + `DerivedAttributes:` + repeatedStringForDerivedAttributes + `,`, `}`, }, "") return s @@ -4472,6 +4783,11 @@ func (this *ExactDeviceRequest) String() string { repeatedStringForTolerations += strings.Replace(strings.Replace(f.String(), "DeviceToleration", "DeviceToleration", 1), `&`, ``, 1) + "," } repeatedStringForTolerations += "}" + repeatedStringForDerivedAttributes := "[]DeviceDerivedAttribute{" + for _, f := range this.DerivedAttributes { + repeatedStringForDerivedAttributes += strings.Replace(strings.Replace(f.String(), "DeviceDerivedAttribute", "DeviceDerivedAttribute", 1), `&`, ``, 1) + "," + } + repeatedStringForDerivedAttributes += "}" s := strings.Join([]string{`&ExactDeviceRequest{`, `DeviceClassName:` + fmt.Sprintf("%v", this.DeviceClassName) + `,`, `Selectors:` + repeatedStringForSelectors + `,`, @@ -4480,6 +4796,7 @@ func (this *ExactDeviceRequest) String() string { `AdminAccess:` + valueToStringGenerated(this.AdminAccess) + `,`, `Tolerations:` + repeatedStringForTolerations + `,`, `Capacity:` + strings.Replace(this.Capacity.String(), "CapacityRequirements", "CapacityRequirements", 1) + `,`, + `DerivedAttributes:` + repeatedStringForDerivedAttributes + `,`, `}`, }, "") return s @@ -4496,13 +4813,36 @@ func (this *NetworkDeviceData) String() string { }, "") return s } -func (this *NodeAllocatableResourceMapping) String() string { +func (this *NodeAllocatableMapping) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&NodeAllocatableResourceMapping{`, + s := strings.Join([]string{`&NodeAllocatableMapping{`, `CapacityKey:` + valueToStringGenerated(this.CapacityKey) + `,`, - `AllocationMultiplier:` + strings.Replace(fmt.Sprintf("%v", this.AllocationMultiplier), "Quantity", "resource.Quantity", 1) + `,`, + `CapacityMultiplier:` + strings.Replace(fmt.Sprintf("%v", this.CapacityMultiplier), "Quantity", "resource.Quantity", 1) + `,`, + `DeviceMultiplier:` + strings.Replace(fmt.Sprintf("%v", this.DeviceMultiplier), "Quantity", "resource.Quantity", 1) + `,`, + `}`, + }, "") + return s +} +func (this *NodeAllocatableOverhead) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NodeAllocatableOverhead{`, + `PerPod:` + strings.Replace(fmt.Sprintf("%v", this.PerPod), "Quantity", "resource.Quantity", 1) + `,`, + `PerContainer:` + strings.Replace(fmt.Sprintf("%v", this.PerContainer), "Quantity", "resource.Quantity", 1) + `,`, + `}`, + }, "") + return s +} +func (this *NodeAllocatableResource) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NodeAllocatableResource{`, + `Mapping:` + strings.Replace(this.Mapping.String(), "NodeAllocatableMapping", "NodeAllocatableMapping", 1) + `,`, + `Overhead:` + strings.Replace(this.Overhead.String(), "NodeAllocatableOverhead", "NodeAllocatableOverhead", 1) + `,`, `}`, }, "") return s @@ -4691,6 +5031,8 @@ func (this *ResourceSliceSpec) String() string { `Devices:` + repeatedStringForDevices + `,`, `PerDeviceNodeSelection:` + valueToStringGenerated(this.PerDeviceNodeSelection) + `,`, `SharedCounters:` + repeatedStringForSharedCounters + `,`, + `PartitionTypeAttribute:` + valueToStringGenerated(this.PartitionTypeAttribute) + `,`, + `SkipNodeOperations:` + fmt.Sprintf("%v", this.SkipNodeOperations) + `,`, `}`, }, "") return s @@ -6595,9 +6937,9 @@ func (m *Device) Unmarshal(dAtA []byte) error { } b := bool(v != 0) m.AllowMultipleAllocations = &b - case 13: + case 14: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeAllocatableResourceMappings", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NodeAllocatableResources", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6624,11 +6966,11 @@ func (m *Device) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.NodeAllocatableResourceMappings == nil { - m.NodeAllocatableResourceMappings = make(map[k8s_io_api_core_v1.ResourceName]NodeAllocatableResourceMapping) + if m.NodeAllocatableResources == nil { + m.NodeAllocatableResources = make(map[k8s_io_api_core_v1.ResourceName]NodeAllocatableResource) } var mapkey k8s_io_api_core_v1.ResourceName - mapvalue := &NodeAllocatableResourceMapping{} + mapvalue := &NodeAllocatableResource{} for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 @@ -6702,7 +7044,7 @@ func (m *Device) Unmarshal(dAtA []byte) error { if postmsgIndex > l { return io.ErrUnexpectedEOF } - mapvalue = &NodeAllocatableResourceMapping{} + mapvalue = &NodeAllocatableResource{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } @@ -6722,7 +7064,7 @@ func (m *Device) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - m.NodeAllocatableResourceMappings[k8s_io_api_core_v1.ResourceName(mapkey)] = *mapvalue + m.NodeAllocatableResources[k8s_io_api_core_v1.ResourceName(mapkey)] = *mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -8654,16 +8996,162 @@ func (m *DeviceCounterConsumption) Unmarshal(dAtA []byte) error { } m.Counters[mapkey] = *mapvalue iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompatibilityGroups", wireType) } - if (iNdEx + skippy) > l { + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CompatibilityGroups = append(m.CompatibilityGroups, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeviceDerivedAttribute) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeviceDerivedAttribute: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeviceDerivedAttribute: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = FullyQualifiedName(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expression", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Expression = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy @@ -9265,6 +9753,38 @@ func (m *DeviceRequestAllocationResult) Unmarshal(dAtA []byte) error { } m.ConsumedCapacity[QualifiedName(mapkey)] = *mapvalue iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipNodeOperations", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SkipNodeOperations = append(m.SkipNodeOperations, SkipNodeOperation(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -9620,6 +10140,40 @@ func (m *DeviceSubRequest) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DerivedAttributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DerivedAttributes = append(m.DerivedAttributes, DeviceDerivedAttribute{}) + if err := m.DerivedAttributes[len(m.DerivedAttributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -10876,6 +11430,40 @@ func (m *ExactDeviceRequest) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DerivedAttributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DerivedAttributes = append(m.DerivedAttributes, DeviceDerivedAttribute{}) + if err := m.DerivedAttributes[len(m.DerivedAttributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -11043,7 +11631,7 @@ func (m *NetworkDeviceData) Unmarshal(dAtA []byte) error { } return nil } -func (m *NodeAllocatableResourceMapping) Unmarshal(dAtA []byte) error { +func (m *NodeAllocatableMapping) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11066,10 +11654,10 @@ func (m *NodeAllocatableResourceMapping) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: NodeAllocatableResourceMapping: wiretype end group for non-group") + return fmt.Errorf("proto: NodeAllocatableMapping: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: NodeAllocatableResourceMapping: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: NodeAllocatableMapping: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -11107,7 +11695,7 @@ func (m *NodeAllocatableResourceMapping) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AllocationMultiplier", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CapacityMultiplier", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -11134,29 +11722,309 @@ func (m *NodeAllocatableResourceMapping) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.AllocationMultiplier == nil { - m.AllocationMultiplier = &resource.Quantity{} + if m.CapacityMultiplier == nil { + m.CapacityMultiplier = &resource.Quantity{} } - if err := m.AllocationMultiplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.CapacityMultiplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeviceMultiplier", wireType) } - iNdEx += skippy - } - } - + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DeviceMultiplier == nil { + m.DeviceMultiplier = &resource.Quantity{} + } + if err := m.DeviceMultiplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NodeAllocatableOverhead) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NodeAllocatableOverhead: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NodeAllocatableOverhead: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PerPod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PerPod == nil { + m.PerPod = &resource.Quantity{} + } + if err := m.PerPod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PerContainer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PerContainer == nil { + m.PerContainer = &resource.Quantity{} + } + if err := m.PerContainer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NodeAllocatableResource) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NodeAllocatableResource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NodeAllocatableResource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mapping", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Mapping == nil { + m.Mapping = &NodeAllocatableMapping{} + } + if err := m.Mapping.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Overhead", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Overhead == nil { + m.Overhead = &NodeAllocatableOverhead{} + } + if err := m.Overhead.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + if iNdEx > l { return io.ErrUnexpectedEOF } @@ -12933,6 +13801,71 @@ func (m *ResourceSliceSpec) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PartitionTypeAttribute", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := FullyQualifiedName(dAtA[iNdEx:postIndex]) + m.PartitionTypeAttribute = &s + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipNodeOperations", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SkipNodeOperations = append(m.SkipNodeOperations, SkipNodeOperation(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/vendor/k8s.io/api/resource/v1beta2/generated.proto b/vendor/k8s.io/api/resource/v1beta2/generated.proto index 82bb033b3e..3268169cee 100644 --- a/vendor/k8s.io/api/resource/v1beta2/generated.proto +++ b/vendor/k8s.io/api/resource/v1beta2/generated.proto @@ -65,8 +65,8 @@ message AllocatedDeviceStatus { // // +optional // +featureGate=DRAConsumableCapacity - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-uuid optional string shareID = 7; // Conditions contains the latest observation of the device's state. @@ -78,6 +78,9 @@ message AllocatedDeviceStatus { // +optional // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 4; // Data contains arbitrary driver-specific data. @@ -90,7 +93,7 @@ message AllocatedDeviceStatus { // NetworkData contains network-related information specific to the device. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional NetworkDeviceData networkData = 6; } @@ -130,7 +133,7 @@ message CELDeviceSelector { // - driver (string): the name of the driver which defines this device. // - attributes (map[string]object): the device's attributes, grouped by prefix // (e.g. device.attributes["dra.example.com"] evaluates to an object with all - // of the attributes which were prefixed by "dra.example.com". + // of the attributes which were prefixed by "dra.example.com"). // - capacity (map[string]object): the device's capacities, grouped by prefix. // - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device // (v1.34+ with the DRAConsumableCapacity feature enabled). @@ -163,6 +166,15 @@ message CELDeviceSelector { // A robust expression should check for the existence of attributes // before referencing them. // + // Common errors: + // - "no such key": Use optional chaining (.? followed by orValue()) + // or guarding the check with has() for optional fields. + // See CEL Optional Types for details: + // https://pkg.go.dev/github.com/google/cel-go@v0.17.4/cel#OptionalTypes + // + // For more CEL expression syntax and examples, see: + // https://kubernetes.io/docs/reference/using-api/cel/ + // // For ease of use, the cel.bind() function is enabled, and can be used // to simplify expressions that access multiple attributes with the // same domain. For example: @@ -232,6 +244,13 @@ message CapacityRequestPolicy { // CapacityRequestPolicyRange defines a valid range for consumable capacity values. // +// If the DRAFractionalCapacityRange feature gate is +// enabled and at least one of Min, Max, or Step is a fractional quantity (i.e. +// its value is not an integer), milli-unit arithmetic is used instead, +// supporting values with up to 3 decimal places (e.g. 100m = 0.1). +// The largest supported value then is 1000 times smaller compared to using 64-bit integers. +// Otherwise, all comparisons use 64-bit integer arithmetic via resource.Quantity.Value(). +// // - If the requested amount is less than Min, it is rounded up to the Min value. // - If Step is set and the requested amount is between Min and Max but not aligned with Step, // it will be rounded up to the next value equal to Min + (n * Step). @@ -315,8 +334,8 @@ message CounterSet { // It must be a DNS label. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-short-name optional string name = 1; // Counters defines the set of counters for this CounterSet @@ -325,8 +344,8 @@ message CounterSet { // The maximum number of counters is 32. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:eachKey=+k8s:format=k8s-short-name map counters = 2; } @@ -345,7 +364,7 @@ message Device { // The maximum number of attributes and capacities combined is 32. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional map attributes = 2; // Capacity defines the set of capacities for this device. @@ -366,13 +385,13 @@ message Device { // device is 2. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=counterSet + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=counterSet // +featureGate=DRAPartitionableDevices - // +k8s:alpha(since: "1.36")=+k8s:maxItems=2 + // +k8s:beta(since: "1.37")=+k8s:maxItems=2 repeated DeviceCounterConsumption consumesCounters = 4; // NodeName identifies the node where the device is available. @@ -419,7 +438,7 @@ message Device { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated DeviceTaint taints = 8; // BindsToNode indicates if the usage of an allocation involving this device @@ -449,8 +468,8 @@ message Device { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 repeated string bindingConditions = 10; // BindingFailureConditions defines the conditions for binding failure. @@ -467,8 +486,8 @@ message Device { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 repeated string bindingFailureConditions = 11; // AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests. @@ -480,7 +499,7 @@ message Device { // +featureGate=DRAConsumableCapacity optional bool allowMultipleAllocations = 12; - // NodeAllocatableResourceMappings defines the mapping of node resources + // NodeAllocatableResources defines the mapping of node resources // that are managed by the DRA driver exposing this device. This includes resources currently // reported in v1.Node `status.allocatable` that are not extended resources // (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). @@ -492,8 +511,9 @@ message Device { // The keys of this map are the node-allocatable resource names (e.g., "cpu", "memory"). // Extended resource names are not permitted as keys. // +optional + // +k8s:optional // +featureGate=DRANodeAllocatableResources - map nodeAllocatableResourceMappings = 13; + map nodeAllocatableResources = 14; } // DeviceAllocationConfiguration gets embedded in an AllocationResult. @@ -503,7 +523,7 @@ message DeviceAllocationConfiguration { // or from a claim. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string source = 1; // Requests lists the names of requests where the configuration applies. @@ -515,10 +535,10 @@ message DeviceAllocationConfiguration { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated string requests = 2; optional DeviceConfiguration deviceConfiguration = 3; @@ -530,8 +550,8 @@ message DeviceAllocationResult { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceRequestAllocationResult results = 1; // This field is a combination of all the claim and class configuration parameters. @@ -544,8 +564,8 @@ message DeviceAllocationResult { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=64 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=64 repeated DeviceAllocationConfiguration config = 2; } @@ -554,30 +574,30 @@ message DeviceAttribute { // IntValue is a number. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember optional int64 int = 2; // BoolValue is a true/false value. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember optional bool bool = 3; // StringValue is a string. Must not be longer than 64 characters. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember optional string string = 4; // VersionValue is a semantic version according to semver.org spec 2.0.0. // Must not be longer than 64 characters. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember optional string version = 5; // IntValues is a non-empty list of numbers. @@ -587,8 +607,8 @@ message DeviceAttribute { // +optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember // +featureGate=DRAListTypeAttributes repeated int64 ints = 6; @@ -597,8 +617,8 @@ message DeviceAttribute { // +optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember // +featureGate=DRAListTypeAttributes repeated bool bools = 7; @@ -610,8 +630,9 @@ message DeviceAttribute { // +optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember + // +k8s:alpha(since: "1.37")=+k8s:eachVal=+k8s:maxBytes=64 // +featureGate=DRAListTypeAttributes repeated string strings = 8; @@ -623,8 +644,8 @@ message DeviceAttribute { // +optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember // +featureGate=DRAListTypeAttributes repeated string versions = 9; } @@ -662,11 +683,11 @@ message DeviceClaim { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=name - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=name + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceRequest requests = 1; // These constraints must be satisfied by the set of devices that get @@ -674,8 +695,8 @@ message DeviceClaim { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceConstraint constraints = 2; // This field holds configuration for multiple potential drivers which @@ -684,8 +705,8 @@ message DeviceClaim { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceClaimConfiguration config = 3; } @@ -700,10 +721,10 @@ message DeviceClaimConfiguration { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated string requests = 1; optional DeviceConfiguration deviceConfiguration = 2; @@ -719,8 +740,8 @@ message DeviceClaimConfiguration { message DeviceClass { // Standard object metadata // +optional - // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:format=k8s-long-name optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Spec defines what can be allocated and how to configure it. @@ -731,6 +752,7 @@ message DeviceClass { // the time of allocation. // // Changing the spec automatically increments the metadata.generation number. + // +optional optional DeviceClassSpec spec = 2; } @@ -756,8 +778,8 @@ message DeviceClassSpec { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceSelector selectors = 1; // Config defines configuration parameters that apply to each device that is claimed via this class. @@ -768,8 +790,8 @@ message DeviceClassSpec { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceClassConfiguration config = 2; // ExtendedResourceName is the extended resource name for the devices of this class. @@ -781,11 +803,10 @@ message DeviceClassSpec { // If two classes are created at the same time, then the name of the class // lexicographically sorted first is picked. // - // This is a beta field. // +optional // +featureGate=DRAExtendedResource - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-extended-resource-name + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-extended-resource-name optional string extendedResourceName = 4; } @@ -797,7 +818,7 @@ message DeviceConfiguration { // // +optional // +oneOf=ConfigurationType - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional OpaqueDeviceConfiguration opaque = 1; } @@ -815,10 +836,10 @@ message DeviceConstraint { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated string requests = 1; // MatchAttribute requires that all devices in question have this @@ -841,8 +862,8 @@ message DeviceConstraint { // // +optional // +oneOf=ConstraintType - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-fully-qualified-name + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-resource-fully-qualified-name optional string matchAttribute = 2; // DistinctAttribute requires that all devices in question have this @@ -864,6 +885,8 @@ message DeviceConstraint { // +optional // +oneOf=ConstraintType // +featureGate=DRAConsumableCapacity + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-resource-fully-qualified-name optional string distinctAttribute = 3; } @@ -874,8 +897,8 @@ message DeviceCounterConsumption { // counters defined will be consumed. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-short-name optional string counterSet = 1; // Counters defines the counters that will be consumed by the device. @@ -883,9 +906,94 @@ message DeviceCounterConsumption { // The maximum number of counters is 32. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:eachKey=+k8s:format=k8s-short-name map counters = 2; + + // CompatibilityGroups is a list of opaque group names for + // this counter set consumption. + // + // Devices that consume counters from the same counter set may only be + // allocated at the same time ("co-allocated") if they all share at least + // one common group: the intersection of the CompatibilityGroups of all + // co-allocated devices on that counter set must be non-empty. Devices + // that consume from different counter sets are never compared via this + // field. + // + // An unset field, an explicit nil, and an empty list are equivalent and + // mean "no groups": such a device is only co-allocatable with sibling + // devices on the same counter set that also have no groups, and is never + // co-allocatable with a device that declares one or more groups. + // + // Group names are opaque and meaningful only within the + // publishing driver's pool. + // + // The maximum number of groups is 2, and the names must be unique. + // + // +optional + // +listType=atomic + // +featureGate=DRADeviceCompatibilityGroups + // +k8s:listType=atomic + // +k8s:optional + // +k8s:maxItems=2 + // +k8s:unique=set + // +k8s:eachVal=+k8s:format=k8s-short-name + repeated string compatibilityGroups = 3; +} + +// DeviceDerivedAttribute defines a derived attribute computed via CEL. +message DeviceDerivedAttribute { + // Name is the identifier for this derived attribute, used in constraints. + // + // It must be a DNS subdomain followed by a slash ("/") followed by a C identifier + // (e.g. "example.com/numaNode" or "derived/numaNode"). + // + // If the chosen name matches an existing physical attribute from a driver, + // the derived attribute's expression will shadow the physical attribute, + // and its evaluated value will be used in constraints instead. When the goal + // is to define a derived attribute that is only used within the ResourceClaim + // and not meant to shadow an existing attribute, use a domain prefix that + // no DRA driver should be using (e.g. "derived/myAttribute"). + // + // It is not valid to define a derived attribute that isn't used in at least + // one constraint. + // + // +required + // +k8s:required + // +k8s:format=k8s-resource-fully-qualified-name + optional string name = 1; + + // Expression is a CEL expression evaluated against each candidate device. + // The expression must evaluate to a primitive scalar (string, integer, + // boolean, or semver) or a list of these scalars ([]string, []int64, + // []bool, []semver) to act as a virtual grouping key. Any other return type + // is an error and causes CEL evaluation for the device to fail. + // + // The expression's input is an object named "device", which carries the + // same properties as in a CELDeviceSelector. + // + // When pod scheduling encounters CEL runtime errors (such as looking + // up an attribute that isn't defined) for some devices, it will abort + // allocation and fail scheduling for the Pod. Surfacing evaluation + // errors immediately prevents silent topology matching failures that are + // extremely hard to detect. A robust expression should, for example, check + // for the existence of attributes before referencing them to avoid + // runtime evaluation errors. + // + // The expression gets evaluated after a device has passed the other + // selector expressions for the request in which this expression is used. + // This allows writing expressions that are tailored towards the specific + // devices being requested (for example, by assuming the device is from a + // certain vendor and skipping those checks). + // + // The length of the expression must be smaller or equal to 10 Ki. The + // cost of evaluating it is also limited based on the estimated number + // of logical steps; the combined cost of all derived attributes in a + // claim is capped by a shared CEL cost budget. + // + // +required + // +k8s:required + optional string expression = 2; } // DeviceRequest is a request for devices required for a claim. @@ -914,7 +1022,7 @@ message DeviceRequest { // // +optional // +oneOf=deviceRequestType - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional ExactDeviceRequest exactly = 2; // FirstAvailable contains subrequests, of which exactly one will be @@ -935,11 +1043,11 @@ message DeviceRequest { // +oneOf=deviceRequestType // +listType=atomic // +featureGate=DRAPrioritizedList - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=name - // +k8s:alpha(since: "1.36")=+k8s:maxItems=8 + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=name + // +k8s:beta(since: "1.37")=+k8s:maxItems=8 repeated DeviceSubRequest firstAvailable = 3; } @@ -964,9 +1072,9 @@ message DeviceRequestAllocationResult { // vendor of the driver. It should use only lower case characters. // // +required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless - // +k8s:alpha(since: "1.36")=+k8s:maxLength=63 - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-long-name-caseless + // +k8s:beta(since: "1.37")=+k8s:maxLength=63 + // +k8s:beta(since: "1.37")=+k8s:required optional string driver = 2; // This name together with the driver name and the device name field @@ -976,8 +1084,8 @@ message DeviceRequestAllocationResult { // DNS sub-domains separated by slashes. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-pool-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-resource-pool-name optional string pool = 3; // Device references one device instance via its name in the driver's @@ -1009,7 +1117,7 @@ message DeviceRequestAllocationResult { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated DeviceToleration tolerations = 6; // BindingConditions contains a copy of the BindingConditions @@ -1021,8 +1129,8 @@ message DeviceRequestAllocationResult { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 repeated string bindingConditions = 7; // BindingFailureConditions contains a copy of the BindingFailureConditions @@ -1034,8 +1142,8 @@ message DeviceRequestAllocationResult { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 repeated string bindingFailureConditions = 8; // ShareID uniquely identifies an individual allocation share of the device, @@ -1045,8 +1153,8 @@ message DeviceRequestAllocationResult { // // +optional // +featureGate=DRAConsumableCapacity - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-uuid optional string shareID = 9; // ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request. @@ -1061,6 +1169,19 @@ message DeviceRequestAllocationResult { // +optional // +featureGate=DRAConsumableCapacity map consumedCapacity = 10; + + // SkipNodeOperations lists node-local resource operations (gRPC calls) + // that will be skipped for this allocated device when determining whether + // operations are necessary on the node. If all allocated devices for a driver in + // a claim skip an operation, that gRPC call will be skipped. It is a copy of + // the ResourceSlice.spec.skipNodeOperations value at the time when the device was allocated. + // + // +optional + // +listType=set + // +k8s:listType=set + // +featureGate=DRAOptionalNodeOperations + // +k8s:optional + repeated string skipNodeOperations = 11; } // DeviceSelector must have exactly one field set. @@ -1103,8 +1224,8 @@ message DeviceSubRequest { // to reference. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-long-name optional string deviceClassName = 2; // Selectors define criteria which must be satisfied by a specific @@ -1114,8 +1235,8 @@ message DeviceSubRequest { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceSelector selectors = 3; // AllocationMode and its related fields define how devices are allocated @@ -1137,7 +1258,7 @@ message DeviceSubRequest { // requests with unknown modes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional string allocationMode = 4; // Count is used only when the count mode is "ExactCount". Must be greater than zero. @@ -1168,7 +1289,7 @@ message DeviceSubRequest { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated DeviceToleration tolerations = 6; // Capacity define resource requirements against each capacity. @@ -1187,6 +1308,34 @@ message DeviceSubRequest { // +optional // +featureGate=DRAConsumableCapacity optional CapacityRequirements capacity = 7; + + // DerivedAttributes defines a set of virtual attributes computed via CEL expressions + // for each candidate device. These virtual attributes can be referenced in + // `.devices.constraints` to align and match different devices (e.g., co-allocating + // a GPU and a NIC on the same NUMA node) even if their drivers publish different + // attributes. Derived attributes are not available via `device.attributes` + // in the CEL environment when evaluating selector expressions. + // + // Derived attributes allow you to extract, transform, or normalize topology + // information (such as extracting a NUMA index from a complex topology string or + // renaming a vendor-specific attribute) into a common virtual attribute name at + // scheduling time. The scheduler then evaluates these virtual attributes exactly + // like static attributes when matching constraints. + // + // Every derived attribute defined in this list must be referenced by at least one + // MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list. + // + // The maximum number of derived attributes is 32. + // + // This is an alpha field and requires enabling the DRADerivedAttributes + // feature gate. + // + // +optional + // +listType=atomic + // +featureGate=DRADerivedAttributes + // +k8s:optional + // +k8s:maxItems=32 + repeated DeviceDerivedAttribute derivedAttributes = 8; } // The device this taint is attached to has the "effect" on @@ -1215,7 +1364,7 @@ message DeviceTaint { // Consumers must treat unknown effects like None. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required optional string effect = 3; // TimeAdded represents the time at which the taint was added or @@ -1237,6 +1386,7 @@ message DeviceTaint { // DeviceTaintRule adds one taint to all devices which match the selector. // This has the same effect as if the taint was specified directly // in the ResourceSlice by the DRA driver. +// +k8s:supportsSubresource="/status" message DeviceTaintRule { // Standard object metadata // +optional @@ -1308,6 +1458,9 @@ message DeviceTaintRuleStatus { // +listMapKey=type // +patchStrategy=merge // +patchMergeKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1; } @@ -1351,8 +1504,8 @@ message DeviceToleration { // Must be a label name. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-label-key + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-label-key optional string key = 1; // Operator represents a key's relationship to the value. @@ -1362,7 +1515,7 @@ message DeviceToleration { // // +optional // +default="Equal" - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional string operator = 2; // Value is the taint value the toleration matches to. @@ -1376,7 +1529,7 @@ message DeviceToleration { // When specified, allowed values are NoSchedule and NoExecute. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional string effect = 4; // TolerationSeconds represents the period of time the toleration (which must be @@ -1414,8 +1567,8 @@ message ExactDeviceRequest { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 repeated DeviceSelector selectors = 2; // AllocationMode and its related fields define how devices are allocated @@ -1438,7 +1591,7 @@ message ExactDeviceRequest { // requests with unknown modes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional optional string allocationMode = 3; // Count is used only when the count mode is "ExactCount". Must be greater than zero. @@ -1483,7 +1636,7 @@ message ExactDeviceRequest { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional repeated DeviceToleration tolerations = 6; // Capacity define resource requirements against each capacity. @@ -1502,6 +1655,34 @@ message ExactDeviceRequest { // +optional // +featureGate=DRAConsumableCapacity optional CapacityRequirements capacity = 7; + + // DerivedAttributes defines a set of virtual attributes computed via CEL expressions + // for each candidate device. These virtual attributes can be referenced in + // `.devices.constraints` to align and match different devices (e.g., co-allocating + // a GPU and a NIC on the same NUMA node) even if their drivers publish different + // attributes. Derived attributes are not available via `device.attributes` + // in the CEL environment when evaluating selector expressions. + // + // Derived attributes allow you to extract, transform, or normalize topology + // information (such as extracting a NUMA index from a complex topology string or + // renaming a vendor-specific attribute) into a common virtual attribute name at + // scheduling time. The scheduler then evaluates these virtual attributes exactly + // like static attributes when matching constraints. + // + // Every derived attribute defined in this list must be referenced by at least one + // MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list. + // + // The maximum number of derived attributes is 32. + // + // This is an alpha field and requires enabling the DRADerivedAttributes + // feature gate. + // + // +optional + // +listType=atomic + // +featureGate=DRADerivedAttributes + // +k8s:optional + // +k8s:maxItems=32 + repeated DeviceDerivedAttribute derivedAttributes = 8; } // NetworkDeviceData provides network-related details for the allocated device. @@ -1515,8 +1696,8 @@ message NetworkDeviceData { // Must not be longer than 256 bytes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxBytes=256 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxBytes=256 optional string interfaceName = 1; // IPs lists the network addresses assigned to the device's network interface. @@ -1527,10 +1708,10 @@ message NetworkDeviceData { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=16 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=16 repeated string ips = 2; // HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface. @@ -1538,47 +1719,104 @@ message NetworkDeviceData { // Must not be longer than 128 bytes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxBytes=128 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxBytes=128 optional string hardwareAddress = 3; } -// NodeAllocatableResourceMapping defines the translation between the DRA device/capacity -// units requested to the corresponding quantity of the node allocatable resource. -message NodeAllocatableResourceMapping { +// NodeAllocatableMapping defines how a DRA allocation directly translates into a node allocatable resource quantity. +// The mapping can be derived from either the count of allocated devices (via deviceMultiplier) or the specific capacity consumed (via capacityKey and capacityMultiplier). These options are mutually exclusive. +// Kubelet adds this mapped resource quantity from claim to both requests and limits at the pod-level cgroup, and to limits at the container-level cgroup for each container referencing the claim. +message NodeAllocatableMapping { // CapacityKey references a capacity name defined as a key in the // `spec.devices[*].capacity` map. When this field is set, the value associated with // this key in the `status.allocation.devices.results[*].consumedCapacity` map // (for a specific claim allocation) determines the base quantity for - // the node allocatable resource. If `allocationMultiplier` is also set, it is + // the node allocatable resource. `capacityMultiplier` must also be set and is // multiplied with the base quantity. // For example, if `spec.devices[*].capacity` has an entry "dra.example.com/memory": "128Gi", // and this field is set to "dra.example.com/memory", then for a claim allocation // that consumes { "dra.example.com/memory": "4Gi" } the base quantity for the - // node allocatable resource mapping will be "4Gi", and `allocationMultiplier` should - // be omitted or set to "1". + // node allocatable resource mapping will be "4Gi". + // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:alpha(since: "1.37")=+k8s:dependentRequired("capacityMultiplier") optional string capacityKey = 1; - // AllocationMultiplier is used as a multiplier for the allocated device count or the allocated capacity in the claim. - // It defaults to 1 if not specified. How the field is used also depends on whether `capacityKey` is set. - // 1. If `capacityKey` is NOT set: `allocationMultiplier` multiplies the device count allocated to the claim. - // a. A DRA driver representing each CPU core as a device would have - // {ResourceName: "cpu", allocationMultiplier: "2"} in its - // `nodeAllocatableResourceMappings`. If 4 devices are allocated to the claim, - // 4 * 2 CPUs would be considered as allocated and subtracted from the node's capacity. - // b. A GPU device that needs additional node memory per GPU allocation would - // have {ResourceName: "memory", allocationMultiplier: "2Gi"}. Each allocated - // GPU device instance of this type will account for 2Gi of memory. - // - // 2. If `capacityKey` IS set: `allocationMultiplier` is multiplied by the amount of that capacity consumed. - // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `allocationMultiplier`. - // For example, if a Device's capacity "dra.example.com/cores" is consumed, - // and each "core" provides 2 "cpu"s, the mapping would be: - // {ResourceName: "cpu", capacityKey: "dra.example.com/cores", allocationMultiplier: "2"}. - // If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16. - // +optional - optional .k8s.io.apimachinery.pkg.api.resource.Quantity allocationMultiplier = 2; + // CapacityMultiplier is used as a multiplier for the allocated capacity consumed. + // It is only valid if `capacityKey` is set. + // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. + // For example, if a Device's capacity "dra.example.com/cores" is consumed, + // and each "core" provides 2 "cpu"s, the mapping would be: + // {ResourceName: "cpu", capacityKey: "dra.example.com/cores", capacityMultiplier: "2"}. + // If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16. + // +optional + // +k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:dependentRequired("capacityKey") + optional .k8s.io.apimachinery.pkg.api.resource.Quantity capacityMultiplier = 2; + + // DeviceMultiplier is used as a multiplier for the allocated device count in the claim. + // The final node allocatable resource amount is `deviceCount` * `deviceMultiplier`. + // For example, a DRA driver representing each cache complex (CCX) as a device would have + // {ResourceName: "cpu", deviceMultiplier: "8"} in its `nodeAllocatableResources`. + // If 2 devices (CCX) are allocated to the claim, 2 * 8 = 16 CPUs would be considered as allocated. + // It is only valid when `capacityKey` and `capacityMultiplier` are not set. + // +optional + // +k8s:optional + // +k8s:unionMember + optional .k8s.io.apimachinery.pkg.api.resource.Quantity deviceMultiplier = 3; +} + +// NodeAllocatableOverhead defines auxiliary resource overheads incurred when allocating a device. +// Overheads can be specified as a fixed cost per pod referencing the claim, a variable cost per container reference, or both. +// Kubelet accounts for this overhead by adding it to both the pod-level and container-level cgroups of referencing containers. +message NodeAllocatableOverhead { + // PerPod is overhead applied once per pod referencing the claim on this node. + // This is a flat overhead incurred for every pod referencing the claim. + // +optional + // +k8s:optional + optional .k8s.io.apimachinery.pkg.api.resource.Quantity perPod = 1; + + // PerContainer is applied per container reference to the claim. + // This models overhead scaling linearly with the number of containers actively using the device. + // When both PerPod and PerContainer are specified, the total overhead allocated for each pod referencing + // the claim is computed as: + // Quantity = PerPod + (PerContainer * NumReferences) + // Kubelet accounts for this overhead in cgroups: + // - Pod-level cgroup (requests and limits): Kubelet adds PerPod + (PerContainer * NumReferences). + // - Container-level cgroup (limits only): Kubelet adds PerPod + PerContainer for each referencing container. + // This allows any single container to access the pod-level overhead, while the parent cgroup caps the total usage to account for PerPod exactly once. + // +optional + // +k8s:optional + optional .k8s.io.apimachinery.pkg.api.resource.Quantity perContainer = 2; +} + +// NodeAllocatableResource defines the translation between the DRA device/capacity +// units requested to the corresponding quantity of the node allocatable resource. +// At least one of Mapping or Overhead must be specified. Not specifying either is an invalid configuration. +message NodeAllocatableResource { + // Mapping is used when the device directly models a node allocatable resource like standard CPU or memory + // (e.g., with a CPU DRA driver). The calculated quantity is accounted for exactly once per claim instance + // on the node. To prevent node cgroup isolation friction, the scheduler explicitly + // blocks sharing mapped device claims across multiple pods. + // +optional + // +k8s:optional + optional NodeAllocatableMapping mapping = 3; + + // Overhead contains fields for modeling auxiliary overhead incurred on node allocatable resources + // when allocating devices that are not themselves modeling a node allocatable resource (e.g., host memory overhead for GPUs). + // Sharing overhead-mapped claims across multiple pods is allowed. The node allocatable overhead is accounted + // for individually for each pod referencing the claim. + // Overhead is always subtracted from the node's allocatable capacity for the resource, even when mapping + // is specified for the same resource. + // Eg: If a device models memory capacity per socket as a consumable capacity pool via Mapping (with CapacityKey), + // any overhead specified for the same resource will be subtracted from the node's general allocatable capacity + // and not from the per-socket capacity pool in Mapping. + // +optional + // +k8s:optional + optional NodeAllocatableOverhead overhead = 4; } // OpaqueDeviceConfiguration contains configuration parameters for a driver @@ -1594,9 +1832,9 @@ message OpaqueDeviceConfiguration { // vendor of the driver. It should use only lower case characters. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:maxLength=63 - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:maxLength=63 + // +k8s:beta(since: "1.37")=+k8s:format=k8s-long-name-caseless optional string driver = 1; // Parameters can contain arbitrary data. It is the responsibility of @@ -1625,7 +1863,8 @@ message ResourceClaim { // Spec describes what is being requested and how to configure it. // The spec is immutable. - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:immutable + // +optional optional ResourceClaimSpec spec = 2; // Status describes whether the claim is ready to use and what has been allocated. @@ -1680,8 +1919,8 @@ message ResourceClaimStatus { // Allocation is set once the claim has been allocated successfully. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:update=NoModify + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:update=NoModify optional AllocationResult allocation = 1; // ReservedFor indicates which entities are currently allowed to use @@ -1709,10 +1948,10 @@ message ResourceClaimStatus { // +listMapKey=uid // +patchStrategy=merge // +patchMergeKey=uid - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:listType=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=uid - // +k8s:alpha(since: "1.36")=+k8s:maxItems=256 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:listType=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=uid + // +k8s:beta(since: "1.37")=+k8s:maxItems=256 repeated ResourceClaimConsumerReference reservedFor = 2; // Devices contains the status of each device allocated for this @@ -1720,18 +1959,18 @@ message ResourceClaimStatus { // information. Entries are owned by their respective drivers. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +listType=map // +listMapKey=driver // +listMapKey=device // +listMapKey=pool // +listMapKey=shareID // +featureGate=DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:listType=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=driver - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=device - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=pool - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=shareID + // +k8s:beta(since: "1.37")=+k8s:listType=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=driver + // +k8s:beta(since: "1.37")=+k8s:listMapKey=device + // +k8s:beta(since: "1.37")=+k8s:listMapKey=pool + // +k8s:beta(since: "1.37")=+k8s:listMapKey=shareID repeated AllocatedDeviceStatus devices = 4; } @@ -1749,6 +1988,7 @@ message ResourceClaimTemplate { // This field is immutable. A ResourceClaim will get created by the // control plane for a Pod when needed and then not get updated // anymore. + // +optional optional ResourceClaimTemplateSpec spec = 2; } @@ -1768,11 +2008,13 @@ message ResourceClaimTemplateSpec { // when creating it. No other fields are allowed and will be rejected during // validation. // +optional + // +k8s:opaqueType optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Spec for the ResourceClaim. The entire content is copied unchanged // into the ResourceClaim that gets created from this template. The // same fields as in a ResourceClaim are also valid here. + // +optional optional ResourceClaimSpec spec = 2; } @@ -1780,6 +2022,8 @@ message ResourceClaimTemplateSpec { message ResourcePool { // Name is used to identify the pool. For node-local devices, this // is often the node name, but this is not required. + // A field selector can be used to list only ResourceSlice objects + // belonging to a certain pool. // // It must not be longer than 253 characters and must consist of one or more DNS sub-domains // separated by slashes. This field is immutable. @@ -1920,7 +2164,7 @@ message ResourceSliceSpec { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +zeroOrOneOf=ResourceSliceType repeated Device devices = 6; @@ -1946,14 +2190,50 @@ message ResourceSliceSpec { // The maximum number of counter sets is 8. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=name + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=name // +featureGate=DRAPartitionableDevices // +zeroOrOneOf=ResourceSliceType - // +k8s:alpha(since: "1.36")=+k8s:maxItems=8 + // +k8s:beta(since: "1.37")=+k8s:maxItems=8 repeated CounterSet sharedCounters = 8; + + // PartitionTypeAttribute names a string device attribute (by fully + // qualified name, e.g. "gpu.example.com/profile") whose value labels + // each device with its partition type, such as "Full" or "Half" for a + // MIG-style GPU. + // + // When set, every partitionable device in the slice must carry the attribute + // and devices sharing a value must share the same ConsumesCounters cost. + // + // +optional + // +featureGate=DRAPartitionableDevicesType + // +k8s:ifDisabled(DRAPartitionableDevicesType)=+k8s:forbidden + // +k8s:ifEnabled(DRAPartitionableDevicesType)=+k8s:optional + // +k8s:ifEnabled(DRAPartitionableDevicesType)=+k8s:format=k8s-resource-fully-qualified-name + optional string partitionTypeAttribute = 9; + + // SkipNodeOperations lists node-local resource operations (gRPC calls) + // that will be skipped for the devices in this slice when determining whether + // operations are necessary on the node. If all allocated devices for a driver in + // a claim skip an operation, that gRPC call will be skipped. Valid values are: + // + // - "NodePrepareResources": NodePrepareResources gRPC calls are skipped. This + // value cannot be specified unless "NodeUnprepareResources" is also listed + // (or "*" is specified). + // - "NodeUnprepareResources": NodeUnprepareResources gRPC calls are skipped. + // - "*": All node-local resource operations are skipped. + // + // Other values may be added in the future. The kubelet must ignore unknown + // values. + // + // +optional + // +listType=set + // +k8s:listType=set + // +featureGate=DRAOptionalNodeOperations + // +k8s:optional + repeated string skipNodeOperations = 10; } diff --git a/vendor/k8s.io/api/resource/v1beta2/types.go b/vendor/k8s.io/api/resource/v1beta2/types.go index 47a46355f0..04b5e9fbc5 100644 --- a/vendor/k8s.io/api/resource/v1beta2/types.go +++ b/vendor/k8s.io/api/resource/v1beta2/types.go @@ -78,7 +78,7 @@ const ( // This is an alpha type and requires enabling the DynamicResourceAllocation // feature gate. type ResourceSlice struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -97,6 +97,9 @@ const ( // ResourceSliceSelectorDriver can be used in a [metav1.ListOptions] // field selector to filter based on [ResourceSliceSpec.Driver]. ResourceSliceSelectorDriver = "spec.driver" + // ResourceSliceSelectorPoolName can be used in a [metav1.ListOptions] + // field selector to filter based on [ResourceSliceSpec.Pool.Name]. + ResourceSliceSelectorPoolName = "spec.pool.name" ) // ResourceSliceSpec contains the information published by the driver in one ResourceSlice. @@ -160,7 +163,7 @@ type ResourceSliceSpec struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +zeroOrOneOf=ResourceSliceType Devices []Device `json:"devices,omitempty" protobuf:"bytes,6,name=devices"` @@ -186,17 +189,68 @@ type ResourceSliceSpec struct { // The maximum number of counter sets is 8. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=name + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=name // +featureGate=DRAPartitionableDevices // +zeroOrOneOf=ResourceSliceType - // +k8s:alpha(since: "1.36")=+k8s:maxItems=8 + // +k8s:beta(since: "1.37")=+k8s:maxItems=8 SharedCounters []CounterSet `json:"sharedCounters,omitempty" protobuf:"bytes,8,name=sharedCounters"` + + // PartitionTypeAttribute names a string device attribute (by fully + // qualified name, e.g. "gpu.example.com/profile") whose value labels + // each device with its partition type, such as "Full" or "Half" for a + // MIG-style GPU. + // + // When set, every partitionable device in the slice must carry the attribute + // and devices sharing a value must share the same ConsumesCounters cost. + // + // +optional + // +featureGate=DRAPartitionableDevicesType + // +k8s:ifDisabled(DRAPartitionableDevicesType)=+k8s:forbidden + // +k8s:ifEnabled(DRAPartitionableDevicesType)=+k8s:optional + // +k8s:ifEnabled(DRAPartitionableDevicesType)=+k8s:format=k8s-resource-fully-qualified-name + PartitionTypeAttribute *FullyQualifiedName `json:"partitionTypeAttribute,omitempty" protobuf:"bytes,9,opt,name=partitionTypeAttribute"` + + // SkipNodeOperations lists node-local resource operations (gRPC calls) + // that will be skipped for the devices in this slice when determining whether + // operations are necessary on the node. If all allocated devices for a driver in + // a claim skip an operation, that gRPC call will be skipped. Valid values are: + // + // - "NodePrepareResources": NodePrepareResources gRPC calls are skipped. This + // value cannot be specified unless "NodeUnprepareResources" is also listed + // (or "*" is specified). + // - "NodeUnprepareResources": NodeUnprepareResources gRPC calls are skipped. + // - "*": All node-local resource operations are skipped. + // + // Other values may be added in the future. The kubelet must ignore unknown + // values. + // + // +optional + // +listType=set + // +k8s:listType=set + // +featureGate=DRAOptionalNodeOperations + // +k8s:optional + SkipNodeOperations []SkipNodeOperation `json:"skipNodeOperations,omitempty" protobuf:"bytes,10,rep,name=skipNodeOperations,casttype=SkipNodeOperation"` } +// +enum +// +k8s:enum +type SkipNodeOperation string + +const ( + // SkipNodeOperationNodePrepareResources indicates that NodePrepareResources gRPC calls are skipped. + SkipNodeOperationNodePrepareResources SkipNodeOperation = "NodePrepareResources" + + // SkipNodeOperationNodeUnprepareResources indicates that NodeUnprepareResources gRPC calls are skipped. + SkipNodeOperationNodeUnprepareResources SkipNodeOperation = "NodeUnprepareResources" + + // SkipNodeOperationAll indicates that all node-local resource operations are skipped. + SkipNodeOperationAll SkipNodeOperation = "*" +) + // CounterSet defines a named set of counters // that are available to be used by devices defined in the // ResourcePool. @@ -210,8 +264,8 @@ type CounterSet struct { // It must be a DNS label. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-short-name Name string `json:"name" protobuf:"bytes,1,name=name"` // Counters defines the set of counters for this CounterSet @@ -220,8 +274,8 @@ type CounterSet struct { // The maximum number of counters is 32. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:eachKey=+k8s:format=k8s-short-name Counters map[string]Counter `json:"counters,omitempty" protobuf:"bytes,2,name=counters"` } @@ -233,6 +287,8 @@ const DriverNameMaxLength = 63 type ResourcePool struct { // Name is used to identify the pool. For node-local devices, this // is often the node name, but this is not required. + // A field selector can be used to list only ResourceSlice objects + // belonging to a certain pool. // // It must not be longer than 253 characters and must consist of one or more DNS sub-domains // separated by slashes. This field is immutable. @@ -297,6 +353,10 @@ const ResourceSliceMaxDeviceCounterConsumptionsPerDevice = 2 // per device counter consumption. const ResourceSliceMaxCountersPerDeviceCounterConsumption = 32 +// Defines the maximum number of compatibility groups that can be +// declared per device counter consumption. +const DeviceCompatibilityGroupsMaxSize = 2 + // Device represents one individual hardware instance that can be selected based // on its attributes. Besides the name, exactly one field must be set. type Device struct { @@ -312,7 +372,7 @@ type Device struct { // The maximum number of attributes and capacities combined is 32. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Attributes map[QualifiedName]DeviceAttribute `json:"attributes,omitempty" protobuf:"bytes,2,rep,name=attributes"` // Capacity defines the set of capacities for this device. @@ -333,13 +393,13 @@ type Device struct { // device is 2. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=counterSet + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=counterSet // +featureGate=DRAPartitionableDevices - // +k8s:alpha(since: "1.36")=+k8s:maxItems=2 + // +k8s:beta(since: "1.37")=+k8s:maxItems=2 ConsumesCounters []DeviceCounterConsumption `json:"consumesCounters,omitempty" protobuf:"bytes,4,rep,name=consumesCounters"` // NodeName identifies the node where the device is available. @@ -386,7 +446,7 @@ type Device struct { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Taints []DeviceTaint `json:"taints,omitempty" protobuf:"bytes,8,rep,name=taints"` // BindsToNode indicates if the usage of an allocation involving this device @@ -416,8 +476,8 @@ type Device struct { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 BindingConditions []string `json:"bindingConditions,omitempty" protobuf:"bytes,10,rep,name=bindingConditions"` // BindingFailureConditions defines the conditions for binding failure. @@ -434,8 +494,8 @@ type Device struct { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 BindingFailureConditions []string `json:"bindingFailureConditions,omitempty" protobuf:"bytes,11,rep,name=bindingFailureConditions"` // AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests. @@ -447,7 +507,10 @@ type Device struct { // +featureGate=DRAConsumableCapacity AllowMultipleAllocations *bool `json:"allowMultipleAllocations,omitempty" protobuf:"bytes,12,opt,name=allowMultipleAllocations"` - // NodeAllocatableResourceMappings defines the mapping of node resources + // NodeAllocatableResourceMappings is tombstoned as it got replaced with NodeAllocatableResources. + // NodeAllocatableResourceMappings map[v1.ResourceName]NodeAllocatableResourceMapping `json:"nodeAllocatableResourceMappings,omitempty" protobuf:"bytes,13,opt,name=nodeAllocatableResourceMappings"` + + // NodeAllocatableResources defines the mapping of node resources // that are managed by the DRA driver exposing this device. This includes resources currently // reported in v1.Node `status.allocatable` that are not extended resources // (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). @@ -459,46 +522,104 @@ type Device struct { // The keys of this map are the node-allocatable resource names (e.g., "cpu", "memory"). // Extended resource names are not permitted as keys. // +optional + // +k8s:optional // +featureGate=DRANodeAllocatableResources - NodeAllocatableResourceMappings map[v1.ResourceName]NodeAllocatableResourceMapping `json:"nodeAllocatableResourceMappings,omitempty" protobuf:"bytes,13,opt,name=nodeAllocatableResourceMappings"` + NodeAllocatableResources map[v1.ResourceName]NodeAllocatableResource `json:"nodeAllocatableResources,omitempty" protobuf:"bytes,14,opt,name=nodeAllocatableResources"` } -// NodeAllocatableResourceMapping defines the translation between the DRA device/capacity +// NodeAllocatableResource defines the translation between the DRA device/capacity // units requested to the corresponding quantity of the node allocatable resource. -type NodeAllocatableResourceMapping struct { +// At least one of Mapping or Overhead must be specified. Not specifying either is an invalid configuration. +type NodeAllocatableResource struct { + // Mapping is used when the device directly models a node allocatable resource like standard CPU or memory + // (e.g., with a CPU DRA driver). The calculated quantity is accounted for exactly once per claim instance + // on the node. To prevent node cgroup isolation friction, the scheduler explicitly + // blocks sharing mapped device claims across multiple pods. + // +optional + // +k8s:optional + Mapping *NodeAllocatableMapping `json:"mapping,omitempty" protobuf:"bytes,3,opt,name=mapping"` + + // Overhead contains fields for modeling auxiliary overhead incurred on node allocatable resources + // when allocating devices that are not themselves modeling a node allocatable resource (e.g., host memory overhead for GPUs). + // Sharing overhead-mapped claims across multiple pods is allowed. The node allocatable overhead is accounted + // for individually for each pod referencing the claim. + // Overhead is always subtracted from the node's allocatable capacity for the resource, even when mapping + // is specified for the same resource. + // Eg: If a device models memory capacity per socket as a consumable capacity pool via Mapping (with CapacityKey), + // any overhead specified for the same resource will be subtracted from the node's general allocatable capacity + // and not from the per-socket capacity pool in Mapping. + // +optional + // +k8s:optional + Overhead *NodeAllocatableOverhead `json:"overhead,omitempty" protobuf:"bytes,4,opt,name=overhead"` +} + +// NodeAllocatableMapping defines how a DRA allocation directly translates into a node allocatable resource quantity. +// The mapping can be derived from either the count of allocated devices (via deviceMultiplier) or the specific capacity consumed (via capacityKey and capacityMultiplier). These options are mutually exclusive. +// Kubelet adds this mapped resource quantity from claim to both requests and limits at the pod-level cgroup, and to limits at the container-level cgroup for each container referencing the claim. +type NodeAllocatableMapping struct { // CapacityKey references a capacity name defined as a key in the // `spec.devices[*].capacity` map. When this field is set, the value associated with // this key in the `status.allocation.devices.results[*].consumedCapacity` map // (for a specific claim allocation) determines the base quantity for - // the node allocatable resource. If `allocationMultiplier` is also set, it is + // the node allocatable resource. `capacityMultiplier` must also be set and is // multiplied with the base quantity. // For example, if `spec.devices[*].capacity` has an entry "dra.example.com/memory": "128Gi", // and this field is set to "dra.example.com/memory", then for a claim allocation // that consumes { "dra.example.com/memory": "4Gi" } the base quantity for the - // node allocatable resource mapping will be "4Gi", and `allocationMultiplier` should - // be omitted or set to "1". + // node allocatable resource mapping will be "4Gi". + // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:alpha(since: "1.37")=+k8s:dependentRequired("capacityMultiplier") CapacityKey *QualifiedName `json:"capacityKey,omitempty" protobuf:"bytes,1,opt,name=capacityKey"` - // AllocationMultiplier is used as a multiplier for the allocated device count or the allocated capacity in the claim. - // It defaults to 1 if not specified. How the field is used also depends on whether `capacityKey` is set. - // 1. If `capacityKey` is NOT set: `allocationMultiplier` multiplies the device count allocated to the claim. - // a. A DRA driver representing each CPU core as a device would have - // {ResourceName: "cpu", allocationMultiplier: "2"} in its - // `nodeAllocatableResourceMappings`. If 4 devices are allocated to the claim, - // 4 * 2 CPUs would be considered as allocated and subtracted from the node's capacity. - // b. A GPU device that needs additional node memory per GPU allocation would - // have {ResourceName: "memory", allocationMultiplier: "2Gi"}. Each allocated - // GPU device instance of this type will account for 2Gi of memory. - // - // 2. If `capacityKey` IS set: `allocationMultiplier` is multiplied by the amount of that capacity consumed. - // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `allocationMultiplier`. - // For example, if a Device's capacity "dra.example.com/cores" is consumed, - // and each "core" provides 2 "cpu"s, the mapping would be: - // {ResourceName: "cpu", capacityKey: "dra.example.com/cores", allocationMultiplier: "2"}. - // If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16. - // +optional - AllocationMultiplier *resource.Quantity `json:"allocationMultiplier,omitempty" protobuf:"bytes,2,opt,name=allocationMultiplier"` + // CapacityMultiplier is used as a multiplier for the allocated capacity consumed. + // It is only valid if `capacityKey` is set. + // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. + // For example, if a Device's capacity "dra.example.com/cores" is consumed, + // and each "core" provides 2 "cpu"s, the mapping would be: + // {ResourceName: "cpu", capacityKey: "dra.example.com/cores", capacityMultiplier: "2"}. + // If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16. + // +optional + // +k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:dependentRequired("capacityKey") + CapacityMultiplier *resource.Quantity `json:"capacityMultiplier,omitempty" protobuf:"bytes,2,opt,name=capacityMultiplier"` + + // DeviceMultiplier is used as a multiplier for the allocated device count in the claim. + // The final node allocatable resource amount is `deviceCount` * `deviceMultiplier`. + // For example, a DRA driver representing each cache complex (CCX) as a device would have + // {ResourceName: "cpu", deviceMultiplier: "8"} in its `nodeAllocatableResources`. + // If 2 devices (CCX) are allocated to the claim, 2 * 8 = 16 CPUs would be considered as allocated. + // It is only valid when `capacityKey` and `capacityMultiplier` are not set. + // +optional + // +k8s:optional + // +k8s:unionMember + DeviceMultiplier *resource.Quantity `json:"deviceMultiplier,omitempty" protobuf:"bytes,3,opt,name=deviceMultiplier"` +} + +// NodeAllocatableOverhead defines auxiliary resource overheads incurred when allocating a device. +// Overheads can be specified as a fixed cost per pod referencing the claim, a variable cost per container reference, or both. +// Kubelet accounts for this overhead by adding it to both the pod-level and container-level cgroups of referencing containers. +type NodeAllocatableOverhead struct { + // PerPod is overhead applied once per pod referencing the claim on this node. + // This is a flat overhead incurred for every pod referencing the claim. + // +optional + // +k8s:optional + PerPod *resource.Quantity `json:"perPod,omitempty" protobuf:"bytes,1,opt,name=perPod"` + + // PerContainer is applied per container reference to the claim. + // This models overhead scaling linearly with the number of containers actively using the device. + // When both PerPod and PerContainer are specified, the total overhead allocated for each pod referencing + // the claim is computed as: + // Quantity = PerPod + (PerContainer * NumReferences) + // Kubelet accounts for this overhead in cgroups: + // - Pod-level cgroup (requests and limits): Kubelet adds PerPod + (PerContainer * NumReferences). + // - Container-level cgroup (limits only): Kubelet adds PerPod + PerContainer for each referencing container. + // This allows any single container to access the pod-level overhead, while the parent cgroup caps the total usage to account for PerPod exactly once. + // +optional + // +k8s:optional + PerContainer *resource.Quantity `json:"perContainer,omitempty" protobuf:"bytes,2,opt,name=perContainer"` } // DeviceCounterConsumption defines a set of counters that @@ -508,8 +629,8 @@ type DeviceCounterConsumption struct { // counters defined will be consumed. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-short-name CounterSet string `json:"counterSet" protobuf:"bytes,1,opt,name=counterSet"` // Counters defines the counters that will be consumed by the device. @@ -517,9 +638,39 @@ type DeviceCounterConsumption struct { // The maximum number of counters is 32. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:eachKey=+k8s:format=k8s-short-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:eachKey=+k8s:format=k8s-short-name Counters map[string]Counter `json:"counters,omitempty" protobuf:"bytes,2,opt,name=counters"` + + // CompatibilityGroups is a list of opaque group names for + // this counter set consumption. + // + // Devices that consume counters from the same counter set may only be + // allocated at the same time ("co-allocated") if they all share at least + // one common group: the intersection of the CompatibilityGroups of all + // co-allocated devices on that counter set must be non-empty. Devices + // that consume from different counter sets are never compared via this + // field. + // + // An unset field, an explicit nil, and an empty list are equivalent and + // mean "no groups": such a device is only co-allocatable with sibling + // devices on the same counter set that also have no groups, and is never + // co-allocatable with a device that declares one or more groups. + // + // Group names are opaque and meaningful only within the + // publishing driver's pool. + // + // The maximum number of groups is 2, and the names must be unique. + // + // +optional + // +listType=atomic + // +featureGate=DRADeviceCompatibilityGroups + // +k8s:listType=atomic + // +k8s:optional + // +k8s:maxItems=2 + // +k8s:unique=set + // +k8s:eachVal=+k8s:format=k8s-short-name + CompatibilityGroups []string `json:"compatibilityGroups,omitempty" protobuf:"bytes,3,rep,name=compatibilityGroups"` } // DeviceCapacity describes a quantity associated with a device. @@ -603,6 +754,13 @@ type CapacityRequestPolicy struct { // CapacityRequestPolicyRange defines a valid range for consumable capacity values. // +// If the DRAFractionalCapacityRange feature gate is +// enabled and at least one of Min, Max, or Step is a fractional quantity (i.e. +// its value is not an integer), milli-unit arithmetic is used instead, +// supporting values with up to 3 decimal places (e.g. 100m = 0.1). +// The largest supported value then is 1000 times smaller compared to using 64-bit integers. +// Otherwise, all comparisons use 64-bit integer arithmetic via resource.Quantity.Value(). +// // - If the requested amount is less than Min, it is rounded up to the Min value. // - If Step is set and the requested amount is between Min and Max but not aligned with Step, // it will be rounded up to the next value equal to Min + (n * Step). @@ -682,30 +840,30 @@ type DeviceAttribute struct { // IntValue is a number. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember IntValue *int64 `json:"int,omitempty" protobuf:"varint,2,opt,name=int"` // BoolValue is a true/false value. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember BoolValue *bool `json:"bool,omitempty" protobuf:"varint,3,opt,name=bool"` // StringValue is a string. Must not be longer than 64 characters. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember StringValue *string `json:"string,omitempty" protobuf:"bytes,4,opt,name=string"` // VersionValue is a semantic version according to semver.org spec 2.0.0. // Must not be longer than 64 characters. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember VersionValue *string `json:"version,omitempty" protobuf:"bytes,5,opt,name=version"` // IntValues is a non-empty list of numbers. @@ -715,8 +873,8 @@ type DeviceAttribute struct { // +optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember // +featureGate=DRAListTypeAttributes IntValues []int64 `json:"ints,omitempty" protobuf:"varint,6,opt,name=ints"` @@ -725,8 +883,8 @@ type DeviceAttribute struct { // +optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember // +featureGate=DRAListTypeAttributes BoolValues []bool `json:"bools,omitempty" protobuf:"varint,7,opt,name=bools"` @@ -738,8 +896,9 @@ type DeviceAttribute struct { // +optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember + // +k8s:alpha(since: "1.37")=+k8s:eachVal=+k8s:maxBytes=64 // +featureGate=DRAListTypeAttributes StringValues []string `json:"strings,omitempty" protobuf:"bytes,8,opt,name=strings"` @@ -751,8 +910,8 @@ type DeviceAttribute struct { // +optional // +listType=atomic // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:unionMember + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:unionMember // +featureGate=DRAListTypeAttributes VersionValues []string `json:"versions,omitempty" protobuf:"bytes,9,opt,name=versions"` } @@ -789,7 +948,7 @@ type DeviceTaint struct { // Consumers must treat unknown effects like None. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Effect DeviceTaintEffect `json:"effect" protobuf:"bytes,3,name=effect,casttype=DeviceTaintEffect"` // ^^^^ @@ -828,7 +987,7 @@ type DeviceTaint struct { } // +enum -// +k8s:alpha(since: "1.36")=+k8s:enum +// +k8s:beta(since: "1.37")=+k8s:enum type DeviceTaintEffect string const ( @@ -852,8 +1011,9 @@ const ( // DeviceTaintRule adds one taint to all devices which match the selector. // This has the same effect as if the taint was specified directly // in the ResourceSlice by the DRA driver. +// +k8s:supportsSubresource="/status" type DeviceTaintRule struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -971,6 +1131,9 @@ type DeviceTaintRuleStatus struct { // +listMapKey=type // +patchStrategy=merge // +patchMergeKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` } @@ -985,7 +1148,7 @@ const DeviceTaintConditionEvictionInProgress = "EvictionInProgress" // DeviceTaintRuleList is a collection of DeviceTaintRules. type DeviceTaintRuleList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -999,7 +1162,7 @@ type DeviceTaintRuleList struct { // ResourceSliceList is a collection of ResourceSlices. type ResourceSliceList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -1022,14 +1185,15 @@ type ResourceSliceList struct { // This is an alpha type and requires enabling the DynamicResourceAllocation // feature gate. type ResourceClaim struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec describes what is being requested and how to configure it. // The spec is immutable. - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:immutable + // +optional Spec ResourceClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"` // Status describes whether the claim is ready to use and what has been allocated. @@ -1057,11 +1221,11 @@ type DeviceClaim struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=name - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=name + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Requests []DeviceRequest `json:"requests" protobuf:"bytes,1,name=requests"` // These constraints must be satisfied by the set of devices that get @@ -1069,8 +1233,8 @@ type DeviceClaim struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Constraints []DeviceConstraint `json:"constraints,omitempty" protobuf:"bytes,2,opt,name=constraints"` // This field holds configuration for multiple potential drivers which @@ -1079,8 +1243,8 @@ type DeviceClaim struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Config []DeviceClaimConfiguration `json:"config,omitempty" protobuf:"bytes,3,opt,name=config"` // Potential future extension, ignored by older schedulers. This is @@ -1131,7 +1295,7 @@ type DeviceRequest struct { // // +optional // +oneOf=deviceRequestType - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Exactly *ExactDeviceRequest `json:"exactly,omitempty" protobuf:"bytes,2,name=exactly"` // FirstAvailable contains subrequests, of which exactly one will be @@ -1152,11 +1316,11 @@ type DeviceRequest struct { // +oneOf=deviceRequestType // +listType=atomic // +featureGate=DRAPrioritizedList - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=name - // +k8s:alpha(since: "1.36")=+k8s:maxItems=8 + // +k8s:beta(since: "1.37")=+k8s:unique=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=name + // +k8s:beta(since: "1.37")=+k8s:maxItems=8 FirstAvailable []DeviceSubRequest `json:"firstAvailable,omitempty" protobuf:"bytes,3,name=firstAvailable"` } @@ -1184,8 +1348,8 @@ type ExactDeviceRequest struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,2,name=selectors"` // AllocationMode and its related fields define how devices are allocated @@ -1208,7 +1372,7 @@ type ExactDeviceRequest struct { // requests with unknown modes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional AllocationMode DeviceAllocationMode `json:"allocationMode,omitempty" protobuf:"bytes,3,opt,name=allocationMode"` // Count is used only when the count mode is "ExactCount". Must be greater than zero. @@ -1253,7 +1417,7 @@ type ExactDeviceRequest struct { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Tolerations []DeviceToleration `json:"tolerations,omitempty" protobuf:"bytes,6,opt,name=tolerations"` // Capacity define resource requirements against each capacity. @@ -1272,6 +1436,34 @@ type ExactDeviceRequest struct { // +optional // +featureGate=DRAConsumableCapacity Capacity *CapacityRequirements `json:"capacity,omitempty" protobuf:"bytes,7,opt,name=capacity"` + + // DerivedAttributes defines a set of virtual attributes computed via CEL expressions + // for each candidate device. These virtual attributes can be referenced in + // `.devices.constraints` to align and match different devices (e.g., co-allocating + // a GPU and a NIC on the same NUMA node) even if their drivers publish different + // attributes. Derived attributes are not available via `device.attributes` + // in the CEL environment when evaluating selector expressions. + // + // Derived attributes allow you to extract, transform, or normalize topology + // information (such as extracting a NUMA index from a complex topology string or + // renaming a vendor-specific attribute) into a common virtual attribute name at + // scheduling time. The scheduler then evaluates these virtual attributes exactly + // like static attributes when matching constraints. + // + // Every derived attribute defined in this list must be referenced by at least one + // MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list. + // + // The maximum number of derived attributes is 32. + // + // This is an alpha field and requires enabling the DRADerivedAttributes + // feature gate. + // + // +optional + // +listType=atomic + // +featureGate=DRADerivedAttributes + // +k8s:optional + // +k8s:maxItems=32 + DerivedAttributes []DeviceDerivedAttribute `json:"derivedAttributes,omitempty" protobuf:"bytes,8,rep,name=derivedAttributes"` } // DeviceSubRequest describes a request for device provided in the @@ -1305,8 +1497,8 @@ type DeviceSubRequest struct { // to reference. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-long-name DeviceClassName string `json:"deviceClassName" protobuf:"bytes,2,name=deviceClassName"` // Selectors define criteria which must be satisfied by a specific @@ -1316,8 +1508,8 @@ type DeviceSubRequest struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,3,name=selectors"` // AllocationMode and its related fields define how devices are allocated @@ -1339,7 +1531,7 @@ type DeviceSubRequest struct { // requests with unknown modes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional AllocationMode DeviceAllocationMode `json:"allocationMode,omitempty" protobuf:"bytes,4,opt,name=allocationMode"` // Count is used only when the count mode is "ExactCount". Must be greater than zero. @@ -1370,7 +1562,7 @@ type DeviceSubRequest struct { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Tolerations []DeviceToleration `json:"tolerations,omitempty" protobuf:"bytes,6,opt,name=tolerations"` // Capacity define resource requirements against each capacity. @@ -1389,6 +1581,34 @@ type DeviceSubRequest struct { // +optional // +featureGate=DRAConsumableCapacity Capacity *CapacityRequirements `json:"capacity,omitempty" protobuf:"bytes,7,opt,name=capacity"` + + // DerivedAttributes defines a set of virtual attributes computed via CEL expressions + // for each candidate device. These virtual attributes can be referenced in + // `.devices.constraints` to align and match different devices (e.g., co-allocating + // a GPU and a NIC on the same NUMA node) even if their drivers publish different + // attributes. Derived attributes are not available via `device.attributes` + // in the CEL environment when evaluating selector expressions. + // + // Derived attributes allow you to extract, transform, or normalize topology + // information (such as extracting a NUMA index from a complex topology string or + // renaming a vendor-specific attribute) into a common virtual attribute name at + // scheduling time. The scheduler then evaluates these virtual attributes exactly + // like static attributes when matching constraints. + // + // Every derived attribute defined in this list must be referenced by at least one + // MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list. + // + // The maximum number of derived attributes is 32. + // + // This is an alpha field and requires enabling the DRADerivedAttributes + // feature gate. + // + // +optional + // +listType=atomic + // +featureGate=DRADerivedAttributes + // +k8s:optional + // +k8s:maxItems=32 + DerivedAttributes []DeviceDerivedAttribute `json:"derivedAttributes,omitempty" protobuf:"bytes,8,rep,name=derivedAttributes"` } // CapacityRequirements defines the capacity requirements for a specific device request. @@ -1420,14 +1640,70 @@ type CapacityRequirements struct { Requests map[QualifiedName]resource.Quantity `json:"requests,omitempty" protobuf:"bytes,1,rep,name=requests,castkey=QualifiedName"` } +// DeviceDerivedAttribute defines a derived attribute computed via CEL. +type DeviceDerivedAttribute struct { + // Name is the identifier for this derived attribute, used in constraints. + // + // It must be a DNS subdomain followed by a slash ("/") followed by a C identifier + // (e.g. "example.com/numaNode" or "derived/numaNode"). + // + // If the chosen name matches an existing physical attribute from a driver, + // the derived attribute's expression will shadow the physical attribute, + // and its evaluated value will be used in constraints instead. When the goal + // is to define a derived attribute that is only used within the ResourceClaim + // and not meant to shadow an existing attribute, use a domain prefix that + // no DRA driver should be using (e.g. "derived/myAttribute"). + // + // It is not valid to define a derived attribute that isn't used in at least + // one constraint. + // + // +required + // +k8s:required + // +k8s:format=k8s-resource-fully-qualified-name + Name FullyQualifiedName `json:"name" protobuf:"bytes,1,name=name"` + + // Expression is a CEL expression evaluated against each candidate device. + // The expression must evaluate to a primitive scalar (string, integer, + // boolean, or semver) or a list of these scalars ([]string, []int64, + // []bool, []semver) to act as a virtual grouping key. Any other return type + // is an error and causes CEL evaluation for the device to fail. + // + // The expression's input is an object named "device", which carries the + // same properties as in a CELDeviceSelector. + // + // When pod scheduling encounters CEL runtime errors (such as looking + // up an attribute that isn't defined) for some devices, it will abort + // allocation and fail scheduling for the Pod. Surfacing evaluation + // errors immediately prevents silent topology matching failures that are + // extremely hard to detect. A robust expression should, for example, check + // for the existence of attributes before referencing them to avoid + // runtime evaluation errors. + // + // The expression gets evaluated after a device has passed the other + // selector expressions for the request in which this expression is used. + // This allows writing expressions that are tailored towards the specific + // devices being requested (for example, by assuming the device is from a + // certain vendor and skipping those checks). + // + // The length of the expression must be smaller or equal to 10 Ki. The + // cost of evaluating it is also limited based on the estimated number + // of logical steps; the combined cost of all derived attributes in a + // claim is capped by a shared CEL cost budget. + // + // +required + // +k8s:required + Expression string `json:"expression" protobuf:"bytes,2,name=expression"` +} + const ( DeviceSelectorsMaxSize = 32 FirstAvailableDeviceRequestMaxSize = 8 DeviceTolerationsMaxLength = 16 + DeviceDerivedAttributesMaxSize = 32 ) // +enum -// +k8s:alpha(since: "1.36")=+k8s:enum +// +k8s:beta(since: "1.37")=+k8s:enum type DeviceAllocationMode string // Valid [DeviceRequest.CountMode] values. @@ -1457,7 +1733,7 @@ type CELDeviceSelector struct { // - driver (string): the name of the driver which defines this device. // - attributes (map[string]object): the device's attributes, grouped by prefix // (e.g. device.attributes["dra.example.com"] evaluates to an object with all - // of the attributes which were prefixed by "dra.example.com". + // of the attributes which were prefixed by "dra.example.com"). // - capacity (map[string]object): the device's capacities, grouped by prefix. // - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device // (v1.34+ with the DRAConsumableCapacity feature enabled). @@ -1490,6 +1766,15 @@ type CELDeviceSelector struct { // A robust expression should check for the existence of attributes // before referencing them. // + // Common errors: + // - "no such key": Use optional chaining (.? followed by orValue()) + // or guarding the check with has() for optional fields. + // See CEL Optional Types for details: + // https://pkg.go.dev/github.com/google/cel-go@v0.17.4/cel#OptionalTypes + // + // For more CEL expression syntax and examples, see: + // https://kubernetes.io/docs/reference/using-api/cel/ + // // For ease of use, the cel.bind() function is enabled, and can be used // to simplify expressions that access multiple attributes with the // same domain. For example: @@ -1537,6 +1822,25 @@ type CELDeviceSelector struct { // However, this depends on how fast the machine is. const CELSelectorExpressionMaxCost = 1000000 +// DeviceClaimDerivedAttributeCELMaxCost is the maximum combined execution cost +// allowed for all derived attribute CEL expressions within a single DeviceClaim. +// +// During validation, the API server computes the estimated execution cost of each +// derived attribute expression. The sum of these costs across all requests in the +// claim must not exceed this budget. If it does, the claim is rejected. +// +// To stay within the budget, consumers should simplify their CEL expressions, +// avoid computationally expensive operations like deep nesting or iterations +// (such as `.all()` or `.exists()`), and minimize the total number of derived +// attributes in a claim. +// +// This shared budget prevents excessively complex claims from degrading the +// performance of the kube-scheduler. The limit is set to 1,000,000 instruction +// executions (roughly 0.1 seconds of evaluation time), tying the collective +// cost of all derived attributes to the maximum cost allowed for a single +// CEL selector. +const DeviceClaimDerivedAttributeCELMaxCost = 1000000 + // CELSelectorExpressionMaxLength is the maximum length of a CEL selector expression string. const CELSelectorExpressionMaxLength = 10 * 1024 @@ -1554,10 +1858,10 @@ type DeviceConstraint struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Requests []string `json:"requests,omitempty" protobuf:"bytes,1,opt,name=requests"` // MatchAttribute requires that all devices in question have this @@ -1580,8 +1884,8 @@ type DeviceConstraint struct { // // +optional // +oneOf=ConstraintType - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-fully-qualified-name + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-resource-fully-qualified-name MatchAttribute *FullyQualifiedName `json:"matchAttribute,omitempty" protobuf:"bytes,2,opt,name=matchAttribute"` // Potential future extension, not part of the current design: @@ -1613,6 +1917,8 @@ type DeviceConstraint struct { // +optional // +oneOf=ConstraintType // +featureGate=DRAConsumableCapacity + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-resource-fully-qualified-name DistinctAttribute *FullyQualifiedName `json:"distinctAttribute,omitempty" protobuf:"bytes,3,opt,name=distinctAttribute"` } @@ -1627,13 +1933,13 @@ type DeviceClaimConfiguration struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Requests []string `json:"requests,omitempty" protobuf:"bytes,1,opt,name=requests"` - DeviceConfiguration `json:",inline" protobuf:"bytes,2,name=deviceConfiguration"` + DeviceConfiguration `json:"" protobuf:"bytes,2,name=deviceConfiguration"` } // DeviceConfiguration must have exactly one field set. It gets embedded @@ -1644,7 +1950,7 @@ type DeviceConfiguration struct { // // +optional // +oneOf=ConfigurationType - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Opaque *OpaqueDeviceConfiguration `json:"opaque,omitempty" protobuf:"bytes,1,opt,name=opaque"` } @@ -1661,9 +1967,9 @@ type OpaqueDeviceConfiguration struct { // vendor of the driver. It should use only lower case characters. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:maxLength=63 - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:maxLength=63 + // +k8s:beta(since: "1.37")=+k8s:format=k8s-long-name-caseless Driver string `json:"driver" protobuf:"bytes,1,name=driver"` // Parameters can contain arbitrary data. It is the responsibility of @@ -1689,8 +1995,8 @@ type DeviceToleration struct { // Must be a label name. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-label-key + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-label-key Key string `json:"key,omitempty" protobuf:"bytes,1,opt,name=key"` // Operator represents a key's relationship to the value. @@ -1700,7 +2006,7 @@ type DeviceToleration struct { // // +optional // +default="Equal" - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Operator DeviceTolerationOperator `json:"operator,omitempty" protobuf:"bytes,2,opt,name=operator,casttype=DeviceTolerationOperator"` // Value is the taint value the toleration matches to. @@ -1714,7 +2020,7 @@ type DeviceToleration struct { // When specified, allowed values are NoSchedule and NoExecute. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Effect DeviceTaintEffect `json:"effect,omitempty" protobuf:"bytes,4,opt,name=effect,casttype=DeviceTaintEffect"` // TolerationSeconds represents the period of time the toleration (which must be @@ -1731,7 +2037,7 @@ type DeviceToleration struct { // A toleration operator is the set of operators that can be used in a toleration. // // +enum -// +k8s:alpha(since: "1.36")=+k8s:enum +// +k8s:beta(since: "1.37")=+k8s:enum type DeviceTolerationOperator string const ( @@ -1745,8 +2051,8 @@ type ResourceClaimStatus struct { // Allocation is set once the claim has been allocated successfully. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:update=NoModify + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:update=NoModify Allocation *AllocationResult `json:"allocation,omitempty" protobuf:"bytes,1,opt,name=allocation"` // ReservedFor indicates which entities are currently allowed to use @@ -1774,10 +2080,10 @@ type ResourceClaimStatus struct { // +listMapKey=uid // +patchStrategy=merge // +patchMergeKey=uid - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:listType=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=uid - // +k8s:alpha(since: "1.36")=+k8s:maxItems=256 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:listType=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=uid + // +k8s:beta(since: "1.37")=+k8s:maxItems=256 ReservedFor []ResourceClaimConsumerReference `json:"reservedFor,omitempty" protobuf:"bytes,2,opt,name=reservedFor" patchStrategy:"merge" patchMergeKey:"uid"` // DeallocationRequested is tombstoned since Kubernetes 1.32 where @@ -1790,18 +2096,18 @@ type ResourceClaimStatus struct { // information. Entries are owned by their respective drivers. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +listType=map // +listMapKey=driver // +listMapKey=device // +listMapKey=pool // +listMapKey=shareID // +featureGate=DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:listType=map - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=driver - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=device - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=pool - // +k8s:alpha(since: "1.36")=+k8s:listMapKey=shareID + // +k8s:beta(since: "1.37")=+k8s:listType=map + // +k8s:beta(since: "1.37")=+k8s:listMapKey=driver + // +k8s:beta(since: "1.37")=+k8s:listMapKey=device + // +k8s:beta(since: "1.37")=+k8s:listMapKey=pool + // +k8s:beta(since: "1.37")=+k8s:listMapKey=shareID Devices []AllocatedDeviceStatus `json:"devices,omitempty" protobuf:"bytes,4,opt,name=devices"` } @@ -1864,8 +2170,8 @@ type DeviceAllocationResult struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Results []DeviceRequestAllocationResult `json:"results,omitempty" protobuf:"bytes,1,opt,name=results"` // This field is a combination of all the claim and class configuration parameters. @@ -1878,8 +2184,8 @@ type DeviceAllocationResult struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=64 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=64 Config []DeviceAllocationConfiguration `json:"config,omitempty" protobuf:"bytes,2,opt,name=config"` } @@ -1908,9 +2214,9 @@ type DeviceRequestAllocationResult struct { // vendor of the driver. It should use only lower case characters. // // +required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-long-name-caseless - // +k8s:alpha(since: "1.36")=+k8s:maxLength=63 - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-long-name-caseless + // +k8s:beta(since: "1.37")=+k8s:maxLength=63 + // +k8s:beta(since: "1.37")=+k8s:required Driver string `json:"driver" protobuf:"bytes,2,name=driver"` // This name together with the driver name and the device name field @@ -1920,8 +2226,8 @@ type DeviceRequestAllocationResult struct { // DNS sub-domains separated by slashes. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-resource-pool-name + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format=k8s-resource-pool-name Pool string `json:"pool" protobuf:"bytes,3,name=pool"` // Device references one device instance via its name in the driver's @@ -1953,7 +2259,7 @@ type DeviceRequestAllocationResult struct { // +optional // +listType=atomic // +featureGate=DRADeviceTaints - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional Tolerations []DeviceToleration `json:"tolerations,omitempty" protobuf:"bytes,6,opt,name=tolerations"` // BindingConditions contains a copy of the BindingConditions @@ -1965,8 +2271,8 @@ type DeviceRequestAllocationResult struct { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 BindingConditions []string `json:"bindingConditions,omitempty" protobuf:"bytes,7,rep,name=bindingConditions"` // BindingFailureConditions contains a copy of the BindingFailureConditions @@ -1978,8 +2284,8 @@ type DeviceRequestAllocationResult struct { // +optional // +listType=atomic // +featureGate=DRADeviceBindingConditions,DRAResourceClaimDeviceStatus - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=4 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=4 BindingFailureConditions []string `json:"bindingFailureConditions,omitempty" protobuf:"bytes,8,rep,name=bindingFailureConditions"` // ShareID uniquely identifies an individual allocation share of the device, @@ -1989,8 +2295,8 @@ type DeviceRequestAllocationResult struct { // // +optional // +featureGate=DRAConsumableCapacity - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-uuid ShareID *types.UID `json:"shareID,omitempty" protobuf:"bytes,9,opt,name=shareID"` // ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request. @@ -2005,6 +2311,19 @@ type DeviceRequestAllocationResult struct { // +optional // +featureGate=DRAConsumableCapacity ConsumedCapacity map[QualifiedName]resource.Quantity `json:"consumedCapacity,omitempty" protobuf:"bytes,10,rep,name=consumedCapacity"` + + // SkipNodeOperations lists node-local resource operations (gRPC calls) + // that will be skipped for this allocated device when determining whether + // operations are necessary on the node. If all allocated devices for a driver in + // a claim skip an operation, that gRPC call will be skipped. It is a copy of + // the ResourceSlice.spec.skipNodeOperations value at the time when the device was allocated. + // + // +optional + // +listType=set + // +k8s:listType=set + // +featureGate=DRAOptionalNodeOperations + // +k8s:optional + SkipNodeOperations []SkipNodeOperation `json:"skipNodeOperations,omitempty" protobuf:"bytes,11,rep,name=skipNodeOperations,casttype=SkipNodeOperation"` } // DeviceAllocationConfiguration gets embedded in an AllocationResult. @@ -2014,7 +2333,7 @@ type DeviceAllocationConfiguration struct { // or from a claim. // // +required - // +k8s:alpha(since: "1.36")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:required Source AllocationConfigSource `json:"source" protobuf:"bytes,1,name=source"` // Requests lists the names of requests where the configuration applies. @@ -2026,17 +2345,17 @@ type DeviceAllocationConfiguration struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Requests []string `json:"requests,omitempty" protobuf:"bytes,2,opt,name=requests"` - DeviceConfiguration `json:",inline" protobuf:"bytes,3,name=deviceConfiguration"` + DeviceConfiguration `json:"" protobuf:"bytes,3,name=deviceConfiguration"` } // +enum -// +k8s:alpha(since: "1.36")=+k8s:enum +// +k8s:beta(since: "1.37")=+k8s:enum type AllocationConfigSource string // Valid [DeviceAllocationConfiguration.Source] values. @@ -2050,7 +2369,7 @@ const ( // ResourceClaimList is a collection of claims. type ResourceClaimList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -2072,11 +2391,11 @@ type ResourceClaimList struct { // This is an alpha type and requires enabling the DynamicResourceAllocation // feature gate. type DeviceClass struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata // +optional - // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:subfield(name)=+k8s:format=k8s-long-name metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec defines what can be allocated and how to configure it. @@ -2087,6 +2406,7 @@ type DeviceClass struct { // the time of allocation. // // Changing the spec automatically increments the metadata.generation number. + // +optional Spec DeviceClassSpec `json:"spec" protobuf:"bytes,2,name=spec"` } @@ -2097,8 +2417,8 @@ type DeviceClassSpec struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Selectors []DeviceSelector `json:"selectors,omitempty" protobuf:"bytes,1,opt,name=selectors"` // Config defines configuration parameters that apply to each device that is claimed via this class. @@ -2109,8 +2429,8 @@ type DeviceClassSpec struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxItems=32 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxItems=32 Config []DeviceClassConfiguration `json:"config,omitempty" protobuf:"bytes,2,opt,name=config"` // SuitableNodes is tombstoned since Kubernetes 1.32 where @@ -2127,17 +2447,16 @@ type DeviceClassSpec struct { // If two classes are created at the same time, then the name of the class // lexicographically sorted first is picked. // - // This is a beta field. // +optional // +featureGate=DRAExtendedResource - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-extended-resource-name + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-extended-resource-name ExtendedResourceName *string `json:"extendedResourceName,omitempty" protobuf:"bytes,4,opt,name=extendedResourceName"` } // DeviceClassConfiguration is used in DeviceClass. type DeviceClassConfiguration struct { - DeviceConfiguration `json:",inline" protobuf:"bytes,1,opt,name=deviceConfiguration"` + DeviceConfiguration `json:"" protobuf:"bytes,1,opt,name=deviceConfiguration"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -2145,7 +2464,7 @@ type DeviceClassConfiguration struct { // DeviceClassList is a collection of classes. type DeviceClassList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -2163,7 +2482,7 @@ type DeviceClassList struct { // This is an alpha type and requires enabling the DynamicResourceAllocation // feature gate. type ResourceClaimTemplate struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -2173,6 +2492,7 @@ type ResourceClaimTemplate struct { // This field is immutable. A ResourceClaim will get created by the // control plane for a Pod when needed and then not get updated // anymore. + // +optional Spec ResourceClaimTemplateSpec `json:"spec" protobuf:"bytes,2,name=spec"` } @@ -2182,11 +2502,13 @@ type ResourceClaimTemplateSpec struct { // when creating it. No other fields are allowed and will be rejected during // validation. // +optional + // +k8s:opaqueType metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec for the ResourceClaim. The entire content is copied unchanged // into the ResourceClaim that gets created from this template. The // same fields as in a ResourceClaim are also valid here. + // +optional Spec ResourceClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"` } @@ -2195,7 +2517,7 @@ type ResourceClaimTemplateSpec struct { // ResourceClaimTemplateList is a collection of claim templates. type ResourceClaimTemplateList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // +optional metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -2257,8 +2579,8 @@ type AllocatedDeviceStatus struct { // // +optional // +featureGate=DRAConsumableCapacity - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:format=k8s-uuid + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:format=k8s-uuid ShareID *string `json:"shareID,omitempty" protobuf:"bytes,7,opt,name=shareID"` // Conditions contains the latest observation of the device's state. @@ -2270,6 +2592,9 @@ type AllocatedDeviceStatus struct { // +optional // +listType=map // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type Conditions []metav1.Condition `json:"conditions" protobuf:"bytes,4,opt,name=conditions"` // Data contains arbitrary driver-specific data. @@ -2282,7 +2607,7 @@ type AllocatedDeviceStatus struct { // NetworkData contains network-related information specific to the device. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional NetworkData *NetworkDeviceData `json:"networkData,omitempty" protobuf:"bytes,6,opt,name=networkData"` } @@ -2297,8 +2622,8 @@ type NetworkDeviceData struct { // Must not be longer than 256 bytes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxBytes=256 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxBytes=256 InterfaceName string `json:"interfaceName,omitempty" protobuf:"bytes,1,opt,name=interfaceName"` // IPs lists the network addresses assigned to the device's network interface. @@ -2309,10 +2634,10 @@ type NetworkDeviceData struct { // // +optional // +listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:optional // +k8s:listType=atomic - // +k8s:alpha(since: "1.36")=+k8s:unique=set - // +k8s:alpha(since: "1.36")=+k8s:maxItems=16 + // +k8s:beta(since: "1.37")=+k8s:unique=set + // +k8s:beta(since: "1.37")=+k8s:maxItems=16 IPs []string `json:"ips,omitempty" protobuf:"bytes,2,opt,name=ips"` // HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface. @@ -2320,7 +2645,7 @@ type NetworkDeviceData struct { // Must not be longer than 128 bytes. // // +optional - // +k8s:alpha(since: "1.36")=+k8s:optional - // +k8s:alpha(since: "1.36")=+k8s:maxBytes=128 + // +k8s:beta(since: "1.37")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:maxBytes=128 HardwareAddress string `json:"hardwareAddress,omitempty" protobuf:"bytes,3,opt,name=hardwareAddress"` } diff --git a/vendor/k8s.io/api/resource/v1beta2/types_swagger_doc_generated.go b/vendor/k8s.io/api/resource/v1beta2/types_swagger_doc_generated.go index 122170ec25..3f0c9176b4 100644 --- a/vendor/k8s.io/api/resource/v1beta2/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/resource/v1beta2/types_swagger_doc_generated.go @@ -55,7 +55,7 @@ func (AllocationResult) SwaggerDoc() map[string]string { var map_CELDeviceSelector = map[string]string{ "": "CELDeviceSelector contains a CEL expression for selecting a device.", - "expression": "Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort.\n\nThe expression's input is an object named \"device\", which carries the following properties:\n - driver (string): the name of the driver which defines this device.\n - attributes (map[string]object): the device's attributes, grouped by prefix\n (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all\n of the attributes which were prefixed by \"dra.example.com\".\n - capacity (map[string]object): the device's capacities, grouped by prefix.\n - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device\n (v1.34+ with the DRAConsumableCapacity feature enabled).\n\nExample: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields:\n\n device.driver\n device.attributes[\"dra.example.com\"].model\n device.attributes[\"ext.example.com\"].family\n device.capacity[\"dra.example.com\"].modules\n\nThe device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers.\n\nThe value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity.\n\nIf an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort.\n\nA robust expression should check for the existence of attributes before referencing them.\n\nFor ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example:\n\n cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool)\n\nWhen the DRAListTypeAttributes feature gate is enabled, the includes() helper is available and it can work for both scalar and list-type attributes. It was introduced to support smooth migration from scalar attributes to list-type attributes while keeping CEL expressions simple. For example:\n\n device.attributes[\"dra.example.com\"].models.includes(\"some-model\")\n\nThe length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps.", + "expression": "Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort.\n\nThe expression's input is an object named \"device\", which carries the following properties:\n - driver (string): the name of the driver which defines this device.\n - attributes (map[string]object): the device's attributes, grouped by prefix\n (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all\n of the attributes which were prefixed by \"dra.example.com\").\n - capacity (map[string]object): the device's capacities, grouped by prefix.\n - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device\n (v1.34+ with the DRAConsumableCapacity feature enabled).\n\nExample: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields:\n\n device.driver\n device.attributes[\"dra.example.com\"].model\n device.attributes[\"ext.example.com\"].family\n device.capacity[\"dra.example.com\"].modules\n\nThe device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers.\n\nThe value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity.\n\nIf an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort.\n\nA robust expression should check for the existence of attributes before referencing them.\n\nCommon errors: - \"no such key\": Use optional chaining (.? followed by orValue())\n or guarding the check with has() for optional fields.\n See CEL Optional Types for details:\n https://pkg.go.dev/github.com/google/cel-go@v0.17.4/cel#OptionalTypes\n\nFor more CEL expression syntax and examples, see: https://kubernetes.io/docs/reference/using-api/cel/\n\nFor ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example:\n\n cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool)\n\nWhen the DRAListTypeAttributes feature gate is enabled, the includes() helper is available and it can work for both scalar and list-type attributes. It was introduced to support smooth migration from scalar attributes to list-type attributes while keeping CEL expressions simple. For example:\n\n device.attributes[\"dra.example.com\"].models.includes(\"some-model\")\n\nThe length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps.", } func (CELDeviceSelector) SwaggerDoc() map[string]string { @@ -74,7 +74,7 @@ func (CapacityRequestPolicy) SwaggerDoc() map[string]string { } var map_CapacityRequestPolicyRange = map[string]string{ - "": "CapacityRequestPolicyRange defines a valid range for consumable capacity values.\n\n - If the requested amount is less than Min, it is rounded up to the Min value.\n - If Step is set and the requested amount is between Min and Max but not aligned with Step,\n it will be rounded up to the next value equal to Min + (n * Step).\n - If Step is not set, the requested amount is used as-is if it falls within the range Min to Max (if set).\n - If the requested or rounded amount exceeds Max (if set), the request does not satisfy the policy,\n and the device cannot be allocated.", + "": "CapacityRequestPolicyRange defines a valid range for consumable capacity values.\n\nIf the DRAFractionalCapacityRange feature gate is enabled and at least one of Min, Max, or Step is a fractional quantity (i.e. its value is not an integer), milli-unit arithmetic is used instead, supporting values with up to 3 decimal places (e.g. 100m = 0.1). The largest supported value then is 1000 times smaller compared to using 64-bit integers. Otherwise, all comparisons use 64-bit integer arithmetic via resource.Quantity.Value().\n\n - If the requested amount is less than Min, it is rounded up to the Min value.\n - If Step is set and the requested amount is between Min and Max but not aligned with Step,\n it will be rounded up to the next value equal to Min + (n * Step).\n - If Step is not set, the requested amount is used as-is if it falls within the range Min to Max (if set).\n - If the requested or rounded amount exceeds Max (if set), the request does not satisfy the policy,\n and the device cannot be allocated.", "min": "Min specifies the minimum capacity allowed for a consumption request.\n\nMin must be greater than or equal to zero, and less than or equal to the capacity value. requestPolicy.default must be more than or equal to the minimum.", "max": "Max defines the upper limit for capacity that can be requested.\n\nMax must be less than or equal to the capacity value. Min and requestPolicy.default must be less than or equal to the maximum.", "step": "Step defines the step size between valid capacity amounts within the range.\n\nMax (if set) and requestPolicy.default must be a multiple of Step. Min + Step must be less than or equal to the capacity value.", @@ -113,20 +113,20 @@ func (CounterSet) SwaggerDoc() map[string]string { } var map_Device = map[string]string{ - "": "Device represents one individual hardware instance that can be selected based on its attributes. Besides the name, exactly one field must be set.", - "name": "Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label.", - "attributes": "Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.", - "capacity": "Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.", - "consumesCounters": "ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets.\n\nThere can only be a single entry per counterSet.\n\nThe maximum number of device counter consumptions per device is 2.", - "nodeName": "NodeName identifies the node where the device is available.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", - "nodeSelector": "NodeSelector defines the nodes where the device is available.\n\nMust use exactly one term.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", - "allNodes": "AllNodes indicates that all nodes have access to the device.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", - "taints": "If specified, these are the driver-defined taints.\n\nThe maximum number of taints is 16. If taints are set for any device in a ResourceSlice, then the maximum number of allowed devices per ResourceSlice is 64 instead of 128.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.", - "bindsToNode": "BindsToNode indicates if the usage of an allocation involving this device has to be limited to exactly the node that was chosen when allocating the claim. If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector to match the node where the allocation was made.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", - "bindingConditions": "BindingConditions defines the conditions for proceeding with binding. All of these conditions must be set in the per-device status conditions with a value of True to proceed with binding the pod to the node while scheduling the pod.\n\nThe maximum number of binding conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", - "bindingFailureConditions": "BindingFailureConditions defines the conditions for binding failure. They may be set in the per-device status conditions. If any is set to \"True\", a binding failure occurred.\n\nThe maximum number of binding failure conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", - "allowMultipleAllocations": "AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.\n\nIf AllowMultipleAllocations is set to true, the device can be allocated more than once, and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not.", - "nodeAllocatableResourceMappings": "NodeAllocatableResourceMappings defines the mapping of node resources that are managed by the DRA driver exposing this device. This includes resources currently reported in v1.Node `status.allocatable` that are not extended resources (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). Examples include \"cpu\", \"memory\", \"ephemeral-storage\", and hugepages. In addition to standard requests made through the Pod `spec`, these resources can also be requested through claims and allocated by the DRA driver. For example, a CPU DRA driver might allocate exclusive CPUs or auxiliary node memory dependencies of an accelerator device. The keys of this map are the node-allocatable resource names (e.g., \"cpu\", \"memory\"). Extended resource names are not permitted as keys.", + "": "Device represents one individual hardware instance that can be selected based on its attributes. Besides the name, exactly one field must be set.", + "name": "Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label.", + "attributes": "Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.", + "capacity": "Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set.\n\nThe maximum number of attributes and capacities combined is 32.", + "consumesCounters": "ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets.\n\nThere can only be a single entry per counterSet.\n\nThe maximum number of device counter consumptions per device is 2.", + "nodeName": "NodeName identifies the node where the device is available.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", + "nodeSelector": "NodeSelector defines the nodes where the device is available.\n\nMust use exactly one term.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", + "allNodes": "AllNodes indicates that all nodes have access to the device.\n\nMust only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set.", + "taints": "If specified, these are the driver-defined taints.\n\nThe maximum number of taints is 16. If taints are set for any device in a ResourceSlice, then the maximum number of allowed devices per ResourceSlice is 64 instead of 128.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.", + "bindsToNode": "BindsToNode indicates if the usage of an allocation involving this device has to be limited to exactly the node that was chosen when allocating the claim. If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector to match the node where the allocation was made.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", + "bindingConditions": "BindingConditions defines the conditions for proceeding with binding. All of these conditions must be set in the per-device status conditions with a value of True to proceed with binding the pod to the node while scheduling the pod.\n\nThe maximum number of binding conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", + "bindingFailureConditions": "BindingFailureConditions defines the conditions for binding failure. They may be set in the per-device status conditions. If any is set to \"True\", a binding failure occurred.\n\nThe maximum number of binding failure conditions is 4.\n\nThe conditions must be a valid condition type string.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", + "allowMultipleAllocations": "AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.\n\nIf AllowMultipleAllocations is set to true, the device can be allocated more than once, and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not.", + "nodeAllocatableResources": "NodeAllocatableResources defines the mapping of node resources that are managed by the DRA driver exposing this device. This includes resources currently reported in v1.Node `status.allocatable` that are not extended resources (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). Examples include \"cpu\", \"memory\", \"ephemeral-storage\", and hugepages. In addition to standard requests made through the Pod `spec`, these resources can also be requested through claims and allocated by the DRA driver. For example, a CPU DRA driver might allocate exclusive CPUs or auxiliary node memory dependencies of an accelerator device. The keys of this map are the node-allocatable resource names (e.g., \"cpu\", \"memory\"). Extended resource names are not permitted as keys.", } func (Device) SwaggerDoc() map[string]string { @@ -231,7 +231,7 @@ var map_DeviceClassSpec = map[string]string{ "": "DeviceClassSpec is used in a [DeviceClass] to define what can be allocated and how to configure it.", "selectors": "Each selector must be satisfied by a device which is claimed via this class.", "config": "Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver.\n\nThey are passed to the driver, but are not considered while allocating the claim.", - "extendedResourceName": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.\n\nThis is a beta field.", + "extendedResourceName": "ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked.", } func (DeviceClassSpec) SwaggerDoc() map[string]string { @@ -259,15 +259,26 @@ func (DeviceConstraint) SwaggerDoc() map[string]string { } var map_DeviceCounterConsumption = map[string]string{ - "": "DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet.", - "counterSet": "CounterSet is the name of the set from which the counters defined will be consumed.", - "counters": "Counters defines the counters that will be consumed by the device.\n\nThe maximum number of counters is 32.", + "": "DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet.", + "counterSet": "CounterSet is the name of the set from which the counters defined will be consumed.", + "counters": "Counters defines the counters that will be consumed by the device.\n\nThe maximum number of counters is 32.", + "compatibilityGroups": "CompatibilityGroups is a list of opaque group names for this counter set consumption.\n\nDevices that consume counters from the same counter set may only be allocated at the same time (\"co-allocated\") if they all share at least one common group: the intersection of the CompatibilityGroups of all co-allocated devices on that counter set must be non-empty. Devices that consume from different counter sets are never compared via this field.\n\nAn unset field, an explicit nil, and an empty list are equivalent and mean \"no groups\": such a device is only co-allocatable with sibling devices on the same counter set that also have no groups, and is never co-allocatable with a device that declares one or more groups.\n\nGroup names are opaque and meaningful only within the publishing driver's pool.\n\nThe maximum number of groups is 2, and the names must be unique.", } func (DeviceCounterConsumption) SwaggerDoc() map[string]string { return map_DeviceCounterConsumption } +var map_DeviceDerivedAttribute = map[string]string{ + "": "DeviceDerivedAttribute defines a derived attribute computed via CEL.", + "name": "Name is the identifier for this derived attribute, used in constraints.\n\nIt must be a DNS subdomain followed by a slash (\"/\") followed by a C identifier (e.g. \"example.com/numaNode\" or \"derived/numaNode\").\n\nIf the chosen name matches an existing physical attribute from a driver, the derived attribute's expression will shadow the physical attribute, and its evaluated value will be used in constraints instead. When the goal is to define a derived attribute that is only used within the ResourceClaim and not meant to shadow an existing attribute, use a domain prefix that no DRA driver should be using (e.g. \"derived/myAttribute\").\n\nIt is not valid to define a derived attribute that isn't used in at least one constraint.", + "expression": "Expression is a CEL expression evaluated against each candidate device. The expression must evaluate to a primitive scalar (string, integer, boolean, or semver) or a list of these scalars ([]string, []int64, []bool, []semver) to act as a virtual grouping key. Any other return type is an error and causes CEL evaluation for the device to fail.\n\nThe expression's input is an object named \"device\", which carries the same properties as in a CELDeviceSelector.\n\nWhen pod scheduling encounters CEL runtime errors (such as looking up an attribute that isn't defined) for some devices, it will abort allocation and fail scheduling for the Pod. Surfacing evaluation errors immediately prevents silent topology matching failures that are extremely hard to detect. A robust expression should, for example, check for the existence of attributes before referencing them to avoid runtime evaluation errors.\n\nThe expression gets evaluated after a device has passed the other selector expressions for the request in which this expression is used. This allows writing expressions that are tailored towards the specific devices being requested (for example, by assuming the device is from a certain vendor and skipping those checks).\n\nThe length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps; the combined cost of all derived attributes in a claim is capped by a shared CEL cost budget.", +} + +func (DeviceDerivedAttribute) SwaggerDoc() map[string]string { + return map_DeviceDerivedAttribute +} + var map_DeviceRequest = map[string]string{ "": "DeviceRequest is a request for devices required for a claim. This is typically a request for a single resource like a device, but can also ask for several identical devices. With FirstAvailable it is also possible to provide a prioritized list of requests.", "name": "Name can be used to reference this request in a pod.spec.containers[].resources.claims entry and in a constraint of the claim.\n\nReferences using the name in the DeviceRequest will uniquely identify a request when the Exactly field is set. When the FirstAvailable field is set, a reference to the name of the DeviceRequest will match whatever subrequest is chosen by the scheduler.\n\nMust be a DNS label.", @@ -291,6 +302,7 @@ var map_DeviceRequestAllocationResult = map[string]string{ "bindingFailureConditions": "BindingFailureConditions contains a copy of the BindingFailureConditions from the corresponding ResourceSlice at the time of allocation.\n\nThis is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates.", "shareID": "ShareID uniquely identifies an individual allocation share of the device, used when the device supports multiple simultaneous allocations. It serves as an additional map key to differentiate concurrent shares of the same device.", "consumedCapacity": "ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request. The consumed amount may differ from the requested amount: it is rounded up to the nearest valid value based on the device’s requestPolicy if applicable (i.e., may not be less than the requested amount).\n\nThe total consumed capacity for each device must not exceed the DeviceCapacity's Value.\n\nThis field is populated only for devices that allow multiple allocations. All capacity entries are included, even if the consumed amount is zero.", + "skipNodeOperations": "SkipNodeOperations lists node-local resource operations (gRPC calls) that will be skipped for this allocated device when determining whether operations are necessary on the node. If all allocated devices for a driver in a claim skip an operation, that gRPC call will be skipped. It is a copy of the ResourceSlice.spec.skipNodeOperations value at the time when the device was allocated.", } func (DeviceRequestAllocationResult) SwaggerDoc() map[string]string { @@ -307,14 +319,15 @@ func (DeviceSelector) SwaggerDoc() map[string]string { } var map_DeviceSubRequest = map[string]string{ - "": "DeviceSubRequest describes a request for device provided in the claim.spec.devices.requests[].firstAvailable array. Each is typically a request for a single resource like a device, but can also ask for several identical devices.\n\nDeviceSubRequest is similar to ExactDeviceRequest, but doesn't expose the AdminAccess field as that one is only supported when requesting a specific device.", - "name": "Name can be used to reference this subrequest in the list of constraints or the list of configurations for the claim. References must use the format
/.\n\nMust be a DNS label.", - "deviceClassName": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this subrequest.\n\nA class is required. Which classes are available depends on the cluster.\n\nAdministrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference.", - "selectors": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this subrequest. All selectors must be satisfied for a device to be considered.", - "allocationMode": "AllocationMode and its related fields define how devices are allocated to satisfy this subrequest. Supported values are:\n\n- ExactCount: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This subrequest is for all of the matching devices in a pool.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other subrequests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", - "count": "Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one.", - "tolerations": "If specified, the request's tolerations.\n\nTolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute.\n\nIn addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated.\n\nThe maximum number of tolerations is 16.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.", - "capacity": "Capacity define resource requirements against each capacity.\n\nIf this field is unset and the device supports multiple allocations, the default value will be applied to each capacity according to requestPolicy. For the capacity that has no requestPolicy, default is the full capacity value.\n\nApplies to each device allocation. If Count > 1, the request fails if there aren't enough devices that meet the requirements. If AllocationMode is set to All, the request fails if there are devices that otherwise match the request, and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request.", + "": "DeviceSubRequest describes a request for device provided in the claim.spec.devices.requests[].firstAvailable array. Each is typically a request for a single resource like a device, but can also ask for several identical devices.\n\nDeviceSubRequest is similar to ExactDeviceRequest, but doesn't expose the AdminAccess field as that one is only supported when requesting a specific device.", + "name": "Name can be used to reference this subrequest in the list of constraints or the list of configurations for the claim. References must use the format
/.\n\nMust be a DNS label.", + "deviceClassName": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this subrequest.\n\nA class is required. Which classes are available depends on the cluster.\n\nAdministrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference.", + "selectors": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this subrequest. All selectors must be satisfied for a device to be considered.", + "allocationMode": "AllocationMode and its related fields define how devices are allocated to satisfy this subrequest. Supported values are:\n\n- ExactCount: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This subrequest is for all of the matching devices in a pool.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other subrequests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", + "count": "Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one.", + "tolerations": "If specified, the request's tolerations.\n\nTolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute.\n\nIn addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated.\n\nThe maximum number of tolerations is 16.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.", + "capacity": "Capacity define resource requirements against each capacity.\n\nIf this field is unset and the device supports multiple allocations, the default value will be applied to each capacity according to requestPolicy. For the capacity that has no requestPolicy, default is the full capacity value.\n\nApplies to each device allocation. If Count > 1, the request fails if there aren't enough devices that meet the requirements. If AllocationMode is set to All, the request fails if there are devices that otherwise match the request, and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request.", + "derivedAttributes": "DerivedAttributes defines a set of virtual attributes computed via CEL expressions for each candidate device. These virtual attributes can be referenced in `.devices.constraints` to align and match different devices (e.g., co-allocating a GPU and a NIC on the same NUMA node) even if their drivers publish different attributes. Derived attributes are not available via `device.attributes` in the CEL environment when evaluating selector expressions.\n\nDerived attributes allow you to extract, transform, or normalize topology information (such as extracting a NUMA index from a complex topology string or renaming a vendor-specific attribute) into a common virtual attribute name at scheduling time. The scheduler then evaluates these virtual attributes exactly like static attributes when matching constraints.\n\nEvery derived attribute defined in this list must be referenced by at least one MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list.\n\nThe maximum number of derived attributes is 32.\n\nThis is an alpha field and requires enabling the DRADerivedAttributes feature gate.", } func (DeviceSubRequest) SwaggerDoc() map[string]string { @@ -398,14 +411,15 @@ func (DeviceToleration) SwaggerDoc() map[string]string { } var map_ExactDeviceRequest = map[string]string{ - "": "ExactDeviceRequest is a request for one or more identical devices.", - "deviceClassName": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this request.\n\nA DeviceClassName is required.\n\nAdministrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference.", - "selectors": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this request. All selectors must be satisfied for a device to be considered.", - "allocationMode": "AllocationMode and its related fields define how devices are allocated to satisfy this request. Supported values are:\n\n- ExactCount: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This request is for all of the matching devices in a pool.\n At least one device must exist on the node for the allocation to succeed.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other requests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", - "count": "Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one.", - "adminAccess": "AdminAccess indicates that this is a claim for administrative access to the device(s). Claims with AdminAccess are expected to be used for monitoring or other management services for a device. They ignore all ordinary claims to the device with respect to access modes and any resource allocations.\n\nThis is an alpha field and requires enabling the DRAAdminAccess feature gate. Admin access is disabled if this field is unset or set to false, otherwise it is enabled.", - "tolerations": "If specified, the request's tolerations.\n\nTolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute.\n\nIn addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated.\n\nThe maximum number of tolerations is 16.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.", - "capacity": "Capacity define resource requirements against each capacity.\n\nIf this field is unset and the device supports multiple allocations, the default value will be applied to each capacity according to requestPolicy. For the capacity that has no requestPolicy, default is the full capacity value.\n\nApplies to each device allocation. If Count > 1, the request fails if there aren't enough devices that meet the requirements. If AllocationMode is set to All, the request fails if there are devices that otherwise match the request, and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request.", + "": "ExactDeviceRequest is a request for one or more identical devices.", + "deviceClassName": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this request.\n\nA DeviceClassName is required.\n\nAdministrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference.", + "selectors": "Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this request. All selectors must be satisfied for a device to be considered.", + "allocationMode": "AllocationMode and its related fields define how devices are allocated to satisfy this request. Supported values are:\n\n- ExactCount: This request is for a specific number of devices.\n This is the default. The exact number is provided in the\n count field.\n\n- All: This request is for all of the matching devices in a pool.\n At least one device must exist on the node for the allocation to succeed.\n Allocation will fail if some devices are already allocated,\n unless adminAccess is requested.\n\nIf AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other requests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", + "count": "Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one.", + "adminAccess": "AdminAccess indicates that this is a claim for administrative access to the device(s). Claims with AdminAccess are expected to be used for monitoring or other management services for a device. They ignore all ordinary claims to the device with respect to access modes and any resource allocations.\n\nThis is an alpha field and requires enabling the DRAAdminAccess feature gate. Admin access is disabled if this field is unset or set to false, otherwise it is enabled.", + "tolerations": "If specified, the request's tolerations.\n\nTolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute.\n\nIn addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated.\n\nThe maximum number of tolerations is 16.\n\nThis is a beta field and requires enabling the DRADeviceTaints feature gate.", + "capacity": "Capacity define resource requirements against each capacity.\n\nIf this field is unset and the device supports multiple allocations, the default value will be applied to each capacity according to requestPolicy. For the capacity that has no requestPolicy, default is the full capacity value.\n\nApplies to each device allocation. If Count > 1, the request fails if there aren't enough devices that meet the requirements. If AllocationMode is set to All, the request fails if there are devices that otherwise match the request, and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request.", + "derivedAttributes": "DerivedAttributes defines a set of virtual attributes computed via CEL expressions for each candidate device. These virtual attributes can be referenced in `.devices.constraints` to align and match different devices (e.g., co-allocating a GPU and a NIC on the same NUMA node) even if their drivers publish different attributes. Derived attributes are not available via `device.attributes` in the CEL environment when evaluating selector expressions.\n\nDerived attributes allow you to extract, transform, or normalize topology information (such as extracting a NUMA index from a complex topology string or renaming a vendor-specific attribute) into a common virtual attribute name at scheduling time. The scheduler then evaluates these virtual attributes exactly like static attributes when matching constraints.\n\nEvery derived attribute defined in this list must be referenced by at least one MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list.\n\nThe maximum number of derived attributes is 32.\n\nThis is an alpha field and requires enabling the DRADerivedAttributes feature gate.", } func (ExactDeviceRequest) SwaggerDoc() map[string]string { @@ -423,14 +437,35 @@ func (NetworkDeviceData) SwaggerDoc() map[string]string { return map_NetworkDeviceData } -var map_NodeAllocatableResourceMapping = map[string]string{ - "": "NodeAllocatableResourceMapping defines the translation between the DRA device/capacity units requested to the corresponding quantity of the node allocatable resource.", - "capacityKey": "CapacityKey references a capacity name defined as a key in the `spec.devices[*].capacity` map. When this field is set, the value associated with this key in the `status.allocation.devices.results[*].consumedCapacity` map (for a specific claim allocation) determines the base quantity for the node allocatable resource. If `allocationMultiplier` is also set, it is multiplied with the base quantity. For example, if `spec.devices[*].capacity` has an entry \"dra.example.com/memory\": \"128Gi\", and this field is set to \"dra.example.com/memory\", then for a claim allocation that consumes { \"dra.example.com/memory\": \"4Gi\" } the base quantity for the node allocatable resource mapping will be \"4Gi\", and `allocationMultiplier` should be omitted or set to \"1\".", - "allocationMultiplier": "AllocationMultiplier is used as a multiplier for the allocated device count or the allocated capacity in the claim. It defaults to 1 if not specified. How the field is used also depends on whether `capacityKey` is set. 1. If `capacityKey` is NOT set: `allocationMultiplier` multiplies the device count allocated to the claim.\n\t a. A DRA driver representing each CPU core as a device would have\n {ResourceName: \"cpu\", allocationMultiplier: \"2\"} in its\n `nodeAllocatableResourceMappings`. If 4 devices are allocated to the claim,\n\t\t 4 * 2 CPUs would be considered as allocated and subtracted from the node's capacity.\n b. A GPU device that needs additional node memory per GPU allocation would\n have {ResourceName: \"memory\", allocationMultiplier: \"2Gi\"}. Each allocated\n\t\t GPU device instance of this type will account for 2Gi of memory.\n\n2. If `capacityKey` IS set: `allocationMultiplier` is multiplied by the amount of that capacity consumed.\n\t The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `allocationMultiplier`.\n For example, if a Device's capacity \"dra.example.com/cores\" is consumed,\n and each \"core\" provides 2 \"cpu\"s, the mapping would be:\n {ResourceName: \"cpu\", capacityKey: \"dra.example.com/cores\", allocationMultiplier: \"2\"}.\n If a claim consumes 8 \"dra.example.com/cores\", the CPU footprint is 8 * 2 = 16.", +var map_NodeAllocatableMapping = map[string]string{ + "": "NodeAllocatableMapping defines how a DRA allocation directly translates into a node allocatable resource quantity. The mapping can be derived from either the count of allocated devices (via deviceMultiplier) or the specific capacity consumed (via capacityKey and capacityMultiplier). These options are mutually exclusive. Kubelet adds this mapped resource quantity from claim to both requests and limits at the pod-level cgroup, and to limits at the container-level cgroup for each container referencing the claim.", + "capacityKey": "CapacityKey references a capacity name defined as a key in the `spec.devices[*].capacity` map. When this field is set, the value associated with this key in the `status.allocation.devices.results[*].consumedCapacity` map (for a specific claim allocation) determines the base quantity for the node allocatable resource. `capacityMultiplier` must also be set and is multiplied with the base quantity. For example, if `spec.devices[*].capacity` has an entry \"dra.example.com/memory\": \"128Gi\", and this field is set to \"dra.example.com/memory\", then for a claim allocation that consumes { \"dra.example.com/memory\": \"4Gi\" } the base quantity for the node allocatable resource mapping will be \"4Gi\". The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`.", + "capacityMultiplier": "CapacityMultiplier is used as a multiplier for the allocated capacity consumed. It is only valid if `capacityKey` is set. The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. For example, if a Device's capacity \"dra.example.com/cores\" is consumed, and each \"core\" provides 2 \"cpu\"s, the mapping would be: {ResourceName: \"cpu\", capacityKey: \"dra.example.com/cores\", capacityMultiplier: \"2\"}. If a claim consumes 8 \"dra.example.com/cores\", the CPU footprint is 8 * 2 = 16.", + "deviceMultiplier": "DeviceMultiplier is used as a multiplier for the allocated device count in the claim. The final node allocatable resource amount is `deviceCount` * `deviceMultiplier`. For example, a DRA driver representing each cache complex (CCX) as a device would have {ResourceName: \"cpu\", deviceMultiplier: \"8\"} in its `nodeAllocatableResources`. If 2 devices (CCX) are allocated to the claim, 2 * 8 = 16 CPUs would be considered as allocated. It is only valid when `capacityKey` and `capacityMultiplier` are not set.", +} + +func (NodeAllocatableMapping) SwaggerDoc() map[string]string { + return map_NodeAllocatableMapping +} + +var map_NodeAllocatableOverhead = map[string]string{ + "": "NodeAllocatableOverhead defines auxiliary resource overheads incurred when allocating a device. Overheads can be specified as a fixed cost per pod referencing the claim, a variable cost per container reference, or both. Kubelet accounts for this overhead by adding it to both the pod-level and container-level cgroups of referencing containers.", + "perPod": "PerPod is overhead applied once per pod referencing the claim on this node. This is a flat overhead incurred for every pod referencing the claim.", + "perContainer": "PerContainer is applied per container reference to the claim. This models overhead scaling linearly with the number of containers actively using the device. When both PerPod and PerContainer are specified, the total overhead allocated for each pod referencing the claim is computed as: Quantity = PerPod + (PerContainer * NumReferences) Kubelet accounts for this overhead in cgroups: - Pod-level cgroup (requests and limits): Kubelet adds PerPod + (PerContainer * NumReferences). - Container-level cgroup (limits only): Kubelet adds PerPod + PerContainer for each referencing container. This allows any single container to access the pod-level overhead, while the parent cgroup caps the total usage to account for PerPod exactly once.", +} + +func (NodeAllocatableOverhead) SwaggerDoc() map[string]string { + return map_NodeAllocatableOverhead +} + +var map_NodeAllocatableResource = map[string]string{ + "": "NodeAllocatableResource defines the translation between the DRA device/capacity units requested to the corresponding quantity of the node allocatable resource. At least one of Mapping or Overhead must be specified. Not specifying either is an invalid configuration.", + "mapping": "Mapping is used when the device directly models a node allocatable resource like standard CPU or memory (e.g., with a CPU DRA driver). The calculated quantity is accounted for exactly once per claim instance on the node. To prevent node cgroup isolation friction, the scheduler explicitly blocks sharing mapped device claims across multiple pods.", + "overhead": "Overhead contains fields for modeling auxiliary overhead incurred on node allocatable resources when allocating devices that are not themselves modeling a node allocatable resource (e.g., host memory overhead for GPUs). Sharing overhead-mapped claims across multiple pods is allowed. The node allocatable overhead is accounted for individually for each pod referencing the claim. Overhead is always subtracted from the node's allocatable capacity for the resource, even when mapping is specified for the same resource. Eg: If a device models memory capacity per socket as a consumable capacity pool via Mapping (with CapacityKey), any overhead specified for the same resource will be subtracted from the node's general allocatable capacity and not from the per-socket capacity pool in Mapping.", } -func (NodeAllocatableResourceMapping) SwaggerDoc() map[string]string { - return map_NodeAllocatableResourceMapping +func (NodeAllocatableResource) SwaggerDoc() map[string]string { + return map_NodeAllocatableResource } var map_OpaqueDeviceConfiguration = map[string]string{ @@ -528,7 +563,7 @@ func (ResourceClaimTemplateSpec) SwaggerDoc() map[string]string { var map_ResourcePool = map[string]string{ "": "ResourcePool describes the pool that ResourceSlices belong to.", - "name": "Name is used to identify the pool. For node-local devices, this is often the node name, but this is not required.\n\nIt must not be longer than 253 characters and must consist of one or more DNS sub-domains separated by slashes. This field is immutable.", + "name": "Name is used to identify the pool. For node-local devices, this is often the node name, but this is not required. A field selector can be used to list only ResourceSlice objects belonging to a certain pool.\n\nIt must not be longer than 253 characters and must consist of one or more DNS sub-domains separated by slashes. This field is immutable.", "generation": "Generation tracks the change in a pool over time. Whenever a driver changes something about one or more of the resources in a pool, it must change the generation in all ResourceSlices which are part of that pool. Consumers of ResourceSlices should only consider resources from the pool with the highest generation number. The generation may be reset by drivers, which should be fine for consumers, assuming that all ResourceSlices in a pool are updated to match or deleted.\n\nCombined with ResourceSliceCount, this mechanism enables consumers to detect pools which are comprised of multiple ResourceSlices and are in an incomplete state.", "resourceSliceCount": "ResourceSliceCount is the total number of ResourceSlices in the pool at this generation number. Must be greater than zero.\n\nConsumers can use this to check whether they have seen all ResourceSlices belonging to the same pool.", } @@ -567,6 +602,8 @@ var map_ResourceSliceSpec = map[string]string{ "devices": "Devices lists some or all of the devices in this pool.\n\nMust not have more than 128 entries. If any device uses taints or consumes counters the limit is 64.\n\nOnly one of Devices and SharedCounters can be set in a ResourceSlice.", "perDeviceNodeSelection": "PerDeviceNodeSelection defines whether the access from nodes to resources in the pool is set on the ResourceSlice level or on each device. If it is set to true, every device defined the ResourceSlice must specify this individually.\n\nExactly one of NodeName, NodeSelector, AllNodes, and PerDeviceNodeSelection must be set.", "sharedCounters": "SharedCounters defines a list of counter sets, each of which has a name and a list of counters available.\n\nThe names of the counter sets must be unique in the ResourcePool.\n\nOnly one of Devices and SharedCounters can be set in a ResourceSlice.\n\nThe maximum number of counter sets is 8.", + "partitionTypeAttribute": "PartitionTypeAttribute names a string device attribute (by fully qualified name, e.g. \"gpu.example.com/profile\") whose value labels each device with its partition type, such as \"Full\" or \"Half\" for a MIG-style GPU.\n\nWhen set, every partitionable device in the slice must carry the attribute and devices sharing a value must share the same ConsumesCounters cost.", + "skipNodeOperations": "SkipNodeOperations lists node-local resource operations (gRPC calls) that will be skipped for the devices in this slice when determining whether operations are necessary on the node. If all allocated devices for a driver in a claim skip an operation, that gRPC call will be skipped. Valid values are:\n\n- \"NodePrepareResources\": NodePrepareResources gRPC calls are skipped. This\n value cannot be specified unless \"NodeUnprepareResources\" is also listed\n (or \"*\" is specified).\n- \"NodeUnprepareResources\": NodeUnprepareResources gRPC calls are skipped. - \"*\": All node-local resource operations are skipped.\n\nOther values may be added in the future. The kubelet must ignore unknown values.", } func (ResourceSliceSpec) SwaggerDoc() map[string]string { diff --git a/vendor/k8s.io/api/resource/v1beta2/zz_generated.deepcopy.go b/vendor/k8s.io/api/resource/v1beta2/zz_generated.deepcopy.go index 820ad2af61..5e87f13ca1 100644 --- a/vendor/k8s.io/api/resource/v1beta2/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/resource/v1beta2/zz_generated.deepcopy.go @@ -302,9 +302,9 @@ func (in *Device) DeepCopyInto(out *Device) { *out = new(bool) **out = **in } - if in.NodeAllocatableResourceMappings != nil { - in, out := &in.NodeAllocatableResourceMappings, &out.NodeAllocatableResourceMappings - *out = make(map[corev1.ResourceName]NodeAllocatableResourceMapping, len(*in)) + if in.NodeAllocatableResources != nil { + in, out := &in.NodeAllocatableResources, &out.NodeAllocatableResources + *out = make(map[corev1.ResourceName]NodeAllocatableResource, len(*in)) for key, val := range *in { (*out)[key] = *val.DeepCopy() } @@ -685,6 +685,11 @@ func (in *DeviceCounterConsumption) DeepCopyInto(out *DeviceCounterConsumption) (*out)[key] = *val.DeepCopy() } } + if in.CompatibilityGroups != nil { + in, out := &in.CompatibilityGroups, &out.CompatibilityGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } return } @@ -698,6 +703,22 @@ func (in *DeviceCounterConsumption) DeepCopy() *DeviceCounterConsumption { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceDerivedAttribute) DeepCopyInto(out *DeviceDerivedAttribute) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceDerivedAttribute. +func (in *DeviceDerivedAttribute) DeepCopy() *DeviceDerivedAttribute { + if in == nil { + return nil + } + out := new(DeviceDerivedAttribute) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeviceRequest) DeepCopyInto(out *DeviceRequest) { *out = *in @@ -763,6 +784,11 @@ func (in *DeviceRequestAllocationResult) DeepCopyInto(out *DeviceRequestAllocati (*out)[key] = val.DeepCopy() } } + if in.SkipNodeOperations != nil { + in, out := &in.SkipNodeOperations, &out.SkipNodeOperations + *out = make([]SkipNodeOperation, len(*in)) + copy(*out, *in) + } return } @@ -819,6 +845,11 @@ func (in *DeviceSubRequest) DeepCopyInto(out *DeviceSubRequest) { *out = new(CapacityRequirements) (*in).DeepCopyInto(*out) } + if in.DerivedAttributes != nil { + in, out := &in.DerivedAttributes, &out.DerivedAttributes + *out = make([]DeviceDerivedAttribute, len(*in)) + copy(*out, *in) + } return } @@ -1037,6 +1068,11 @@ func (in *ExactDeviceRequest) DeepCopyInto(out *ExactDeviceRequest) { *out = new(CapacityRequirements) (*in).DeepCopyInto(*out) } + if in.DerivedAttributes != nil { + in, out := &in.DerivedAttributes, &out.DerivedAttributes + *out = make([]DeviceDerivedAttribute, len(*in)) + copy(*out, *in) + } return } @@ -1072,27 +1108,84 @@ func (in *NetworkDeviceData) DeepCopy() *NetworkDeviceData { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeAllocatableResourceMapping) DeepCopyInto(out *NodeAllocatableResourceMapping) { +func (in *NodeAllocatableMapping) DeepCopyInto(out *NodeAllocatableMapping) { *out = *in if in.CapacityKey != nil { in, out := &in.CapacityKey, &out.CapacityKey *out = new(QualifiedName) **out = **in } - if in.AllocationMultiplier != nil { - in, out := &in.AllocationMultiplier, &out.AllocationMultiplier + if in.CapacityMultiplier != nil { + in, out := &in.CapacityMultiplier, &out.CapacityMultiplier + x := (*in).DeepCopy() + *out = &x + } + if in.DeviceMultiplier != nil { + in, out := &in.DeviceMultiplier, &out.DeviceMultiplier x := (*in).DeepCopy() *out = &x } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocatableResourceMapping. -func (in *NodeAllocatableResourceMapping) DeepCopy() *NodeAllocatableResourceMapping { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocatableMapping. +func (in *NodeAllocatableMapping) DeepCopy() *NodeAllocatableMapping { if in == nil { return nil } - out := new(NodeAllocatableResourceMapping) + out := new(NodeAllocatableMapping) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeAllocatableOverhead) DeepCopyInto(out *NodeAllocatableOverhead) { + *out = *in + if in.PerPod != nil { + in, out := &in.PerPod, &out.PerPod + x := (*in).DeepCopy() + *out = &x + } + if in.PerContainer != nil { + in, out := &in.PerContainer, &out.PerContainer + x := (*in).DeepCopy() + *out = &x + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocatableOverhead. +func (in *NodeAllocatableOverhead) DeepCopy() *NodeAllocatableOverhead { + if in == nil { + return nil + } + out := new(NodeAllocatableOverhead) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeAllocatableResource) DeepCopyInto(out *NodeAllocatableResource) { + *out = *in + if in.Mapping != nil { + in, out := &in.Mapping, &out.Mapping + *out = new(NodeAllocatableMapping) + (*in).DeepCopyInto(*out) + } + if in.Overhead != nil { + in, out := &in.Overhead, &out.Overhead + *out = new(NodeAllocatableOverhead) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocatableResource. +func (in *NodeAllocatableResource) DeepCopy() *NodeAllocatableResource { + if in == nil { + return nil + } + out := new(NodeAllocatableResource) in.DeepCopyInto(out) return out } @@ -1433,6 +1526,16 @@ func (in *ResourceSliceSpec) DeepCopyInto(out *ResourceSliceSpec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.PartitionTypeAttribute != nil { + in, out := &in.PartitionTypeAttribute, &out.PartitionTypeAttribute + *out = new(FullyQualifiedName) + **out = **in + } + if in.SkipNodeOperations != nil { + in, out := &in.SkipNodeOperations, &out.SkipNodeOperations + *out = make([]SkipNodeOperation, len(*in)) + copy(*out, *in) + } return } diff --git a/vendor/k8s.io/api/resource/v1beta2/zz_generated.model_name.go b/vendor/k8s.io/api/resource/v1beta2/zz_generated.model_name.go index ce388ffd2e..7135589ce4 100644 --- a/vendor/k8s.io/api/resource/v1beta2/zz_generated.model_name.go +++ b/vendor/k8s.io/api/resource/v1beta2/zz_generated.model_name.go @@ -131,6 +131,11 @@ func (in DeviceCounterConsumption) OpenAPIModelName() string { return "io.k8s.api.resource.v1beta2.DeviceCounterConsumption" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DeviceDerivedAttribute) OpenAPIModelName() string { + return "io.k8s.api.resource.v1beta2.DeviceDerivedAttribute" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in DeviceRequest) OpenAPIModelName() string { return "io.k8s.api.resource.v1beta2.DeviceRequest" @@ -197,8 +202,18 @@ func (in NetworkDeviceData) OpenAPIModelName() string { } // OpenAPIModelName returns the OpenAPI model name for this type. -func (in NodeAllocatableResourceMapping) OpenAPIModelName() string { - return "io.k8s.api.resource.v1beta2.NodeAllocatableResourceMapping" +func (in NodeAllocatableMapping) OpenAPIModelName() string { + return "io.k8s.api.resource.v1beta2.NodeAllocatableMapping" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeAllocatableOverhead) OpenAPIModelName() string { + return "io.k8s.api.resource.v1beta2.NodeAllocatableOverhead" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeAllocatableResource) OpenAPIModelName() string { + return "io.k8s.api.resource.v1beta2.NodeAllocatableResource" } // OpenAPIModelName returns the OpenAPI model name for this type. diff --git a/vendor/k8s.io/api/scheduling/v1/generated.proto b/vendor/k8s.io/api/scheduling/v1/generated.proto index 6be7204de1..20eb5907d4 100644 --- a/vendor/k8s.io/api/scheduling/v1/generated.proto +++ b/vendor/k8s.io/api/scheduling/v1/generated.proto @@ -32,7 +32,7 @@ option go_package = "k8s.io/api/scheduling/v1"; // PriorityClass defines mapping from a priority class name to the priority // integer value. The value can be any valid integer. message PriorityClass { - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; diff --git a/vendor/k8s.io/api/scheduling/v1/types.go b/vendor/k8s.io/api/scheduling/v1/types.go index 655b5eb159..f1f259fee0 100644 --- a/vendor/k8s.io/api/scheduling/v1/types.go +++ b/vendor/k8s.io/api/scheduling/v1/types.go @@ -29,8 +29,8 @@ import ( // PriorityClass defines mapping from a priority class name to the priority // integer value. The value can be any valid integer. type PriorityClass struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -65,7 +65,7 @@ type PriorityClass struct { // PriorityClassList is a collection of priority classes. type PriorityClassList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional diff --git a/vendor/k8s.io/api/scheduling/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/scheduling/v1/types_swagger_doc_generated.go index f167e19707..8913d60025 100644 --- a/vendor/k8s.io/api/scheduling/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/scheduling/v1/types_swagger_doc_generated.go @@ -29,7 +29,7 @@ package v1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_PriorityClass = map[string]string{ "": "PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "value": "value represents the integer value of this priority class. This is the actual priority that pods receive when they have the name of this class in their pod spec.", "globalDefault": "globalDefault specifies whether this PriorityClass should be considered as the default priority for pods that do not have any priority class. Only one PriorityClass can be marked as `globalDefault`. However, if more than one PriorityClasses exists with their `globalDefault` field set to true, the smallest value of such global default PriorityClasses will be used as the default priority.", "description": "description is an arbitrary string that usually provides guidelines on when this priority class should be used.", diff --git a/vendor/k8s.io/api/scheduling/v1alpha2/generated.proto b/vendor/k8s.io/api/scheduling/v1alpha2/generated.proto deleted file mode 100644 index 73b3308e38..0000000000 --- a/vendor/k8s.io/api/scheduling/v1alpha2/generated.proto +++ /dev/null @@ -1,550 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = "proto2"; - -package k8s.io.api.scheduling.v1alpha2; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "k8s.io/api/scheduling/v1alpha2"; - -// BasicSchedulingPolicy indicates that standard Kubernetes -// scheduling behavior should be used. -message BasicSchedulingPolicy { -} - -// GangSchedulingPolicy defines the parameters for gang scheduling. -message GangSchedulingPolicy { - // MinCount is the minimum number of pods that must be schedulable or scheduled - // at the same time for the scheduler to admit the entire group. - // It must be a positive integer. - // - // +required - // +k8s:required - // +k8s:minimum=1 - optional int32 minCount = 1; -} - -// PodGroup represents a runtime instance of pods grouped together. -// PodGroups are created by workload controllers (Job, LWS, JobSet, etc...) from -// Workload.podGroupTemplates. -// PodGroup API enablement is toggled by the GenericWorkload feature gate. -message PodGroup { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines the desired state of the PodGroup. - // - // +required - optional PodGroupSpec spec = 2; - - // Status represents the current observed state of the PodGroup. - // - // +optional - optional PodGroupStatus status = 3; -} - -// PodGroupList contains a list of PodGroup resources. -message PodGroupList { - // Standard list metadata. - // - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of PodGroups. - repeated PodGroup items = 2; -} - -// PodGroupResourceClaim references exactly one ResourceClaim, either directly -// or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim -// for the PodGroup. -// -// It adds a name to it that uniquely identifies the ResourceClaim inside the PodGroup. -// Pods that need access to the ResourceClaim define a matching reference in its -// own Spec.ResourceClaims. The Pod's claim must match all fields of the -// PodGroup's claim exactly. -message PodGroupResourceClaim { - // Name uniquely identifies this resource claim inside the PodGroup. - // This must be a DNS_LABEL. - // - // +required - // +k8s:required - // +k8s:format=k8s-short-name - optional string name = 1; - - // ResourceClaimName is the name of a ResourceClaim object in the same - // namespace as this PodGroup. The ResourceClaim will be reserved for the - // PodGroup instead of its individual pods. - // - // Exactly one of ResourceClaimName and ResourceClaimTemplateName must - // be set. - // - // +optional - // +k8s:optional - // +k8s:unionMember - // +k8s:format=k8s-long-name - optional string resourceClaimName = 2; - - // ResourceClaimTemplateName is the name of a ResourceClaimTemplate - // object in the same namespace as this PodGroup. - // - // The template will be used to create a new ResourceClaim, which will - // be bound to this PodGroup. When this PodGroup is deleted, the ResourceClaim - // will also be deleted. The PodGroup 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 podgroup.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. - // - // +optional - // +k8s:optional - // +k8s:unionMember - // +k8s:format=k8s-long-name - optional string resourceClaimTemplateName = 3; -} - -// PodGroupResourceClaimStatus is stored in the PodGroupStatus for each -// PodGroupResourceClaim which references a ResourceClaimTemplate. It stores the -// generated name for the corresponding ResourceClaim. -message PodGroupResourceClaimStatus { - // Name uniquely identifies this resource claim inside the PodGroup. This - // must match the name of an entry in podgroup.spec.resourceClaims, which - // implies that the string must be a DNS_LABEL. - // - // +required - optional string name = 1; - - // ResourceClaimName is the name of the ResourceClaim that was generated for - // the PodGroup in the namespace of the PodGroup. If this is unset, then - // generating a ResourceClaim was not necessary. The - // podgroup.spec.resourceClaims entry can be ignored in this case. - // - // +optional - // +k8s:optional - // +k8s:format=k8s-long-name - optional string resourceClaimName = 2; -} - -// PodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a PodGroup. -message PodGroupSchedulingConstraints { - // Topology defines the topology constraints for the pod group. - // Currently only a single topology constraint can be specified. This may change in the future. - // - // +optional - // +k8s:optional - // +k8s:maxItems=1 - // +listType=atomic - // +k8s:listType=atomic - repeated TopologyConstraint topology = 1; -} - -// PodGroupSchedulingPolicy defines the scheduling configuration for a PodGroup. -// Exactly one policy must be set. -// +union -message PodGroupSchedulingPolicy { - // Basic specifies that the pods in this group should be scheduled using - // standard Kubernetes scheduling behavior. - // - // +optional - // +k8s:optional - // +k8s:unionMember - optional BasicSchedulingPolicy basic = 1; - - // Gang specifies that the pods in this group should be scheduled using - // all-or-nothing semantics. - // - // +optional - // +k8s:optional - // +k8s:unionMember - optional GangSchedulingPolicy gang = 2; -} - -// PodGroupSpec defines the desired state of a PodGroup. -message PodGroupSpec { - // PodGroupTemplateRef references an optional PodGroup template within other object - // (e.g. Workload) that was used to create the PodGroup. This field is immutable. - // - // +optional - // +k8s:optional - // +k8s:immutable - optional PodGroupTemplateReference podGroupTemplateRef = 1; - - // SchedulingPolicy defines the scheduling policy for this instance of the PodGroup. - // Controllers are expected to fill this field by copying it from a PodGroupTemplate. - // This field is immutable. - // - // +required - // +k8s:immutable - optional PodGroupSchedulingPolicy schedulingPolicy = 2; - - // SchedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroup. - // Controllers are expected to fill this field by copying it from a PodGroupTemplate. - // This field is immutable. - // This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. - // - // +featureGate=TopologyAwareWorkloadScheduling - // +optional - // +k8s:ifDisabled(TopologyAwareWorkloadScheduling)=+k8s:forbidden - // +k8s:ifEnabled(TopologyAwareWorkloadScheduling)=+k8s:optional - // +k8s:ifEnabled(TopologyAwareWorkloadScheduling)=+k8s:immutable - optional PodGroupSchedulingConstraints schedulingConstraints = 3; - - // ResourceClaims defines which ResourceClaims may be shared among Pods in - // the group. Pods consume the devices allocated to a PodGroup's claim by - // defining a claim in its own Spec.ResourceClaims that matches the - // PodGroup's claim exactly. The claim must have the same name and refer to - // the same ResourceClaim or ResourceClaimTemplate. - // - // This is an alpha-level field and requires that the - // DRAWorkloadResourceClaims feature gate is enabled. - // - // This field is immutable. - // - // +optional - // +patchMergeKey=name - // +patchStrategy=merge,retainKeys - // +listType=map - // +listMapKey=name - // +k8s:optional - // +k8s:listType=map - // +k8s:listMapKey=name - // +k8s:maxItems=4 - // +k8s:immutable - // +featureGate=DRAWorkloadResourceClaims - repeated PodGroupResourceClaim resourceClaims = 4; - - // DisruptionMode defines the mode in which a given PodGroup can be disrupted. - // Controllers are expected to fill this field by copying it from a PodGroupTemplate. - // One of Pod, PodGroup. Defaults to Pod if unset. - // This field is immutable. - // This field is available only when the WorkloadAwarePreemption feature gate - // is enabled. - // - // +featureGate=WorkloadAwarePreemption - // +optional - // +k8s:ifDisabled("WorkloadAwarePreemption")=+k8s:forbidden - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:optional - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:immutable - // +default="Pod" - optional string disruptionMode = 5; - - // PriorityClassName defines the priority that should be considered when scheduling this pod group. - // Controllers are expected to fill this field by copying it from a PodGroupTemplate. - // Otherwise, it is validated and resolved similarly to the PriorityClassName on PodGroupTemplate - // (i.e. if no priority class is specified, admission control can set this to the global default - // priority class if it exists. Otherwise, the pod group's priority will be zero). - // This field is immutable. - // This field is available only when the WorkloadAwarePreemption feature gate - // is enabled. - // - // +featureGate=WorkloadAwarePreemption - // +optional - // +k8s:ifDisabled("WorkloadAwarePreemption")=+k8s:forbidden - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:optional - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:format=k8s-long-name - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:immutable - optional string priorityClassName = 6; - - // Priority is the value of priority of this pod group. Various system components - // use this field to find the priority of the pod group. When Priority Admission - // Controller is enabled, it prevents users from setting this field. The admission - // controller populates this field from PriorityClassName. - // The higher the value, the higher the priority. - // This field is immutable. - // This field is available only when the WorkloadAwarePreemption feature gate - // is enabled. - // - // +featureGate=WorkloadAwarePreemption - // +optional - // +k8s:ifDisabled("WorkloadAwarePreemption")=+k8s:forbidden - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:optional - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:immutable - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:maximum=1000000000 # HighestUserDefinablePriority - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:minimum=-2147483648 - optional int32 priority = 7; -} - -// PodGroupStatus represents information about the status of a pod group. -message PodGroupStatus { - // Conditions represent the latest observations of the PodGroup's state. - // - // Known condition types: - // - "PodGroupScheduled": Indicates whether the scheduling requirement has been satisfied. - // - "DisruptionTarget": Indicates whether the PodGroup is about to be terminated - // due to disruption such as preemption. - // - // Known reasons for the PodGroupScheduled condition: - // - "Unschedulable": The PodGroup cannot be scheduled due to resource constraints, - // affinity/anti-affinity rules, or insufficient capacity for the gang. - // - "SchedulerError": The PodGroup cannot be scheduled due to some internal error - // that happened during scheduling, for example due to nodeAffinity parsing errors. - // - // Known reasons for the DisruptionTarget condition: - // - "PreemptionByScheduler": The PodGroup was preempted by the scheduler to make room for - // higher-priority PodGroups or Pods. - // - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - // +listType=map - // +listMapKey=type - repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1; - - // Status of resource claims. - // +optional - // +patchMergeKey=name - // +patchStrategy=merge,retainKeys - // +listType=map - // +listMapKey=name - // +k8s:optional - // +k8s:listType=map - // +k8s:listMapKey=name - // +k8s:maxItems=4 - // +featureGate=DRAWorkloadResourceClaims - repeated PodGroupResourceClaimStatus resourceClaimStatuses = 2; -} - -// PodGroupTemplate represents a template for a set of pods with a scheduling policy. -message PodGroupTemplate { - // Name is a unique identifier for the PodGroupTemplate within the Workload. - // It must be a DNS label. This field is immutable. - // - // +required - // +k8s:required - // +k8s:format=k8s-short-name - optional string name = 1; - - // SchedulingPolicy defines the scheduling policy for this PodGroupTemplate. - // - // +required - optional PodGroupSchedulingPolicy schedulingPolicy = 2; - - // SchedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroupTemplate. - // This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. - // - // +featureGate=TopologyAwareWorkloadScheduling - // +optional - // +k8s:ifDisabled(TopologyAwareWorkloadScheduling)=+k8s:forbidden - // +k8s:ifEnabled(TopologyAwareWorkloadScheduling)=+k8s:optional - optional PodGroupSchedulingConstraints schedulingConstraints = 3; - - // ResourceClaims defines which ResourceClaims may be shared among Pods in - // the group. Pods consume the devices allocated to a PodGroup's claim by - // defining a claim in its own Spec.ResourceClaims that matches the - // PodGroup's claim exactly. The claim must have the same name and refer to - // the same ResourceClaim or ResourceClaimTemplate. - // - // This is an alpha-level field and requires that the - // DRAWorkloadResourceClaims feature gate is enabled. - // - // This field is immutable. - // - // +optional - // +patchMergeKey=name - // +patchStrategy=merge,retainKeys - // +listType=map - // +listMapKey=name - // +k8s:optional - // +k8s:listType=map - // +k8s:listMapKey=name - // +k8s:maxItems=4 - // +k8s:immutable - // +featureGate=DRAWorkloadResourceClaims - repeated PodGroupResourceClaim resourceClaims = 4; - - // DisruptionMode defines the mode in which a given PodGroup can be disrupted. - // One of Pod, PodGroup. - // This field is available only when the WorkloadAwarePreemption feature gate - // is enabled. - // - // +featureGate=WorkloadAwarePreemption - // +optional - // +k8s:ifDisabled("WorkloadAwarePreemption")=+k8s:forbidden - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:optional - optional string disruptionMode = 5; - - // PriorityClassName indicates the priority that should be considered when scheduling - // a pod group created from this template. If no priority class is specified, admission - // control can set this to the global default priority class if it exists. Otherwise, - // pod groups created from this template will have the priority set to zero. - // This field is available only when the WorkloadAwarePreemption feature gate - // is enabled. - // - // +featureGate=WorkloadAwarePreemption - // +optional - // +k8s:ifDisabled("WorkloadAwarePreemption")=+k8s:forbidden - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:optional - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:format=k8s-long-name - optional string priorityClassName = 6; - - // Priority is the value of priority of pod groups created from this template. Various - // system components use this field to find the priority of the pod group. When - // Priority Admission Controller is enabled, it prevents users from setting this field. - // The admission controller populates this field from PriorityClassName. - // The higher the value, the higher the priority. - // This field is available only when the WorkloadAwarePreemption feature gate - // is enabled. - // - // +featureGate=WorkloadAwarePreemption - // +optional - // +k8s:ifDisabled("WorkloadAwarePreemption")=+k8s:forbidden - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:optional - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:maximum=1000000000 # HighestUserDefinablePriority - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:minimum=-2147483648 - optional int32 priority = 7; -} - -// PodGroupTemplateReference references a PodGroup template defined in some object (e.g. Workload). -// Exactly one reference must be set. -// +union -message PodGroupTemplateReference { - // Workload references the PodGroupTemplate within the Workload object that was used to create - // the PodGroup. - // - // +optional - // +k8s:optional - // +k8s:unionMember - optional WorkloadPodGroupTemplateReference workload = 1; -} - -// TopologyConstraint defines a topology constraint for a PodGroup. -message TopologyConstraint { - // Key specifies the key of the node label representing the topology domain. - // All pods within the PodGroup must be colocated within the same domain instance. - // Different PodGroups can land on different domain instances even if they derive from the same PodGroupTemplate. - // Examples: "topology.kubernetes.io/rack" - // - // +required - // +k8s:required - // +k8s:format=k8s-label-key - optional string key = 1; -} - -// TypedLocalObjectReference allows to reference typed object inside the same namespace. -message TypedLocalObjectReference { - // APIGroup is the group for the resource being referenced. - // If APIGroup is empty, the specified Kind must be in the core API group. - // For any other third-party types, setting APIGroup is required. - // It must be a DNS subdomain. - // - // +optional - // +k8s:optional - // +k8s:format=k8s-long-name - optional string apiGroup = 1; - - // Kind is the type of resource being referenced. - // It must be a path segment name. - // - // +required - // +k8s:required - // +k8s:format=k8s-path-segment-name - optional string kind = 2; - - // Name is the name of resource being referenced. - // It must be a path segment name. - // - // +required - // +k8s:required - // +k8s:format=k8s-path-segment-name - optional string name = 3; -} - -// Workload allows for expressing scheduling constraints that should be used -// when managing the lifecycle of workloads from the scheduling perspective, -// including scheduling, preemption, eviction and other phases. -// Workload API enablement is toggled by the GenericWorkload feature gate. -message Workload { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines the desired behavior of a Workload. - // - // +required - optional WorkloadSpec spec = 2; -} - -// WorkloadList contains a list of Workload resources. -message WorkloadList { - // Standard list metadata. - // - // +optional - optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is the list of Workloads. - repeated Workload items = 2; -} - -// WorkloadPodGroupTemplateReference references the PodGroupTemplate within the Workload object. -message WorkloadPodGroupTemplateReference { - // WorkloadName defines the name of the Workload object. - // - // +required - // +k8s:required - // +k8s:format=k8s-long-name - optional string workloadName = 1; - - // PodGroupTemplateName defines the PodGroupTemplate name within the Workload object. - // - // +required - // +k8s:required - // +k8s:format=k8s-short-name - optional string podGroupTemplateName = 2; -} - -// WorkloadSpec defines the desired state of a Workload. -message WorkloadSpec { - // ControllerRef is an optional reference to the controlling object, such as a - // Deployment or Job. This field is intended for use by tools like CLIs - // to provide a link back to the original workload definition. - // This field is immutable. - // - // +optional - // +k8s:optional - // +k8s:immutable - optional TypedLocalObjectReference controllerRef = 1; - - // PodGroupTemplates is the list of templates that make up the Workload. - // The maximum number of templates is 8. This field is immutable. - // - // +required - // +listType=map - // +listMapKey=name - // +k8s:required - // +k8s:listType=map - // +k8s:listMapKey=name - // +k8s:maxItems=8 - // +k8s:immutable - repeated PodGroupTemplate podGroupTemplates = 2; -} - diff --git a/vendor/k8s.io/api/scheduling/v1alpha2/types.go b/vendor/k8s.io/api/scheduling/v1alpha2/types.go deleted file mode 100644 index 1f84f2c43d..0000000000 --- a/vendor/k8s.io/api/scheduling/v1alpha2/types.go +++ /dev/null @@ -1,601 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha2 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// Workload allows for expressing scheduling constraints that should be used -// when managing the lifecycle of workloads from the scheduling perspective, -// including scheduling, preemption, eviction and other phases. -// Workload API enablement is toggled by the GenericWorkload feature gate. -type Workload struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Spec defines the desired behavior of a Workload. - // - // +required - Spec WorkloadSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// WorkloadList contains a list of Workload resources. -type WorkloadList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata. - // - // +optional - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Items is the list of Workloads. - Items []Workload `json:"items" protobuf:"bytes,2,rep,name=items"` -} - -// WorkloadMaxPodGroupTemplates is the maximum number of pod group templates per Workload. -const WorkloadMaxPodGroupTemplates = 8 - -// WorkloadSpec defines the desired state of a Workload. -type WorkloadSpec struct { - // ControllerRef is an optional reference to the controlling object, such as a - // Deployment or Job. This field is intended for use by tools like CLIs - // to provide a link back to the original workload definition. - // This field is immutable. - // - // +optional - // +k8s:optional - // +k8s:immutable - ControllerRef *TypedLocalObjectReference `json:"controllerRef,omitempty" protobuf:"bytes,1,opt,name=controllerRef"` - - // PodGroupTemplates is the list of templates that make up the Workload. - // The maximum number of templates is 8. This field is immutable. - // - // +required - // +listType=map - // +listMapKey=name - // +k8s:required - // +k8s:listType=map - // +k8s:listMapKey=name - // +k8s:maxItems=8 - // +k8s:immutable - PodGroupTemplates []PodGroupTemplate `json:"podGroupTemplates" protobuf:"bytes,2,rep,name=podGroupTemplates"` -} - -// TypedLocalObjectReference allows to reference typed object inside the same namespace. -type TypedLocalObjectReference struct { - // APIGroup is the group for the resource being referenced. - // If APIGroup is empty, the specified Kind must be in the core API group. - // For any other third-party types, setting APIGroup is required. - // It must be a DNS subdomain. - // - // +optional - // +k8s:optional - // +k8s:format=k8s-long-name - APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,1,opt,name=apiGroup"` - // Kind is the type of resource being referenced. - // It must be a path segment name. - // - // +required - // +k8s:required - // +k8s:format=k8s-path-segment-name - Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"` - // Name is the name of resource being referenced. - // It must be a path segment name. - // - // +required - // +k8s:required - // +k8s:format=k8s-path-segment-name - Name string `json:"name" protobuf:"bytes,3,opt,name=name"` -} - -// MaxPodGroupResourceClaims is the maximum number of resource claims for a -// PodGroup or a Workload's PodGroupTemplate. -const MaxPodGroupResourceClaims = 4 - -// PodGroupTemplate represents a template for a set of pods with a scheduling policy. -type PodGroupTemplate struct { - // Name is a unique identifier for the PodGroupTemplate within the Workload. - // It must be a DNS label. This field is immutable. - // - // +required - // +k8s:required - // +k8s:format=k8s-short-name - Name string `json:"name" protobuf:"bytes,1,opt,name=name"` - - // SchedulingPolicy defines the scheduling policy for this PodGroupTemplate. - // - // +required - SchedulingPolicy PodGroupSchedulingPolicy `json:"schedulingPolicy" protobuf:"bytes,2,opt,name=schedulingPolicy"` - - // SchedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroupTemplate. - // This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. - // - // +featureGate=TopologyAwareWorkloadScheduling - // +optional - // +k8s:ifDisabled(TopologyAwareWorkloadScheduling)=+k8s:forbidden - // +k8s:ifEnabled(TopologyAwareWorkloadScheduling)=+k8s:optional - SchedulingConstraints *PodGroupSchedulingConstraints `json:"schedulingConstraints" protobuf:"bytes,3,opt,name=schedulingConstraints"` - - // ResourceClaims defines which ResourceClaims may be shared among Pods in - // the group. Pods consume the devices allocated to a PodGroup's claim by - // defining a claim in its own Spec.ResourceClaims that matches the - // PodGroup's claim exactly. The claim must have the same name and refer to - // the same ResourceClaim or ResourceClaimTemplate. - // - // This is an alpha-level field and requires that the - // DRAWorkloadResourceClaims feature gate is enabled. - // - // This field is immutable. - // - // +optional - // +patchMergeKey=name - // +patchStrategy=merge,retainKeys - // +listType=map - // +listMapKey=name - // +k8s:optional - // +k8s:listType=map - // +k8s:listMapKey=name - // +k8s:maxItems=4 - // +k8s:immutable - // +featureGate=DRAWorkloadResourceClaims - ResourceClaims []PodGroupResourceClaim `json:"resourceClaims,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name" protobuf:"bytes,4,rep,name=resourceClaims"` - - // DisruptionMode defines the mode in which a given PodGroup can be disrupted. - // One of Pod, PodGroup. - // This field is available only when the WorkloadAwarePreemption feature gate - // is enabled. - // - // +featureGate=WorkloadAwarePreemption - // +optional - // +k8s:ifDisabled("WorkloadAwarePreemption")=+k8s:forbidden - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:optional - DisruptionMode *DisruptionMode `json:"disruptionMode,omitempty" protobuf:"bytes,5,opt,name=disruptionMode,casttype=DisruptionMode"` - - // PriorityClassName indicates the priority that should be considered when scheduling - // a pod group created from this template. If no priority class is specified, admission - // control can set this to the global default priority class if it exists. Otherwise, - // pod groups created from this template will have the priority set to zero. - // This field is available only when the WorkloadAwarePreemption feature gate - // is enabled. - // - // +featureGate=WorkloadAwarePreemption - // +optional - // +k8s:ifDisabled("WorkloadAwarePreemption")=+k8s:forbidden - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:optional - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:format=k8s-long-name - PriorityClassName string `json:"priorityClassName,omitempty" protobuf:"bytes,6,opt,name=priorityClassName"` - - // Priority is the value of priority of pod groups created from this template. Various - // system components use this field to find the priority of the pod group. When - // Priority Admission Controller is enabled, it prevents users from setting this field. - // The admission controller populates this field from PriorityClassName. - // The higher the value, the higher the priority. - // This field is available only when the WorkloadAwarePreemption feature gate - // is enabled. - // - // +featureGate=WorkloadAwarePreemption - // +optional - // +k8s:ifDisabled("WorkloadAwarePreemption")=+k8s:forbidden - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:optional - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:maximum=1000000000 # HighestUserDefinablePriority - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:minimum=-2147483648 - Priority *int32 `json:"priority,omitempty" protobuf:"varint,7,opt,name=priority"` -} - -// PodGroupSchedulingPolicy defines the scheduling configuration for a PodGroup. -// Exactly one policy must be set. -// +union -type PodGroupSchedulingPolicy struct { - // Basic specifies that the pods in this group should be scheduled using - // standard Kubernetes scheduling behavior. - // - // +optional - // +k8s:optional - // +k8s:unionMember - Basic *BasicSchedulingPolicy `json:"basic,omitempty" protobuf:"bytes,1,opt,name=basic"` - - // Gang specifies that the pods in this group should be scheduled using - // all-or-nothing semantics. - // - // +optional - // +k8s:optional - // +k8s:unionMember - Gang *GangSchedulingPolicy `json:"gang,omitempty" protobuf:"bytes,2,opt,name=gang"` -} - -// BasicSchedulingPolicy indicates that standard Kubernetes -// scheduling behavior should be used. -type BasicSchedulingPolicy struct { - // This is intentionally empty. Its presence indicates that the basic - // scheduling policy should be applied. In the future, new fields may appear, - // describing such constraints on a pod group level without "all or nothing" - // (gang) scheduling. -} - -// GangSchedulingPolicy defines the parameters for gang scheduling. -type GangSchedulingPolicy struct { - // MinCount is the minimum number of pods that must be schedulable or scheduled - // at the same time for the scheduler to admit the entire group. - // It must be a positive integer. - // - // +required - // +k8s:required - // +k8s:minimum=1 - MinCount int32 `json:"minCount" protobuf:"varint,1,opt,name=minCount"` -} - -// PodGroupResourceClaim references exactly one ResourceClaim, either directly -// or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim -// for the PodGroup. -// -// It adds a name to it that uniquely identifies the ResourceClaim inside the PodGroup. -// Pods that need access to the ResourceClaim define a matching reference in its -// own Spec.ResourceClaims. The Pod's claim must match all fields of the -// PodGroup's claim exactly. -type PodGroupResourceClaim struct { - // Name uniquely identifies this resource claim inside the PodGroup. - // This must be a DNS_LABEL. - // - // +required - // +k8s:required - // +k8s:format=k8s-short-name - Name string `json:"name" protobuf:"bytes,1,opt,name=name"` - - // ResourceClaimName is the name of a ResourceClaim object in the same - // namespace as this PodGroup. The ResourceClaim will be reserved for the - // PodGroup instead of its individual pods. - // - // Exactly one of ResourceClaimName and ResourceClaimTemplateName must - // be set. - // - // +optional - // +k8s:optional - // +k8s:unionMember - // +k8s:format=k8s-long-name - ResourceClaimName *string `json:"resourceClaimName,omitempty" protobuf:"bytes,2,opt,name=resourceClaimName"` - - // ResourceClaimTemplateName is the name of a ResourceClaimTemplate - // object in the same namespace as this PodGroup. - // - // The template will be used to create a new ResourceClaim, which will - // be bound to this PodGroup. When this PodGroup is deleted, the ResourceClaim - // will also be deleted. The PodGroup 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 podgroup.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. - // - // +optional - // +k8s:optional - // +k8s:unionMember - // +k8s:format=k8s-long-name - ResourceClaimTemplateName *string `json:"resourceClaimTemplateName,omitempty" protobuf:"bytes,3,opt,name=resourceClaimTemplateName"` -} - -// DisruptionMode describes the mode in which a PodGroup can be disrupted (e.g. preempted). -// +enum -// +k8s:enum -type DisruptionMode string - -const ( - // DisruptionModePod means that individual pods can be disrupted or preempted independently. - // It doesn't depend on exact set of pods currently running in this PodGroup. - DisruptionModePod DisruptionMode = "Pod" - // DisruptionModePodGroup means that the whole PodGroup needs to be disrupted - // or preempted together. - DisruptionModePodGroup DisruptionMode = "PodGroup" -) - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:supportsSubresource="/status" - -// PodGroup represents a runtime instance of pods grouped together. -// PodGroups are created by workload controllers (Job, LWS, JobSet, etc...) from -// Workload.podGroupTemplates. -// PodGroup API enablement is toggled by the GenericWorkload feature gate. -type PodGroup struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Spec defines the desired state of the PodGroup. - // - // +required - Spec PodGroupSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` - - // Status represents the current observed state of the PodGroup. - // - // +optional - Status PodGroupStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// PodGroupList contains a list of PodGroup resources. -type PodGroupList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata. - // - // +optional - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Items is the list of PodGroups. - Items []PodGroup `json:"items" protobuf:"bytes,2,rep,name=items"` -} - -// PodGroupSpec defines the desired state of a PodGroup. -type PodGroupSpec struct { - // PodGroupTemplateRef references an optional PodGroup template within other object - // (e.g. Workload) that was used to create the PodGroup. This field is immutable. - // - // +optional - // +k8s:optional - // +k8s:immutable - PodGroupTemplateRef *PodGroupTemplateReference `json:"podGroupTemplateRef" protobuf:"bytes,1,opt,name=podGroupTemplateRef"` - - // SchedulingPolicy defines the scheduling policy for this instance of the PodGroup. - // Controllers are expected to fill this field by copying it from a PodGroupTemplate. - // This field is immutable. - // - // +required - // +k8s:immutable - SchedulingPolicy PodGroupSchedulingPolicy `json:"schedulingPolicy" protobuf:"bytes,2,opt,name=schedulingPolicy"` - - // SchedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroup. - // Controllers are expected to fill this field by copying it from a PodGroupTemplate. - // This field is immutable. - // This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. - // - // +featureGate=TopologyAwareWorkloadScheduling - // +optional - // +k8s:ifDisabled(TopologyAwareWorkloadScheduling)=+k8s:forbidden - // +k8s:ifEnabled(TopologyAwareWorkloadScheduling)=+k8s:optional - // +k8s:ifEnabled(TopologyAwareWorkloadScheduling)=+k8s:immutable - SchedulingConstraints *PodGroupSchedulingConstraints `json:"schedulingConstraints,omitempty" protobuf:"bytes,3,opt,name=schedulingConstraints"` - - // ResourceClaims defines which ResourceClaims may be shared among Pods in - // the group. Pods consume the devices allocated to a PodGroup's claim by - // defining a claim in its own Spec.ResourceClaims that matches the - // PodGroup's claim exactly. The claim must have the same name and refer to - // the same ResourceClaim or ResourceClaimTemplate. - // - // This is an alpha-level field and requires that the - // DRAWorkloadResourceClaims feature gate is enabled. - // - // This field is immutable. - // - // +optional - // +patchMergeKey=name - // +patchStrategy=merge,retainKeys - // +listType=map - // +listMapKey=name - // +k8s:optional - // +k8s:listType=map - // +k8s:listMapKey=name - // +k8s:maxItems=4 - // +k8s:immutable - // +featureGate=DRAWorkloadResourceClaims - ResourceClaims []PodGroupResourceClaim `json:"resourceClaims,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name" protobuf:"bytes,4,rep,name=resourceClaims"` - - // DisruptionMode defines the mode in which a given PodGroup can be disrupted. - // Controllers are expected to fill this field by copying it from a PodGroupTemplate. - // One of Pod, PodGroup. Defaults to Pod if unset. - // This field is immutable. - // This field is available only when the WorkloadAwarePreemption feature gate - // is enabled. - // - // +featureGate=WorkloadAwarePreemption - // +optional - // +k8s:ifDisabled("WorkloadAwarePreemption")=+k8s:forbidden - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:optional - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:immutable - // +default="Pod" - DisruptionMode *DisruptionMode `json:"disruptionMode,omitempty" protobuf:"bytes,5,opt,name=disruptionMode,casttype=DisruptionMode"` - - // PriorityClassName defines the priority that should be considered when scheduling this pod group. - // Controllers are expected to fill this field by copying it from a PodGroupTemplate. - // Otherwise, it is validated and resolved similarly to the PriorityClassName on PodGroupTemplate - // (i.e. if no priority class is specified, admission control can set this to the global default - // priority class if it exists. Otherwise, the pod group's priority will be zero). - // This field is immutable. - // This field is available only when the WorkloadAwarePreemption feature gate - // is enabled. - // - // +featureGate=WorkloadAwarePreemption - // +optional - // +k8s:ifDisabled("WorkloadAwarePreemption")=+k8s:forbidden - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:optional - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:format=k8s-long-name - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:immutable - PriorityClassName string `json:"priorityClassName,omitempty" protobuf:"bytes,6,opt,name=priorityClassName"` - - // Priority is the value of priority of this pod group. Various system components - // use this field to find the priority of the pod group. When Priority Admission - // Controller is enabled, it prevents users from setting this field. The admission - // controller populates this field from PriorityClassName. - // The higher the value, the higher the priority. - // This field is immutable. - // This field is available only when the WorkloadAwarePreemption feature gate - // is enabled. - // - // +featureGate=WorkloadAwarePreemption - // +optional - // +k8s:ifDisabled("WorkloadAwarePreemption")=+k8s:forbidden - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:optional - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:immutable - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:maximum=1000000000 # HighestUserDefinablePriority - // +k8s:ifEnabled("WorkloadAwarePreemption")=+k8s:minimum=-2147483648 - Priority *int32 `json:"priority,omitempty" protobuf:"varint,7,opt,name=priority"` -} - -// PodGroupStatus represents information about the status of a pod group. -type PodGroupStatus struct { - // Conditions represent the latest observations of the PodGroup's state. - // - // Known condition types: - // - "PodGroupScheduled": Indicates whether the scheduling requirement has been satisfied. - // - "DisruptionTarget": Indicates whether the PodGroup is about to be terminated - // due to disruption such as preemption. - // - // Known reasons for the PodGroupScheduled condition: - // - "Unschedulable": The PodGroup cannot be scheduled due to resource constraints, - // affinity/anti-affinity rules, or insufficient capacity for the gang. - // - "SchedulerError": The PodGroup cannot be scheduled due to some internal error - // that happened during scheduling, for example due to nodeAffinity parsing errors. - // - // Known reasons for the DisruptionTarget condition: - // - "PreemptionByScheduler": The PodGroup was preempted by the scheduler to make room for - // higher-priority PodGroups or Pods. - // - // +optional - // +patchMergeKey=type - // +patchStrategy=merge - // +listType=map - // +listMapKey=type - Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` - - // Status of resource claims. - // +optional - // +patchMergeKey=name - // +patchStrategy=merge,retainKeys - // +listType=map - // +listMapKey=name - // +k8s:optional - // +k8s:listType=map - // +k8s:listMapKey=name - // +k8s:maxItems=4 - // +featureGate=DRAWorkloadResourceClaims - ResourceClaimStatuses []PodGroupResourceClaimStatus `json:"resourceClaimStatuses,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name" protobuf:"bytes,2,rep,name=resourceClaimStatuses"` -} - -// Well-known condition types for PodGroups. -const ( - // PodGroupScheduled represents status of the scheduling process for this PodGroup. - PodGroupScheduled string = "PodGroupScheduled" - // DisruptionTarget indicates the PodGroup is about to be terminated due to disruption - // such as preemption. - DisruptionTarget string = "DisruptionTarget" -) - -// Well-known condition reasons for PodGroups. -const ( - // Unschedulable reason in the PodGroupScheduled condition indicates that the PodGroup cannot be scheduled - // due to resource constraints, affinity/anti-affinity rules, or insufficient capacity for the PodGroup. - PodGroupReasonUnschedulable string = "Unschedulable" - // SchedulerError reason in the PodGroupScheduled condition means that some internal error happens - // during scheduling, for example due to nodeAffinity parsing errors. - PodGroupReasonSchedulerError string = "SchedulerError" - // PreemptionByScheduler reason in the DisruptionTarget condition indicates the PodGroup was preempted - // to make room for higher-priority PodGroups or Pods. - PodGroupReasonPreemptionByScheduler string = "PreemptionByScheduler" -) - -// PodGroupResourceClaimStatus is stored in the PodGroupStatus for each -// PodGroupResourceClaim which references a ResourceClaimTemplate. It stores the -// generated name for the corresponding ResourceClaim. -type PodGroupResourceClaimStatus struct { - // Name uniquely identifies this resource claim inside the PodGroup. This - // must match the name of an entry in podgroup.spec.resourceClaims, which - // implies that the string must be a DNS_LABEL. - // - // +required - Name string `json:"name" protobuf:"bytes,1,name=name"` - - // ResourceClaimName is the name of the ResourceClaim that was generated for - // the PodGroup in the namespace of the PodGroup. If this is unset, then - // generating a ResourceClaim was not necessary. The - // podgroup.spec.resourceClaims entry can be ignored in this case. - // - // +optional - // +k8s:optional - // +k8s:format=k8s-long-name - ResourceClaimName *string `json:"resourceClaimName,omitempty" protobuf:"bytes,2,opt,name=resourceClaimName"` -} - -// PodGroupTemplateReference references a PodGroup template defined in some object (e.g. Workload). -// Exactly one reference must be set. -// +union -type PodGroupTemplateReference struct { - // Workload references the PodGroupTemplate within the Workload object that was used to create - // the PodGroup. - // - // +optional - // +k8s:optional - // +k8s:unionMember - Workload *WorkloadPodGroupTemplateReference `json:"workload" protobuf:"bytes,1,opt,name=workload"` -} - -// WorkloadPodGroupTemplateReference references the PodGroupTemplate within the Workload object. -type WorkloadPodGroupTemplateReference struct { - // WorkloadName defines the name of the Workload object. - // - // +required - // +k8s:required - // +k8s:format=k8s-long-name - WorkloadName string `json:"workloadName" protobuf:"bytes,1,opt,name=workloadName"` - - // PodGroupTemplateName defines the PodGroupTemplate name within the Workload object. - // - // +required - // +k8s:required - // +k8s:format=k8s-short-name - PodGroupTemplateName string `json:"podGroupTemplateName" protobuf:"bytes,2,opt,name=podGroupTemplateName"` -} - -// PodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a PodGroup. -type PodGroupSchedulingConstraints struct { - // Topology defines the topology constraints for the pod group. - // Currently only a single topology constraint can be specified. This may change in the future. - // - // +optional - // +k8s:optional - // +k8s:maxItems=1 - // +listType=atomic - // +k8s:listType=atomic - Topology []TopologyConstraint `json:"topology,omitempty" protobuf:"bytes,1,rep,name=topology"` -} - -// TopologyConstraint defines a topology constraint for a PodGroup. -type TopologyConstraint struct { - // Key specifies the key of the node label representing the topology domain. - // All pods within the PodGroup must be colocated within the same domain instance. - // Different PodGroups can land on different domain instances even if they derive from the same PodGroupTemplate. - // Examples: "topology.kubernetes.io/rack" - // - // +required - // +k8s:required - // +k8s:format=k8s-label-key - Key string `json:"key" protobuf:"bytes,1,opt,name=key"` -} diff --git a/vendor/k8s.io/api/scheduling/v1alpha2/types_swagger_doc_generated.go b/vendor/k8s.io/api/scheduling/v1alpha2/types_swagger_doc_generated.go deleted file mode 100644 index 2dc06b1c6f..0000000000 --- a/vendor/k8s.io/api/scheduling/v1alpha2/types_swagger_doc_generated.go +++ /dev/null @@ -1,217 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha2 - -// This file contains a collection of methods that can be used from go-restful to -// generate Swagger API documentation for its models. Please read this PR for more -// information on the implementation: https://github.com/emicklei/go-restful/pull/215 -// -// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if -// they are on one line! For multiple line or blocks that you want to ignore use ---. -// Any context after a --- is ignored. -// -// Those methods can be generated by using hack/update-codegen.sh - -// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. -var map_BasicSchedulingPolicy = map[string]string{ - "": "BasicSchedulingPolicy indicates that standard Kubernetes scheduling behavior should be used.", -} - -func (BasicSchedulingPolicy) SwaggerDoc() map[string]string { - return map_BasicSchedulingPolicy -} - -var map_GangSchedulingPolicy = map[string]string{ - "": "GangSchedulingPolicy defines the parameters for gang scheduling.", - "minCount": "MinCount is the minimum number of pods that must be schedulable or scheduled at the same time for the scheduler to admit the entire group. It must be a positive integer.", -} - -func (GangSchedulingPolicy) SwaggerDoc() map[string]string { - return map_GangSchedulingPolicy -} - -var map_PodGroup = map[string]string{ - "": "PodGroup represents a runtime instance of pods grouped together. PodGroups are created by workload controllers (Job, LWS, JobSet, etc...) from Workload.podGroupTemplates. PodGroup API enablement is toggled by the GenericWorkload feature gate.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "spec": "Spec defines the desired state of the PodGroup.", - "status": "Status represents the current observed state of the PodGroup.", -} - -func (PodGroup) SwaggerDoc() map[string]string { - return map_PodGroup -} - -var map_PodGroupList = map[string]string{ - "": "PodGroupList contains a list of PodGroup resources.", - "metadata": "Standard list metadata.", - "items": "Items is the list of PodGroups.", -} - -func (PodGroupList) SwaggerDoc() map[string]string { - return map_PodGroupList -} - -var map_PodGroupResourceClaim = map[string]string{ - "": "PodGroupResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the PodGroup.\n\nIt adds a name to it that uniquely identifies the ResourceClaim inside the PodGroup. Pods that need access to the ResourceClaim define a matching reference in its own Spec.ResourceClaims. The Pod's claim must match all fields of the PodGroup's claim exactly.", - "name": "Name uniquely identifies this resource claim inside the PodGroup. This must be a DNS_LABEL.", - "resourceClaimName": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this PodGroup. The ResourceClaim will be reserved for the PodGroup instead of its individual pods.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.", - "resourceClaimTemplateName": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this PodGroup.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this PodGroup. When this PodGroup is deleted, the ResourceClaim will also be deleted. The PodGroup 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 podgroup.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.", -} - -func (PodGroupResourceClaim) SwaggerDoc() map[string]string { - return map_PodGroupResourceClaim -} - -var map_PodGroupResourceClaimStatus = map[string]string{ - "": "PodGroupResourceClaimStatus is stored in the PodGroupStatus for each PodGroupResourceClaim which references a ResourceClaimTemplate. It stores the generated name for the corresponding ResourceClaim.", - "name": "Name uniquely identifies this resource claim inside the PodGroup. This must match the name of an entry in podgroup.spec.resourceClaims, which implies that the string must be a DNS_LABEL.", - "resourceClaimName": "ResourceClaimName is the name of the ResourceClaim that was generated for the PodGroup in the namespace of the PodGroup. If this is unset, then generating a ResourceClaim was not necessary. The podgroup.spec.resourceClaims entry can be ignored in this case.", -} - -func (PodGroupResourceClaimStatus) SwaggerDoc() map[string]string { - return map_PodGroupResourceClaimStatus -} - -var map_PodGroupSchedulingConstraints = map[string]string{ - "": "PodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a PodGroup.", - "topology": "Topology defines the topology constraints for the pod group. Currently only a single topology constraint can be specified. This may change in the future.", -} - -func (PodGroupSchedulingConstraints) SwaggerDoc() map[string]string { - return map_PodGroupSchedulingConstraints -} - -var map_PodGroupSchedulingPolicy = map[string]string{ - "": "PodGroupSchedulingPolicy defines the scheduling configuration for a PodGroup. Exactly one policy must be set.", - "basic": "Basic specifies that the pods in this group should be scheduled using standard Kubernetes scheduling behavior.", - "gang": "Gang specifies that the pods in this group should be scheduled using all-or-nothing semantics.", -} - -func (PodGroupSchedulingPolicy) SwaggerDoc() map[string]string { - return map_PodGroupSchedulingPolicy -} - -var map_PodGroupSpec = map[string]string{ - "": "PodGroupSpec defines the desired state of a PodGroup.", - "podGroupTemplateRef": "PodGroupTemplateRef references an optional PodGroup template within other object (e.g. Workload) that was used to create the PodGroup. This field is immutable.", - "schedulingPolicy": "SchedulingPolicy defines the scheduling policy for this instance of the PodGroup. Controllers are expected to fill this field by copying it from a PodGroupTemplate. This field is immutable.", - "schedulingConstraints": "SchedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroup. Controllers are expected to fill this field by copying it from a PodGroupTemplate. This field is immutable. This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled.", - "resourceClaims": "ResourceClaims defines which ResourceClaims may be shared among Pods in the group. Pods consume the devices allocated to a PodGroup's claim by defining a claim in its own Spec.ResourceClaims that matches the PodGroup's claim exactly. The claim must have the same name and refer to the same ResourceClaim or ResourceClaimTemplate.\n\nThis is an alpha-level field and requires that the DRAWorkloadResourceClaims feature gate is enabled.\n\nThis field is immutable.", - "disruptionMode": "DisruptionMode defines the mode in which a given PodGroup can be disrupted. Controllers are expected to fill this field by copying it from a PodGroupTemplate. One of Pod, PodGroup. Defaults to Pod if unset. This field is immutable. This field is available only when the WorkloadAwarePreemption feature gate is enabled.", - "priorityClassName": "PriorityClassName defines the priority that should be considered when scheduling this pod group. Controllers are expected to fill this field by copying it from a PodGroupTemplate. Otherwise, it is validated and resolved similarly to the PriorityClassName on PodGroupTemplate (i.e. if no priority class is specified, admission control can set this to the global default priority class if it exists. Otherwise, the pod group's priority will be zero). This field is immutable. This field is available only when the WorkloadAwarePreemption feature gate is enabled.", - "priority": "Priority is the value of priority of this pod group. Various system components use this field to find the priority of the pod group. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. This field is immutable. This field is available only when the WorkloadAwarePreemption feature gate is enabled.", -} - -func (PodGroupSpec) SwaggerDoc() map[string]string { - return map_PodGroupSpec -} - -var map_PodGroupStatus = map[string]string{ - "": "PodGroupStatus represents information about the status of a pod group.", - "conditions": "Conditions represent the latest observations of the PodGroup's state.\n\nKnown condition types: - \"PodGroupScheduled\": Indicates whether the scheduling requirement has been satisfied. - \"DisruptionTarget\": Indicates whether the PodGroup is about to be terminated\n due to disruption such as preemption.\n\nKnown reasons for the PodGroupScheduled condition: - \"Unschedulable\": The PodGroup cannot be scheduled due to resource constraints,\n affinity/anti-affinity rules, or insufficient capacity for the gang.\n- \"SchedulerError\": The PodGroup cannot be scheduled due to some internal error\n that happened during scheduling, for example due to nodeAffinity parsing errors.\n\nKnown reasons for the DisruptionTarget condition: - \"PreemptionByScheduler\": The PodGroup was preempted by the scheduler to make room for\n higher-priority PodGroups or Pods.", - "resourceClaimStatuses": "Status of resource claims.", -} - -func (PodGroupStatus) SwaggerDoc() map[string]string { - return map_PodGroupStatus -} - -var map_PodGroupTemplate = map[string]string{ - "": "PodGroupTemplate represents a template for a set of pods with a scheduling policy.", - "name": "Name is a unique identifier for the PodGroupTemplate within the Workload. It must be a DNS label. This field is immutable.", - "schedulingPolicy": "SchedulingPolicy defines the scheduling policy for this PodGroupTemplate.", - "schedulingConstraints": "SchedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroupTemplate. This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled.", - "resourceClaims": "ResourceClaims defines which ResourceClaims may be shared among Pods in the group. Pods consume the devices allocated to a PodGroup's claim by defining a claim in its own Spec.ResourceClaims that matches the PodGroup's claim exactly. The claim must have the same name and refer to the same ResourceClaim or ResourceClaimTemplate.\n\nThis is an alpha-level field and requires that the DRAWorkloadResourceClaims feature gate is enabled.\n\nThis field is immutable.", - "disruptionMode": "DisruptionMode defines the mode in which a given PodGroup can be disrupted. One of Pod, PodGroup. This field is available only when the WorkloadAwarePreemption feature gate is enabled.", - "priorityClassName": "PriorityClassName indicates the priority that should be considered when scheduling a pod group created from this template. If no priority class is specified, admission control can set this to the global default priority class if it exists. Otherwise, pod groups created from this template will have the priority set to zero. This field is available only when the WorkloadAwarePreemption feature gate is enabled.", - "priority": "Priority is the value of priority of pod groups created from this template. Various system components use this field to find the priority of the pod group. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. This field is available only when the WorkloadAwarePreemption feature gate is enabled.", -} - -func (PodGroupTemplate) SwaggerDoc() map[string]string { - return map_PodGroupTemplate -} - -var map_PodGroupTemplateReference = map[string]string{ - "": "PodGroupTemplateReference references a PodGroup template defined in some object (e.g. Workload). Exactly one reference must be set.", - "workload": "Workload references the PodGroupTemplate within the Workload object that was used to create the PodGroup.", -} - -func (PodGroupTemplateReference) SwaggerDoc() map[string]string { - return map_PodGroupTemplateReference -} - -var map_TopologyConstraint = map[string]string{ - "": "TopologyConstraint defines a topology constraint for a PodGroup.", - "key": "Key specifies the key of the node label representing the topology domain. All pods within the PodGroup must be colocated within the same domain instance. Different PodGroups can land on different domain instances even if they derive from the same PodGroupTemplate. Examples: \"topology.kubernetes.io/rack\"", -} - -func (TopologyConstraint) SwaggerDoc() map[string]string { - return map_TopologyConstraint -} - -var map_TypedLocalObjectReference = map[string]string{ - "": "TypedLocalObjectReference allows to reference typed object inside the same namespace.", - "apiGroup": "APIGroup is the group for the resource being referenced. If APIGroup is empty, the specified Kind must be in the core API group. For any other third-party types, setting APIGroup is required. It must be a DNS subdomain.", - "kind": "Kind is the type of resource being referenced. It must be a path segment name.", - "name": "Name is the name of resource being referenced. It must be a path segment name.", -} - -func (TypedLocalObjectReference) SwaggerDoc() map[string]string { - return map_TypedLocalObjectReference -} - -var map_Workload = map[string]string{ - "": "Workload allows for expressing scheduling constraints that should be used when managing the lifecycle of workloads from the scheduling perspective, including scheduling, preemption, eviction and other phases. Workload API enablement is toggled by the GenericWorkload feature gate.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "spec": "Spec defines the desired behavior of a Workload.", -} - -func (Workload) SwaggerDoc() map[string]string { - return map_Workload -} - -var map_WorkloadList = map[string]string{ - "": "WorkloadList contains a list of Workload resources.", - "metadata": "Standard list metadata.", - "items": "Items is the list of Workloads.", -} - -func (WorkloadList) SwaggerDoc() map[string]string { - return map_WorkloadList -} - -var map_WorkloadPodGroupTemplateReference = map[string]string{ - "": "WorkloadPodGroupTemplateReference references the PodGroupTemplate within the Workload object.", - "workloadName": "WorkloadName defines the name of the Workload object.", - "podGroupTemplateName": "PodGroupTemplateName defines the PodGroupTemplate name within the Workload object.", -} - -func (WorkloadPodGroupTemplateReference) SwaggerDoc() map[string]string { - return map_WorkloadPodGroupTemplateReference -} - -var map_WorkloadSpec = map[string]string{ - "": "WorkloadSpec defines the desired state of a Workload.", - "controllerRef": "ControllerRef is an optional reference to the controlling object, such as a Deployment or Job. This field is intended for use by tools like CLIs to provide a link back to the original workload definition. This field is immutable.", - "podGroupTemplates": "PodGroupTemplates is the list of templates that make up the Workload. The maximum number of templates is 8. This field is immutable.", -} - -func (WorkloadSpec) SwaggerDoc() map[string]string { - return map_WorkloadSpec -} - -// AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/k8s.io/api/scheduling/v1alpha2/zz_generated.deepcopy.go b/vendor/k8s.io/api/scheduling/v1alpha2/zz_generated.deepcopy.go deleted file mode 100644 index 901bb0a3ad..0000000000 --- a/vendor/k8s.io/api/scheduling/v1alpha2/zz_generated.deepcopy.go +++ /dev/null @@ -1,484 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BasicSchedulingPolicy) DeepCopyInto(out *BasicSchedulingPolicy) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicSchedulingPolicy. -func (in *BasicSchedulingPolicy) DeepCopy() *BasicSchedulingPolicy { - if in == nil { - return nil - } - out := new(BasicSchedulingPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GangSchedulingPolicy) DeepCopyInto(out *GangSchedulingPolicy) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GangSchedulingPolicy. -func (in *GangSchedulingPolicy) DeepCopy() *GangSchedulingPolicy { - if in == nil { - return nil - } - out := new(GangSchedulingPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PodGroup) DeepCopyInto(out *PodGroup) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroup. -func (in *PodGroup) DeepCopy() *PodGroup { - if in == nil { - return nil - } - out := new(PodGroup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PodGroup) 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 *PodGroupList) DeepCopyInto(out *PodGroupList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PodGroup, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupList. -func (in *PodGroupList) DeepCopy() *PodGroupList { - if in == nil { - return nil - } - out := new(PodGroupList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PodGroupList) 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 *PodGroupResourceClaim) DeepCopyInto(out *PodGroupResourceClaim) { - *out = *in - if in.ResourceClaimName != nil { - in, out := &in.ResourceClaimName, &out.ResourceClaimName - *out = new(string) - **out = **in - } - if in.ResourceClaimTemplateName != nil { - in, out := &in.ResourceClaimTemplateName, &out.ResourceClaimTemplateName - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupResourceClaim. -func (in *PodGroupResourceClaim) DeepCopy() *PodGroupResourceClaim { - if in == nil { - return nil - } - out := new(PodGroupResourceClaim) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PodGroupResourceClaimStatus) DeepCopyInto(out *PodGroupResourceClaimStatus) { - *out = *in - if in.ResourceClaimName != nil { - in, out := &in.ResourceClaimName, &out.ResourceClaimName - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupResourceClaimStatus. -func (in *PodGroupResourceClaimStatus) DeepCopy() *PodGroupResourceClaimStatus { - if in == nil { - return nil - } - out := new(PodGroupResourceClaimStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PodGroupSchedulingConstraints) DeepCopyInto(out *PodGroupSchedulingConstraints) { - *out = *in - if in.Topology != nil { - in, out := &in.Topology, &out.Topology - *out = make([]TopologyConstraint, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupSchedulingConstraints. -func (in *PodGroupSchedulingConstraints) DeepCopy() *PodGroupSchedulingConstraints { - if in == nil { - return nil - } - out := new(PodGroupSchedulingConstraints) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PodGroupSchedulingPolicy) DeepCopyInto(out *PodGroupSchedulingPolicy) { - *out = *in - if in.Basic != nil { - in, out := &in.Basic, &out.Basic - *out = new(BasicSchedulingPolicy) - **out = **in - } - if in.Gang != nil { - in, out := &in.Gang, &out.Gang - *out = new(GangSchedulingPolicy) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupSchedulingPolicy. -func (in *PodGroupSchedulingPolicy) DeepCopy() *PodGroupSchedulingPolicy { - if in == nil { - return nil - } - out := new(PodGroupSchedulingPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PodGroupSpec) DeepCopyInto(out *PodGroupSpec) { - *out = *in - if in.PodGroupTemplateRef != nil { - in, out := &in.PodGroupTemplateRef, &out.PodGroupTemplateRef - *out = new(PodGroupTemplateReference) - (*in).DeepCopyInto(*out) - } - in.SchedulingPolicy.DeepCopyInto(&out.SchedulingPolicy) - if in.SchedulingConstraints != nil { - in, out := &in.SchedulingConstraints, &out.SchedulingConstraints - *out = new(PodGroupSchedulingConstraints) - (*in).DeepCopyInto(*out) - } - if in.ResourceClaims != nil { - in, out := &in.ResourceClaims, &out.ResourceClaims - *out = make([]PodGroupResourceClaim, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.DisruptionMode != nil { - in, out := &in.DisruptionMode, &out.DisruptionMode - *out = new(DisruptionMode) - **out = **in - } - if in.Priority != nil { - in, out := &in.Priority, &out.Priority - *out = new(int32) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupSpec. -func (in *PodGroupSpec) DeepCopy() *PodGroupSpec { - if in == nil { - return nil - } - out := new(PodGroupSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PodGroupStatus) DeepCopyInto(out *PodGroupStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]v1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ResourceClaimStatuses != nil { - in, out := &in.ResourceClaimStatuses, &out.ResourceClaimStatuses - *out = make([]PodGroupResourceClaimStatus, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupStatus. -func (in *PodGroupStatus) DeepCopy() *PodGroupStatus { - if in == nil { - return nil - } - out := new(PodGroupStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PodGroupTemplate) DeepCopyInto(out *PodGroupTemplate) { - *out = *in - in.SchedulingPolicy.DeepCopyInto(&out.SchedulingPolicy) - if in.SchedulingConstraints != nil { - in, out := &in.SchedulingConstraints, &out.SchedulingConstraints - *out = new(PodGroupSchedulingConstraints) - (*in).DeepCopyInto(*out) - } - if in.ResourceClaims != nil { - in, out := &in.ResourceClaims, &out.ResourceClaims - *out = make([]PodGroupResourceClaim, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.DisruptionMode != nil { - in, out := &in.DisruptionMode, &out.DisruptionMode - *out = new(DisruptionMode) - **out = **in - } - if in.Priority != nil { - in, out := &in.Priority, &out.Priority - *out = new(int32) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupTemplate. -func (in *PodGroupTemplate) DeepCopy() *PodGroupTemplate { - if in == nil { - return nil - } - out := new(PodGroupTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PodGroupTemplateReference) DeepCopyInto(out *PodGroupTemplateReference) { - *out = *in - if in.Workload != nil { - in, out := &in.Workload, &out.Workload - *out = new(WorkloadPodGroupTemplateReference) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupTemplateReference. -func (in *PodGroupTemplateReference) DeepCopy() *PodGroupTemplateReference { - if in == nil { - return nil - } - out := new(PodGroupTemplateReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TopologyConstraint) DeepCopyInto(out *TopologyConstraint) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopologyConstraint. -func (in *TopologyConstraint) DeepCopy() *TopologyConstraint { - if in == nil { - return nil - } - out := new(TopologyConstraint) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TypedLocalObjectReference) DeepCopyInto(out *TypedLocalObjectReference) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TypedLocalObjectReference. -func (in *TypedLocalObjectReference) DeepCopy() *TypedLocalObjectReference { - if in == nil { - return nil - } - out := new(TypedLocalObjectReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Workload) DeepCopyInto(out *Workload) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workload. -func (in *Workload) DeepCopy() *Workload { - if in == nil { - return nil - } - out := new(Workload) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Workload) 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 *WorkloadList) DeepCopyInto(out *WorkloadList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Workload, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadList. -func (in *WorkloadList) DeepCopy() *WorkloadList { - if in == nil { - return nil - } - out := new(WorkloadList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *WorkloadList) 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 *WorkloadPodGroupTemplateReference) DeepCopyInto(out *WorkloadPodGroupTemplateReference) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadPodGroupTemplateReference. -func (in *WorkloadPodGroupTemplateReference) DeepCopy() *WorkloadPodGroupTemplateReference { - if in == nil { - return nil - } - out := new(WorkloadPodGroupTemplateReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WorkloadSpec) DeepCopyInto(out *WorkloadSpec) { - *out = *in - if in.ControllerRef != nil { - in, out := &in.ControllerRef, &out.ControllerRef - *out = new(TypedLocalObjectReference) - **out = **in - } - if in.PodGroupTemplates != nil { - in, out := &in.PodGroupTemplates, &out.PodGroupTemplates - *out = make([]PodGroupTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadSpec. -func (in *WorkloadSpec) DeepCopy() *WorkloadSpec { - if in == nil { - return nil - } - out := new(WorkloadSpec) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/k8s.io/api/scheduling/v1alpha2/zz_generated.model_name.go b/vendor/k8s.io/api/scheduling/v1alpha2/zz_generated.model_name.go deleted file mode 100644 index 1b7effea96..0000000000 --- a/vendor/k8s.io/api/scheduling/v1alpha2/zz_generated.model_name.go +++ /dev/null @@ -1,112 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by openapi-gen. DO NOT EDIT. - -package v1alpha2 - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in BasicSchedulingPolicy) OpenAPIModelName() string { - return "io.k8s.api.scheduling.v1alpha2.BasicSchedulingPolicy" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in GangSchedulingPolicy) OpenAPIModelName() string { - return "io.k8s.api.scheduling.v1alpha2.GangSchedulingPolicy" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in PodGroup) OpenAPIModelName() string { - return "io.k8s.api.scheduling.v1alpha2.PodGroup" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in PodGroupList) OpenAPIModelName() string { - return "io.k8s.api.scheduling.v1alpha2.PodGroupList" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in PodGroupResourceClaim) OpenAPIModelName() string { - return "io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaim" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in PodGroupResourceClaimStatus) OpenAPIModelName() string { - return "io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaimStatus" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in PodGroupSchedulingConstraints) OpenAPIModelName() string { - return "io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingConstraints" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in PodGroupSchedulingPolicy) OpenAPIModelName() string { - return "io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingPolicy" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in PodGroupSpec) OpenAPIModelName() string { - return "io.k8s.api.scheduling.v1alpha2.PodGroupSpec" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in PodGroupStatus) OpenAPIModelName() string { - return "io.k8s.api.scheduling.v1alpha2.PodGroupStatus" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in PodGroupTemplate) OpenAPIModelName() string { - return "io.k8s.api.scheduling.v1alpha2.PodGroupTemplate" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in PodGroupTemplateReference) OpenAPIModelName() string { - return "io.k8s.api.scheduling.v1alpha2.PodGroupTemplateReference" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in TopologyConstraint) OpenAPIModelName() string { - return "io.k8s.api.scheduling.v1alpha2.TopologyConstraint" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in TypedLocalObjectReference) OpenAPIModelName() string { - return "io.k8s.api.scheduling.v1alpha2.TypedLocalObjectReference" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in Workload) OpenAPIModelName() string { - return "io.k8s.api.scheduling.v1alpha2.Workload" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in WorkloadList) OpenAPIModelName() string { - return "io.k8s.api.scheduling.v1alpha2.WorkloadList" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in WorkloadPodGroupTemplateReference) OpenAPIModelName() string { - return "io.k8s.api.scheduling.v1alpha2.WorkloadPodGroupTemplateReference" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in WorkloadSpec) OpenAPIModelName() string { - return "io.k8s.api.scheduling.v1alpha2.WorkloadSpec" -} diff --git a/vendor/k8s.io/api/scheduling/v1alpha3/doc.go b/vendor/k8s.io/api/scheduling/v1alpha3/doc.go new file mode 100644 index 0000000000..d2e7419d68 --- /dev/null +++ b/vendor/k8s.io/api/scheduling/v1alpha3/doc.go @@ -0,0 +1,37 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package +// +k8s:protobuf-gen=package +// +k8s:openapi-gen=true +// +k8s:openapi-model-package=io.k8s.api.scheduling.v1alpha3 + +// +groupName=scheduling.k8s.io + +// +k8s:validation-gen=* +// +k8s:validation-gen-input=k8s.io/api/scheduling/v1alpha3 +// +k8s:validation-gen-scheme-registry=nil + +// A non-registering copy of the declarative validation is generated in this +// package so out-of-tree consumers can run the same validation the +// kube-apiserver enforces without importing k8s.io/kubernetes/pkg or mutating +// a shared scheme on import. The registered copy lives in +// k8s.io/kubernetes/pkg/apis/scheduling/v1alpha3. +// The `*` selector generates validators for all types, including the +// WorkloadPodGroup* building blocks that are not reachable from a TypeMeta +// root. + +package v1alpha3 diff --git a/vendor/k8s.io/api/scheduling/v1alpha3/generated.pb.go b/vendor/k8s.io/api/scheduling/v1alpha3/generated.pb.go new file mode 100644 index 0000000000..5c56e7bc94 --- /dev/null +++ b/vendor/k8s.io/api/scheduling/v1alpha3/generated.pb.go @@ -0,0 +1,8927 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: k8s.io/api/scheduling/v1alpha3/generated.proto + +package v1alpha3 + +import ( + fmt "fmt" + + io "io" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + math_bits "math/bits" + reflect "reflect" + strings "strings" +) + +func (m *AllCompositeDisruptionMode) Reset() { *m = AllCompositeDisruptionMode{} } + +func (m *AllDisruptionMode) Reset() { *m = AllDisruptionMode{} } + +func (m *BasicSchedulingPolicy) Reset() { *m = BasicSchedulingPolicy{} } + +func (m *CompositeBasicSchedulingPolicy) Reset() { *m = CompositeBasicSchedulingPolicy{} } + +func (m *CompositeDisruptionMode) Reset() { *m = CompositeDisruptionMode{} } + +func (m *CompositeGangSchedulingPolicy) Reset() { *m = CompositeGangSchedulingPolicy{} } + +func (m *CompositePodGroup) Reset() { *m = CompositePodGroup{} } + +func (m *CompositePodGroupList) Reset() { *m = CompositePodGroupList{} } + +func (m *CompositePodGroupSchedulingConstraints) Reset() { + *m = CompositePodGroupSchedulingConstraints{} +} + +func (m *CompositePodGroupSchedulingPolicy) Reset() { *m = CompositePodGroupSchedulingPolicy{} } + +func (m *CompositePodGroupSpec) Reset() { *m = CompositePodGroupSpec{} } + +func (m *CompositePodGroupStatus) Reset() { *m = CompositePodGroupStatus{} } + +func (m *CompositePodGroupTemplate) Reset() { *m = CompositePodGroupTemplate{} } + +func (m *DisruptionMode) Reset() { *m = DisruptionMode{} } + +func (m *GangSchedulingPolicy) Reset() { *m = GangSchedulingPolicy{} } + +func (m *PodGroup) Reset() { *m = PodGroup{} } + +func (m *PodGroupList) Reset() { *m = PodGroupList{} } + +func (m *PodGroupResourceClaim) Reset() { *m = PodGroupResourceClaim{} } + +func (m *PodGroupResourceClaimStatus) Reset() { *m = PodGroupResourceClaimStatus{} } + +func (m *PodGroupSchedulingConstraints) Reset() { *m = PodGroupSchedulingConstraints{} } + +func (m *PodGroupSchedulingPolicy) Reset() { *m = PodGroupSchedulingPolicy{} } + +func (m *PodGroupSpec) Reset() { *m = PodGroupSpec{} } + +func (m *PodGroupStatus) Reset() { *m = PodGroupStatus{} } + +func (m *PodGroupTemplate) Reset() { *m = PodGroupTemplate{} } + +func (m *SingleCompositeDisruptionMode) Reset() { *m = SingleCompositeDisruptionMode{} } + +func (m *SingleDisruptionMode) Reset() { *m = SingleDisruptionMode{} } + +func (m *TopologyConstraint) Reset() { *m = TopologyConstraint{} } + +func (m *TypedLocalObjectReference) Reset() { *m = TypedLocalObjectReference{} } + +func (m *Workload) Reset() { *m = Workload{} } + +func (m *WorkloadCompositePodGroupAllDisruptionMode) Reset() { + *m = WorkloadCompositePodGroupAllDisruptionMode{} +} + +func (m *WorkloadCompositePodGroupBasicSchedulingPolicy) Reset() { + *m = WorkloadCompositePodGroupBasicSchedulingPolicy{} +} + +func (m *WorkloadCompositePodGroupDisruptionMode) Reset() { + *m = WorkloadCompositePodGroupDisruptionMode{} +} + +func (m *WorkloadCompositePodGroupGangSchedulingPolicy) Reset() { + *m = WorkloadCompositePodGroupGangSchedulingPolicy{} +} + +func (m *WorkloadCompositePodGroupSchedulingConstraints) Reset() { + *m = WorkloadCompositePodGroupSchedulingConstraints{} +} + +func (m *WorkloadCompositePodGroupSchedulingPolicy) Reset() { + *m = WorkloadCompositePodGroupSchedulingPolicy{} +} + +func (m *WorkloadCompositePodGroupSingleDisruptionMode) Reset() { + *m = WorkloadCompositePodGroupSingleDisruptionMode{} +} + +func (m *WorkloadList) Reset() { *m = WorkloadList{} } + +func (m *WorkloadPodGroupAllDisruptionMode) Reset() { *m = WorkloadPodGroupAllDisruptionMode{} } + +func (m *WorkloadPodGroupBasicSchedulingPolicy) Reset() { *m = WorkloadPodGroupBasicSchedulingPolicy{} } + +func (m *WorkloadPodGroupDisruptionMode) Reset() { *m = WorkloadPodGroupDisruptionMode{} } + +func (m *WorkloadPodGroupGangSchedulingPolicy) Reset() { *m = WorkloadPodGroupGangSchedulingPolicy{} } + +func (m *WorkloadPodGroupResourceClaim) Reset() { *m = WorkloadPodGroupResourceClaim{} } + +func (m *WorkloadPodGroupSchedulingConstraints) Reset() { *m = WorkloadPodGroupSchedulingConstraints{} } + +func (m *WorkloadPodGroupSchedulingPolicy) Reset() { *m = WorkloadPodGroupSchedulingPolicy{} } + +func (m *WorkloadPodGroupSingleDisruptionMode) Reset() { *m = WorkloadPodGroupSingleDisruptionMode{} } + +func (m *WorkloadReference) Reset() { *m = WorkloadReference{} } + +func (m *WorkloadSpec) Reset() { *m = WorkloadSpec{} } + +func (m *AllCompositeDisruptionMode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AllCompositeDisruptionMode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AllCompositeDisruptionMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *AllDisruptionMode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AllDisruptionMode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AllDisruptionMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *BasicSchedulingPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BasicSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BasicSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *CompositeBasicSchedulingPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompositeBasicSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompositeBasicSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *CompositeDisruptionMode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompositeDisruptionMode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompositeDisruptionMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.All != nil { + { + size, err := m.All.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Single != nil { + { + size, err := m.Single.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CompositeGangSchedulingPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompositeGangSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompositeGangSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.MinGroupCount)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *CompositePodGroup) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompositePodGroup) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompositePodGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *CompositePodGroupList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompositePodGroupList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompositePodGroupList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *CompositePodGroupSchedulingConstraints) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompositePodGroupSchedulingConstraints) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompositePodGroupSchedulingConstraints) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Topology) > 0 { + for iNdEx := len(m.Topology) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Topology[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *CompositePodGroupSchedulingPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompositePodGroupSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompositePodGroupSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Gang != nil { + { + size, err := m.Gang.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Basic != nil { + { + size, err := m.Basic.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CompositePodGroupSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompositePodGroupSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompositePodGroupSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PreemptionPolicy != nil { + i -= len(*m.PreemptionPolicy) + copy(dAtA[i:], *m.PreemptionPolicy) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PreemptionPolicy))) + i-- + dAtA[i] = 0x42 + } + if m.Priority != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Priority)) + i-- + dAtA[i] = 0x38 + } + i -= len(m.PriorityClassName) + copy(dAtA[i:], m.PriorityClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PriorityClassName))) + i-- + dAtA[i] = 0x32 + if m.DisruptionMode != nil { + { + size, err := m.DisruptionMode.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.SchedulingConstraints != nil { + { + size, err := m.SchedulingConstraints.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + { + size, err := m.SchedulingPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.WorkloadRef != nil { + { + size, err := m.WorkloadRef.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ParentCompositePodGroupName != nil { + i -= len(*m.ParentCompositePodGroupName) + copy(dAtA[i:], *m.ParentCompositePodGroupName) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ParentCompositePodGroupName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CompositePodGroupStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompositePodGroupStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompositePodGroupStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Conditions) > 0 { + for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *CompositePodGroupTemplate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompositePodGroupTemplate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompositePodGroupTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CompositePodGroupTemplates) > 0 { + for iNdEx := len(m.CompositePodGroupTemplates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CompositePodGroupTemplates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if len(m.PodGroupTemplates) > 0 { + for iNdEx := len(m.PodGroupTemplates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PodGroupTemplates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if m.PreemptionPolicy != nil { + i -= len(*m.PreemptionPolicy) + copy(dAtA[i:], *m.PreemptionPolicy) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PreemptionPolicy))) + i-- + dAtA[i] = 0x3a + } + if m.Priority != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Priority)) + i-- + dAtA[i] = 0x30 + } + i -= len(m.PriorityClassName) + copy(dAtA[i:], m.PriorityClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PriorityClassName))) + i-- + dAtA[i] = 0x2a + if m.DisruptionMode != nil { + { + size, err := m.DisruptionMode.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.SchedulingConstraints != nil { + { + size, err := m.SchedulingConstraints.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + { + size, err := m.SchedulingPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *DisruptionMode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DisruptionMode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DisruptionMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.All != nil { + { + size, err := m.All.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Single != nil { + { + size, err := m.Single.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GangSchedulingPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GangSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GangSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.MinCount)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *PodGroup) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodGroup) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PodGroupList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodGroupList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodGroupList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PodGroupResourceClaim) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodGroupResourceClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodGroupResourceClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ResourceClaimTemplateName != nil { + i -= len(*m.ResourceClaimTemplateName) + copy(dAtA[i:], *m.ResourceClaimTemplateName) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ResourceClaimTemplateName))) + i-- + dAtA[i] = 0x1a + } + if m.ResourceClaimName != nil { + i -= len(*m.ResourceClaimName) + copy(dAtA[i:], *m.ResourceClaimName) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ResourceClaimName))) + i-- + dAtA[i] = 0x12 + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PodGroupResourceClaimStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodGroupResourceClaimStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodGroupResourceClaimStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ResourceClaimName != nil { + i -= len(*m.ResourceClaimName) + copy(dAtA[i:], *m.ResourceClaimName) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ResourceClaimName))) + i-- + dAtA[i] = 0x12 + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PodGroupSchedulingConstraints) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodGroupSchedulingConstraints) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodGroupSchedulingConstraints) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Topology) > 0 { + for iNdEx := len(m.Topology) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Topology[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PodGroupSchedulingPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodGroupSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodGroupSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Gang != nil { + { + size, err := m.Gang.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Basic != nil { + { + size, err := m.Basic.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PodGroupSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodGroupSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodGroupSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PreemptionPolicy != nil { + i -= len(*m.PreemptionPolicy) + copy(dAtA[i:], *m.PreemptionPolicy) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PreemptionPolicy))) + i-- + dAtA[i] = 0x4a + } + if m.Priority != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Priority)) + i-- + dAtA[i] = 0x40 + } + i -= len(m.PriorityClassName) + copy(dAtA[i:], m.PriorityClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PriorityClassName))) + i-- + dAtA[i] = 0x3a + if m.DisruptionMode != nil { + { + size, err := m.DisruptionMode.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.ResourceClaims) > 0 { + for iNdEx := len(m.ResourceClaims) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResourceClaims[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if m.SchedulingConstraints != nil { + { + size, err := m.SchedulingConstraints.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + { + size, err := m.SchedulingPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.WorkloadRef != nil { + { + size, err := m.WorkloadRef.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ParentCompositePodGroupName != nil { + i -= len(*m.ParentCompositePodGroupName) + copy(dAtA[i:], *m.ParentCompositePodGroupName) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ParentCompositePodGroupName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PodGroupStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodGroupStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodGroupStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ResourceClaimStatuses) > 0 { + for iNdEx := len(m.ResourceClaimStatuses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResourceClaimStatuses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Conditions) > 0 { + for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PodGroupTemplate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodGroupTemplate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodGroupTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PreemptionPolicy != nil { + i -= len(*m.PreemptionPolicy) + copy(dAtA[i:], *m.PreemptionPolicy) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PreemptionPolicy))) + i-- + dAtA[i] = 0x42 + } + if m.Priority != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Priority)) + i-- + dAtA[i] = 0x38 + } + i -= len(m.PriorityClassName) + copy(dAtA[i:], m.PriorityClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PriorityClassName))) + i-- + dAtA[i] = 0x32 + if m.DisruptionMode != nil { + { + size, err := m.DisruptionMode.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.ResourceClaims) > 0 { + for iNdEx := len(m.ResourceClaims) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResourceClaims[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.SchedulingConstraints != nil { + { + size, err := m.SchedulingConstraints.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + { + size, err := m.SchedulingPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SingleCompositeDisruptionMode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SingleCompositeDisruptionMode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SingleCompositeDisruptionMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *SingleDisruptionMode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SingleDisruptionMode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SingleDisruptionMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *TopologyConstraint) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TopologyConstraint) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TopologyConstraint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *TypedLocalObjectReference) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TypedLocalObjectReference) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TypedLocalObjectReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0x12 + i -= len(m.APIGroup) + copy(dAtA[i:], m.APIGroup) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIGroup))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Workload) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Workload) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Workload) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *WorkloadCompositePodGroupAllDisruptionMode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadCompositePodGroupAllDisruptionMode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadCompositePodGroupAllDisruptionMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *WorkloadCompositePodGroupBasicSchedulingPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadCompositePodGroupBasicSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadCompositePodGroupBasicSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *WorkloadCompositePodGroupDisruptionMode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadCompositePodGroupDisruptionMode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadCompositePodGroupDisruptionMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.All != nil { + { + size, err := m.All.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Single != nil { + { + size, err := m.Single.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *WorkloadCompositePodGroupGangSchedulingPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadCompositePodGroupGangSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadCompositePodGroupGangSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MinGroupCount != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.MinGroupCount)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *WorkloadCompositePodGroupSchedulingConstraints) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadCompositePodGroupSchedulingConstraints) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadCompositePodGroupSchedulingConstraints) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Topology) > 0 { + for iNdEx := len(m.Topology) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Topology[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *WorkloadCompositePodGroupSchedulingPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadCompositePodGroupSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadCompositePodGroupSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Gang != nil { + { + size, err := m.Gang.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Basic != nil { + { + size, err := m.Basic.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *WorkloadCompositePodGroupSingleDisruptionMode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadCompositePodGroupSingleDisruptionMode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadCompositePodGroupSingleDisruptionMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *WorkloadList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *WorkloadPodGroupAllDisruptionMode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadPodGroupAllDisruptionMode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadPodGroupAllDisruptionMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *WorkloadPodGroupBasicSchedulingPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadPodGroupBasicSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadPodGroupBasicSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *WorkloadPodGroupDisruptionMode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadPodGroupDisruptionMode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadPodGroupDisruptionMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.All != nil { + { + size, err := m.All.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Single != nil { + { + size, err := m.Single.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *WorkloadPodGroupGangSchedulingPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadPodGroupGangSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadPodGroupGangSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MinCount != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.MinCount)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *WorkloadPodGroupResourceClaim) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadPodGroupResourceClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadPodGroupResourceClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ResourceClaimTemplateName != nil { + i -= len(*m.ResourceClaimTemplateName) + copy(dAtA[i:], *m.ResourceClaimTemplateName) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ResourceClaimTemplateName))) + i-- + dAtA[i] = 0x1a + } + if m.ResourceClaimName != nil { + i -= len(*m.ResourceClaimName) + copy(dAtA[i:], *m.ResourceClaimName) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ResourceClaimName))) + i-- + dAtA[i] = 0x12 + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *WorkloadPodGroupSchedulingConstraints) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadPodGroupSchedulingConstraints) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadPodGroupSchedulingConstraints) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Topology) > 0 { + for iNdEx := len(m.Topology) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Topology[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *WorkloadPodGroupSchedulingPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadPodGroupSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadPodGroupSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Gang != nil { + { + size, err := m.Gang.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Basic != nil { + { + size, err := m.Basic.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *WorkloadPodGroupSingleDisruptionMode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadPodGroupSingleDisruptionMode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadPodGroupSingleDisruptionMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *WorkloadReference) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadReference) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.TemplateName) + copy(dAtA[i:], m.TemplateName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.TemplateName))) + i-- + dAtA[i] = 0x12 + i -= len(m.WorkloadName) + copy(dAtA[i:], m.WorkloadName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.WorkloadName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *WorkloadSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CompositePodGroupTemplates) > 0 { + for iNdEx := len(m.CompositePodGroupTemplates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CompositePodGroupTemplates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.PodGroupTemplates) > 0 { + for iNdEx := len(m.PodGroupTemplates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PodGroupTemplates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.ControllerRef != nil { + { + size, err := m.ControllerRef.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { + offset -= sovGenerated(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AllCompositeDisruptionMode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *AllDisruptionMode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *BasicSchedulingPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *CompositeBasicSchedulingPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *CompositeDisruptionMode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Single != nil { + l = m.Single.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.All != nil { + l = m.All.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *CompositeGangSchedulingPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.MinGroupCount)) + return n +} + +func (m *CompositePodGroup) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *CompositePodGroupList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *CompositePodGroupSchedulingConstraints) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Topology) > 0 { + for _, e := range m.Topology { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *CompositePodGroupSchedulingPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Basic != nil { + l = m.Basic.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Gang != nil { + l = m.Gang.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *CompositePodGroupSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParentCompositePodGroupName != nil { + l = len(*m.ParentCompositePodGroupName) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.WorkloadRef != nil { + l = m.WorkloadRef.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = m.SchedulingPolicy.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.SchedulingConstraints != nil { + l = m.SchedulingConstraints.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.DisruptionMode != nil { + l = m.DisruptionMode.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.PriorityClassName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Priority != nil { + n += 1 + sovGenerated(uint64(*m.Priority)) + } + if m.PreemptionPolicy != nil { + l = len(*m.PreemptionPolicy) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *CompositePodGroupStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *CompositePodGroupTemplate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = m.SchedulingPolicy.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.SchedulingConstraints != nil { + l = m.SchedulingConstraints.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.DisruptionMode != nil { + l = m.DisruptionMode.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.PriorityClassName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Priority != nil { + n += 1 + sovGenerated(uint64(*m.Priority)) + } + if m.PreemptionPolicy != nil { + l = len(*m.PreemptionPolicy) + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.PodGroupTemplates) > 0 { + for _, e := range m.PodGroupTemplates { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.CompositePodGroupTemplates) > 0 { + for _, e := range m.CompositePodGroupTemplates { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *DisruptionMode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Single != nil { + l = m.Single.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.All != nil { + l = m.All.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *GangSchedulingPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.MinCount)) + return n +} + +func (m *PodGroup) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *PodGroupList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PodGroupResourceClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if m.ResourceClaimName != nil { + l = len(*m.ResourceClaimName) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ResourceClaimTemplateName != nil { + l = len(*m.ResourceClaimTemplateName) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PodGroupResourceClaimStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if m.ResourceClaimName != nil { + l = len(*m.ResourceClaimName) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PodGroupSchedulingConstraints) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Topology) > 0 { + for _, e := range m.Topology { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PodGroupSchedulingPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Basic != nil { + l = m.Basic.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Gang != nil { + l = m.Gang.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PodGroupSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParentCompositePodGroupName != nil { + l = len(*m.ParentCompositePodGroupName) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.WorkloadRef != nil { + l = m.WorkloadRef.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = m.SchedulingPolicy.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.SchedulingConstraints != nil { + l = m.SchedulingConstraints.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.ResourceClaims) > 0 { + for _, e := range m.ResourceClaims { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.DisruptionMode != nil { + l = m.DisruptionMode.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.PriorityClassName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Priority != nil { + n += 1 + sovGenerated(uint64(*m.Priority)) + } + if m.PreemptionPolicy != nil { + l = len(*m.PreemptionPolicy) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PodGroupStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.ResourceClaimStatuses) > 0 { + for _, e := range m.ResourceClaimStatuses { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PodGroupTemplate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = m.SchedulingPolicy.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.SchedulingConstraints != nil { + l = m.SchedulingConstraints.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.ResourceClaims) > 0 { + for _, e := range m.ResourceClaims { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.DisruptionMode != nil { + l = m.DisruptionMode.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.PriorityClassName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Priority != nil { + n += 1 + sovGenerated(uint64(*m.Priority)) + } + if m.PreemptionPolicy != nil { + l = len(*m.PreemptionPolicy) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *SingleCompositeDisruptionMode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *SingleDisruptionMode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *TopologyConstraint) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *TypedLocalObjectReference) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.APIGroup) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Kind) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *Workload) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *WorkloadCompositePodGroupAllDisruptionMode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *WorkloadCompositePodGroupBasicSchedulingPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *WorkloadCompositePodGroupDisruptionMode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Single != nil { + l = m.Single.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.All != nil { + l = m.All.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *WorkloadCompositePodGroupGangSchedulingPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MinGroupCount != nil { + n += 1 + sovGenerated(uint64(*m.MinGroupCount)) + } + return n +} + +func (m *WorkloadCompositePodGroupSchedulingConstraints) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Topology) > 0 { + for _, e := range m.Topology { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *WorkloadCompositePodGroupSchedulingPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Basic != nil { + l = m.Basic.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Gang != nil { + l = m.Gang.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *WorkloadCompositePodGroupSingleDisruptionMode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *WorkloadList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *WorkloadPodGroupAllDisruptionMode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *WorkloadPodGroupBasicSchedulingPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *WorkloadPodGroupDisruptionMode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Single != nil { + l = m.Single.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.All != nil { + l = m.All.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *WorkloadPodGroupGangSchedulingPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MinCount != nil { + n += 1 + sovGenerated(uint64(*m.MinCount)) + } + return n +} + +func (m *WorkloadPodGroupResourceClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if m.ResourceClaimName != nil { + l = len(*m.ResourceClaimName) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ResourceClaimTemplateName != nil { + l = len(*m.ResourceClaimTemplateName) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *WorkloadPodGroupSchedulingConstraints) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Topology) > 0 { + for _, e := range m.Topology { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *WorkloadPodGroupSchedulingPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Basic != nil { + l = m.Basic.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Gang != nil { + l = m.Gang.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *WorkloadPodGroupSingleDisruptionMode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *WorkloadReference) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.WorkloadName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.TemplateName) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *WorkloadSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ControllerRef != nil { + l = m.ControllerRef.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.PodGroupTemplates) > 0 { + for _, e := range m.PodGroupTemplates { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.CompositePodGroupTemplates) > 0 { + for _, e := range m.CompositePodGroupTemplates { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func sovGenerated(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenerated(x uint64) (n int) { + return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *AllCompositeDisruptionMode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AllCompositeDisruptionMode{`, + `}`, + }, "") + return s +} +func (this *AllDisruptionMode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AllDisruptionMode{`, + `}`, + }, "") + return s +} +func (this *BasicSchedulingPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BasicSchedulingPolicy{`, + `}`, + }, "") + return s +} +func (this *CompositeBasicSchedulingPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CompositeBasicSchedulingPolicy{`, + `}`, + }, "") + return s +} +func (this *CompositeDisruptionMode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CompositeDisruptionMode{`, + `Single:` + strings.Replace(this.Single.String(), "SingleCompositeDisruptionMode", "SingleCompositeDisruptionMode", 1) + `,`, + `All:` + strings.Replace(this.All.String(), "AllCompositeDisruptionMode", "AllCompositeDisruptionMode", 1) + `,`, + `}`, + }, "") + return s +} +func (this *CompositeGangSchedulingPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CompositeGangSchedulingPolicy{`, + `MinGroupCount:` + fmt.Sprintf("%v", this.MinGroupCount) + `,`, + `}`, + }, "") + return s +} +func (this *CompositePodGroup) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CompositePodGroup{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "CompositePodGroupSpec", "CompositePodGroupSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "CompositePodGroupStatus", "CompositePodGroupStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *CompositePodGroupList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]CompositePodGroup{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "CompositePodGroup", "CompositePodGroup", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&CompositePodGroupList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *CompositePodGroupSchedulingConstraints) String() string { + if this == nil { + return "nil" + } + repeatedStringForTopology := "[]TopologyConstraint{" + for _, f := range this.Topology { + repeatedStringForTopology += strings.Replace(strings.Replace(f.String(), "TopologyConstraint", "TopologyConstraint", 1), `&`, ``, 1) + "," + } + repeatedStringForTopology += "}" + s := strings.Join([]string{`&CompositePodGroupSchedulingConstraints{`, + `Topology:` + repeatedStringForTopology + `,`, + `}`, + }, "") + return s +} +func (this *CompositePodGroupSchedulingPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CompositePodGroupSchedulingPolicy{`, + `Basic:` + strings.Replace(this.Basic.String(), "CompositeBasicSchedulingPolicy", "CompositeBasicSchedulingPolicy", 1) + `,`, + `Gang:` + strings.Replace(this.Gang.String(), "CompositeGangSchedulingPolicy", "CompositeGangSchedulingPolicy", 1) + `,`, + `}`, + }, "") + return s +} +func (this *CompositePodGroupSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CompositePodGroupSpec{`, + `ParentCompositePodGroupName:` + valueToStringGenerated(this.ParentCompositePodGroupName) + `,`, + `WorkloadRef:` + strings.Replace(this.WorkloadRef.String(), "WorkloadReference", "WorkloadReference", 1) + `,`, + `SchedulingPolicy:` + strings.Replace(strings.Replace(this.SchedulingPolicy.String(), "CompositePodGroupSchedulingPolicy", "CompositePodGroupSchedulingPolicy", 1), `&`, ``, 1) + `,`, + `SchedulingConstraints:` + strings.Replace(this.SchedulingConstraints.String(), "CompositePodGroupSchedulingConstraints", "CompositePodGroupSchedulingConstraints", 1) + `,`, + `DisruptionMode:` + strings.Replace(this.DisruptionMode.String(), "CompositeDisruptionMode", "CompositeDisruptionMode", 1) + `,`, + `PriorityClassName:` + fmt.Sprintf("%v", this.PriorityClassName) + `,`, + `Priority:` + valueToStringGenerated(this.Priority) + `,`, + `PreemptionPolicy:` + valueToStringGenerated(this.PreemptionPolicy) + `,`, + `}`, + }, "") + return s +} +func (this *CompositePodGroupStatus) String() string { + if this == nil { + return "nil" + } + repeatedStringForConditions := "[]Condition{" + for _, f := range this.Conditions { + repeatedStringForConditions += fmt.Sprintf("%v", f) + "," + } + repeatedStringForConditions += "}" + s := strings.Join([]string{`&CompositePodGroupStatus{`, + `Conditions:` + repeatedStringForConditions + `,`, + `}`, + }, "") + return s +} +func (this *CompositePodGroupTemplate) String() string { + if this == nil { + return "nil" + } + repeatedStringForPodGroupTemplates := "[]PodGroupTemplate{" + for _, f := range this.PodGroupTemplates { + repeatedStringForPodGroupTemplates += strings.Replace(strings.Replace(f.String(), "PodGroupTemplate", "PodGroupTemplate", 1), `&`, ``, 1) + "," + } + repeatedStringForPodGroupTemplates += "}" + repeatedStringForCompositePodGroupTemplates := "[]CompositePodGroupTemplate{" + for _, f := range this.CompositePodGroupTemplates { + repeatedStringForCompositePodGroupTemplates += strings.Replace(strings.Replace(f.String(), "CompositePodGroupTemplate", "CompositePodGroupTemplate", 1), `&`, ``, 1) + "," + } + repeatedStringForCompositePodGroupTemplates += "}" + s := strings.Join([]string{`&CompositePodGroupTemplate{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `SchedulingPolicy:` + strings.Replace(strings.Replace(this.SchedulingPolicy.String(), "CompositePodGroupSchedulingPolicy", "CompositePodGroupSchedulingPolicy", 1), `&`, ``, 1) + `,`, + `SchedulingConstraints:` + strings.Replace(this.SchedulingConstraints.String(), "CompositePodGroupSchedulingConstraints", "CompositePodGroupSchedulingConstraints", 1) + `,`, + `DisruptionMode:` + strings.Replace(this.DisruptionMode.String(), "CompositeDisruptionMode", "CompositeDisruptionMode", 1) + `,`, + `PriorityClassName:` + fmt.Sprintf("%v", this.PriorityClassName) + `,`, + `Priority:` + valueToStringGenerated(this.Priority) + `,`, + `PreemptionPolicy:` + valueToStringGenerated(this.PreemptionPolicy) + `,`, + `PodGroupTemplates:` + repeatedStringForPodGroupTemplates + `,`, + `CompositePodGroupTemplates:` + repeatedStringForCompositePodGroupTemplates + `,`, + `}`, + }, "") + return s +} +func (this *DisruptionMode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DisruptionMode{`, + `Single:` + strings.Replace(this.Single.String(), "SingleDisruptionMode", "SingleDisruptionMode", 1) + `,`, + `All:` + strings.Replace(this.All.String(), "AllDisruptionMode", "AllDisruptionMode", 1) + `,`, + `}`, + }, "") + return s +} +func (this *GangSchedulingPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GangSchedulingPolicy{`, + `MinCount:` + fmt.Sprintf("%v", this.MinCount) + `,`, + `}`, + }, "") + return s +} +func (this *PodGroup) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodGroup{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "PodGroupSpec", "PodGroupSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "PodGroupStatus", "PodGroupStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *PodGroupList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]PodGroup{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "PodGroup", "PodGroup", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&PodGroupList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *PodGroupResourceClaim) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodGroupResourceClaim{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `ResourceClaimName:` + valueToStringGenerated(this.ResourceClaimName) + `,`, + `ResourceClaimTemplateName:` + valueToStringGenerated(this.ResourceClaimTemplateName) + `,`, + `}`, + }, "") + return s +} +func (this *PodGroupResourceClaimStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodGroupResourceClaimStatus{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `ResourceClaimName:` + valueToStringGenerated(this.ResourceClaimName) + `,`, + `}`, + }, "") + return s +} +func (this *PodGroupSchedulingConstraints) String() string { + if this == nil { + return "nil" + } + repeatedStringForTopology := "[]TopologyConstraint{" + for _, f := range this.Topology { + repeatedStringForTopology += strings.Replace(strings.Replace(f.String(), "TopologyConstraint", "TopologyConstraint", 1), `&`, ``, 1) + "," + } + repeatedStringForTopology += "}" + s := strings.Join([]string{`&PodGroupSchedulingConstraints{`, + `Topology:` + repeatedStringForTopology + `,`, + `}`, + }, "") + return s +} +func (this *PodGroupSchedulingPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodGroupSchedulingPolicy{`, + `Basic:` + strings.Replace(this.Basic.String(), "BasicSchedulingPolicy", "BasicSchedulingPolicy", 1) + `,`, + `Gang:` + strings.Replace(this.Gang.String(), "GangSchedulingPolicy", "GangSchedulingPolicy", 1) + `,`, + `}`, + }, "") + return s +} +func (this *PodGroupSpec) String() string { + if this == nil { + return "nil" + } + repeatedStringForResourceClaims := "[]PodGroupResourceClaim{" + for _, f := range this.ResourceClaims { + repeatedStringForResourceClaims += strings.Replace(strings.Replace(f.String(), "PodGroupResourceClaim", "PodGroupResourceClaim", 1), `&`, ``, 1) + "," + } + repeatedStringForResourceClaims += "}" + s := strings.Join([]string{`&PodGroupSpec{`, + `ParentCompositePodGroupName:` + valueToStringGenerated(this.ParentCompositePodGroupName) + `,`, + `WorkloadRef:` + strings.Replace(this.WorkloadRef.String(), "WorkloadReference", "WorkloadReference", 1) + `,`, + `SchedulingPolicy:` + strings.Replace(strings.Replace(this.SchedulingPolicy.String(), "PodGroupSchedulingPolicy", "PodGroupSchedulingPolicy", 1), `&`, ``, 1) + `,`, + `SchedulingConstraints:` + strings.Replace(this.SchedulingConstraints.String(), "PodGroupSchedulingConstraints", "PodGroupSchedulingConstraints", 1) + `,`, + `ResourceClaims:` + repeatedStringForResourceClaims + `,`, + `DisruptionMode:` + strings.Replace(this.DisruptionMode.String(), "DisruptionMode", "DisruptionMode", 1) + `,`, + `PriorityClassName:` + fmt.Sprintf("%v", this.PriorityClassName) + `,`, + `Priority:` + valueToStringGenerated(this.Priority) + `,`, + `PreemptionPolicy:` + valueToStringGenerated(this.PreemptionPolicy) + `,`, + `}`, + }, "") + return s +} +func (this *PodGroupStatus) String() string { + if this == nil { + return "nil" + } + repeatedStringForConditions := "[]Condition{" + for _, f := range this.Conditions { + repeatedStringForConditions += fmt.Sprintf("%v", f) + "," + } + repeatedStringForConditions += "}" + repeatedStringForResourceClaimStatuses := "[]PodGroupResourceClaimStatus{" + for _, f := range this.ResourceClaimStatuses { + repeatedStringForResourceClaimStatuses += strings.Replace(strings.Replace(f.String(), "PodGroupResourceClaimStatus", "PodGroupResourceClaimStatus", 1), `&`, ``, 1) + "," + } + repeatedStringForResourceClaimStatuses += "}" + s := strings.Join([]string{`&PodGroupStatus{`, + `Conditions:` + repeatedStringForConditions + `,`, + `ResourceClaimStatuses:` + repeatedStringForResourceClaimStatuses + `,`, + `}`, + }, "") + return s +} +func (this *PodGroupTemplate) String() string { + if this == nil { + return "nil" + } + repeatedStringForResourceClaims := "[]PodGroupResourceClaim{" + for _, f := range this.ResourceClaims { + repeatedStringForResourceClaims += strings.Replace(strings.Replace(f.String(), "PodGroupResourceClaim", "PodGroupResourceClaim", 1), `&`, ``, 1) + "," + } + repeatedStringForResourceClaims += "}" + s := strings.Join([]string{`&PodGroupTemplate{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `SchedulingPolicy:` + strings.Replace(strings.Replace(this.SchedulingPolicy.String(), "PodGroupSchedulingPolicy", "PodGroupSchedulingPolicy", 1), `&`, ``, 1) + `,`, + `SchedulingConstraints:` + strings.Replace(this.SchedulingConstraints.String(), "PodGroupSchedulingConstraints", "PodGroupSchedulingConstraints", 1) + `,`, + `ResourceClaims:` + repeatedStringForResourceClaims + `,`, + `DisruptionMode:` + strings.Replace(this.DisruptionMode.String(), "DisruptionMode", "DisruptionMode", 1) + `,`, + `PriorityClassName:` + fmt.Sprintf("%v", this.PriorityClassName) + `,`, + `Priority:` + valueToStringGenerated(this.Priority) + `,`, + `PreemptionPolicy:` + valueToStringGenerated(this.PreemptionPolicy) + `,`, + `}`, + }, "") + return s +} +func (this *SingleCompositeDisruptionMode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SingleCompositeDisruptionMode{`, + `}`, + }, "") + return s +} +func (this *SingleDisruptionMode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SingleDisruptionMode{`, + `}`, + }, "") + return s +} +func (this *TopologyConstraint) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TopologyConstraint{`, + `Key:` + fmt.Sprintf("%v", this.Key) + `,`, + `}`, + }, "") + return s +} +func (this *TypedLocalObjectReference) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TypedLocalObjectReference{`, + `APIGroup:` + fmt.Sprintf("%v", this.APIGroup) + `,`, + `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} +func (this *Workload) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Workload{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "WorkloadSpec", "WorkloadSpec", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *WorkloadCompositePodGroupAllDisruptionMode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WorkloadCompositePodGroupAllDisruptionMode{`, + `}`, + }, "") + return s +} +func (this *WorkloadCompositePodGroupBasicSchedulingPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WorkloadCompositePodGroupBasicSchedulingPolicy{`, + `}`, + }, "") + return s +} +func (this *WorkloadCompositePodGroupDisruptionMode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WorkloadCompositePodGroupDisruptionMode{`, + `Single:` + strings.Replace(this.Single.String(), "WorkloadCompositePodGroupSingleDisruptionMode", "WorkloadCompositePodGroupSingleDisruptionMode", 1) + `,`, + `All:` + strings.Replace(this.All.String(), "WorkloadCompositePodGroupAllDisruptionMode", "WorkloadCompositePodGroupAllDisruptionMode", 1) + `,`, + `}`, + }, "") + return s +} +func (this *WorkloadCompositePodGroupGangSchedulingPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WorkloadCompositePodGroupGangSchedulingPolicy{`, + `MinGroupCount:` + valueToStringGenerated(this.MinGroupCount) + `,`, + `}`, + }, "") + return s +} +func (this *WorkloadCompositePodGroupSchedulingConstraints) String() string { + if this == nil { + return "nil" + } + repeatedStringForTopology := "[]TopologyConstraint{" + for _, f := range this.Topology { + repeatedStringForTopology += strings.Replace(strings.Replace(f.String(), "TopologyConstraint", "TopologyConstraint", 1), `&`, ``, 1) + "," + } + repeatedStringForTopology += "}" + s := strings.Join([]string{`&WorkloadCompositePodGroupSchedulingConstraints{`, + `Topology:` + repeatedStringForTopology + `,`, + `}`, + }, "") + return s +} +func (this *WorkloadCompositePodGroupSchedulingPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WorkloadCompositePodGroupSchedulingPolicy{`, + `Basic:` + strings.Replace(this.Basic.String(), "WorkloadCompositePodGroupBasicSchedulingPolicy", "WorkloadCompositePodGroupBasicSchedulingPolicy", 1) + `,`, + `Gang:` + strings.Replace(this.Gang.String(), "WorkloadCompositePodGroupGangSchedulingPolicy", "WorkloadCompositePodGroupGangSchedulingPolicy", 1) + `,`, + `}`, + }, "") + return s +} +func (this *WorkloadCompositePodGroupSingleDisruptionMode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WorkloadCompositePodGroupSingleDisruptionMode{`, + `}`, + }, "") + return s +} +func (this *WorkloadList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]Workload{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "Workload", "Workload", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&WorkloadList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *WorkloadPodGroupAllDisruptionMode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WorkloadPodGroupAllDisruptionMode{`, + `}`, + }, "") + return s +} +func (this *WorkloadPodGroupBasicSchedulingPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WorkloadPodGroupBasicSchedulingPolicy{`, + `}`, + }, "") + return s +} +func (this *WorkloadPodGroupDisruptionMode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WorkloadPodGroupDisruptionMode{`, + `Single:` + strings.Replace(this.Single.String(), "WorkloadPodGroupSingleDisruptionMode", "WorkloadPodGroupSingleDisruptionMode", 1) + `,`, + `All:` + strings.Replace(this.All.String(), "WorkloadPodGroupAllDisruptionMode", "WorkloadPodGroupAllDisruptionMode", 1) + `,`, + `}`, + }, "") + return s +} +func (this *WorkloadPodGroupGangSchedulingPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WorkloadPodGroupGangSchedulingPolicy{`, + `MinCount:` + valueToStringGenerated(this.MinCount) + `,`, + `}`, + }, "") + return s +} +func (this *WorkloadPodGroupResourceClaim) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WorkloadPodGroupResourceClaim{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `ResourceClaimName:` + valueToStringGenerated(this.ResourceClaimName) + `,`, + `ResourceClaimTemplateName:` + valueToStringGenerated(this.ResourceClaimTemplateName) + `,`, + `}`, + }, "") + return s +} +func (this *WorkloadPodGroupSchedulingConstraints) String() string { + if this == nil { + return "nil" + } + repeatedStringForTopology := "[]TopologyConstraint{" + for _, f := range this.Topology { + repeatedStringForTopology += strings.Replace(strings.Replace(f.String(), "TopologyConstraint", "TopologyConstraint", 1), `&`, ``, 1) + "," + } + repeatedStringForTopology += "}" + s := strings.Join([]string{`&WorkloadPodGroupSchedulingConstraints{`, + `Topology:` + repeatedStringForTopology + `,`, + `}`, + }, "") + return s +} +func (this *WorkloadPodGroupSchedulingPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WorkloadPodGroupSchedulingPolicy{`, + `Basic:` + strings.Replace(this.Basic.String(), "WorkloadPodGroupBasicSchedulingPolicy", "WorkloadPodGroupBasicSchedulingPolicy", 1) + `,`, + `Gang:` + strings.Replace(this.Gang.String(), "WorkloadPodGroupGangSchedulingPolicy", "WorkloadPodGroupGangSchedulingPolicy", 1) + `,`, + `}`, + }, "") + return s +} +func (this *WorkloadPodGroupSingleDisruptionMode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WorkloadPodGroupSingleDisruptionMode{`, + `}`, + }, "") + return s +} +func (this *WorkloadReference) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WorkloadReference{`, + `WorkloadName:` + fmt.Sprintf("%v", this.WorkloadName) + `,`, + `TemplateName:` + fmt.Sprintf("%v", this.TemplateName) + `,`, + `}`, + }, "") + return s +} +func (this *WorkloadSpec) String() string { + if this == nil { + return "nil" + } + repeatedStringForPodGroupTemplates := "[]PodGroupTemplate{" + for _, f := range this.PodGroupTemplates { + repeatedStringForPodGroupTemplates += strings.Replace(strings.Replace(f.String(), "PodGroupTemplate", "PodGroupTemplate", 1), `&`, ``, 1) + "," + } + repeatedStringForPodGroupTemplates += "}" + repeatedStringForCompositePodGroupTemplates := "[]CompositePodGroupTemplate{" + for _, f := range this.CompositePodGroupTemplates { + repeatedStringForCompositePodGroupTemplates += strings.Replace(strings.Replace(f.String(), "CompositePodGroupTemplate", "CompositePodGroupTemplate", 1), `&`, ``, 1) + "," + } + repeatedStringForCompositePodGroupTemplates += "}" + s := strings.Join([]string{`&WorkloadSpec{`, + `ControllerRef:` + strings.Replace(this.ControllerRef.String(), "TypedLocalObjectReference", "TypedLocalObjectReference", 1) + `,`, + `PodGroupTemplates:` + repeatedStringForPodGroupTemplates + `,`, + `CompositePodGroupTemplates:` + repeatedStringForCompositePodGroupTemplates + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *AllCompositeDisruptionMode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AllCompositeDisruptionMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllCompositeDisruptionMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AllDisruptionMode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AllDisruptionMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllDisruptionMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BasicSchedulingPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BasicSchedulingPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BasicSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompositeBasicSchedulingPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompositeBasicSchedulingPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompositeBasicSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompositeDisruptionMode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompositeDisruptionMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompositeDisruptionMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Single", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Single == nil { + m.Single = &SingleCompositeDisruptionMode{} + } + if err := m.Single.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field All", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.All == nil { + m.All = &AllCompositeDisruptionMode{} + } + if err := m.All.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompositeGangSchedulingPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompositeGangSchedulingPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompositeGangSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinGroupCount", wireType) + } + m.MinGroupCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinGroupCount |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompositePodGroup) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompositePodGroup: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompositePodGroup: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompositePodGroupList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompositePodGroupList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompositePodGroupList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, CompositePodGroup{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompositePodGroupSchedulingConstraints) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompositePodGroupSchedulingConstraints: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompositePodGroupSchedulingConstraints: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topology", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topology = append(m.Topology, TopologyConstraint{}) + if err := m.Topology[len(m.Topology)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompositePodGroupSchedulingPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompositePodGroupSchedulingPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompositePodGroupSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Basic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Basic == nil { + m.Basic = &CompositeBasicSchedulingPolicy{} + } + if err := m.Basic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gang", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Gang == nil { + m.Gang = &CompositeGangSchedulingPolicy{} + } + if err := m.Gang.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompositePodGroupSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompositePodGroupSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompositePodGroupSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParentCompositePodGroupName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.ParentCompositePodGroupName = &s + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WorkloadRef", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.WorkloadRef == nil { + m.WorkloadRef = &WorkloadReference{} + } + if err := m.WorkloadRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchedulingPolicy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SchedulingPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchedulingConstraints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SchedulingConstraints == nil { + m.SchedulingConstraints = &CompositePodGroupSchedulingConstraints{} + } + if err := m.SchedulingConstraints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisruptionMode", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DisruptionMode == nil { + m.DisruptionMode = &CompositeDisruptionMode{} + } + if err := m.DisruptionMode.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PriorityClassName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PriorityClassName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Priority = &v + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PreemptionPolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := PreemptionPolicy(dAtA[iNdEx:postIndex]) + m.PreemptionPolicy = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompositePodGroupStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompositePodGroupStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompositePodGroupStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Conditions = append(m.Conditions, v1.Condition{}) + if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompositePodGroupTemplate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompositePodGroupTemplate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompositePodGroupTemplate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchedulingPolicy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SchedulingPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchedulingConstraints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SchedulingConstraints == nil { + m.SchedulingConstraints = &CompositePodGroupSchedulingConstraints{} + } + if err := m.SchedulingConstraints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisruptionMode", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DisruptionMode == nil { + m.DisruptionMode = &CompositeDisruptionMode{} + } + if err := m.DisruptionMode.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PriorityClassName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PriorityClassName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Priority = &v + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PreemptionPolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := PreemptionPolicy(dAtA[iNdEx:postIndex]) + m.PreemptionPolicy = &s + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PodGroupTemplates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PodGroupTemplates = append(m.PodGroupTemplates, PodGroupTemplate{}) + if err := m.PodGroupTemplates[len(m.PodGroupTemplates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompositePodGroupTemplates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CompositePodGroupTemplates = append(m.CompositePodGroupTemplates, CompositePodGroupTemplate{}) + if err := m.CompositePodGroupTemplates[len(m.CompositePodGroupTemplates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DisruptionMode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DisruptionMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DisruptionMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Single", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Single == nil { + m.Single = &SingleDisruptionMode{} + } + if err := m.Single.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field All", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.All == nil { + m.All = &AllDisruptionMode{} + } + if err := m.All.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GangSchedulingPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GangSchedulingPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GangSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinCount", wireType) + } + m.MinCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinCount |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodGroup) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodGroup: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodGroup: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodGroupList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodGroupList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodGroupList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, PodGroup{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodGroupResourceClaim) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodGroupResourceClaim: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodGroupResourceClaim: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.ResourceClaimName = &s + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimTemplateName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.ResourceClaimTemplateName = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodGroupResourceClaimStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodGroupResourceClaimStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodGroupResourceClaimStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.ResourceClaimName = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodGroupSchedulingConstraints) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodGroupSchedulingConstraints: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodGroupSchedulingConstraints: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topology", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topology = append(m.Topology, TopologyConstraint{}) + if err := m.Topology[len(m.Topology)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodGroupSchedulingPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodGroupSchedulingPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodGroupSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Basic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Basic == nil { + m.Basic = &BasicSchedulingPolicy{} + } + if err := m.Basic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gang", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Gang == nil { + m.Gang = &GangSchedulingPolicy{} + } + if err := m.Gang.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodGroupSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodGroupSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodGroupSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParentCompositePodGroupName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.ParentCompositePodGroupName = &s + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WorkloadRef", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.WorkloadRef == nil { + m.WorkloadRef = &WorkloadReference{} + } + if err := m.WorkloadRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchedulingPolicy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SchedulingPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchedulingConstraints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SchedulingConstraints == nil { + m.SchedulingConstraints = &PodGroupSchedulingConstraints{} + } + if err := m.SchedulingConstraints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaims", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResourceClaims = append(m.ResourceClaims, PodGroupResourceClaim{}) + if err := m.ResourceClaims[len(m.ResourceClaims)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisruptionMode", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DisruptionMode == nil { + m.DisruptionMode = &DisruptionMode{} + } + if err := m.DisruptionMode.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PriorityClassName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PriorityClassName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Priority = &v + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PreemptionPolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := PreemptionPolicy(dAtA[iNdEx:postIndex]) + m.PreemptionPolicy = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodGroupStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodGroupStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodGroupStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Conditions = append(m.Conditions, v1.Condition{}) + if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimStatuses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResourceClaimStatuses = append(m.ResourceClaimStatuses, PodGroupResourceClaimStatus{}) + if err := m.ResourceClaimStatuses[len(m.ResourceClaimStatuses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodGroupTemplate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodGroupTemplate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodGroupTemplate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchedulingPolicy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SchedulingPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchedulingConstraints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SchedulingConstraints == nil { + m.SchedulingConstraints = &PodGroupSchedulingConstraints{} + } + if err := m.SchedulingConstraints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaims", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResourceClaims = append(m.ResourceClaims, PodGroupResourceClaim{}) + if err := m.ResourceClaims[len(m.ResourceClaims)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisruptionMode", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DisruptionMode == nil { + m.DisruptionMode = &DisruptionMode{} + } + if err := m.DisruptionMode.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PriorityClassName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PriorityClassName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Priority = &v + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PreemptionPolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := PreemptionPolicy(dAtA[iNdEx:postIndex]) + m.PreemptionPolicy = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SingleCompositeDisruptionMode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SingleCompositeDisruptionMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SingleCompositeDisruptionMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SingleDisruptionMode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SingleDisruptionMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SingleDisruptionMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TopologyConstraint) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TopologyConstraint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TopologyConstraint: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TypedLocalObjectReference) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TypedLocalObjectReference: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TypedLocalObjectReference: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field APIGroup", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.APIGroup = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Workload) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Workload: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Workload: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadCompositePodGroupAllDisruptionMode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadCompositePodGroupAllDisruptionMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadCompositePodGroupAllDisruptionMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadCompositePodGroupBasicSchedulingPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadCompositePodGroupBasicSchedulingPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadCompositePodGroupBasicSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadCompositePodGroupDisruptionMode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadCompositePodGroupDisruptionMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadCompositePodGroupDisruptionMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Single", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Single == nil { + m.Single = &WorkloadCompositePodGroupSingleDisruptionMode{} + } + if err := m.Single.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field All", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.All == nil { + m.All = &WorkloadCompositePodGroupAllDisruptionMode{} + } + if err := m.All.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadCompositePodGroupGangSchedulingPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadCompositePodGroupGangSchedulingPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadCompositePodGroupGangSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinGroupCount", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.MinGroupCount = &v + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadCompositePodGroupSchedulingConstraints) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadCompositePodGroupSchedulingConstraints: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadCompositePodGroupSchedulingConstraints: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topology", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topology = append(m.Topology, TopologyConstraint{}) + if err := m.Topology[len(m.Topology)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadCompositePodGroupSchedulingPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadCompositePodGroupSchedulingPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadCompositePodGroupSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Basic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Basic == nil { + m.Basic = &WorkloadCompositePodGroupBasicSchedulingPolicy{} + } + if err := m.Basic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gang", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Gang == nil { + m.Gang = &WorkloadCompositePodGroupGangSchedulingPolicy{} + } + if err := m.Gang.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadCompositePodGroupSingleDisruptionMode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadCompositePodGroupSingleDisruptionMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadCompositePodGroupSingleDisruptionMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, Workload{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadPodGroupAllDisruptionMode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadPodGroupAllDisruptionMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadPodGroupAllDisruptionMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadPodGroupBasicSchedulingPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadPodGroupBasicSchedulingPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadPodGroupBasicSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadPodGroupDisruptionMode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadPodGroupDisruptionMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadPodGroupDisruptionMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Single", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Single == nil { + m.Single = &WorkloadPodGroupSingleDisruptionMode{} + } + if err := m.Single.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field All", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.All == nil { + m.All = &WorkloadPodGroupAllDisruptionMode{} + } + if err := m.All.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadPodGroupGangSchedulingPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadPodGroupGangSchedulingPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadPodGroupGangSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinCount", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.MinCount = &v + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadPodGroupResourceClaim) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadPodGroupResourceClaim: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadPodGroupResourceClaim: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.ResourceClaimName = &s + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimTemplateName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.ResourceClaimTemplateName = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadPodGroupSchedulingConstraints) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadPodGroupSchedulingConstraints: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadPodGroupSchedulingConstraints: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topology", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topology = append(m.Topology, TopologyConstraint{}) + if err := m.Topology[len(m.Topology)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadPodGroupSchedulingPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadPodGroupSchedulingPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadPodGroupSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Basic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Basic == nil { + m.Basic = &WorkloadPodGroupBasicSchedulingPolicy{} + } + if err := m.Basic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gang", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Gang == nil { + m.Gang = &WorkloadPodGroupGangSchedulingPolicy{} + } + if err := m.Gang.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadPodGroupSingleDisruptionMode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadPodGroupSingleDisruptionMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadPodGroupSingleDisruptionMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadReference) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadReference: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadReference: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WorkloadName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WorkloadName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TemplateName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TemplateName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ControllerRef", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ControllerRef == nil { + m.ControllerRef = &TypedLocalObjectReference{} + } + if err := m.ControllerRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PodGroupTemplates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PodGroupTemplates = append(m.PodGroupTemplates, PodGroupTemplate{}) + if err := m.PodGroupTemplates[len(m.PodGroupTemplates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompositePodGroupTemplates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CompositePodGroupTemplates = append(m.CompositePodGroupTemplates, CompositePodGroupTemplate{}) + if err := m.CompositePodGroupTemplates[len(m.CompositePodGroupTemplates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenerated(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenerated + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenerated + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") +) diff --git a/vendor/k8s.io/api/scheduling/v1alpha3/generated.proto b/vendor/k8s.io/api/scheduling/v1alpha3/generated.proto new file mode 100644 index 0000000000..662b27b43e --- /dev/null +++ b/vendor/k8s.io/api/scheduling/v1alpha3/generated.proto @@ -0,0 +1,1353 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + + +// This file was autogenerated by go-to-protobuf. Do not edit it manually! + +syntax = "proto2"; + +package k8s.io.api.scheduling.v1alpha3; + +import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; +import "k8s.io/apimachinery/pkg/runtime/generated.proto"; +import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; + +// Package-wide variables from generator "generated". +option go_package = "k8s.io/api/scheduling/v1alpha3"; + +// AllCompositeDisruptionMode means that children of a CompositePodGroup can only be +// disrupted or preempted together. +message AllCompositeDisruptionMode { +} + +// AllDisruptionMode specifies that children can only be disrupted together. +message AllDisruptionMode { +} + +// BasicSchedulingPolicy indicates that standard Kubernetes +// scheduling behavior should be used. +message BasicSchedulingPolicy { +} + +// CompositeBasicSchedulingPolicy indicates that the groups belonging to the composite group +// should be scheduled independently. +message CompositeBasicSchedulingPolicy { +} + +// CompositeDisruptionMode defines how individual entities within a composite pod group can be disrupted. +// Exactly one mode must be set. +// +// +union +message CompositeDisruptionMode { + // single specifies that children groups can be disrupted independently from each other. + // + // +optional + // +k8s:optional + // +k8s:unionMember + optional SingleCompositeDisruptionMode single = 1; + + // all specifies that all children groups can only be disrupted together. + // + // +optional + // +k8s:optional + // +k8s:unionMember + optional AllCompositeDisruptionMode all = 2; +} + +// CompositeGangSchedulingPolicy indicates that the groups belonging to the composite group +// should be scheduled using all-or-nothing semantics. +message CompositeGangSchedulingPolicy { + // minGroupCount is the minimum number of child groups that must be schedulable + // or scheduled at the same time for the scheduler to admit the entire group. + // It must be a positive integer. + // + // +required + // +k8s:required + // +k8s:minimum=1 + optional int32 minGroupCount = 1; +} + +// CompositePodGroup represents a runtime instance of pod groups grouped together. +// CompositePodGroups are created by workload controllers (LWS, JobSet, etc...) from +// Workload.compositePodGroupTemplates. +// CompositePodGroup API enablement is toggled by the CompositePodGroup feature gate. +message CompositePodGroup { + // metadata is the standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // spec defines the desired state of the CompositePodGroup. + // + // +required + optional CompositePodGroupSpec spec = 2; + + // status represents the current observed state of the CompositePodGroup. + // + // +optional + optional CompositePodGroupStatus status = 3; +} + +// CompositePodGroupList contains a list of CompositePodGroup resources. +message CompositePodGroupList { + // Standard list metadata. + // + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // Items is the list of CompositePodGroups. + repeated CompositePodGroup items = 2; +} + +// CompositePodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a CompositePodGroup. +message CompositePodGroupSchedulingConstraints { + // topology defines the topology constraints for the composite pod group. + // Currently only a single topology constraint can be specified. This may change in the future. + // + // +optional + // +k8s:optional + // +k8s:maxItems=1 + // +listType=atomic + // +k8s:listType=atomic + repeated TopologyConstraint topology = 1; +} + +// CompositePodGroupSchedulingPolicy defines the scheduling configuration for a CompositePodGroup. +// Exactly one policy must be set. +// +// +union +message CompositePodGroupSchedulingPolicy { + // basic specifies that the groups of this composite group should be scheduled independently. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + // +k8s:unionMember + optional CompositeBasicSchedulingPolicy basic = 1; + + // gang specifies that the groups of this composite group should be scheduled using + // all-or-nothing semantics. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:update=NoSet + // +k8s:update=NoUnset + optional CompositeGangSchedulingPolicy gang = 2; +} + +// CompositePodGroupSpec defines the desired state of CompositePodGroup. +message CompositePodGroupSpec { + // parentCompositePodGroupName contains the name of the parent composite pod group + // within the same namespace as this composite pod group. It must be a DNS name. + // If it's nil, then this composite pod group is a root of a workload's hierarchy. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + // +k8s:format=k8s-long-name + optional string parentCompositePodGroupName = 1; + + // workloadRef references an optional CompositePodGroup template within the + // Workload object that was used to create the CompositePodGroup. + // This field is required. + // This field is immutable. + // + // +required + // +k8s:required + // +k8s:immutable + optional WorkloadReference workloadRef = 2; + + // schedulingPolicy defines the scheduling policy for this instance of the CompositePodGroup. + // Controllers are expected to fill this field by copying it from a CompositePodGroupTemplate. + // This field is immutable. + // + // +required + // +k8s:immutable + optional CompositePodGroupSchedulingPolicy schedulingPolicy = 3; + + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this CompositePodGroup. + // Controllers are expected to fill this field by copying it from a CompositePodGroupTemplate. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + optional CompositePodGroupSchedulingConstraints schedulingConstraints = 4; + + // disruptionMode defines the mode in which a given CompositePodGroup can be disrupted. + // Controllers are expected to fill this field by copying it from a CompositePodGroupTemplate. + // One of Single, All. Defaults to Single if unset. + // This field is immutable. + // + // +default={"single": {}} + // +optional + // +k8s:optional + // +k8s:immutable + optional CompositeDisruptionMode disruptionMode = 5; + + // priorityClassName defines the priority that should be considered when scheduling this CompositePodGroup. + // Controllers are expected to fill this field by copying it from a CompositePodGroupTemplate. + // If left unspecified, it is validated and resolved similarly to the PriorityClassName field in Pods + // (i.e. if no priority class is specified, admission control can set this to the global default + // priority class if it exists. Otherwise, the composite pod group's priority will be zero). + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:format=k8s-long-name + // +k8s:immutable + optional string priorityClassName = 6; + + // priority is the value of priority of this composite pod group. Various system components + // use this field to find the priority of the composite pod group. When Priority Admission + // Controller is enabled, it prevents users from setting this field. The admission + // controller populates this field from PriorityClassName. + // The higher the value, the higher the priority. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + // +k8s:maximum=1000000000 # HighestUserDefinablePriority + optional int32 priority = 7; + + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. + // When Priority Admission Controller is enabled, it populates this field from PriorityClassName, + // and defaults to PreemptLowerPriority if value is unset in PriorityClass. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + // + // +featureGate=PodGroupPreemptionPolicy + // +optional + // +k8s:immutable + // +k8s:ifDisabled("PodGroupPreemptionPolicy")=+k8s:forbidden + // +k8s:ifEnabled("PodGroupPreemptionPolicy")=+k8s:optional + optional string preemptionPolicy = 8; +} + +// CompositePodGroupStatus represents information about the status of a composite pod group. +message CompositePodGroupStatus { + // conditions represent the latest observations of the CompositePodGroup's state. + // + // Known condition types: + // - "CompositePodGroupInitiallyScheduled": Indicates whether the overall scheduling requirement + // for the subtree under this CompositePodGroup has been satisfied. Once this condition + // transitions to True, it serves as a terminal state and will never revert to False, + // even if pods are subsequently deleted and group constraints are no longer met. + // - "DisruptionTarget": Indicates whether the CompositePodGroup is about to be terminated + // due to disruption such as preemption. + // + // Known reasons for the CompositePodGroupInitiallyScheduled condition: + // - "Unschedulable": The CompositePodGroup's subtree could not be placed due to resource constraints, + // affinity/anti-affinity, or topological constraints. + // - "SchedulerError": The CompositePodGroup cannot be scheduled due to some internal error + // that occurred during scheduling. + // - "Invalid": Set to True when kube-scheduler detects an invalid group layout during + // runtime validation. The `message` field details the specific layout violation (such as + // a detected cycle, exceeding the maximum depth of 4, or referencing multiple distinct Workloads). + // + // Known reasons for the DisruptionTarget condition: + // - "PreemptionByScheduler": The CompositePodGroup was targeted by the scheduler's preemption loop + // to free up capacity for higher-priority preemptors. + // + // +optional + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type + repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1; +} + +// CompositePodGroupTemplate represents a template for a CompositePodGroup with a scheduling policy. +message CompositePodGroupTemplate { + // name is a unique identifier for the CompositePodGroupTemplate within the Workload. + // It must be a DNS label. This field is required. + // + // +required + // +k8s:required + // +k8s:format=k8s-short-name + optional string name = 1; + + // schedulingPolicy defines the scheduling policy for this template. + // + // +required + optional CompositePodGroupSchedulingPolicy schedulingPolicy = 2; + + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this CompositePodGroupTemplate. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + optional CompositePodGroupSchedulingConstraints schedulingConstraints = 3; + + // disruptionMode defines the mode in which a given CompositePodGroup can be disrupted. + // One of Single, All. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + optional CompositeDisruptionMode disruptionMode = 4; + + // priorityClassName indicates the priority that should be considered when scheduling + // a composite pod group created from this template. If no priority class is specified, + // admission control can set this to the global default priority class if it exists. + // Otherwise, composite pod groups created from this template will have the priority set + // to zero. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:format=k8s-long-name + // +k8s:immutable + optional string priorityClassName = 5; + + // priority is the value of priority of composite pod groups created from this template. + // Various system components use this field to find the priority of the composite pod group. + // When Priority Admission Controller is enabled, it prevents users from setting this field. + // The admission controller populates this field from PriorityClassName. + // The higher the value, the higher the priority. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:maximum=1000000000 # HighestUserDefinablePriority + // +k8s:immutable + optional int32 priority = 6; + + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + // + // +featureGate=PodGroupPreemptionPolicy + // +optional + // +k8s:immutable + // +k8s:ifDisabled("PodGroupPreemptionPolicy")=+k8s:forbidden + // +k8s:ifEnabled("PodGroupPreemptionPolicy")=+k8s:optional + optional string preemptionPolicy = 7; + + // podGroupTemplates is the list of templates for children PodGroups. + // The maximum number of templates is 8. At least one entry in CompositePodGroupTemplates + // or PodGroupTemplates must be set. + // + // +optional + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=8 + // +k8s:update=NoAddItem + // +k8s:update=NoRemoveItem + repeated PodGroupTemplate podGroupTemplates = 8; + + // compositePodGroupTemplates is the list of templates for children CompositePodGroups. + // The maximum number of templates is 8. At least one entry in CompositePodGroupTemplates + // or PodGroupTemplates must be set. + // + // +optional + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=8 + // +k8s:update=NoAddItem + // +k8s:update=NoRemoveItem + repeated CompositePodGroupTemplate compositePodGroupTemplates = 9; +} + +// DisruptionMode defines how individual entities within a group can be disrupted. +// Exactly one mode can be set. +// +// +union +message DisruptionMode { + // single specifies that children can be disrupted independently from each other. + // + // +optional + // +k8s:optional + // +k8s:unionMember + optional SingleDisruptionMode single = 1; + + // all specifies that all children can only be disrupted together. + // + // +optional + // +k8s:optional + // +k8s:unionMember + optional AllDisruptionMode all = 2; +} + +// GangSchedulingPolicy defines the parameters for gang scheduling. +message GangSchedulingPolicy { + // minCount is the minimum number of pods that must be schedulable or scheduled + // at the same time for the scheduler to admit the entire group. + // It must be a positive integer. This field is mutable to support workload scaling. + // + // Note that the scheduler operates on an eventually consistent model. Updates + // to minCount may not be immediately reflected in scheduling decisions due to + // propagation delays. If minCount is updated while a scheduling cycle is in + // progress for that group, the new value may not take effect until the next + // cycle. Moreover, minCount is only enforced during scheduling, meaning that + // modifications to this field do not affect already-scheduled pods, applying + // only to those evaluated in future cycles. + // + // +required + // +k8s:required + // +k8s:minimum=1 + optional int32 minCount = 1; +} + +// PodGroup represents a runtime instance of pods grouped together. +// PodGroups are created by workload controllers (Job, LWS, JobSet, etc...) from +// Workload.podGroupTemplates. +// PodGroup API enablement is toggled by the GenericWorkload feature gate. +message PodGroup { + // metadata is the standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // spec defines the desired state of the PodGroup. + // + // +required + optional PodGroupSpec spec = 2; + + // status represents the current observed state of the PodGroup. + // + // +optional + optional PodGroupStatus status = 3; +} + +// PodGroupList contains a list of PodGroup resources. +message PodGroupList { + // Standard list metadata. + // + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // Items is the list of PodGroups. + repeated PodGroup items = 2; +} + +// PodGroupResourceClaim references exactly one ResourceClaim, either directly +// or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim +// for the PodGroup. +// +// It adds a name to it that uniquely identifies the ResourceClaim inside the PodGroup. +// Pods that need access to the ResourceClaim define a matching reference in its +// own Spec.ResourceClaims. The Pod's claim must match all fields of the +// PodGroup's claim exactly. +message PodGroupResourceClaim { + // name uniquely identifies this resource claim inside the PodGroup. + // This must be a DNS_LABEL. + // + // +required + // +k8s:required + // +k8s:format=k8s-short-name + optional string name = 1; + + // resourceClaimName is the name of a ResourceClaim object in the same + // namespace as this PodGroup. The ResourceClaim will be reserved for the + // PodGroup instead of its individual pods. + // + // Exactly one of ResourceClaimName and ResourceClaimTemplateName must + // be set. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:format=k8s-long-name + optional string resourceClaimName = 2; + + // resourceClaimTemplateName is the name of a ResourceClaimTemplate + // object in the same namespace as this PodGroup. + // + // The template will be used to create a new ResourceClaim, which will + // be bound to this PodGroup. When this PodGroup is deleted, the ResourceClaim + // will also be deleted. The PodGroup 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 podgroup.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. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:format=k8s-long-name + optional string resourceClaimTemplateName = 3; +} + +// PodGroupResourceClaimStatus is stored in the PodGroupStatus for each +// PodGroupResourceClaim which references a ResourceClaimTemplate. It stores the +// generated name for the corresponding ResourceClaim. +message PodGroupResourceClaimStatus { + // name uniquely identifies this resource claim inside the PodGroup. This + // must match the name of an entry in podgroup.spec.resourceClaims, which + // implies that the string must be a DNS_LABEL. + // + // +required + optional string name = 1; + + // resourceClaimName is the name of the ResourceClaim that was generated for + // the PodGroup in the namespace of the PodGroup. If this is unset, then + // generating a ResourceClaim was not necessary. The + // podgroup.spec.resourceClaims entry can be ignored in this case. + // + // +optional + // +k8s:optional + // +k8s:format=k8s-long-name + optional string resourceClaimName = 2; +} + +// PodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a PodGroup. +message PodGroupSchedulingConstraints { + // topology defines the topology constraints for the pod group. + // Currently only a single topology constraint can be specified. This may change in the future. + // + // +optional + // +k8s:optional + // +k8s:maxItems=1 + // +listType=atomic + // +k8s:listType=atomic + repeated TopologyConstraint topology = 1; +} + +// PodGroupSchedulingPolicy defines the scheduling configuration for a PodGroup. +// Exactly one policy must be set. The policy is chosen at creation time by setting either the +// Basic or Gang field. The PodGroup may not change policy after creation. +// Fields within chosen policy may be updated after creation when their individual fields allow it. +// +// +union +message PodGroupSchedulingPolicy { + // basic specifies that the pods in this group should be scheduled using + // standard Kubernetes scheduling behavior. Setting this field at group creation time + // opts this group to basic scheduling; this field cannot be changed afterward. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:immutable + optional BasicSchedulingPolicy basic = 1; + + // gang specifies that the pods in this group should be scheduled using + // all-or-nothing semantics. Setting this field at group creation time + // opts this group to gang scheduling; this field cannot be set or unset afterward. + // The minCount field within Gang scheduling policy remains mutable after group creation. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:update=NoSet + // +k8s:update=NoUnset + optional GangSchedulingPolicy gang = 2; +} + +// PodGroupSpec defines the desired state of a PodGroup. +message PodGroupSpec { + // parentCompositePodGroupName contains the name of the parent composite pod group + // within the same namespace as this pod group. + // If it's nil, then this pod group is a root of a workload's hierarchy. + // This field is used only when the CompositePodGroup feature gate is enabled. + // This field is immutable. + // + // +featureGate=CompositePodGroup + // +optional + // +k8s:ifDisabled(CompositePodGroup)=+k8s:forbidden + // +k8s:ifEnabled(CompositePodGroup)=+k8s:optional + // +k8s:immutable + // +k8s:format=k8s-long-name + // +k8s:alpha(since: "1.37")=+k8s:dependentRequired("workloadRef") + optional string parentCompositePodGroupName = 1; + + // workloadRef references an optional PodGroup template within the Workload + // object that was used to create the PodGroup. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + optional WorkloadReference workloadRef = 2; + + // schedulingPolicy defines the scheduling policy for this instance of the PodGroup. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // + // +required + optional PodGroupSchedulingPolicy schedulingPolicy = 3; + + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroup. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // This field is immutable. + // This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. + // + // +featureGate=TopologyAwareWorkloadScheduling + // +optional + // +k8s:ifDisabled(TopologyAwareWorkloadScheduling)=+k8s:forbidden + // +k8s:ifEnabled(TopologyAwareWorkloadScheduling)=+k8s:optional + // +k8s:ifEnabled(TopologyAwareWorkloadScheduling)=+k8s:immutable + optional PodGroupSchedulingConstraints schedulingConstraints = 4; + + // resourceClaims defines which ResourceClaims may be shared among Pods in + // the group. Pods consume the devices allocated to a PodGroup's claim by + // defining a claim in its own Spec.ResourceClaims that matches the + // PodGroup's claim exactly. The claim must have the same name and refer to + // the same ResourceClaim or ResourceClaimTemplate. + // + // This is a beta-level field and requires that the + // DRAWorkloadResourceClaims feature gate is enabled. + // + // This field is immutable. + // + // +optional + // +patchMergeKey=name + // +patchStrategy=merge,retainKeys + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=4 + // +k8s:immutable + // +featureGate=DRAWorkloadResourceClaims + repeated PodGroupResourceClaim resourceClaims = 5; + + // disruptionMode defines the mode in which a given PodGroup can be disrupted. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // One of Single, All. Defaults to Single if unset. + // This field is immutable. + // + // +default={"single": {}} + // +optional + // +k8s:optional + // +k8s:immutable + optional DisruptionMode disruptionMode = 6; + + // priorityClassName defines the priority that should be considered when scheduling this pod group. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // Otherwise, it is validated and resolved similarly to the PriorityClassName on PodGroupTemplate + // (i.e. if no priority class is specified, admission control can set this to the global default + // priority class if it exists. Otherwise, the pod group's priority will be zero). + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + // +k8s:format=k8s-long-name + optional string priorityClassName = 7; + + // priority is the value of priority of this pod group. Various system components + // use this field to find the priority of the pod group. When Priority Admission + // Controller is enabled, it prevents users from setting this field. The admission + // controller populates this field from PriorityClassName. + // The higher the value, the higher the priority. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + // +k8s:maximum=1000000000 # HighestUserDefinablePriority + optional int32 priority = 8; + + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. + // When Priority Admission Controller is enabled, it populates this field from PriorityClassName, + // and defaults to PreemptLowerPriority if value is unset in PriorityClass. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + // + // +featureGate=PodGroupPreemptionPolicy + // +optional + // +k8s:immutable + // +k8s:ifDisabled("PodGroupPreemptionPolicy")=+k8s:forbidden + // +k8s:ifEnabled("PodGroupPreemptionPolicy")=+k8s:optional + optional string preemptionPolicy = 9; +} + +// PodGroupStatus represents information about the status of a pod group. +message PodGroupStatus { + // conditions represent the latest observations of the PodGroup's state. + // + // Known condition types: + // - "PodGroupInitiallyScheduled": Indicates whether the scheduling requirement has been satisfied. + // Once this condition transitions to True, it serves as a terminal state and will never revert to False, + // even if pods are subsequently evicted and group constraints are no longer met. + // - "DisruptionTarget": Indicates whether the PodGroup is about to be terminated + // due to disruption such as preemption. + // + // Known reasons for the PodGroupInitiallyScheduled condition: + // - "Unschedulable": The PodGroup cannot be scheduled due to resource constraints, + // affinity/anti-affinity rules, or insufficient capacity for the gang. + // - "SchedulerError": The PodGroup cannot be scheduled due to some internal error + // that happened during scheduling, for example due to nodeAffinity parsing errors. + // + // Known reasons for the DisruptionTarget condition: + // - "PreemptionByScheduler": The PodGroup was preempted by the scheduler to make room for + // higher-priority PodGroups or Pods. + // + // +optional + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type + repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1; + + // resourceClaimStatuses is status of resource claims. + // +optional + // +patchMergeKey=name + // +patchStrategy=merge,retainKeys + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=4 + // +featureGate=DRAWorkloadResourceClaims + repeated PodGroupResourceClaimStatus resourceClaimStatuses = 2; +} + +// PodGroupTemplate represents a template for a set of pods with a scheduling policy. +message PodGroupTemplate { + // name is a unique identifier for the PodGroupTemplate within the Workload. + // It must be a DNS label. This field is immutable. + // + // +required + // +k8s:required + // +k8s:format=k8s-short-name + optional string name = 1; + + // schedulingPolicy defines the scheduling policy for this PodGroupTemplate. + // + // +required + optional PodGroupSchedulingPolicy schedulingPolicy = 2; + + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroupTemplate. + // This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. + // This field is immutable. + // + // +featureGate=TopologyAwareWorkloadScheduling + // +optional + // +k8s:ifDisabled(TopologyAwareWorkloadScheduling)=+k8s:forbidden + // +k8s:ifEnabled(TopologyAwareWorkloadScheduling)=+k8s:optional + // +k8s:immutable + optional PodGroupSchedulingConstraints schedulingConstraints = 3; + + // resourceClaims defines which ResourceClaims may be shared among Pods in + // the group. Pods consume the devices allocated to a PodGroup's claim by + // defining a claim in its own Spec.ResourceClaims that matches the + // PodGroup's claim exactly. The claim must have the same name and refer to + // the same ResourceClaim or ResourceClaimTemplate. + // + // This is a beta-level field and requires that the + // DRAWorkloadResourceClaims feature gate is enabled. + // + // This field is immutable. + // + // +optional + // +patchMergeKey=name + // +patchStrategy=merge,retainKeys + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=4 + // +featureGate=DRAWorkloadResourceClaims + // +k8s:immutable + repeated PodGroupResourceClaim resourceClaims = 4; + + // disruptionMode defines the mode in which a given PodGroup can be disrupted. + // One of Single, All. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + optional DisruptionMode disruptionMode = 5; + + // priorityClassName indicates the priority that should be considered when scheduling + // a pod group created from this template. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:format=k8s-long-name + // +k8s:immutable + optional string priorityClassName = 6; + + // priority is the value of priority of pod groups created from this template. Various + // system components use this field to find the priority of the pod group. + // The higher the value, the higher the priority. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:maximum=1000000000 # HighestUserDefinablePriority + // +k8s:immutable + optional int32 priority = 7; + + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + // + // +featureGate=PodGroupPreemptionPolicy + // +optional + // +k8s:immutable + // +k8s:ifDisabled("PodGroupPreemptionPolicy")=+k8s:forbidden + // +k8s:ifEnabled("PodGroupPreemptionPolicy")=+k8s:optional + optional string preemptionPolicy = 8; +} + +// SingleCompositeDisruptionMode means that individual children of a CompositePodGroup +// can be disrupted or preempted independently. +message SingleCompositeDisruptionMode { +} + +// SingleDisruptionMode specifies that children can be disrupted independently. +message SingleDisruptionMode { +} + +// TopologyConstraint defines a topology constraint for a PodGroup. +message TopologyConstraint { + // key specifies the key of the node label representing the topology domain. + // All pods within the PodGroup must be colocated within the same domain instance. + // Different PodGroups can land on different domain instances even if they derive from the same PodGroupTemplate. + // Examples: "topology.kubernetes.io/rack" + // + // +required + // +k8s:required + // +k8s:format=k8s-label-key + optional string key = 1; +} + +// TypedLocalObjectReference allows to reference typed object inside the same namespace. +message TypedLocalObjectReference { + // apiGroup is the group for the resource being referenced. + // If APIGroup is empty, the specified Kind must be in the core API group. + // For any other third-party types, setting APIGroup is required. + // It must be a DNS subdomain. + // + // +optional + // +k8s:optional + // +k8s:format=k8s-long-name + optional string apiGroup = 1; + + // kind is the type of resource being referenced. + // It must be a path segment name. + // + // +required + // +k8s:required + // +k8s:format=k8s-path-segment-name + optional string kind = 2; + + // name is the name of resource being referenced. + // It must be a path segment name. + // + // +required + // +k8s:required + // +k8s:format=k8s-path-segment-name + optional string name = 3; +} + +// Workload allows for expressing scheduling constraints that should be used +// when managing the lifecycle of workloads from the scheduling perspective, +// including scheduling, preemption, eviction and other phases. +// Workload API enablement is toggled by the GenericWorkload feature gate. +message Workload { + // metadata is the standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // spec defines the desired behavior of a Workload. + // + // +required + optional WorkloadSpec spec = 2; +} + +// WorkloadCompositePodGroupAllDisruptionMode indicates that all child groups +// must be disrupted together. +message WorkloadCompositePodGroupAllDisruptionMode { +} + +// WorkloadCompositePodGroupBasicSchedulingPolicy indicates that the child groups +// of a composite group should be scheduled independently. +message WorkloadCompositePodGroupBasicSchedulingPolicy { +} + +// WorkloadCompositePodGroupDisruptionMode defines how the child groups of a +// composite group can be disrupted. Exactly one mode must be set. +// +// --- +// +// This is a reusable building block meant to be embedded in a composite +// controller's own API, next to its other scheduling fields. It is the +// group-of-groups analogue of WorkloadPodGroupDisruptionMode. It's recommended +// to freeze the field after creation (+k8s:immutable), since the selected mode +// is immutable in the compiled Workload. For example, +// +// type JobSetSchedulingConfiguration struct { +// // DisruptionMode defines the mode in which this JobSet's child groups +// // can be disrupted. +// // One of Single, All. +// // This field is immutable after creation: it may not be added or removed, +// // and the selected mode may not be changed. +// // +optional +// // +k8s:optional +// // +k8s:immutable +// DisruptionMode *schedulingv1alpha3.WorkloadCompositePodGroupDisruptionMode `json:"disruptionMode,omitempty" protobuf:"bytes,N,opt,name=disruptionMode"` +// +// // other scheduling fields +// } +// +// +union +message WorkloadCompositePodGroupDisruptionMode { + // single specifies that child groups can be disrupted independently from + // each other. + // + // +optional + // +k8s:optional + // +k8s:unionMember + optional WorkloadCompositePodGroupSingleDisruptionMode single = 1; + + // all specifies that all child groups must be disrupted together. + // + // +optional + // +k8s:optional + // +k8s:unionMember + optional WorkloadCompositePodGroupAllDisruptionMode all = 2; +} + +// WorkloadCompositePodGroupGangSchedulingPolicy defines the parameters for gang +// scheduling of a composite group's child groups. +message WorkloadCompositePodGroupGangSchedulingPolicy { + // minGroupCount is the minimum number of child groups that must be + // schedulable at the same time for the scheduler to admit the entire + // composite group. + // This field is optional. If it is not specified, the controller + // should inject a context-specific sane default (e.g., the number of + // child groups). + // If set, it must be a positive integer. + // + // +optional + // +k8s:optional + // +k8s:minimum=1 + optional int32 minGroupCount = 1; +} + +// WorkloadCompositePodGroupSchedulingConstraints defines composite-level +// scheduling constraints, such as topology, for a CompositePodGroup (a group of +// groups) managed by a workload controller. +// +// --- +// +// This is a reusable building block meant to be embedded in a composite +// controller's own API, next to its other scheduling fields. It is the +// group-of-groups analogue of WorkloadPodGroupSchedulingConstraints. It's +// recommended to freeze the field after creation (+k8s:immutable), since +// constraints are immutable in the compiled Workload. For example, +// +// type JobSetSchedulingConfiguration struct { +// // SchedulingConstraints defines scheduling constraints (e.g. topology) +// // for this JobSet. +// // This field is immutable after creation. +// // +optional +// // +k8s:optional +// // +k8s:immutable +// SchedulingConstraints *schedulingv1alpha3.WorkloadCompositePodGroupSchedulingConstraints `json:"schedulingConstraints,omitempty" protobuf:"bytes,N,opt,name=schedulingConstraints"` +// +// // other scheduling fields +// } +message WorkloadCompositePodGroupSchedulingConstraints { + // topology specifies desired topological placements for all child groups + // within the composite group. + // If unset, no topology placement is requested. + // + // +optional + // +k8s:optional + // +k8s:maxItems=1 + // +listType=atomic + // +k8s:listType=atomic + repeated TopologyConstraint topology = 1; +} + +// WorkloadCompositePodGroupSchedulingPolicy defines the scheduling policy for a +// CompositePodGroup (a group of groups) managed by a workload controller. +// Exactly one policy must be set. +// +// --- +// +// This is a reusable building block meant to be embedded in a composite +// controller's own API, next to its other scheduling fields. It is the +// group-of-groups analogue of WorkloadPodGroupSchedulingPolicy. The composite +// scheduling policy is immutable, so it's recommended to freeze the whole +// field after creation (+k8s:immutable). For example, +// +// type JobSetSchedulingConfiguration struct { +// // SchedulingPolicy defines the scheduling policy for this JobSet. +// // Exactly one of Basic or Gang must be set. +// // This field is immutable after creation. +// // +optional +// // +k8s:optional +// // +k8s:immutable +// SchedulingPolicy *schedulingv1alpha3.WorkloadCompositePodGroupSchedulingPolicy `json:"schedulingPolicy,omitempty" protobuf:"bytes,N,opt,name=schedulingPolicy"` +// +// // other scheduling fields +// } +// +// +union +message WorkloadCompositePodGroupSchedulingPolicy { + // basic specifies that the child groups of this composite group should be + // scheduled independently. + // + // +optional + // +k8s:optional + // +k8s:unionMember + optional WorkloadCompositePodGroupBasicSchedulingPolicy basic = 1; + + // gang specifies that the child groups of this composite group should be + // scheduled using all-or-nothing semantics. + // + // +optional + // +k8s:optional + // +k8s:unionMember + optional WorkloadCompositePodGroupGangSchedulingPolicy gang = 2; +} + +// WorkloadCompositePodGroupSingleDisruptionMode indicates that child groups +// can be disrupted independently. +message WorkloadCompositePodGroupSingleDisruptionMode { +} + +// WorkloadList contains a list of Workload resources. +message WorkloadList { + // Standard list metadata. + // + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // Items is the list of Workloads. + repeated Workload items = 2; +} + +// WorkloadPodGroupAllDisruptionMode indicates that all pods in the +// group must be disrupted together. +message WorkloadPodGroupAllDisruptionMode { +} + +// WorkloadPodGroupBasicSchedulingPolicy indicates standard Kubernetes +// scheduling behavior. +message WorkloadPodGroupBasicSchedulingPolicy { +} + +// WorkloadPodGroupDisruptionMode defines how individual pods within a +// group can be disrupted. Exactly one mode must be set. +// +// --- +// +// This is a reusable building block meant to be embedded in a controller's own +// API, next to its other scheduling fields (for example, in a Job's +// spec.scheduling). It's recommended to freeze the field after creation +// (+k8s:immutable), since the selected mode is immutable in the compiled +// Workload. For example, +// +// type JobSchedulingConfiguration struct { +// // DisruptionMode defines the mode in which the Job's pods can be disrupted. +// // One of Single, All. +// // This field is immutable after creation: it may not be added or removed, +// // and the selected mode may not be changed. +// // +optional +// // +k8s:optional +// // +k8s:immutable +// DisruptionMode *schedulingv1alpha3.WorkloadPodGroupDisruptionMode `json:"disruptionMode,omitempty" protobuf:"bytes,N,opt,name=disruptionMode"` +// +// // other scheduling fields +// } +// +// +union +message WorkloadPodGroupDisruptionMode { + // single specifies that pods can be disrupted independently from each other. + // + // +optional + // +k8s:optional + // +k8s:unionMember + optional WorkloadPodGroupSingleDisruptionMode single = 1; + + // all specifies that all pods in the group must be disrupted together. + // + // +optional + // +k8s:optional + // +k8s:unionMember + optional WorkloadPodGroupAllDisruptionMode all = 2; +} + +// WorkloadPodGroupGangSchedulingPolicy defines the parameters for gang +// (all-or-nothing) scheduling. +message WorkloadPodGroupGangSchedulingPolicy { + // minCount is the minimum number of pods that must be scheduled + // at the same time for the scheduler to admit the entire group. + // This field is optional. If it is not specified, the controller + // should inject a context-specific sane default (e.g., + // parallelism for a Job). + // If set, it must be a positive integer. + // + // +optional + // +k8s:optional + // +k8s:minimum=1 + optional int32 minCount = 1; +} + +// WorkloadPodGroupResourceClaim references a dynamic resource claim +// that is shared across pods in the group. +// +// --- +// +// This is a reusable building block meant to be embedded in a controller's own +// API as a list, next to its other scheduling fields (for example, in a Job's +// spec.scheduling). It's recommended to freeze the whole list after creation +// (+k8s:immutable), since the list is immutable in the compiled Workload. For +// example, +// +// type JobSchedulingConfiguration struct { +// // ResourceClaims lists the ResourceClaims shared among the group's pods. +// // At most 4 claims may be set, matching the limit on the resulting PodGroup. +// // This list is immutable after creation: entries may neither be added, +// // removed, nor modified. +// // +optional +// // +patchMergeKey=name +// // +patchStrategy=merge +// // +listType=map +// // +listMapKey=name +// // +k8s:optional +// // +k8s:listType=map +// // +k8s:listMapKey=name +// // +k8s:maxItems=4 +// // +k8s:immutable +// ResourceClaims []schedulingv1alpha3.WorkloadPodGroupResourceClaim `json:"resourceClaims,omitempty" protobuf:"bytes,N,rep,name=resourceClaims"` +// +// // other scheduling fields +// } +message WorkloadPodGroupResourceClaim { + // name uniquely identifies this resource claim inside the group. + // This field is required. It must be a DNS_LABEL. + // + // +required + // +k8s:required + // +k8s:format=k8s-short-name + optional string name = 1; + + // resourceClaimName is the name of a ResourceClaim object in the same + // namespace. + // This field is optional. If it is not specified, no resource claim + // is used. If set, it must be a DNS subdomain. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:format=k8s-long-name + optional string resourceClaimName = 2; + + // resourceClaimTemplateName is the name of a ResourceClaimTemplate + // object in the same namespace. + // This field is optional. If it is not specified, no resource claim + // template is used. If set, it must be a DNS subdomain. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:format=k8s-long-name + optional string resourceClaimTemplateName = 3; +} + +// WorkloadPodGroupSchedulingConstraints defines leaf-level scheduling +// constraints, such as topology. +// +// --- +// +// This is a reusable building block meant to be embedded in a controller's own +// API, next to its other scheduling fields (for example, in a Job's +// spec.scheduling). It's recommended to freeze the field after creation +// (+k8s:immutable), since constraints are immutable in the compiled Workload. +// For example, +// +// type JobSchedulingConfiguration struct { +// // SchedulingConstraints defines scheduling constraints (e.g. topology) +// // for the Job's pods. +// // This field is immutable after creation. +// // +optional +// // +k8s:optional +// // +k8s:immutable +// SchedulingConstraints *schedulingv1alpha3.WorkloadPodGroupSchedulingConstraints `json:"schedulingConstraints,omitempty" protobuf:"bytes,N,opt,name=schedulingConstraints"` +// +// // other scheduling fields +// } +message WorkloadPodGroupSchedulingConstraints { + // topology specifies desired topological placements for all pods + // within the pod group. + // If unset, no topology placement is requested. + // + // +optional + // +k8s:optional + // +k8s:maxItems=1 + // +listType=atomic + // +k8s:listType=atomic + repeated TopologyConstraint topology = 1; +} + +// WorkloadPodGroupSchedulingPolicy defines the scheduling policy for a +// group of pods managed by a workload controller. +// Exactly one policy must be set. +// +// --- +// +// This is a reusable building block meant to be embedded in a controller's own +// API, next to its other scheduling fields (for example, in a Job's +// spec.scheduling). It's recommended to block changing the policy +// after creation, while still allowing gang.minCount to change. DV cannot +// express that only gang.minCount is mutable while the basic/gang variant is +// frozen, so the embedder must enforce variant immutability with hand-written +// validation. For example, +// +// type JobSchedulingConfiguration struct { +// // SchedulingPolicy defines the scheduling policy for this Job. +// // Exactly one of Basic or Gang must be set. +// // This field is immutable after creation: the policy may not be added or +// // removed. The policy variant (basic/gang) is frozen by the controller's +// // hand-written validation; only schedulingPolicy.gang.minCount may be changed. +// // +optional +// // +k8s:optional +// // +k8s:update=NoSet +// // +k8s:update=NoUnset +// SchedulingPolicy *schedulingv1alpha3.WorkloadPodGroupSchedulingPolicy `json:"schedulingPolicy,omitempty" protobuf:"bytes,N,opt,name=schedulingPolicy"` +// +// // other scheduling fields +// } +// +// +union +message WorkloadPodGroupSchedulingPolicy { + // basic specifies that standard, pod-by-pod Kubernetes scheduling + // behavior should be used. + // + // +optional + // +k8s:optional + // +k8s:unionMember + optional WorkloadPodGroupBasicSchedulingPolicy basic = 1; + + // gang specifies all-or-nothing scheduling semantics. + // + // +optional + // +k8s:optional + // +k8s:unionMember + optional WorkloadPodGroupGangSchedulingPolicy gang = 2; +} + +// WorkloadPodGroupSingleDisruptionMode indicates that individual pods +// can be disrupted independently. +message WorkloadPodGroupSingleDisruptionMode { +} + +// WorkloadReference references the Workload object together with the template +// that was used to create a particular PodGroup. +message WorkloadReference { + // workloadName is the name of the Workload object that contains a template + // that was used when creating a pod group. It must + // be a DNS name. + // This field is required. + // + // +required + // +k8s:required + // +k8s:format=k8s-long-name + optional string workloadName = 1; + + // templateName is the name of a template within the Workload object that + // was used to create a pod group. It must be a DNS label. + // This field is required. + // + // +required + // +k8s:required + // +k8s:format=k8s-short-name + optional string templateName = 2; +} + +// WorkloadSpec defines the desired state of a Workload. +message WorkloadSpec { + // controllerRef is an optional reference to the controlling object, such as a + // Deployment or Job. This field is intended for use by tools like CLIs + // to provide a link back to the original workload definition. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + optional TypedLocalObjectReference controllerRef = 1; + + // podGroupTemplates is the list of templates that make up the Workload. + // The maximum number of templates is 8. Templates cannot be added or removed after the workload is created. + // Existing templates may still be updated where their individual fields allow it. + // Exactly one of CompositePodGroupTemplates and PodGroupTemplates must be set. + // + // +optional + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:unionMember + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=8 + // +k8s:update=NoAddItem + // +k8s:update=NoRemoveItem + repeated PodGroupTemplate podGroupTemplates = 2; + + // compositePodGroupTemplates is the list of CompositePodGroup templates that make up the Workload. + // The maximum number of templates is 8. This field is immutable. + // Exactly one of CompositePodGroupTemplates and PodGroupTemplates must be set. + // + // This field is used only when the CompositePodGroup feature gate is enabled. + // + // +featureGate=CompositePodGroup + // +optional + // +listType=map + // +listMapKey=name + // +k8s:ifDisabled("CompositePodGroup")=+k8s:forbidden + // +k8s:ifEnabled("CompositePodGroup")=+k8s:optional + // +k8s:unionMember + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=8 + // +k8s:update=NoAddItem + // +k8s:update=NoRemoveItem + repeated CompositePodGroupTemplate compositePodGroupTemplates = 3; +} + diff --git a/vendor/k8s.io/api/scheduling/v1alpha2/register.go b/vendor/k8s.io/api/scheduling/v1alpha3/register.go similarity index 95% rename from vendor/k8s.io/api/scheduling/v1alpha2/register.go rename to vendor/k8s.io/api/scheduling/v1alpha3/register.go index fc03ae5ec9..fe3bac60e5 100644 --- a/vendor/k8s.io/api/scheduling/v1alpha2/register.go +++ b/vendor/k8s.io/api/scheduling/v1alpha3/register.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -26,7 +26,7 @@ import ( const GroupName = "scheduling.k8s.io" // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha2"} +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha3"} // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { @@ -49,6 +49,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &WorkloadList{}, &PodGroup{}, &PodGroupList{}, + &CompositePodGroup{}, + &CompositePodGroupList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/vendor/k8s.io/api/scheduling/v1alpha3/types.go b/vendor/k8s.io/api/scheduling/v1alpha3/types.go new file mode 100644 index 0000000000..138659ae41 --- /dev/null +++ b/vendor/k8s.io/api/scheduling/v1alpha3/types.go @@ -0,0 +1,1429 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha3 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Workload allows for expressing scheduling constraints that should be used +// when managing the lifecycle of workloads from the scheduling perspective, +// including scheduling, preemption, eviction and other phases. +// Workload API enablement is toggled by the GenericWorkload feature gate. +type Workload struct { + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // spec defines the desired behavior of a Workload. + // + // +required + Spec WorkloadSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// WorkloadList contains a list of Workload resources. +type WorkloadList struct { + metav1.TypeMeta `json:""` + // Standard list metadata. + // + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Items is the list of Workloads. + Items []Workload `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +const ( + // WorkloadMaxPodGroupTemplates is the maximum number of pod group templates per Workload. + WorkloadMaxPodGroupTemplates = 8 + // WorkloadMaxTreeDepth is the maximum allowed depth for a tree of (composite) pod group templates in a Workload. + WorkloadMaxTreeDepth = 4 +) + +// WorkloadSpec defines the desired state of a Workload. +type WorkloadSpec struct { + // controllerRef is an optional reference to the controlling object, such as a + // Deployment or Job. This field is intended for use by tools like CLIs + // to provide a link back to the original workload definition. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + ControllerRef *TypedLocalObjectReference `json:"controllerRef,omitempty" protobuf:"bytes,1,opt,name=controllerRef"` + + // podGroupTemplates is the list of templates that make up the Workload. + // The maximum number of templates is 8. Templates cannot be added or removed after the workload is created. + // Existing templates may still be updated where their individual fields allow it. + // Exactly one of CompositePodGroupTemplates and PodGroupTemplates must be set. + // + // +optional + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:unionMember + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=8 + // +k8s:update=NoAddItem + // +k8s:update=NoRemoveItem + PodGroupTemplates []PodGroupTemplate `json:"podGroupTemplates" protobuf:"bytes,2,rep,name=podGroupTemplates"` + + // compositePodGroupTemplates is the list of CompositePodGroup templates that make up the Workload. + // The maximum number of templates is 8. This field is immutable. + // Exactly one of CompositePodGroupTemplates and PodGroupTemplates must be set. + // + // This field is used only when the CompositePodGroup feature gate is enabled. + // + // +featureGate=CompositePodGroup + // +optional + // +listType=map + // +listMapKey=name + // +k8s:ifDisabled("CompositePodGroup")=+k8s:forbidden + // +k8s:ifEnabled("CompositePodGroup")=+k8s:optional + // +k8s:unionMember + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=8 + // +k8s:update=NoAddItem + // +k8s:update=NoRemoveItem + CompositePodGroupTemplates []CompositePodGroupTemplate `json:"compositePodGroupTemplates,omitempty" protobuf:"bytes,3,rep,name=compositePodGroupTemplates"` +} + +// TypedLocalObjectReference allows to reference typed object inside the same namespace. +type TypedLocalObjectReference struct { + // apiGroup is the group for the resource being referenced. + // If APIGroup is empty, the specified Kind must be in the core API group. + // For any other third-party types, setting APIGroup is required. + // It must be a DNS subdomain. + // + // +optional + // +k8s:optional + // +k8s:format=k8s-long-name + APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,1,opt,name=apiGroup"` + // kind is the type of resource being referenced. + // It must be a path segment name. + // + // +required + // +k8s:required + // +k8s:format=k8s-path-segment-name + Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"` + // name is the name of resource being referenced. + // It must be a path segment name. + // + // +required + // +k8s:required + // +k8s:format=k8s-path-segment-name + Name string `json:"name" protobuf:"bytes,3,opt,name=name"` +} + +// MaxPodGroupResourceClaims is the maximum number of resource claims for a +// PodGroup or a Workload's PodGroupTemplate. +const MaxPodGroupResourceClaims = 4 + +// PodGroupTemplate represents a template for a set of pods with a scheduling policy. +type PodGroupTemplate struct { + // name is a unique identifier for the PodGroupTemplate within the Workload. + // It must be a DNS label. This field is immutable. + // + // +required + // +k8s:required + // +k8s:format=k8s-short-name + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + + // schedulingPolicy defines the scheduling policy for this PodGroupTemplate. + // + // +required + SchedulingPolicy PodGroupSchedulingPolicy `json:"schedulingPolicy" protobuf:"bytes,2,opt,name=schedulingPolicy"` + + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroupTemplate. + // This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. + // This field is immutable. + // + // +featureGate=TopologyAwareWorkloadScheduling + // +optional + // +k8s:ifDisabled(TopologyAwareWorkloadScheduling)=+k8s:forbidden + // +k8s:ifEnabled(TopologyAwareWorkloadScheduling)=+k8s:optional + // +k8s:immutable + SchedulingConstraints *PodGroupSchedulingConstraints `json:"schedulingConstraints" protobuf:"bytes,3,opt,name=schedulingConstraints"` + + // resourceClaims defines which ResourceClaims may be shared among Pods in + // the group. Pods consume the devices allocated to a PodGroup's claim by + // defining a claim in its own Spec.ResourceClaims that matches the + // PodGroup's claim exactly. The claim must have the same name and refer to + // the same ResourceClaim or ResourceClaimTemplate. + // + // This is a beta-level field and requires that the + // DRAWorkloadResourceClaims feature gate is enabled. + // + // This field is immutable. + // + // +optional + // +patchMergeKey=name + // +patchStrategy=merge,retainKeys + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=4 + // +featureGate=DRAWorkloadResourceClaims + // +k8s:immutable + ResourceClaims []PodGroupResourceClaim `json:"resourceClaims,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name" protobuf:"bytes,4,rep,name=resourceClaims"` + + // disruptionMode defines the mode in which a given PodGroup can be disrupted. + // One of Single, All. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + DisruptionMode *DisruptionMode `json:"disruptionMode,omitempty" protobuf:"bytes,5,opt,name=disruptionMode"` + + // priorityClassName indicates the priority that should be considered when scheduling + // a pod group created from this template. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:format=k8s-long-name + // +k8s:immutable + PriorityClassName string `json:"priorityClassName,omitempty" protobuf:"bytes,6,opt,name=priorityClassName"` + + // priority is the value of priority of pod groups created from this template. Various + // system components use this field to find the priority of the pod group. + // The higher the value, the higher the priority. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:maximum=1000000000 # HighestUserDefinablePriority + // +k8s:immutable + Priority *int32 `json:"priority,omitempty" protobuf:"varint,7,opt,name=priority"` + + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + // + // +featureGate=PodGroupPreemptionPolicy + // +optional + // +k8s:immutable + // +k8s:ifDisabled("PodGroupPreemptionPolicy")=+k8s:forbidden + // +k8s:ifEnabled("PodGroupPreemptionPolicy")=+k8s:optional + PreemptionPolicy *PreemptionPolicy `json:"preemptionPolicy,omitempty" protobuf:"bytes,8,opt,name=preemptionPolicy"` +} + +// CompositePodGroupTemplate represents a template for a CompositePodGroup with a scheduling policy. +type CompositePodGroupTemplate struct { + // name is a unique identifier for the CompositePodGroupTemplate within the Workload. + // It must be a DNS label. This field is required. + // + // +required + // +k8s:required + // +k8s:format=k8s-short-name + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + + // schedulingPolicy defines the scheduling policy for this template. + // + // +required + SchedulingPolicy CompositePodGroupSchedulingPolicy `json:"schedulingPolicy" protobuf:"bytes,2,opt,name=schedulingPolicy"` + + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this CompositePodGroupTemplate. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + SchedulingConstraints *CompositePodGroupSchedulingConstraints `json:"schedulingConstraints,omitempty" protobuf:"bytes,3,opt,name=schedulingConstraints"` + + // disruptionMode defines the mode in which a given CompositePodGroup can be disrupted. + // One of Single, All. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + DisruptionMode *CompositeDisruptionMode `json:"disruptionMode,omitempty" protobuf:"bytes,4,opt,name=disruptionMode"` + + // priorityClassName indicates the priority that should be considered when scheduling + // a composite pod group created from this template. If no priority class is specified, + // admission control can set this to the global default priority class if it exists. + // Otherwise, composite pod groups created from this template will have the priority set + // to zero. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:format=k8s-long-name + // +k8s:immutable + PriorityClassName string `json:"priorityClassName,omitempty" protobuf:"bytes,5,opt,name=priorityClassName"` + + // priority is the value of priority of composite pod groups created from this template. + // Various system components use this field to find the priority of the composite pod group. + // When Priority Admission Controller is enabled, it prevents users from setting this field. + // The admission controller populates this field from PriorityClassName. + // The higher the value, the higher the priority. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:maximum=1000000000 # HighestUserDefinablePriority + // +k8s:immutable + Priority *int32 `json:"priority,omitempty" protobuf:"varint,6,opt,name=priority"` + + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + // + // +featureGate=PodGroupPreemptionPolicy + // +optional + // +k8s:immutable + // +k8s:ifDisabled("PodGroupPreemptionPolicy")=+k8s:forbidden + // +k8s:ifEnabled("PodGroupPreemptionPolicy")=+k8s:optional + PreemptionPolicy *PreemptionPolicy `json:"preemptionPolicy,omitempty" protobuf:"bytes,7,opt,name=preemptionPolicy"` + + // podGroupTemplates is the list of templates for children PodGroups. + // The maximum number of templates is 8. At least one entry in CompositePodGroupTemplates + // or PodGroupTemplates must be set. + // + // +optional + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=8 + // +k8s:update=NoAddItem + // +k8s:update=NoRemoveItem + PodGroupTemplates []PodGroupTemplate `json:"podGroupTemplates,omitempty" protobuf:"bytes,8,rep,name=podGroupTemplates"` + + // compositePodGroupTemplates is the list of templates for children CompositePodGroups. + // The maximum number of templates is 8. At least one entry in CompositePodGroupTemplates + // or PodGroupTemplates must be set. + // + // +optional + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=8 + // +k8s:update=NoAddItem + // +k8s:update=NoRemoveItem + CompositePodGroupTemplates []CompositePodGroupTemplate `json:"compositePodGroupTemplates,omitempty" protobuf:"bytes,9,rep,name=compositePodGroupTemplates"` +} + +// PodGroupSchedulingPolicy defines the scheduling configuration for a PodGroup. +// Exactly one policy must be set. The policy is chosen at creation time by setting either the +// Basic or Gang field. The PodGroup may not change policy after creation. +// Fields within chosen policy may be updated after creation when their individual fields allow it. +// +// +union +type PodGroupSchedulingPolicy struct { + // basic specifies that the pods in this group should be scheduled using + // standard Kubernetes scheduling behavior. Setting this field at group creation time + // opts this group to basic scheduling; this field cannot be changed afterward. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:immutable + Basic *BasicSchedulingPolicy `json:"basic,omitempty" protobuf:"bytes,1,opt,name=basic"` + + // gang specifies that the pods in this group should be scheduled using + // all-or-nothing semantics. Setting this field at group creation time + // opts this group to gang scheduling; this field cannot be set or unset afterward. + // The minCount field within Gang scheduling policy remains mutable after group creation. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:update=NoSet + // +k8s:update=NoUnset + Gang *GangSchedulingPolicy `json:"gang,omitempty" protobuf:"bytes,2,opt,name=gang"` +} + +// BasicSchedulingPolicy indicates that standard Kubernetes +// scheduling behavior should be used. +type BasicSchedulingPolicy struct { + // This is intentionally empty. Its presence indicates that the basic + // scheduling policy should be applied. In the future, new fields may appear, + // describing such constraints on a pod group level without "all or nothing" + // (gang) scheduling. +} + +// GangSchedulingPolicy defines the parameters for gang scheduling. +type GangSchedulingPolicy struct { + // minCount is the minimum number of pods that must be schedulable or scheduled + // at the same time for the scheduler to admit the entire group. + // It must be a positive integer. This field is mutable to support workload scaling. + // + // Note that the scheduler operates on an eventually consistent model. Updates + // to minCount may not be immediately reflected in scheduling decisions due to + // propagation delays. If minCount is updated while a scheduling cycle is in + // progress for that group, the new value may not take effect until the next + // cycle. Moreover, minCount is only enforced during scheduling, meaning that + // modifications to this field do not affect already-scheduled pods, applying + // only to those evaluated in future cycles. + // + // +required + // +k8s:required + // +k8s:minimum=1 + MinCount int32 `json:"minCount" protobuf:"varint,1,opt,name=minCount"` +} + +// PodGroupResourceClaim references exactly one ResourceClaim, either directly +// or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim +// for the PodGroup. +// +// It adds a name to it that uniquely identifies the ResourceClaim inside the PodGroup. +// Pods that need access to the ResourceClaim define a matching reference in its +// own Spec.ResourceClaims. The Pod's claim must match all fields of the +// PodGroup's claim exactly. +type PodGroupResourceClaim struct { + // name uniquely identifies this resource claim inside the PodGroup. + // This must be a DNS_LABEL. + // + // +required + // +k8s:required + // +k8s:format=k8s-short-name + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + + // resourceClaimName is the name of a ResourceClaim object in the same + // namespace as this PodGroup. The ResourceClaim will be reserved for the + // PodGroup instead of its individual pods. + // + // Exactly one of ResourceClaimName and ResourceClaimTemplateName must + // be set. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:format=k8s-long-name + ResourceClaimName *string `json:"resourceClaimName,omitempty" protobuf:"bytes,2,opt,name=resourceClaimName"` + + // resourceClaimTemplateName is the name of a ResourceClaimTemplate + // object in the same namespace as this PodGroup. + // + // The template will be used to create a new ResourceClaim, which will + // be bound to this PodGroup. When this PodGroup is deleted, the ResourceClaim + // will also be deleted. The PodGroup 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 podgroup.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. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:format=k8s-long-name + ResourceClaimTemplateName *string `json:"resourceClaimTemplateName,omitempty" protobuf:"bytes,3,opt,name=resourceClaimTemplateName"` +} + +// DisruptionMode defines how individual entities within a group can be disrupted. +// Exactly one mode can be set. +// +// +union +type DisruptionMode struct { + // single specifies that children can be disrupted independently from each other. + // + // +optional + // +k8s:optional + // +k8s:unionMember + Single *SingleDisruptionMode `json:"single,omitempty" protobuf:"bytes,1,opt,name=single"` + + // all specifies that all children can only be disrupted together. + // + // +optional + // +k8s:optional + // +k8s:unionMember + All *AllDisruptionMode `json:"all,omitempty" protobuf:"bytes,2,opt,name=all"` +} + +// SingleDisruptionMode specifies that children can be disrupted independently. +type SingleDisruptionMode struct { + // Intentionally empty now. +} + +// AllDisruptionMode specifies that children can only be disrupted together. +type AllDisruptionMode struct { + // Intentionally empty now. +} + +// PreemptionPolicy describes a policy for if/when to preempt a pod. +// +enum +// +k8s:enum +type PreemptionPolicy string + +const ( + // PreemptLowerPriority means that pod can preempt other pods with lower priority. + PreemptLowerPriority PreemptionPolicy = "PreemptLowerPriority" + // PreemptNever means that pod never preempts other pods with lower priority. + PreemptNever PreemptionPolicy = "Never" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:supportsSubresource="/status" + +// PodGroup represents a runtime instance of pods grouped together. +// PodGroups are created by workload controllers (Job, LWS, JobSet, etc...) from +// Workload.podGroupTemplates. +// PodGroup API enablement is toggled by the GenericWorkload feature gate. +type PodGroup struct { + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // spec defines the desired state of the PodGroup. + // + // +required + Spec PodGroupSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` + + // status represents the current observed state of the PodGroup. + // + // +optional + Status PodGroupStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// PodGroupList contains a list of PodGroup resources. +type PodGroupList struct { + metav1.TypeMeta `json:""` + // Standard list metadata. + // + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Items is the list of PodGroups. + Items []PodGroup `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// PodGroupSpec defines the desired state of a PodGroup. +type PodGroupSpec struct { + // parentCompositePodGroupName contains the name of the parent composite pod group + // within the same namespace as this pod group. + // If it's nil, then this pod group is a root of a workload's hierarchy. + // This field is used only when the CompositePodGroup feature gate is enabled. + // This field is immutable. + // + // +featureGate=CompositePodGroup + // +optional + // +k8s:ifDisabled(CompositePodGroup)=+k8s:forbidden + // +k8s:ifEnabled(CompositePodGroup)=+k8s:optional + // +k8s:immutable + // +k8s:format=k8s-long-name + // +k8s:alpha(since: "1.37")=+k8s:dependentRequired("workloadRef") + ParentCompositePodGroupName *string `json:"parentCompositePodGroupName,omitempty" protobuf:"bytes,1,opt,name=parentCompositePodGroupName"` + + // workloadRef references an optional PodGroup template within the Workload + // object that was used to create the PodGroup. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + WorkloadRef *WorkloadReference `json:"workloadRef,omitempty" protobuf:"bytes,2,opt,name=workloadRef"` + + // schedulingPolicy defines the scheduling policy for this instance of the PodGroup. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // + // +required + SchedulingPolicy PodGroupSchedulingPolicy `json:"schedulingPolicy" protobuf:"bytes,3,opt,name=schedulingPolicy"` + + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroup. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // This field is immutable. + // This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. + // + // +featureGate=TopologyAwareWorkloadScheduling + // +optional + // +k8s:ifDisabled(TopologyAwareWorkloadScheduling)=+k8s:forbidden + // +k8s:ifEnabled(TopologyAwareWorkloadScheduling)=+k8s:optional + // +k8s:ifEnabled(TopologyAwareWorkloadScheduling)=+k8s:immutable + SchedulingConstraints *PodGroupSchedulingConstraints `json:"schedulingConstraints,omitempty" protobuf:"bytes,4,opt,name=schedulingConstraints"` + + // resourceClaims defines which ResourceClaims may be shared among Pods in + // the group. Pods consume the devices allocated to a PodGroup's claim by + // defining a claim in its own Spec.ResourceClaims that matches the + // PodGroup's claim exactly. The claim must have the same name and refer to + // the same ResourceClaim or ResourceClaimTemplate. + // + // This is a beta-level field and requires that the + // DRAWorkloadResourceClaims feature gate is enabled. + // + // This field is immutable. + // + // +optional + // +patchMergeKey=name + // +patchStrategy=merge,retainKeys + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=4 + // +k8s:immutable + // +featureGate=DRAWorkloadResourceClaims + ResourceClaims []PodGroupResourceClaim `json:"resourceClaims,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name" protobuf:"bytes,5,rep,name=resourceClaims"` + + // disruptionMode defines the mode in which a given PodGroup can be disrupted. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // One of Single, All. Defaults to Single if unset. + // This field is immutable. + // + // +default={"single": {}} + // +optional + // +k8s:optional + // +k8s:immutable + DisruptionMode *DisruptionMode `json:"disruptionMode,omitempty" protobuf:"bytes,6,opt,name=disruptionMode"` + + // priorityClassName defines the priority that should be considered when scheduling this pod group. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // Otherwise, it is validated and resolved similarly to the PriorityClassName on PodGroupTemplate + // (i.e. if no priority class is specified, admission control can set this to the global default + // priority class if it exists. Otherwise, the pod group's priority will be zero). + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + // +k8s:format=k8s-long-name + PriorityClassName string `json:"priorityClassName,omitempty" protobuf:"bytes,7,opt,name=priorityClassName"` + + // priority is the value of priority of this pod group. Various system components + // use this field to find the priority of the pod group. When Priority Admission + // Controller is enabled, it prevents users from setting this field. The admission + // controller populates this field from PriorityClassName. + // The higher the value, the higher the priority. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + // +k8s:maximum=1000000000 # HighestUserDefinablePriority + Priority *int32 `json:"priority,omitempty" protobuf:"varint,8,opt,name=priority"` + + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. + // When Priority Admission Controller is enabled, it populates this field from PriorityClassName, + // and defaults to PreemptLowerPriority if value is unset in PriorityClass. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + // + // +featureGate=PodGroupPreemptionPolicy + // +optional + // +k8s:immutable + // +k8s:ifDisabled("PodGroupPreemptionPolicy")=+k8s:forbidden + // +k8s:ifEnabled("PodGroupPreemptionPolicy")=+k8s:optional + PreemptionPolicy *PreemptionPolicy `json:"preemptionPolicy,omitempty" protobuf:"bytes,9,opt,name=preemptionPolicy"` +} + +// PodGroupStatus represents information about the status of a pod group. +type PodGroupStatus struct { + // conditions represent the latest observations of the PodGroup's state. + // + // Known condition types: + // - "PodGroupInitiallyScheduled": Indicates whether the scheduling requirement has been satisfied. + // Once this condition transitions to True, it serves as a terminal state and will never revert to False, + // even if pods are subsequently evicted and group constraints are no longer met. + // - "DisruptionTarget": Indicates whether the PodGroup is about to be terminated + // due to disruption such as preemption. + // + // Known reasons for the PodGroupInitiallyScheduled condition: + // - "Unschedulable": The PodGroup cannot be scheduled due to resource constraints, + // affinity/anti-affinity rules, or insufficient capacity for the gang. + // - "SchedulerError": The PodGroup cannot be scheduled due to some internal error + // that happened during scheduling, for example due to nodeAffinity parsing errors. + // + // Known reasons for the DisruptionTarget condition: + // - "PreemptionByScheduler": The PodGroup was preempted by the scheduler to make room for + // higher-priority PodGroups or Pods. + // + // +optional + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` + + // resourceClaimStatuses is status of resource claims. + // +optional + // +patchMergeKey=name + // +patchStrategy=merge,retainKeys + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=4 + // +featureGate=DRAWorkloadResourceClaims + ResourceClaimStatuses []PodGroupResourceClaimStatus `json:"resourceClaimStatuses,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name" protobuf:"bytes,2,rep,name=resourceClaimStatuses"` +} + +// Well-known condition types for PodGroups. +const ( + // PodGroupInitiallyScheduled represents status of the scheduling process for this PodGroup till first success. + PodGroupInitiallyScheduled string = "PodGroupInitiallyScheduled" + // DisruptionTarget indicates the PodGroup is about to be terminated due to disruption + // such as preemption. + DisruptionTarget string = "DisruptionTarget" +) + +// Well-known condition reasons for PodGroups. +const ( + // Unschedulable reason in the PodGroupInitiallyScheduled condition indicates that the PodGroup cannot be scheduled + // due to resource constraints, affinity/anti-affinity rules, or insufficient capacity for the PodGroup. + PodGroupReasonUnschedulable string = "Unschedulable" + // SchedulerError reason in the PodGroupInitiallyScheduled condition means that some internal error happens + // during scheduling, for example due to nodeAffinity parsing errors. + PodGroupReasonSchedulerError string = "SchedulerError" + // PreemptionByScheduler reason in the DisruptionTarget condition indicates the PodGroup was preempted + // to make room for higher-priority PodGroups or Pods. + PodGroupReasonPreemptionByScheduler string = "PreemptionByScheduler" +) + +// PodGroupResourceClaimStatus is stored in the PodGroupStatus for each +// PodGroupResourceClaim which references a ResourceClaimTemplate. It stores the +// generated name for the corresponding ResourceClaim. +type PodGroupResourceClaimStatus struct { + // name uniquely identifies this resource claim inside the PodGroup. This + // must match the name of an entry in podgroup.spec.resourceClaims, which + // implies that the string must be a DNS_LABEL. + // + // +required + Name string `json:"name" protobuf:"bytes,1,name=name"` + + // resourceClaimName is the name of the ResourceClaim that was generated for + // the PodGroup in the namespace of the PodGroup. If this is unset, then + // generating a ResourceClaim was not necessary. The + // podgroup.spec.resourceClaims entry can be ignored in this case. + // + // +optional + // +k8s:optional + // +k8s:format=k8s-long-name + ResourceClaimName *string `json:"resourceClaimName,omitempty" protobuf:"bytes,2,opt,name=resourceClaimName"` +} + +// WorkloadReference references the Workload object together with the template +// that was used to create a particular PodGroup. +type WorkloadReference struct { + // workloadName is the name of the Workload object that contains a template + // that was used when creating a pod group. It must + // be a DNS name. + // This field is required. + // + // +required + // +k8s:required + // +k8s:format=k8s-long-name + WorkloadName string `json:"workloadName" protobuf:"bytes,1,opt,name=workloadName"` + + // templateName is the name of a template within the Workload object that + // was used to create a pod group. It must be a DNS label. + // This field is required. + // + // +required + // +k8s:required + // +k8s:format=k8s-short-name + TemplateName string `json:"templateName" protobuf:"bytes,2,opt,name=templateName"` +} + +// PodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a PodGroup. +type PodGroupSchedulingConstraints struct { + // topology defines the topology constraints for the pod group. + // Currently only a single topology constraint can be specified. This may change in the future. + // + // +optional + // +k8s:optional + // +k8s:maxItems=1 + // +listType=atomic + // +k8s:listType=atomic + Topology []TopologyConstraint `json:"topology,omitempty" protobuf:"bytes,1,rep,name=topology"` +} + +// TopologyConstraint defines a topology constraint for a PodGroup. +type TopologyConstraint struct { + // key specifies the key of the node label representing the topology domain. + // All pods within the PodGroup must be colocated within the same domain instance. + // Different PodGroups can land on different domain instances even if they derive from the same PodGroupTemplate. + // Examples: "topology.kubernetes.io/rack" + // + // +required + // +k8s:required + // +k8s:format=k8s-label-key + Key string `json:"key" protobuf:"bytes,1,opt,name=key"` +} + +// WorkloadPodGroupSchedulingPolicy defines the scheduling policy for a +// group of pods managed by a workload controller. +// Exactly one policy must be set. +// +// --- +// +// This is a reusable building block meant to be embedded in a controller's own +// API, next to its other scheduling fields (for example, in a Job's +// spec.scheduling). It's recommended to block changing the policy +// after creation, while still allowing gang.minCount to change. DV cannot +// express that only gang.minCount is mutable while the basic/gang variant is +// frozen, so the embedder must enforce variant immutability with hand-written +// validation. For example, +// +// type JobSchedulingConfiguration struct { +// // SchedulingPolicy defines the scheduling policy for this Job. +// // Exactly one of Basic or Gang must be set. +// // This field is immutable after creation: the policy may not be added or +// // removed. The policy variant (basic/gang) is frozen by the controller's +// // hand-written validation; only schedulingPolicy.gang.minCount may be changed. +// // +optional +// // +k8s:optional +// // +k8s:update=NoSet +// // +k8s:update=NoUnset +// SchedulingPolicy *schedulingv1alpha3.WorkloadPodGroupSchedulingPolicy `json:"schedulingPolicy,omitempty" protobuf:"bytes,N,opt,name=schedulingPolicy"` +// +// // other scheduling fields +// } +// +// +union +type WorkloadPodGroupSchedulingPolicy struct { + // basic specifies that standard, pod-by-pod Kubernetes scheduling + // behavior should be used. + // + // +optional + // +k8s:optional + // +k8s:unionMember + Basic *WorkloadPodGroupBasicSchedulingPolicy `json:"basic,omitempty" protobuf:"bytes,1,opt,name=basic"` + + // gang specifies all-or-nothing scheduling semantics. + // + // +optional + // +k8s:optional + // +k8s:unionMember + Gang *WorkloadPodGroupGangSchedulingPolicy `json:"gang,omitempty" protobuf:"bytes,2,opt,name=gang"` +} + +// WorkloadPodGroupBasicSchedulingPolicy indicates standard Kubernetes +// scheduling behavior. +type WorkloadPodGroupBasicSchedulingPolicy struct { + // Intentionally empty for now. +} + +// WorkloadPodGroupGangSchedulingPolicy defines the parameters for gang +// (all-or-nothing) scheduling. +type WorkloadPodGroupGangSchedulingPolicy struct { + // minCount is the minimum number of pods that must be scheduled + // at the same time for the scheduler to admit the entire group. + // This field is optional. If it is not specified, the controller + // should inject a context-specific sane default (e.g., + // parallelism for a Job). + // If set, it must be a positive integer. + // + // +optional + // +k8s:optional + // +k8s:minimum=1 + MinCount *int32 `json:"minCount,omitempty" protobuf:"varint,1,opt,name=minCount"` +} + +// WorkloadPodGroupSchedulingConstraints defines leaf-level scheduling +// constraints, such as topology. +// +// --- +// +// This is a reusable building block meant to be embedded in a controller's own +// API, next to its other scheduling fields (for example, in a Job's +// spec.scheduling). It's recommended to freeze the field after creation +// (+k8s:immutable), since constraints are immutable in the compiled Workload. +// For example, +// +// type JobSchedulingConfiguration struct { +// // SchedulingConstraints defines scheduling constraints (e.g. topology) +// // for the Job's pods. +// // This field is immutable after creation. +// // +optional +// // +k8s:optional +// // +k8s:immutable +// SchedulingConstraints *schedulingv1alpha3.WorkloadPodGroupSchedulingConstraints `json:"schedulingConstraints,omitempty" protobuf:"bytes,N,opt,name=schedulingConstraints"` +// +// // other scheduling fields +// } +type WorkloadPodGroupSchedulingConstraints struct { + // topology specifies desired topological placements for all pods + // within the pod group. + // If unset, no topology placement is requested. + // + // +optional + // +k8s:optional + // +k8s:maxItems=1 + // +listType=atomic + // +k8s:listType=atomic + Topology []TopologyConstraint `json:"topology,omitempty" protobuf:"bytes,1,rep,name=topology"` +} + +// WorkloadPodGroupResourceClaim references a dynamic resource claim +// that is shared across pods in the group. +// +// --- +// +// This is a reusable building block meant to be embedded in a controller's own +// API as a list, next to its other scheduling fields (for example, in a Job's +// spec.scheduling). It's recommended to freeze the whole list after creation +// (+k8s:immutable), since the list is immutable in the compiled Workload. For +// example, +// +// type JobSchedulingConfiguration struct { +// // ResourceClaims lists the ResourceClaims shared among the group's pods. +// // At most 4 claims may be set, matching the limit on the resulting PodGroup. +// // This list is immutable after creation: entries may neither be added, +// // removed, nor modified. +// // +optional +// // +patchMergeKey=name +// // +patchStrategy=merge +// // +listType=map +// // +listMapKey=name +// // +k8s:optional +// // +k8s:listType=map +// // +k8s:listMapKey=name +// // +k8s:maxItems=4 +// // +k8s:immutable +// ResourceClaims []schedulingv1alpha3.WorkloadPodGroupResourceClaim `json:"resourceClaims,omitempty" protobuf:"bytes,N,rep,name=resourceClaims"` +// +// // other scheduling fields +// } +type WorkloadPodGroupResourceClaim struct { + // name uniquely identifies this resource claim inside the group. + // This field is required. It must be a DNS_LABEL. + // + // +required + // +k8s:required + // +k8s:format=k8s-short-name + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + + // resourceClaimName is the name of a ResourceClaim object in the same + // namespace. + // This field is optional. If it is not specified, no resource claim + // is used. If set, it must be a DNS subdomain. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:format=k8s-long-name + ResourceClaimName *string `json:"resourceClaimName,omitempty" protobuf:"bytes,2,opt,name=resourceClaimName"` + + // resourceClaimTemplateName is the name of a ResourceClaimTemplate + // object in the same namespace. + // This field is optional. If it is not specified, no resource claim + // template is used. If set, it must be a DNS subdomain. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:format=k8s-long-name + ResourceClaimTemplateName *string `json:"resourceClaimTemplateName,omitempty" protobuf:"bytes,3,opt,name=resourceClaimTemplateName"` +} + +// WorkloadPodGroupDisruptionMode defines how individual pods within a +// group can be disrupted. Exactly one mode must be set. +// +// --- +// +// This is a reusable building block meant to be embedded in a controller's own +// API, next to its other scheduling fields (for example, in a Job's +// spec.scheduling). It's recommended to freeze the field after creation +// (+k8s:immutable), since the selected mode is immutable in the compiled +// Workload. For example, +// +// type JobSchedulingConfiguration struct { +// // DisruptionMode defines the mode in which the Job's pods can be disrupted. +// // One of Single, All. +// // This field is immutable after creation: it may not be added or removed, +// // and the selected mode may not be changed. +// // +optional +// // +k8s:optional +// // +k8s:immutable +// DisruptionMode *schedulingv1alpha3.WorkloadPodGroupDisruptionMode `json:"disruptionMode,omitempty" protobuf:"bytes,N,opt,name=disruptionMode"` +// +// // other scheduling fields +// } +// +// +union +type WorkloadPodGroupDisruptionMode struct { + // single specifies that pods can be disrupted independently from each other. + // + // +optional + // +k8s:optional + // +k8s:unionMember + Single *WorkloadPodGroupSingleDisruptionMode `json:"single,omitempty" protobuf:"bytes,1,opt,name=single"` + + // all specifies that all pods in the group must be disrupted together. + // + // +optional + // +k8s:optional + // +k8s:unionMember + All *WorkloadPodGroupAllDisruptionMode `json:"all,omitempty" protobuf:"bytes,2,opt,name=all"` +} + +// WorkloadPodGroupSingleDisruptionMode indicates that individual pods +// can be disrupted independently. +type WorkloadPodGroupSingleDisruptionMode struct { + // Intentionally empty for now. +} + +// WorkloadPodGroupAllDisruptionMode indicates that all pods in the +// group must be disrupted together. +type WorkloadPodGroupAllDisruptionMode struct { + // Intentionally empty for now. +} + +// WorkloadCompositePodGroupSchedulingPolicy defines the scheduling policy for a +// CompositePodGroup (a group of groups) managed by a workload controller. +// Exactly one policy must be set. +// +// --- +// +// This is a reusable building block meant to be embedded in a composite +// controller's own API, next to its other scheduling fields. It is the +// group-of-groups analogue of WorkloadPodGroupSchedulingPolicy. The composite +// scheduling policy is immutable, so it's recommended to freeze the whole +// field after creation (+k8s:immutable). For example, +// +// type JobSetSchedulingConfiguration struct { +// // SchedulingPolicy defines the scheduling policy for this JobSet. +// // Exactly one of Basic or Gang must be set. +// // This field is immutable after creation. +// // +optional +// // +k8s:optional +// // +k8s:immutable +// SchedulingPolicy *schedulingv1alpha3.WorkloadCompositePodGroupSchedulingPolicy `json:"schedulingPolicy,omitempty" protobuf:"bytes,N,opt,name=schedulingPolicy"` +// +// // other scheduling fields +// } +// +// +union +type WorkloadCompositePodGroupSchedulingPolicy struct { + // basic specifies that the child groups of this composite group should be + // scheduled independently. + // + // +optional + // +k8s:optional + // +k8s:unionMember + Basic *WorkloadCompositePodGroupBasicSchedulingPolicy `json:"basic,omitempty" protobuf:"bytes,1,opt,name=basic"` + + // gang specifies that the child groups of this composite group should be + // scheduled using all-or-nothing semantics. + // + // +optional + // +k8s:optional + // +k8s:unionMember + Gang *WorkloadCompositePodGroupGangSchedulingPolicy `json:"gang,omitempty" protobuf:"bytes,2,opt,name=gang"` +} + +// WorkloadCompositePodGroupBasicSchedulingPolicy indicates that the child groups +// of a composite group should be scheduled independently. +type WorkloadCompositePodGroupBasicSchedulingPolicy struct { + // Intentionally empty for now. +} + +// WorkloadCompositePodGroupGangSchedulingPolicy defines the parameters for gang +// scheduling of a composite group's child groups. +type WorkloadCompositePodGroupGangSchedulingPolicy struct { + // minGroupCount is the minimum number of child groups that must be + // schedulable at the same time for the scheduler to admit the entire + // composite group. + // This field is optional. If it is not specified, the controller + // should inject a context-specific sane default (e.g., the number of + // child groups). + // If set, it must be a positive integer. + // + // +optional + // +k8s:optional + // +k8s:minimum=1 + MinGroupCount *int32 `json:"minGroupCount,omitempty" protobuf:"varint,1,opt,name=minGroupCount"` +} + +// WorkloadCompositePodGroupSchedulingConstraints defines composite-level +// scheduling constraints, such as topology, for a CompositePodGroup (a group of +// groups) managed by a workload controller. +// +// --- +// +// This is a reusable building block meant to be embedded in a composite +// controller's own API, next to its other scheduling fields. It is the +// group-of-groups analogue of WorkloadPodGroupSchedulingConstraints. It's +// recommended to freeze the field after creation (+k8s:immutable), since +// constraints are immutable in the compiled Workload. For example, +// +// type JobSetSchedulingConfiguration struct { +// // SchedulingConstraints defines scheduling constraints (e.g. topology) +// // for this JobSet. +// // This field is immutable after creation. +// // +optional +// // +k8s:optional +// // +k8s:immutable +// SchedulingConstraints *schedulingv1alpha3.WorkloadCompositePodGroupSchedulingConstraints `json:"schedulingConstraints,omitempty" protobuf:"bytes,N,opt,name=schedulingConstraints"` +// +// // other scheduling fields +// } +type WorkloadCompositePodGroupSchedulingConstraints struct { + // topology specifies desired topological placements for all child groups + // within the composite group. + // If unset, no topology placement is requested. + // + // +optional + // +k8s:optional + // +k8s:maxItems=1 + // +listType=atomic + // +k8s:listType=atomic + Topology []TopologyConstraint `json:"topology,omitempty" protobuf:"bytes,1,rep,name=topology"` +} + +// WorkloadCompositePodGroupDisruptionMode defines how the child groups of a +// composite group can be disrupted. Exactly one mode must be set. +// +// --- +// +// This is a reusable building block meant to be embedded in a composite +// controller's own API, next to its other scheduling fields. It is the +// group-of-groups analogue of WorkloadPodGroupDisruptionMode. It's recommended +// to freeze the field after creation (+k8s:immutable), since the selected mode +// is immutable in the compiled Workload. For example, +// +// type JobSetSchedulingConfiguration struct { +// // DisruptionMode defines the mode in which this JobSet's child groups +// // can be disrupted. +// // One of Single, All. +// // This field is immutable after creation: it may not be added or removed, +// // and the selected mode may not be changed. +// // +optional +// // +k8s:optional +// // +k8s:immutable +// DisruptionMode *schedulingv1alpha3.WorkloadCompositePodGroupDisruptionMode `json:"disruptionMode,omitempty" protobuf:"bytes,N,opt,name=disruptionMode"` +// +// // other scheduling fields +// } +// +// +union +type WorkloadCompositePodGroupDisruptionMode struct { + // single specifies that child groups can be disrupted independently from + // each other. + // + // +optional + // +k8s:optional + // +k8s:unionMember + Single *WorkloadCompositePodGroupSingleDisruptionMode `json:"single,omitempty" protobuf:"bytes,1,opt,name=single"` + + // all specifies that all child groups must be disrupted together. + // + // +optional + // +k8s:optional + // +k8s:unionMember + All *WorkloadCompositePodGroupAllDisruptionMode `json:"all,omitempty" protobuf:"bytes,2,opt,name=all"` +} + +// WorkloadCompositePodGroupSingleDisruptionMode indicates that child groups +// can be disrupted independently. +type WorkloadCompositePodGroupSingleDisruptionMode struct { + // Intentionally empty for now. +} + +// WorkloadCompositePodGroupAllDisruptionMode indicates that all child groups +// must be disrupted together. +type WorkloadCompositePodGroupAllDisruptionMode struct { + // Intentionally empty for now. +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:supportsSubresource="/status" + +// CompositePodGroup represents a runtime instance of pod groups grouped together. +// CompositePodGroups are created by workload controllers (LWS, JobSet, etc...) from +// Workload.compositePodGroupTemplates. +// CompositePodGroup API enablement is toggled by the CompositePodGroup feature gate. +type CompositePodGroup struct { + metav1.TypeMeta `json:""` + + // metadata is the standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // spec defines the desired state of the CompositePodGroup. + // + // +required + Spec CompositePodGroupSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` + + // status represents the current observed state of the CompositePodGroup. + // + // +optional + Status CompositePodGroupStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// CompositePodGroupList contains a list of CompositePodGroup resources. +type CompositePodGroupList struct { + metav1.TypeMeta `json:""` + // Standard list metadata. + // + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Items is the list of CompositePodGroups. + Items []CompositePodGroup `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// CompositePodGroupSpec defines the desired state of CompositePodGroup. +type CompositePodGroupSpec struct { + // parentCompositePodGroupName contains the name of the parent composite pod group + // within the same namespace as this composite pod group. It must be a DNS name. + // If it's nil, then this composite pod group is a root of a workload's hierarchy. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + // +k8s:format=k8s-long-name + ParentCompositePodGroupName *string `json:"parentCompositePodGroupName,omitempty" protobuf:"bytes,1,opt,name=parentCompositePodGroupName"` + + // workloadRef references an optional CompositePodGroup template within the + // Workload object that was used to create the CompositePodGroup. + // This field is required. + // This field is immutable. + // + // +required + // +k8s:required + // +k8s:immutable + WorkloadRef *WorkloadReference `json:"workloadRef" protobuf:"bytes,2,opt,name=workloadRef"` + + // schedulingPolicy defines the scheduling policy for this instance of the CompositePodGroup. + // Controllers are expected to fill this field by copying it from a CompositePodGroupTemplate. + // This field is immutable. + // + // +required + // +k8s:immutable + SchedulingPolicy CompositePodGroupSchedulingPolicy `json:"schedulingPolicy" protobuf:"bytes,3,opt,name=schedulingPolicy"` + + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this CompositePodGroup. + // Controllers are expected to fill this field by copying it from a CompositePodGroupTemplate. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + SchedulingConstraints *CompositePodGroupSchedulingConstraints `json:"schedulingConstraints,omitempty" protobuf:"bytes,4,opt,name=schedulingConstraints"` + + // disruptionMode defines the mode in which a given CompositePodGroup can be disrupted. + // Controllers are expected to fill this field by copying it from a CompositePodGroupTemplate. + // One of Single, All. Defaults to Single if unset. + // This field is immutable. + // + // +default={"single": {}} + // +optional + // +k8s:optional + // +k8s:immutable + DisruptionMode *CompositeDisruptionMode `json:"disruptionMode,omitempty" protobuf:"bytes,5,opt,name=disruptionMode"` + + // priorityClassName defines the priority that should be considered when scheduling this CompositePodGroup. + // Controllers are expected to fill this field by copying it from a CompositePodGroupTemplate. + // If left unspecified, it is validated and resolved similarly to the PriorityClassName field in Pods + // (i.e. if no priority class is specified, admission control can set this to the global default + // priority class if it exists. Otherwise, the composite pod group's priority will be zero). + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:format=k8s-long-name + // +k8s:immutable + PriorityClassName string `json:"priorityClassName,omitempty" protobuf:"bytes,6,opt,name=priorityClassName"` + + // priority is the value of priority of this composite pod group. Various system components + // use this field to find the priority of the composite pod group. When Priority Admission + // Controller is enabled, it prevents users from setting this field. The admission + // controller populates this field from PriorityClassName. + // The higher the value, the higher the priority. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + // +k8s:maximum=1000000000 # HighestUserDefinablePriority + Priority *int32 `json:"priority,omitempty" protobuf:"varint,7,opt,name=priority"` + + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. + // When Priority Admission Controller is enabled, it populates this field from PriorityClassName, + // and defaults to PreemptLowerPriority if value is unset in PriorityClass. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + // + // +featureGate=PodGroupPreemptionPolicy + // +optional + // +k8s:immutable + // +k8s:ifDisabled("PodGroupPreemptionPolicy")=+k8s:forbidden + // +k8s:ifEnabled("PodGroupPreemptionPolicy")=+k8s:optional + PreemptionPolicy *PreemptionPolicy `json:"preemptionPolicy,omitempty" protobuf:"bytes,8,opt,name=preemptionPolicy"` +} + +// CompositePodGroupSchedulingPolicy defines the scheduling configuration for a CompositePodGroup. +// Exactly one policy must be set. +// +// +union +type CompositePodGroupSchedulingPolicy struct { + // basic specifies that the groups of this composite group should be scheduled independently. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + // +k8s:unionMember + Basic *CompositeBasicSchedulingPolicy `json:"basic,omitempty" protobuf:"bytes,1,opt,name=basic"` + + // gang specifies that the groups of this composite group should be scheduled using + // all-or-nothing semantics. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:update=NoSet + // +k8s:update=NoUnset + Gang *CompositeGangSchedulingPolicy `json:"gang,omitempty" protobuf:"bytes,2,opt,name=gang"` +} + +// CompositeBasicSchedulingPolicy indicates that the groups belonging to the composite group +// should be scheduled independently. +type CompositeBasicSchedulingPolicy struct { + // This is intentionally empty. Its presence indicates that the basic group + // scheduling policy should be applied. In the future, new fields may appear, + // describing such constraints on a composite pod group level without "all or + // nothing" (gang) scheduling. +} + +// CompositeGangSchedulingPolicy indicates that the groups belonging to the composite group +// should be scheduled using all-or-nothing semantics. +type CompositeGangSchedulingPolicy struct { + // minGroupCount is the minimum number of child groups that must be schedulable + // or scheduled at the same time for the scheduler to admit the entire group. + // It must be a positive integer. + // + // +required + // +k8s:required + // +k8s:minimum=1 + MinGroupCount int32 `json:"minGroupCount" protobuf:"varint,1,req,name=minGroupCount"` +} + +// CompositeDisruptionMode defines how individual entities within a composite pod group can be disrupted. +// Exactly one mode must be set. +// +// +union +type CompositeDisruptionMode struct { + // single specifies that children groups can be disrupted independently from each other. + // + // +optional + // +k8s:optional + // +k8s:unionMember + Single *SingleCompositeDisruptionMode `json:"single,omitempty" protobuf:"bytes,1,opt,name=single"` + + // all specifies that all children groups can only be disrupted together. + // + // +optional + // +k8s:optional + // +k8s:unionMember + All *AllCompositeDisruptionMode `json:"all,omitempty" protobuf:"bytes,2,opt,name=all"` +} + +// SingleCompositeDisruptionMode means that individual children of a CompositePodGroup +// can be disrupted or preempted independently. +type SingleCompositeDisruptionMode struct { + // This is intentionally empty. +} + +// AllCompositeDisruptionMode means that children of a CompositePodGroup can only be +// disrupted or preempted together. +type AllCompositeDisruptionMode struct { + // This is intentionally empty. +} + +// CompositePodGroupStatus represents information about the status of a composite pod group. +type CompositePodGroupStatus struct { + // conditions represent the latest observations of the CompositePodGroup's state. + // + // Known condition types: + // - "CompositePodGroupInitiallyScheduled": Indicates whether the overall scheduling requirement + // for the subtree under this CompositePodGroup has been satisfied. Once this condition + // transitions to True, it serves as a terminal state and will never revert to False, + // even if pods are subsequently deleted and group constraints are no longer met. + // - "DisruptionTarget": Indicates whether the CompositePodGroup is about to be terminated + // due to disruption such as preemption. + // + // Known reasons for the CompositePodGroupInitiallyScheduled condition: + // - "Unschedulable": The CompositePodGroup's subtree could not be placed due to resource constraints, + // affinity/anti-affinity, or topological constraints. + // - "SchedulerError": The CompositePodGroup cannot be scheduled due to some internal error + // that occurred during scheduling. + // - "Invalid": Set to True when kube-scheduler detects an invalid group layout during + // runtime validation. The `message` field details the specific layout violation (such as + // a detected cycle, exceeding the maximum depth of 4, or referencing multiple distinct Workloads). + // + // Known reasons for the DisruptionTarget condition: + // - "PreemptionByScheduler": The CompositePodGroup was targeted by the scheduler's preemption loop + // to free up capacity for higher-priority preemptors. + // + // +optional + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` +} + +// CompositePodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a CompositePodGroup. +type CompositePodGroupSchedulingConstraints struct { + // topology defines the topology constraints for the composite pod group. + // Currently only a single topology constraint can be specified. This may change in the future. + // + // +optional + // +k8s:optional + // +k8s:maxItems=1 + // +listType=atomic + // +k8s:listType=atomic + Topology []TopologyConstraint `json:"topology,omitempty" protobuf:"bytes,1,rep,name=topology"` +} diff --git a/vendor/k8s.io/api/scheduling/v1alpha3/types_swagger_doc_generated.go b/vendor/k8s.io/api/scheduling/v1alpha3/types_swagger_doc_generated.go new file mode 100644 index 0000000000..953a72fcd2 --- /dev/null +++ b/vendor/k8s.io/api/scheduling/v1alpha3/types_swagger_doc_generated.go @@ -0,0 +1,498 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha3 + +// This file contains a collection of methods that can be used from go-restful to +// generate Swagger API documentation for its models. Please read this PR for more +// information on the implementation: https://github.com/emicklei/go-restful/pull/215 +// +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. +// Any context after a --- is ignored. +// +// Those methods can be generated by using hack/update-codegen.sh + +// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. +var map_AllCompositeDisruptionMode = map[string]string{ + "": "AllCompositeDisruptionMode means that children of a CompositePodGroup can only be disrupted or preempted together.", +} + +func (AllCompositeDisruptionMode) SwaggerDoc() map[string]string { + return map_AllCompositeDisruptionMode +} + +var map_AllDisruptionMode = map[string]string{ + "": "AllDisruptionMode specifies that children can only be disrupted together.", +} + +func (AllDisruptionMode) SwaggerDoc() map[string]string { + return map_AllDisruptionMode +} + +var map_BasicSchedulingPolicy = map[string]string{ + "": "BasicSchedulingPolicy indicates that standard Kubernetes scheduling behavior should be used.", +} + +func (BasicSchedulingPolicy) SwaggerDoc() map[string]string { + return map_BasicSchedulingPolicy +} + +var map_CompositeBasicSchedulingPolicy = map[string]string{ + "": "CompositeBasicSchedulingPolicy indicates that the groups belonging to the composite group should be scheduled independently.", +} + +func (CompositeBasicSchedulingPolicy) SwaggerDoc() map[string]string { + return map_CompositeBasicSchedulingPolicy +} + +var map_CompositeDisruptionMode = map[string]string{ + "": "CompositeDisruptionMode defines how individual entities within a composite pod group can be disrupted. Exactly one mode must be set.", + "single": "single specifies that children groups can be disrupted independently from each other.", + "all": "all specifies that all children groups can only be disrupted together.", +} + +func (CompositeDisruptionMode) SwaggerDoc() map[string]string { + return map_CompositeDisruptionMode +} + +var map_CompositeGangSchedulingPolicy = map[string]string{ + "": "CompositeGangSchedulingPolicy indicates that the groups belonging to the composite group should be scheduled using all-or-nothing semantics.", + "minGroupCount": "minGroupCount is the minimum number of child groups that must be schedulable or scheduled at the same time for the scheduler to admit the entire group. It must be a positive integer.", +} + +func (CompositeGangSchedulingPolicy) SwaggerDoc() map[string]string { + return map_CompositeGangSchedulingPolicy +} + +var map_CompositePodGroup = map[string]string{ + "": "CompositePodGroup represents a runtime instance of pod groups grouped together. CompositePodGroups are created by workload controllers (LWS, JobSet, etc...) from Workload.compositePodGroupTemplates. CompositePodGroup API enablement is toggled by the CompositePodGroup feature gate.", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec defines the desired state of the CompositePodGroup.", + "status": "status represents the current observed state of the CompositePodGroup.", +} + +func (CompositePodGroup) SwaggerDoc() map[string]string { + return map_CompositePodGroup +} + +var map_CompositePodGroupList = map[string]string{ + "": "CompositePodGroupList contains a list of CompositePodGroup resources.", + "metadata": "Standard list metadata.", + "items": "Items is the list of CompositePodGroups.", +} + +func (CompositePodGroupList) SwaggerDoc() map[string]string { + return map_CompositePodGroupList +} + +var map_CompositePodGroupSchedulingConstraints = map[string]string{ + "": "CompositePodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a CompositePodGroup.", + "topology": "topology defines the topology constraints for the composite pod group. Currently only a single topology constraint can be specified. This may change in the future.", +} + +func (CompositePodGroupSchedulingConstraints) SwaggerDoc() map[string]string { + return map_CompositePodGroupSchedulingConstraints +} + +var map_CompositePodGroupSchedulingPolicy = map[string]string{ + "": "CompositePodGroupSchedulingPolicy defines the scheduling configuration for a CompositePodGroup. Exactly one policy must be set.", + "basic": "basic specifies that the groups of this composite group should be scheduled independently. This field is immutable.", + "gang": "gang specifies that the groups of this composite group should be scheduled using all-or-nothing semantics.", +} + +func (CompositePodGroupSchedulingPolicy) SwaggerDoc() map[string]string { + return map_CompositePodGroupSchedulingPolicy +} + +var map_CompositePodGroupSpec = map[string]string{ + "": "CompositePodGroupSpec defines the desired state of CompositePodGroup.", + "parentCompositePodGroupName": "parentCompositePodGroupName contains the name of the parent composite pod group within the same namespace as this composite pod group. It must be a DNS name. If it's nil, then this composite pod group is a root of a workload's hierarchy. This field is immutable.", + "workloadRef": "workloadRef references an optional CompositePodGroup template within the Workload object that was used to create the CompositePodGroup. This field is required. This field is immutable.", + "schedulingPolicy": "schedulingPolicy defines the scheduling policy for this instance of the CompositePodGroup. Controllers are expected to fill this field by copying it from a CompositePodGroupTemplate. This field is immutable.", + "schedulingConstraints": "schedulingConstraints defines optional scheduling constraints (e.g. topology) for this CompositePodGroup. Controllers are expected to fill this field by copying it from a CompositePodGroupTemplate. This field is immutable.", + "disruptionMode": "disruptionMode defines the mode in which a given CompositePodGroup can be disrupted. Controllers are expected to fill this field by copying it from a CompositePodGroupTemplate. One of Single, All. Defaults to Single if unset. This field is immutable.", + "priorityClassName": "priorityClassName defines the priority that should be considered when scheduling this CompositePodGroup. Controllers are expected to fill this field by copying it from a CompositePodGroupTemplate. If left unspecified, it is validated and resolved similarly to the PriorityClassName field in Pods (i.e. if no priority class is specified, admission control can set this to the global default priority class if it exists. Otherwise, the composite pod group's priority will be zero). This field is immutable.", + "priority": "priority is the value of priority of this composite pod group. Various system components use this field to find the priority of the composite pod group. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. This field is immutable.", + "preemptionPolicy": "preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. When Priority Admission Controller is enabled, it populates this field from PriorityClassName, and defaults to PreemptLowerPriority if value is unset in PriorityClass. This field is immutable. This field is available only when the PodGroupPreemptionPolicy feature gate is enabled.", +} + +func (CompositePodGroupSpec) SwaggerDoc() map[string]string { + return map_CompositePodGroupSpec +} + +var map_CompositePodGroupStatus = map[string]string{ + "": "CompositePodGroupStatus represents information about the status of a composite pod group.", + "conditions": "conditions represent the latest observations of the CompositePodGroup's state.\n\nKnown condition types: - \"CompositePodGroupInitiallyScheduled\": Indicates whether the overall scheduling requirement\n for the subtree under this CompositePodGroup has been satisfied. Once this condition\n transitions to True, it serves as a terminal state and will never revert to False,\n even if pods are subsequently deleted and group constraints are no longer met.\n- \"DisruptionTarget\": Indicates whether the CompositePodGroup is about to be terminated\n due to disruption such as preemption.\n\nKnown reasons for the CompositePodGroupInitiallyScheduled condition: - \"Unschedulable\": The CompositePodGroup's subtree could not be placed due to resource constraints,\n affinity/anti-affinity, or topological constraints.\n- \"SchedulerError\": The CompositePodGroup cannot be scheduled due to some internal error\n that occurred during scheduling.\n- \"Invalid\": Set to True when kube-scheduler detects an invalid group layout during\n runtime validation. The `message` field details the specific layout violation (such as\n a detected cycle, exceeding the maximum depth of 4, or referencing multiple distinct Workloads).\n\nKnown reasons for the DisruptionTarget condition: - \"PreemptionByScheduler\": The CompositePodGroup was targeted by the scheduler's preemption loop\n to free up capacity for higher-priority preemptors.", +} + +func (CompositePodGroupStatus) SwaggerDoc() map[string]string { + return map_CompositePodGroupStatus +} + +var map_CompositePodGroupTemplate = map[string]string{ + "": "CompositePodGroupTemplate represents a template for a CompositePodGroup with a scheduling policy.", + "name": "name is a unique identifier for the CompositePodGroupTemplate within the Workload. It must be a DNS label. This field is required.", + "schedulingPolicy": "schedulingPolicy defines the scheduling policy for this template.", + "schedulingConstraints": "schedulingConstraints defines optional scheduling constraints (e.g. topology) for this CompositePodGroupTemplate. This field is immutable.", + "disruptionMode": "disruptionMode defines the mode in which a given CompositePodGroup can be disrupted. One of Single, All. This field is immutable.", + "priorityClassName": "priorityClassName indicates the priority that should be considered when scheduling a composite pod group created from this template. If no priority class is specified, admission control can set this to the global default priority class if it exists. Otherwise, composite pod groups created from this template will have the priority set to zero. This field is immutable.", + "priority": "priority is the value of priority of composite pod groups created from this template. Various system components use this field to find the priority of the composite pod group. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. This field is immutable.", + "preemptionPolicy": "preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. One of Never, PreemptLowerPriority. This field is immutable. This field is available only when the PodGroupPreemptionPolicy feature gate is enabled.", + "podGroupTemplates": "podGroupTemplates is the list of templates for children PodGroups. The maximum number of templates is 8. At least one entry in CompositePodGroupTemplates or PodGroupTemplates must be set.", + "compositePodGroupTemplates": "compositePodGroupTemplates is the list of templates for children CompositePodGroups. The maximum number of templates is 8. At least one entry in CompositePodGroupTemplates or PodGroupTemplates must be set.", +} + +func (CompositePodGroupTemplate) SwaggerDoc() map[string]string { + return map_CompositePodGroupTemplate +} + +var map_DisruptionMode = map[string]string{ + "": "DisruptionMode defines how individual entities within a group can be disrupted. Exactly one mode can be set.", + "single": "single specifies that children can be disrupted independently from each other.", + "all": "all specifies that all children can only be disrupted together.", +} + +func (DisruptionMode) SwaggerDoc() map[string]string { + return map_DisruptionMode +} + +var map_GangSchedulingPolicy = map[string]string{ + "": "GangSchedulingPolicy defines the parameters for gang scheduling.", + "minCount": "minCount is the minimum number of pods that must be schedulable or scheduled at the same time for the scheduler to admit the entire group. It must be a positive integer. This field is mutable to support workload scaling.\n\nNote that the scheduler operates on an eventually consistent model. Updates to minCount may not be immediately reflected in scheduling decisions due to propagation delays. If minCount is updated while a scheduling cycle is in progress for that group, the new value may not take effect until the next cycle. Moreover, minCount is only enforced during scheduling, meaning that modifications to this field do not affect already-scheduled pods, applying only to those evaluated in future cycles.", +} + +func (GangSchedulingPolicy) SwaggerDoc() map[string]string { + return map_GangSchedulingPolicy +} + +var map_PodGroup = map[string]string{ + "": "PodGroup represents a runtime instance of pods grouped together. PodGroups are created by workload controllers (Job, LWS, JobSet, etc...) from Workload.podGroupTemplates. PodGroup API enablement is toggled by the GenericWorkload feature gate.", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec defines the desired state of the PodGroup.", + "status": "status represents the current observed state of the PodGroup.", +} + +func (PodGroup) SwaggerDoc() map[string]string { + return map_PodGroup +} + +var map_PodGroupList = map[string]string{ + "": "PodGroupList contains a list of PodGroup resources.", + "metadata": "Standard list metadata.", + "items": "Items is the list of PodGroups.", +} + +func (PodGroupList) SwaggerDoc() map[string]string { + return map_PodGroupList +} + +var map_PodGroupResourceClaim = map[string]string{ + "": "PodGroupResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the PodGroup.\n\nIt adds a name to it that uniquely identifies the ResourceClaim inside the PodGroup. Pods that need access to the ResourceClaim define a matching reference in its own Spec.ResourceClaims. The Pod's claim must match all fields of the PodGroup's claim exactly.", + "name": "name uniquely identifies this resource claim inside the PodGroup. This must be a DNS_LABEL.", + "resourceClaimName": "resourceClaimName is the name of a ResourceClaim object in the same namespace as this PodGroup. The ResourceClaim will be reserved for the PodGroup instead of its individual pods.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.", + "resourceClaimTemplateName": "resourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this PodGroup.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this PodGroup. When this PodGroup is deleted, the ResourceClaim will also be deleted. The PodGroup 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 podgroup.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.", +} + +func (PodGroupResourceClaim) SwaggerDoc() map[string]string { + return map_PodGroupResourceClaim +} + +var map_PodGroupResourceClaimStatus = map[string]string{ + "": "PodGroupResourceClaimStatus is stored in the PodGroupStatus for each PodGroupResourceClaim which references a ResourceClaimTemplate. It stores the generated name for the corresponding ResourceClaim.", + "name": "name uniquely identifies this resource claim inside the PodGroup. This must match the name of an entry in podgroup.spec.resourceClaims, which implies that the string must be a DNS_LABEL.", + "resourceClaimName": "resourceClaimName is the name of the ResourceClaim that was generated for the PodGroup in the namespace of the PodGroup. If this is unset, then generating a ResourceClaim was not necessary. The podgroup.spec.resourceClaims entry can be ignored in this case.", +} + +func (PodGroupResourceClaimStatus) SwaggerDoc() map[string]string { + return map_PodGroupResourceClaimStatus +} + +var map_PodGroupSchedulingConstraints = map[string]string{ + "": "PodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a PodGroup.", + "topology": "topology defines the topology constraints for the pod group. Currently only a single topology constraint can be specified. This may change in the future.", +} + +func (PodGroupSchedulingConstraints) SwaggerDoc() map[string]string { + return map_PodGroupSchedulingConstraints +} + +var map_PodGroupSchedulingPolicy = map[string]string{ + "": "PodGroupSchedulingPolicy defines the scheduling configuration for a PodGroup. Exactly one policy must be set. The policy is chosen at creation time by setting either the Basic or Gang field. The PodGroup may not change policy after creation. Fields within chosen policy may be updated after creation when their individual fields allow it.", + "basic": "basic specifies that the pods in this group should be scheduled using standard Kubernetes scheduling behavior. Setting this field at group creation time opts this group to basic scheduling; this field cannot be changed afterward.", + "gang": "gang specifies that the pods in this group should be scheduled using all-or-nothing semantics. Setting this field at group creation time opts this group to gang scheduling; this field cannot be set or unset afterward. The minCount field within Gang scheduling policy remains mutable after group creation.", +} + +func (PodGroupSchedulingPolicy) SwaggerDoc() map[string]string { + return map_PodGroupSchedulingPolicy +} + +var map_PodGroupSpec = map[string]string{ + "": "PodGroupSpec defines the desired state of a PodGroup.", + "parentCompositePodGroupName": "parentCompositePodGroupName contains the name of the parent composite pod group within the same namespace as this pod group. If it's nil, then this pod group is a root of a workload's hierarchy. This field is used only when the CompositePodGroup feature gate is enabled. This field is immutable.", + "workloadRef": "workloadRef references an optional PodGroup template within the Workload object that was used to create the PodGroup. This field is immutable.", + "schedulingPolicy": "schedulingPolicy defines the scheduling policy for this instance of the PodGroup. Controllers are expected to fill this field by copying it from a PodGroupTemplate.", + "schedulingConstraints": "schedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroup. Controllers are expected to fill this field by copying it from a PodGroupTemplate. This field is immutable. This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled.", + "resourceClaims": "resourceClaims defines which ResourceClaims may be shared among Pods in the group. Pods consume the devices allocated to a PodGroup's claim by defining a claim in its own Spec.ResourceClaims that matches the PodGroup's claim exactly. The claim must have the same name and refer to the same ResourceClaim or ResourceClaimTemplate.\n\nThis is a beta-level field and requires that the DRAWorkloadResourceClaims feature gate is enabled.\n\nThis field is immutable.", + "disruptionMode": "disruptionMode defines the mode in which a given PodGroup can be disrupted. Controllers are expected to fill this field by copying it from a PodGroupTemplate. One of Single, All. Defaults to Single if unset. This field is immutable.", + "priorityClassName": "priorityClassName defines the priority that should be considered when scheduling this pod group. Controllers are expected to fill this field by copying it from a PodGroupTemplate. Otherwise, it is validated and resolved similarly to the PriorityClassName on PodGroupTemplate (i.e. if no priority class is specified, admission control can set this to the global default priority class if it exists. Otherwise, the pod group's priority will be zero). This field is immutable.", + "priority": "priority is the value of priority of this pod group. Various system components use this field to find the priority of the pod group. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. This field is immutable.", + "preemptionPolicy": "preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. When Priority Admission Controller is enabled, it populates this field from PriorityClassName, and defaults to PreemptLowerPriority if value is unset in PriorityClass. This field is immutable. This field is available only when the PodGroupPreemptionPolicy feature gate is enabled.", +} + +func (PodGroupSpec) SwaggerDoc() map[string]string { + return map_PodGroupSpec +} + +var map_PodGroupStatus = map[string]string{ + "": "PodGroupStatus represents information about the status of a pod group.", + "conditions": "conditions represent the latest observations of the PodGroup's state.\n\nKnown condition types: - \"PodGroupInitiallyScheduled\": Indicates whether the scheduling requirement has been satisfied. Once this condition transitions to True, it serves as a terminal state and will never revert to False, even if pods are subsequently evicted and group constraints are no longer met. - \"DisruptionTarget\": Indicates whether the PodGroup is about to be terminated\n due to disruption such as preemption.\n\nKnown reasons for the PodGroupInitiallyScheduled condition: - \"Unschedulable\": The PodGroup cannot be scheduled due to resource constraints,\n affinity/anti-affinity rules, or insufficient capacity for the gang.\n- \"SchedulerError\": The PodGroup cannot be scheduled due to some internal error\n that happened during scheduling, for example due to nodeAffinity parsing errors.\n\nKnown reasons for the DisruptionTarget condition: - \"PreemptionByScheduler\": The PodGroup was preempted by the scheduler to make room for\n higher-priority PodGroups or Pods.", + "resourceClaimStatuses": "resourceClaimStatuses is status of resource claims.", +} + +func (PodGroupStatus) SwaggerDoc() map[string]string { + return map_PodGroupStatus +} + +var map_PodGroupTemplate = map[string]string{ + "": "PodGroupTemplate represents a template for a set of pods with a scheduling policy.", + "name": "name is a unique identifier for the PodGroupTemplate within the Workload. It must be a DNS label. This field is immutable.", + "schedulingPolicy": "schedulingPolicy defines the scheduling policy for this PodGroupTemplate.", + "schedulingConstraints": "schedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroupTemplate. This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. This field is immutable.", + "resourceClaims": "resourceClaims defines which ResourceClaims may be shared among Pods in the group. Pods consume the devices allocated to a PodGroup's claim by defining a claim in its own Spec.ResourceClaims that matches the PodGroup's claim exactly. The claim must have the same name and refer to the same ResourceClaim or ResourceClaimTemplate.\n\nThis is a beta-level field and requires that the DRAWorkloadResourceClaims feature gate is enabled.\n\nThis field is immutable.", + "disruptionMode": "disruptionMode defines the mode in which a given PodGroup can be disrupted. One of Single, All. This field is immutable.", + "priorityClassName": "priorityClassName indicates the priority that should be considered when scheduling a pod group created from this template. This field is immutable.", + "priority": "priority is the value of priority of pod groups created from this template. Various system components use this field to find the priority of the pod group. The higher the value, the higher the priority. This field is immutable.", + "preemptionPolicy": "preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. One of Never, PreemptLowerPriority. This field is immutable. This field is available only when the PodGroupPreemptionPolicy feature gate is enabled.", +} + +func (PodGroupTemplate) SwaggerDoc() map[string]string { + return map_PodGroupTemplate +} + +var map_SingleCompositeDisruptionMode = map[string]string{ + "": "SingleCompositeDisruptionMode means that individual children of a CompositePodGroup can be disrupted or preempted independently.", +} + +func (SingleCompositeDisruptionMode) SwaggerDoc() map[string]string { + return map_SingleCompositeDisruptionMode +} + +var map_SingleDisruptionMode = map[string]string{ + "": "SingleDisruptionMode specifies that children can be disrupted independently.", +} + +func (SingleDisruptionMode) SwaggerDoc() map[string]string { + return map_SingleDisruptionMode +} + +var map_TopologyConstraint = map[string]string{ + "": "TopologyConstraint defines a topology constraint for a PodGroup.", + "key": "key specifies the key of the node label representing the topology domain. All pods within the PodGroup must be colocated within the same domain instance. Different PodGroups can land on different domain instances even if they derive from the same PodGroupTemplate. Examples: \"topology.kubernetes.io/rack\"", +} + +func (TopologyConstraint) SwaggerDoc() map[string]string { + return map_TopologyConstraint +} + +var map_TypedLocalObjectReference = map[string]string{ + "": "TypedLocalObjectReference allows to reference typed object inside the same namespace.", + "apiGroup": "apiGroup is the group for the resource being referenced. If APIGroup is empty, the specified Kind must be in the core API group. For any other third-party types, setting APIGroup is required. It must be a DNS subdomain.", + "kind": "kind is the type of resource being referenced. It must be a path segment name.", + "name": "name is the name of resource being referenced. It must be a path segment name.", +} + +func (TypedLocalObjectReference) SwaggerDoc() map[string]string { + return map_TypedLocalObjectReference +} + +var map_Workload = map[string]string{ + "": "Workload allows for expressing scheduling constraints that should be used when managing the lifecycle of workloads from the scheduling perspective, including scheduling, preemption, eviction and other phases. Workload API enablement is toggled by the GenericWorkload feature gate.", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec defines the desired behavior of a Workload.", +} + +func (Workload) SwaggerDoc() map[string]string { + return map_Workload +} + +var map_WorkloadCompositePodGroupAllDisruptionMode = map[string]string{ + "": "WorkloadCompositePodGroupAllDisruptionMode indicates that all child groups must be disrupted together.", +} + +func (WorkloadCompositePodGroupAllDisruptionMode) SwaggerDoc() map[string]string { + return map_WorkloadCompositePodGroupAllDisruptionMode +} + +var map_WorkloadCompositePodGroupBasicSchedulingPolicy = map[string]string{ + "": "WorkloadCompositePodGroupBasicSchedulingPolicy indicates that the child groups of a composite group should be scheduled independently.", +} + +func (WorkloadCompositePodGroupBasicSchedulingPolicy) SwaggerDoc() map[string]string { + return map_WorkloadCompositePodGroupBasicSchedulingPolicy +} + +var map_WorkloadCompositePodGroupDisruptionMode = map[string]string{ + "": "WorkloadCompositePodGroupDisruptionMode defines how the child groups of a composite group can be disrupted. Exactly one mode must be set.", + "single": "single specifies that child groups can be disrupted independently from each other.", + "all": "all specifies that all child groups must be disrupted together.", +} + +func (WorkloadCompositePodGroupDisruptionMode) SwaggerDoc() map[string]string { + return map_WorkloadCompositePodGroupDisruptionMode +} + +var map_WorkloadCompositePodGroupGangSchedulingPolicy = map[string]string{ + "": "WorkloadCompositePodGroupGangSchedulingPolicy defines the parameters for gang scheduling of a composite group's child groups.", + "minGroupCount": "minGroupCount is the minimum number of child groups that must be schedulable at the same time for the scheduler to admit the entire composite group. This field is optional. If it is not specified, the controller should inject a context-specific sane default (e.g., the number of child groups). If set, it must be a positive integer.", +} + +func (WorkloadCompositePodGroupGangSchedulingPolicy) SwaggerDoc() map[string]string { + return map_WorkloadCompositePodGroupGangSchedulingPolicy +} + +var map_WorkloadCompositePodGroupSchedulingConstraints = map[string]string{ + "": "WorkloadCompositePodGroupSchedulingConstraints defines composite-level scheduling constraints, such as topology, for a CompositePodGroup (a group of groups) managed by a workload controller.", + "topology": "topology specifies desired topological placements for all child groups within the composite group. If unset, no topology placement is requested.", +} + +func (WorkloadCompositePodGroupSchedulingConstraints) SwaggerDoc() map[string]string { + return map_WorkloadCompositePodGroupSchedulingConstraints +} + +var map_WorkloadCompositePodGroupSchedulingPolicy = map[string]string{ + "": "WorkloadCompositePodGroupSchedulingPolicy defines the scheduling policy for a CompositePodGroup (a group of groups) managed by a workload controller. Exactly one policy must be set.", + "basic": "basic specifies that the child groups of this composite group should be scheduled independently.", + "gang": "gang specifies that the child groups of this composite group should be scheduled using all-or-nothing semantics.", +} + +func (WorkloadCompositePodGroupSchedulingPolicy) SwaggerDoc() map[string]string { + return map_WorkloadCompositePodGroupSchedulingPolicy +} + +var map_WorkloadCompositePodGroupSingleDisruptionMode = map[string]string{ + "": "WorkloadCompositePodGroupSingleDisruptionMode indicates that child groups can be disrupted independently.", +} + +func (WorkloadCompositePodGroupSingleDisruptionMode) SwaggerDoc() map[string]string { + return map_WorkloadCompositePodGroupSingleDisruptionMode +} + +var map_WorkloadList = map[string]string{ + "": "WorkloadList contains a list of Workload resources.", + "metadata": "Standard list metadata.", + "items": "Items is the list of Workloads.", +} + +func (WorkloadList) SwaggerDoc() map[string]string { + return map_WorkloadList +} + +var map_WorkloadPodGroupAllDisruptionMode = map[string]string{ + "": "WorkloadPodGroupAllDisruptionMode indicates that all pods in the group must be disrupted together.", +} + +func (WorkloadPodGroupAllDisruptionMode) SwaggerDoc() map[string]string { + return map_WorkloadPodGroupAllDisruptionMode +} + +var map_WorkloadPodGroupBasicSchedulingPolicy = map[string]string{ + "": "WorkloadPodGroupBasicSchedulingPolicy indicates standard Kubernetes scheduling behavior.", +} + +func (WorkloadPodGroupBasicSchedulingPolicy) SwaggerDoc() map[string]string { + return map_WorkloadPodGroupBasicSchedulingPolicy +} + +var map_WorkloadPodGroupDisruptionMode = map[string]string{ + "": "WorkloadPodGroupDisruptionMode defines how individual pods within a group can be disrupted. Exactly one mode must be set.", + "single": "single specifies that pods can be disrupted independently from each other.", + "all": "all specifies that all pods in the group must be disrupted together.", +} + +func (WorkloadPodGroupDisruptionMode) SwaggerDoc() map[string]string { + return map_WorkloadPodGroupDisruptionMode +} + +var map_WorkloadPodGroupGangSchedulingPolicy = map[string]string{ + "": "WorkloadPodGroupGangSchedulingPolicy defines the parameters for gang (all-or-nothing) scheduling.", + "minCount": "minCount is the minimum number of pods that must be scheduled at the same time for the scheduler to admit the entire group. This field is optional. If it is not specified, the controller should inject a context-specific sane default (e.g., parallelism for a Job). If set, it must be a positive integer.", +} + +func (WorkloadPodGroupGangSchedulingPolicy) SwaggerDoc() map[string]string { + return map_WorkloadPodGroupGangSchedulingPolicy +} + +var map_WorkloadPodGroupResourceClaim = map[string]string{ + "": "WorkloadPodGroupResourceClaim references a dynamic resource claim that is shared across pods in the group.", + "name": "name uniquely identifies this resource claim inside the group. This field is required. It must be a DNS_LABEL.", + "resourceClaimName": "resourceClaimName is the name of a ResourceClaim object in the same namespace. This field is optional. If it is not specified, no resource claim is used. If set, it must be a DNS subdomain.", + "resourceClaimTemplateName": "resourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace. This field is optional. If it is not specified, no resource claim template is used. If set, it must be a DNS subdomain.", +} + +func (WorkloadPodGroupResourceClaim) SwaggerDoc() map[string]string { + return map_WorkloadPodGroupResourceClaim +} + +var map_WorkloadPodGroupSchedulingConstraints = map[string]string{ + "": "WorkloadPodGroupSchedulingConstraints defines leaf-level scheduling constraints, such as topology.", + "topology": "topology specifies desired topological placements for all pods within the pod group. If unset, no topology placement is requested.", +} + +func (WorkloadPodGroupSchedulingConstraints) SwaggerDoc() map[string]string { + return map_WorkloadPodGroupSchedulingConstraints +} + +var map_WorkloadPodGroupSchedulingPolicy = map[string]string{ + "": "WorkloadPodGroupSchedulingPolicy defines the scheduling policy for a group of pods managed by a workload controller. Exactly one policy must be set.", + "basic": "basic specifies that standard, pod-by-pod Kubernetes scheduling behavior should be used.", + "gang": "gang specifies all-or-nothing scheduling semantics.", +} + +func (WorkloadPodGroupSchedulingPolicy) SwaggerDoc() map[string]string { + return map_WorkloadPodGroupSchedulingPolicy +} + +var map_WorkloadPodGroupSingleDisruptionMode = map[string]string{ + "": "WorkloadPodGroupSingleDisruptionMode indicates that individual pods can be disrupted independently.", +} + +func (WorkloadPodGroupSingleDisruptionMode) SwaggerDoc() map[string]string { + return map_WorkloadPodGroupSingleDisruptionMode +} + +var map_WorkloadReference = map[string]string{ + "": "WorkloadReference references the Workload object together with the template that was used to create a particular PodGroup.", + "workloadName": "workloadName is the name of the Workload object that contains a template that was used when creating a pod group. It must be a DNS name. This field is required.", + "templateName": "templateName is the name of a template within the Workload object that was used to create a pod group. It must be a DNS label. This field is required.", +} + +func (WorkloadReference) SwaggerDoc() map[string]string { + return map_WorkloadReference +} + +var map_WorkloadSpec = map[string]string{ + "": "WorkloadSpec defines the desired state of a Workload.", + "controllerRef": "controllerRef is an optional reference to the controlling object, such as a Deployment or Job. This field is intended for use by tools like CLIs to provide a link back to the original workload definition. This field is immutable.", + "podGroupTemplates": "podGroupTemplates is the list of templates that make up the Workload. The maximum number of templates is 8. Templates cannot be added or removed after the workload is created. Existing templates may still be updated where their individual fields allow it. Exactly one of CompositePodGroupTemplates and PodGroupTemplates must be set.", + "compositePodGroupTemplates": "compositePodGroupTemplates is the list of CompositePodGroup templates that make up the Workload. The maximum number of templates is 8. This field is immutable. Exactly one of CompositePodGroupTemplates and PodGroupTemplates must be set.\n\nThis field is used only when the CompositePodGroup feature gate is enabled.", +} + +func (WorkloadSpec) SwaggerDoc() map[string]string { + return map_WorkloadSpec +} + +// AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/k8s.io/api/scheduling/v1alpha3/zz_generated.deepcopy.go b/vendor/k8s.io/api/scheduling/v1alpha3/zz_generated.deepcopy.go new file mode 100644 index 0000000000..ae0a82088b --- /dev/null +++ b/vendor/k8s.io/api/scheduling/v1alpha3/zz_generated.deepcopy.go @@ -0,0 +1,1172 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllCompositeDisruptionMode) DeepCopyInto(out *AllCompositeDisruptionMode) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllCompositeDisruptionMode. +func (in *AllCompositeDisruptionMode) DeepCopy() *AllCompositeDisruptionMode { + if in == nil { + return nil + } + out := new(AllCompositeDisruptionMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllDisruptionMode) DeepCopyInto(out *AllDisruptionMode) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllDisruptionMode. +func (in *AllDisruptionMode) DeepCopy() *AllDisruptionMode { + if in == nil { + return nil + } + out := new(AllDisruptionMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BasicSchedulingPolicy) DeepCopyInto(out *BasicSchedulingPolicy) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicSchedulingPolicy. +func (in *BasicSchedulingPolicy) DeepCopy() *BasicSchedulingPolicy { + if in == nil { + return nil + } + out := new(BasicSchedulingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CompositeBasicSchedulingPolicy) DeepCopyInto(out *CompositeBasicSchedulingPolicy) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositeBasicSchedulingPolicy. +func (in *CompositeBasicSchedulingPolicy) DeepCopy() *CompositeBasicSchedulingPolicy { + if in == nil { + return nil + } + out := new(CompositeBasicSchedulingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CompositeDisruptionMode) DeepCopyInto(out *CompositeDisruptionMode) { + *out = *in + if in.Single != nil { + in, out := &in.Single, &out.Single + *out = new(SingleCompositeDisruptionMode) + **out = **in + } + if in.All != nil { + in, out := &in.All, &out.All + *out = new(AllCompositeDisruptionMode) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositeDisruptionMode. +func (in *CompositeDisruptionMode) DeepCopy() *CompositeDisruptionMode { + if in == nil { + return nil + } + out := new(CompositeDisruptionMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CompositeGangSchedulingPolicy) DeepCopyInto(out *CompositeGangSchedulingPolicy) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositeGangSchedulingPolicy. +func (in *CompositeGangSchedulingPolicy) DeepCopy() *CompositeGangSchedulingPolicy { + if in == nil { + return nil + } + out := new(CompositeGangSchedulingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CompositePodGroup) DeepCopyInto(out *CompositePodGroup) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositePodGroup. +func (in *CompositePodGroup) DeepCopy() *CompositePodGroup { + if in == nil { + return nil + } + out := new(CompositePodGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CompositePodGroup) 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 *CompositePodGroupList) DeepCopyInto(out *CompositePodGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CompositePodGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositePodGroupList. +func (in *CompositePodGroupList) DeepCopy() *CompositePodGroupList { + if in == nil { + return nil + } + out := new(CompositePodGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CompositePodGroupList) 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 *CompositePodGroupSchedulingConstraints) DeepCopyInto(out *CompositePodGroupSchedulingConstraints) { + *out = *in + if in.Topology != nil { + in, out := &in.Topology, &out.Topology + *out = make([]TopologyConstraint, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositePodGroupSchedulingConstraints. +func (in *CompositePodGroupSchedulingConstraints) DeepCopy() *CompositePodGroupSchedulingConstraints { + if in == nil { + return nil + } + out := new(CompositePodGroupSchedulingConstraints) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CompositePodGroupSchedulingPolicy) DeepCopyInto(out *CompositePodGroupSchedulingPolicy) { + *out = *in + if in.Basic != nil { + in, out := &in.Basic, &out.Basic + *out = new(CompositeBasicSchedulingPolicy) + **out = **in + } + if in.Gang != nil { + in, out := &in.Gang, &out.Gang + *out = new(CompositeGangSchedulingPolicy) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositePodGroupSchedulingPolicy. +func (in *CompositePodGroupSchedulingPolicy) DeepCopy() *CompositePodGroupSchedulingPolicy { + if in == nil { + return nil + } + out := new(CompositePodGroupSchedulingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CompositePodGroupSpec) DeepCopyInto(out *CompositePodGroupSpec) { + *out = *in + if in.ParentCompositePodGroupName != nil { + in, out := &in.ParentCompositePodGroupName, &out.ParentCompositePodGroupName + *out = new(string) + **out = **in + } + if in.WorkloadRef != nil { + in, out := &in.WorkloadRef, &out.WorkloadRef + *out = new(WorkloadReference) + **out = **in + } + in.SchedulingPolicy.DeepCopyInto(&out.SchedulingPolicy) + if in.SchedulingConstraints != nil { + in, out := &in.SchedulingConstraints, &out.SchedulingConstraints + *out = new(CompositePodGroupSchedulingConstraints) + (*in).DeepCopyInto(*out) + } + if in.DisruptionMode != nil { + in, out := &in.DisruptionMode, &out.DisruptionMode + *out = new(CompositeDisruptionMode) + (*in).DeepCopyInto(*out) + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int32) + **out = **in + } + if in.PreemptionPolicy != nil { + in, out := &in.PreemptionPolicy, &out.PreemptionPolicy + *out = new(PreemptionPolicy) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositePodGroupSpec. +func (in *CompositePodGroupSpec) DeepCopy() *CompositePodGroupSpec { + if in == nil { + return nil + } + out := new(CompositePodGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CompositePodGroupStatus) DeepCopyInto(out *CompositePodGroupStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositePodGroupStatus. +func (in *CompositePodGroupStatus) DeepCopy() *CompositePodGroupStatus { + if in == nil { + return nil + } + out := new(CompositePodGroupStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CompositePodGroupTemplate) DeepCopyInto(out *CompositePodGroupTemplate) { + *out = *in + in.SchedulingPolicy.DeepCopyInto(&out.SchedulingPolicy) + if in.SchedulingConstraints != nil { + in, out := &in.SchedulingConstraints, &out.SchedulingConstraints + *out = new(CompositePodGroupSchedulingConstraints) + (*in).DeepCopyInto(*out) + } + if in.DisruptionMode != nil { + in, out := &in.DisruptionMode, &out.DisruptionMode + *out = new(CompositeDisruptionMode) + (*in).DeepCopyInto(*out) + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int32) + **out = **in + } + if in.PreemptionPolicy != nil { + in, out := &in.PreemptionPolicy, &out.PreemptionPolicy + *out = new(PreemptionPolicy) + **out = **in + } + if in.PodGroupTemplates != nil { + in, out := &in.PodGroupTemplates, &out.PodGroupTemplates + *out = make([]PodGroupTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.CompositePodGroupTemplates != nil { + in, out := &in.CompositePodGroupTemplates, &out.CompositePodGroupTemplates + *out = make([]CompositePodGroupTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositePodGroupTemplate. +func (in *CompositePodGroupTemplate) DeepCopy() *CompositePodGroupTemplate { + if in == nil { + return nil + } + out := new(CompositePodGroupTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DisruptionMode) DeepCopyInto(out *DisruptionMode) { + *out = *in + if in.Single != nil { + in, out := &in.Single, &out.Single + *out = new(SingleDisruptionMode) + **out = **in + } + if in.All != nil { + in, out := &in.All, &out.All + *out = new(AllDisruptionMode) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionMode. +func (in *DisruptionMode) DeepCopy() *DisruptionMode { + if in == nil { + return nil + } + out := new(DisruptionMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GangSchedulingPolicy) DeepCopyInto(out *GangSchedulingPolicy) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GangSchedulingPolicy. +func (in *GangSchedulingPolicy) DeepCopy() *GangSchedulingPolicy { + if in == nil { + return nil + } + out := new(GangSchedulingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodGroup) DeepCopyInto(out *PodGroup) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroup. +func (in *PodGroup) DeepCopy() *PodGroup { + if in == nil { + return nil + } + out := new(PodGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PodGroup) 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 *PodGroupList) DeepCopyInto(out *PodGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PodGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupList. +func (in *PodGroupList) DeepCopy() *PodGroupList { + if in == nil { + return nil + } + out := new(PodGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PodGroupList) 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 *PodGroupResourceClaim) DeepCopyInto(out *PodGroupResourceClaim) { + *out = *in + if in.ResourceClaimName != nil { + in, out := &in.ResourceClaimName, &out.ResourceClaimName + *out = new(string) + **out = **in + } + if in.ResourceClaimTemplateName != nil { + in, out := &in.ResourceClaimTemplateName, &out.ResourceClaimTemplateName + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupResourceClaim. +func (in *PodGroupResourceClaim) DeepCopy() *PodGroupResourceClaim { + if in == nil { + return nil + } + out := new(PodGroupResourceClaim) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodGroupResourceClaimStatus) DeepCopyInto(out *PodGroupResourceClaimStatus) { + *out = *in + if in.ResourceClaimName != nil { + in, out := &in.ResourceClaimName, &out.ResourceClaimName + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupResourceClaimStatus. +func (in *PodGroupResourceClaimStatus) DeepCopy() *PodGroupResourceClaimStatus { + if in == nil { + return nil + } + out := new(PodGroupResourceClaimStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodGroupSchedulingConstraints) DeepCopyInto(out *PodGroupSchedulingConstraints) { + *out = *in + if in.Topology != nil { + in, out := &in.Topology, &out.Topology + *out = make([]TopologyConstraint, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupSchedulingConstraints. +func (in *PodGroupSchedulingConstraints) DeepCopy() *PodGroupSchedulingConstraints { + if in == nil { + return nil + } + out := new(PodGroupSchedulingConstraints) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodGroupSchedulingPolicy) DeepCopyInto(out *PodGroupSchedulingPolicy) { + *out = *in + if in.Basic != nil { + in, out := &in.Basic, &out.Basic + *out = new(BasicSchedulingPolicy) + **out = **in + } + if in.Gang != nil { + in, out := &in.Gang, &out.Gang + *out = new(GangSchedulingPolicy) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupSchedulingPolicy. +func (in *PodGroupSchedulingPolicy) DeepCopy() *PodGroupSchedulingPolicy { + if in == nil { + return nil + } + out := new(PodGroupSchedulingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodGroupSpec) DeepCopyInto(out *PodGroupSpec) { + *out = *in + if in.ParentCompositePodGroupName != nil { + in, out := &in.ParentCompositePodGroupName, &out.ParentCompositePodGroupName + *out = new(string) + **out = **in + } + if in.WorkloadRef != nil { + in, out := &in.WorkloadRef, &out.WorkloadRef + *out = new(WorkloadReference) + **out = **in + } + in.SchedulingPolicy.DeepCopyInto(&out.SchedulingPolicy) + if in.SchedulingConstraints != nil { + in, out := &in.SchedulingConstraints, &out.SchedulingConstraints + *out = new(PodGroupSchedulingConstraints) + (*in).DeepCopyInto(*out) + } + if in.ResourceClaims != nil { + in, out := &in.ResourceClaims, &out.ResourceClaims + *out = make([]PodGroupResourceClaim, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DisruptionMode != nil { + in, out := &in.DisruptionMode, &out.DisruptionMode + *out = new(DisruptionMode) + (*in).DeepCopyInto(*out) + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int32) + **out = **in + } + if in.PreemptionPolicy != nil { + in, out := &in.PreemptionPolicy, &out.PreemptionPolicy + *out = new(PreemptionPolicy) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupSpec. +func (in *PodGroupSpec) DeepCopy() *PodGroupSpec { + if in == nil { + return nil + } + out := new(PodGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodGroupStatus) DeepCopyInto(out *PodGroupStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ResourceClaimStatuses != nil { + in, out := &in.ResourceClaimStatuses, &out.ResourceClaimStatuses + *out = make([]PodGroupResourceClaimStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupStatus. +func (in *PodGroupStatus) DeepCopy() *PodGroupStatus { + if in == nil { + return nil + } + out := new(PodGroupStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodGroupTemplate) DeepCopyInto(out *PodGroupTemplate) { + *out = *in + in.SchedulingPolicy.DeepCopyInto(&out.SchedulingPolicy) + if in.SchedulingConstraints != nil { + in, out := &in.SchedulingConstraints, &out.SchedulingConstraints + *out = new(PodGroupSchedulingConstraints) + (*in).DeepCopyInto(*out) + } + if in.ResourceClaims != nil { + in, out := &in.ResourceClaims, &out.ResourceClaims + *out = make([]PodGroupResourceClaim, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DisruptionMode != nil { + in, out := &in.DisruptionMode, &out.DisruptionMode + *out = new(DisruptionMode) + (*in).DeepCopyInto(*out) + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int32) + **out = **in + } + if in.PreemptionPolicy != nil { + in, out := &in.PreemptionPolicy, &out.PreemptionPolicy + *out = new(PreemptionPolicy) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupTemplate. +func (in *PodGroupTemplate) DeepCopy() *PodGroupTemplate { + if in == nil { + return nil + } + out := new(PodGroupTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SingleCompositeDisruptionMode) DeepCopyInto(out *SingleCompositeDisruptionMode) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SingleCompositeDisruptionMode. +func (in *SingleCompositeDisruptionMode) DeepCopy() *SingleCompositeDisruptionMode { + if in == nil { + return nil + } + out := new(SingleCompositeDisruptionMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SingleDisruptionMode) DeepCopyInto(out *SingleDisruptionMode) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SingleDisruptionMode. +func (in *SingleDisruptionMode) DeepCopy() *SingleDisruptionMode { + if in == nil { + return nil + } + out := new(SingleDisruptionMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TopologyConstraint) DeepCopyInto(out *TopologyConstraint) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopologyConstraint. +func (in *TopologyConstraint) DeepCopy() *TopologyConstraint { + if in == nil { + return nil + } + out := new(TopologyConstraint) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TypedLocalObjectReference) DeepCopyInto(out *TypedLocalObjectReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TypedLocalObjectReference. +func (in *TypedLocalObjectReference) DeepCopy() *TypedLocalObjectReference { + if in == nil { + return nil + } + out := new(TypedLocalObjectReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Workload) DeepCopyInto(out *Workload) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workload. +func (in *Workload) DeepCopy() *Workload { + if in == nil { + return nil + } + out := new(Workload) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Workload) 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 *WorkloadCompositePodGroupAllDisruptionMode) DeepCopyInto(out *WorkloadCompositePodGroupAllDisruptionMode) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadCompositePodGroupAllDisruptionMode. +func (in *WorkloadCompositePodGroupAllDisruptionMode) DeepCopy() *WorkloadCompositePodGroupAllDisruptionMode { + if in == nil { + return nil + } + out := new(WorkloadCompositePodGroupAllDisruptionMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadCompositePodGroupBasicSchedulingPolicy) DeepCopyInto(out *WorkloadCompositePodGroupBasicSchedulingPolicy) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadCompositePodGroupBasicSchedulingPolicy. +func (in *WorkloadCompositePodGroupBasicSchedulingPolicy) DeepCopy() *WorkloadCompositePodGroupBasicSchedulingPolicy { + if in == nil { + return nil + } + out := new(WorkloadCompositePodGroupBasicSchedulingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadCompositePodGroupDisruptionMode) DeepCopyInto(out *WorkloadCompositePodGroupDisruptionMode) { + *out = *in + if in.Single != nil { + in, out := &in.Single, &out.Single + *out = new(WorkloadCompositePodGroupSingleDisruptionMode) + **out = **in + } + if in.All != nil { + in, out := &in.All, &out.All + *out = new(WorkloadCompositePodGroupAllDisruptionMode) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadCompositePodGroupDisruptionMode. +func (in *WorkloadCompositePodGroupDisruptionMode) DeepCopy() *WorkloadCompositePodGroupDisruptionMode { + if in == nil { + return nil + } + out := new(WorkloadCompositePodGroupDisruptionMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadCompositePodGroupGangSchedulingPolicy) DeepCopyInto(out *WorkloadCompositePodGroupGangSchedulingPolicy) { + *out = *in + if in.MinGroupCount != nil { + in, out := &in.MinGroupCount, &out.MinGroupCount + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadCompositePodGroupGangSchedulingPolicy. +func (in *WorkloadCompositePodGroupGangSchedulingPolicy) DeepCopy() *WorkloadCompositePodGroupGangSchedulingPolicy { + if in == nil { + return nil + } + out := new(WorkloadCompositePodGroupGangSchedulingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadCompositePodGroupSchedulingConstraints) DeepCopyInto(out *WorkloadCompositePodGroupSchedulingConstraints) { + *out = *in + if in.Topology != nil { + in, out := &in.Topology, &out.Topology + *out = make([]TopologyConstraint, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadCompositePodGroupSchedulingConstraints. +func (in *WorkloadCompositePodGroupSchedulingConstraints) DeepCopy() *WorkloadCompositePodGroupSchedulingConstraints { + if in == nil { + return nil + } + out := new(WorkloadCompositePodGroupSchedulingConstraints) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadCompositePodGroupSchedulingPolicy) DeepCopyInto(out *WorkloadCompositePodGroupSchedulingPolicy) { + *out = *in + if in.Basic != nil { + in, out := &in.Basic, &out.Basic + *out = new(WorkloadCompositePodGroupBasicSchedulingPolicy) + **out = **in + } + if in.Gang != nil { + in, out := &in.Gang, &out.Gang + *out = new(WorkloadCompositePodGroupGangSchedulingPolicy) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadCompositePodGroupSchedulingPolicy. +func (in *WorkloadCompositePodGroupSchedulingPolicy) DeepCopy() *WorkloadCompositePodGroupSchedulingPolicy { + if in == nil { + return nil + } + out := new(WorkloadCompositePodGroupSchedulingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadCompositePodGroupSingleDisruptionMode) DeepCopyInto(out *WorkloadCompositePodGroupSingleDisruptionMode) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadCompositePodGroupSingleDisruptionMode. +func (in *WorkloadCompositePodGroupSingleDisruptionMode) DeepCopy() *WorkloadCompositePodGroupSingleDisruptionMode { + if in == nil { + return nil + } + out := new(WorkloadCompositePodGroupSingleDisruptionMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadList) DeepCopyInto(out *WorkloadList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Workload, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadList. +func (in *WorkloadList) DeepCopy() *WorkloadList { + if in == nil { + return nil + } + out := new(WorkloadList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkloadList) 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 *WorkloadPodGroupAllDisruptionMode) DeepCopyInto(out *WorkloadPodGroupAllDisruptionMode) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadPodGroupAllDisruptionMode. +func (in *WorkloadPodGroupAllDisruptionMode) DeepCopy() *WorkloadPodGroupAllDisruptionMode { + if in == nil { + return nil + } + out := new(WorkloadPodGroupAllDisruptionMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadPodGroupBasicSchedulingPolicy) DeepCopyInto(out *WorkloadPodGroupBasicSchedulingPolicy) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadPodGroupBasicSchedulingPolicy. +func (in *WorkloadPodGroupBasicSchedulingPolicy) DeepCopy() *WorkloadPodGroupBasicSchedulingPolicy { + if in == nil { + return nil + } + out := new(WorkloadPodGroupBasicSchedulingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadPodGroupDisruptionMode) DeepCopyInto(out *WorkloadPodGroupDisruptionMode) { + *out = *in + if in.Single != nil { + in, out := &in.Single, &out.Single + *out = new(WorkloadPodGroupSingleDisruptionMode) + **out = **in + } + if in.All != nil { + in, out := &in.All, &out.All + *out = new(WorkloadPodGroupAllDisruptionMode) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadPodGroupDisruptionMode. +func (in *WorkloadPodGroupDisruptionMode) DeepCopy() *WorkloadPodGroupDisruptionMode { + if in == nil { + return nil + } + out := new(WorkloadPodGroupDisruptionMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadPodGroupGangSchedulingPolicy) DeepCopyInto(out *WorkloadPodGroupGangSchedulingPolicy) { + *out = *in + if in.MinCount != nil { + in, out := &in.MinCount, &out.MinCount + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadPodGroupGangSchedulingPolicy. +func (in *WorkloadPodGroupGangSchedulingPolicy) DeepCopy() *WorkloadPodGroupGangSchedulingPolicy { + if in == nil { + return nil + } + out := new(WorkloadPodGroupGangSchedulingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadPodGroupResourceClaim) DeepCopyInto(out *WorkloadPodGroupResourceClaim) { + *out = *in + if in.ResourceClaimName != nil { + in, out := &in.ResourceClaimName, &out.ResourceClaimName + *out = new(string) + **out = **in + } + if in.ResourceClaimTemplateName != nil { + in, out := &in.ResourceClaimTemplateName, &out.ResourceClaimTemplateName + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadPodGroupResourceClaim. +func (in *WorkloadPodGroupResourceClaim) DeepCopy() *WorkloadPodGroupResourceClaim { + if in == nil { + return nil + } + out := new(WorkloadPodGroupResourceClaim) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadPodGroupSchedulingConstraints) DeepCopyInto(out *WorkloadPodGroupSchedulingConstraints) { + *out = *in + if in.Topology != nil { + in, out := &in.Topology, &out.Topology + *out = make([]TopologyConstraint, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadPodGroupSchedulingConstraints. +func (in *WorkloadPodGroupSchedulingConstraints) DeepCopy() *WorkloadPodGroupSchedulingConstraints { + if in == nil { + return nil + } + out := new(WorkloadPodGroupSchedulingConstraints) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadPodGroupSchedulingPolicy) DeepCopyInto(out *WorkloadPodGroupSchedulingPolicy) { + *out = *in + if in.Basic != nil { + in, out := &in.Basic, &out.Basic + *out = new(WorkloadPodGroupBasicSchedulingPolicy) + **out = **in + } + if in.Gang != nil { + in, out := &in.Gang, &out.Gang + *out = new(WorkloadPodGroupGangSchedulingPolicy) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadPodGroupSchedulingPolicy. +func (in *WorkloadPodGroupSchedulingPolicy) DeepCopy() *WorkloadPodGroupSchedulingPolicy { + if in == nil { + return nil + } + out := new(WorkloadPodGroupSchedulingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadPodGroupSingleDisruptionMode) DeepCopyInto(out *WorkloadPodGroupSingleDisruptionMode) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadPodGroupSingleDisruptionMode. +func (in *WorkloadPodGroupSingleDisruptionMode) DeepCopy() *WorkloadPodGroupSingleDisruptionMode { + if in == nil { + return nil + } + out := new(WorkloadPodGroupSingleDisruptionMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadReference) DeepCopyInto(out *WorkloadReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadReference. +func (in *WorkloadReference) DeepCopy() *WorkloadReference { + if in == nil { + return nil + } + out := new(WorkloadReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadSpec) DeepCopyInto(out *WorkloadSpec) { + *out = *in + if in.ControllerRef != nil { + in, out := &in.ControllerRef, &out.ControllerRef + *out = new(TypedLocalObjectReference) + **out = **in + } + if in.PodGroupTemplates != nil { + in, out := &in.PodGroupTemplates, &out.PodGroupTemplates + *out = make([]PodGroupTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.CompositePodGroupTemplates != nil { + in, out := &in.CompositePodGroupTemplates, &out.CompositePodGroupTemplates + *out = make([]CompositePodGroupTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadSpec. +func (in *WorkloadSpec) DeepCopy() *WorkloadSpec { + if in == nil { + return nil + } + out := new(WorkloadSpec) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/k8s.io/api/scheduling/v1alpha3/zz_generated.model_name.go b/vendor/k8s.io/api/scheduling/v1alpha3/zz_generated.model_name.go new file mode 100644 index 0000000000..acd9818f25 --- /dev/null +++ b/vendor/k8s.io/api/scheduling/v1alpha3/zz_generated.model_name.go @@ -0,0 +1,257 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by openapi-gen. DO NOT EDIT. + +package v1alpha3 + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AllCompositeDisruptionMode) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.AllCompositeDisruptionMode" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AllDisruptionMode) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.AllDisruptionMode" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in BasicSchedulingPolicy) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.BasicSchedulingPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CompositeBasicSchedulingPolicy) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.CompositeBasicSchedulingPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CompositeDisruptionMode) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.CompositeDisruptionMode" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CompositeGangSchedulingPolicy) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.CompositeGangSchedulingPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CompositePodGroup) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.CompositePodGroup" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CompositePodGroupList) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.CompositePodGroupList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CompositePodGroupSchedulingConstraints) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.CompositePodGroupSchedulingConstraints" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CompositePodGroupSchedulingPolicy) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.CompositePodGroupSchedulingPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CompositePodGroupSpec) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.CompositePodGroupSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CompositePodGroupStatus) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.CompositePodGroupStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CompositePodGroupTemplate) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.CompositePodGroupTemplate" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DisruptionMode) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.DisruptionMode" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GangSchedulingPolicy) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.GangSchedulingPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodGroup) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.PodGroup" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodGroupList) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.PodGroupList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodGroupResourceClaim) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.PodGroupResourceClaim" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodGroupResourceClaimStatus) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.PodGroupResourceClaimStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodGroupSchedulingConstraints) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.PodGroupSchedulingConstraints" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodGroupSchedulingPolicy) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.PodGroupSchedulingPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodGroupSpec) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.PodGroupSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodGroupStatus) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.PodGroupStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodGroupTemplate) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.PodGroupTemplate" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SingleCompositeDisruptionMode) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.SingleCompositeDisruptionMode" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SingleDisruptionMode) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.SingleDisruptionMode" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TopologyConstraint) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.TopologyConstraint" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TypedLocalObjectReference) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.TypedLocalObjectReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Workload) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.Workload" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadCompositePodGroupAllDisruptionMode) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.WorkloadCompositePodGroupAllDisruptionMode" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadCompositePodGroupBasicSchedulingPolicy) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.WorkloadCompositePodGroupBasicSchedulingPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadCompositePodGroupDisruptionMode) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.WorkloadCompositePodGroupDisruptionMode" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadCompositePodGroupGangSchedulingPolicy) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.WorkloadCompositePodGroupGangSchedulingPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadCompositePodGroupSchedulingConstraints) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.WorkloadCompositePodGroupSchedulingConstraints" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadCompositePodGroupSchedulingPolicy) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.WorkloadCompositePodGroupSchedulingPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadCompositePodGroupSingleDisruptionMode) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.WorkloadCompositePodGroupSingleDisruptionMode" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadList) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.WorkloadList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadPodGroupAllDisruptionMode) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupAllDisruptionMode" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadPodGroupBasicSchedulingPolicy) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupBasicSchedulingPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadPodGroupDisruptionMode) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupDisruptionMode" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadPodGroupGangSchedulingPolicy) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupGangSchedulingPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadPodGroupResourceClaim) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupResourceClaim" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadPodGroupSchedulingConstraints) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupSchedulingConstraints" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadPodGroupSchedulingPolicy) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupSchedulingPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadPodGroupSingleDisruptionMode) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupSingleDisruptionMode" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadReference) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.WorkloadReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadSpec) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1alpha3.WorkloadSpec" +} diff --git a/vendor/k8s.io/api/scheduling/v1alpha3/zz_generated.validations.go b/vendor/k8s.io/api/scheduling/v1alpha3/zz_generated.validations.go new file mode 100644 index 0000000000..3202dbe2be --- /dev/null +++ b/vendor/k8s.io/api/scheduling/v1alpha3/zz_generated.validations.go @@ -0,0 +1,3368 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by validation-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + context "context" + + equality "k8s.io/apimachinery/pkg/api/equality" + operation "k8s.io/apimachinery/pkg/api/operation" + safe "k8s.io/apimachinery/pkg/api/safe" + validate "k8s.io/apimachinery/pkg/api/validate" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" + sets "k8s.io/apimachinery/pkg/util/sets" + field "k8s.io/apimachinery/pkg/util/validation/field" +) + +var unionMembershipFor_k8s_io_api_scheduling_v1alpha3_CompositeDisruptionMode_ = validate.NewUnionMembership(validate.NewUnionMember("single"), validate.NewUnionMember("all")) + +// Validate_CompositeDisruptionMode validates an instance of CompositeDisruptionMode according +// to declarative validation rules in the API schema. +func Validate_CompositeDisruptionMode( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *CompositeDisruptionMode) (errs field.ErrorList) { + + if e := validate.Union(ctx, op, fldPath, obj, oldObj, unionMembershipFor_k8s_io_api_scheduling_v1alpha3_CompositeDisruptionMode_, + func(obj *CompositeDisruptionMode) bool { + if obj == nil { + return false + } + return obj.Single != nil + }, + func(obj *CompositeDisruptionMode) bool { + if obj == nil { + return false + } + return obj.All != nil + }); len(e) != 0 { + errs = append(errs, e...) + } + + { // field CompositeDisruptionMode.Single + fn := func( + fldPath *field.Path, + obj, oldObj *SingleCompositeDisruptionMode, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositeDisruptionMode) *SingleCompositeDisruptionMode { + return oldObj.Single + }) + errs = append(errs, fn(fldPath.Child("single"), obj.Single, oldVal, oldObj != nil)...) + } + + { // field CompositeDisruptionMode.All + fn := func( + fldPath *field.Path, + obj, oldObj *AllCompositeDisruptionMode, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositeDisruptionMode) *AllCompositeDisruptionMode { + return oldObj.All + }) + errs = append(errs, fn(fldPath.Child("all"), obj.All, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_CompositeGangSchedulingPolicy validates an instance of CompositeGangSchedulingPolicy according +// to declarative validation rules in the API schema. +func Validate_CompositeGangSchedulingPolicy( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *CompositeGangSchedulingPolicy) (errs field.ErrorList) { + + { // field CompositeGangSchedulingPolicy.MinGroupCount + fn := func( + fldPath *field.Path, + obj, oldObj *int32, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.Minimum(ctx, op, fldPath, obj, oldObj, 1); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositeGangSchedulingPolicy) *int32 { + return &oldObj.MinGroupCount + }) + errs = append(errs, fn(fldPath.Child("minGroupCount"), &obj.MinGroupCount, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_CompositePodGroup validates an instance of CompositePodGroup according +// to declarative validation rules in the API schema. +func Validate_CompositePodGroup( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *CompositePodGroup) (errs field.ErrorList) { + + // field CompositePodGroup.TypeMeta has no validation + + { // field CompositePodGroup.ObjectMeta + fn := func( + fldPath *field.Path, + obj, oldObj *v1.ObjectMeta, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call the type's validation function + errs = append(errs, validation.Validate_ObjectMeta(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroup) *v1.ObjectMeta { + return &oldObj.ObjectMeta + }) + errs = append(errs, fn(fldPath.Child("metadata"), &obj.ObjectMeta, oldVal, oldObj != nil)...) + } + + { // field CompositePodGroup.Spec + fn := func( + fldPath *field.Path, + obj, oldObj *CompositePodGroupSpec, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call the type's validation function + errs = append(errs, Validate_CompositePodGroupSpec(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroup) *CompositePodGroupSpec { + return &oldObj.Spec + }) + errs = append(errs, fn(fldPath.Child("spec"), &obj.Spec, oldVal, oldObj != nil)...) + } + + { // field CompositePodGroup.Status + fn := func( + fldPath *field.Path, + obj, oldObj *CompositePodGroupStatus, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call the type's validation function + errs = append(errs, Validate_CompositePodGroupStatus(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroup) *CompositePodGroupStatus { + return &oldObj.Status + }) + errs = append(errs, fn(fldPath.Child("status"), &obj.Status, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_CompositePodGroupSchedulingConstraints validates an instance of CompositePodGroupSchedulingConstraints according +// to declarative validation rules in the API schema. +func Validate_CompositePodGroupSchedulingConstraints( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *CompositePodGroupSchedulingConstraints) (errs field.ErrorList) { + + { // field CompositePodGroupSchedulingConstraints.Topology + fn := func( + fldPath *field.Path, + obj, oldObj []TopologyConstraint, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 1).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_TopologyConstraint); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupSchedulingConstraints) []TopologyConstraint { + return oldObj.Topology + }) + errs = append(errs, fn(fldPath.Child("topology"), obj.Topology, oldVal, oldObj != nil)...) + } + + return errs +} + +var unionMembershipFor_k8s_io_api_scheduling_v1alpha3_CompositePodGroupSchedulingPolicy_ = validate.NewUnionMembership(validate.NewUnionMember("basic"), validate.NewUnionMember("gang")) + +// Validate_CompositePodGroupSchedulingPolicy validates an instance of CompositePodGroupSchedulingPolicy according +// to declarative validation rules in the API schema. +func Validate_CompositePodGroupSchedulingPolicy( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *CompositePodGroupSchedulingPolicy) (errs field.ErrorList) { + + if e := validate.Union(ctx, op, fldPath, obj, oldObj, unionMembershipFor_k8s_io_api_scheduling_v1alpha3_CompositePodGroupSchedulingPolicy_, + func(obj *CompositePodGroupSchedulingPolicy) bool { + if obj == nil { + return false + } + return obj.Basic != nil + }, + func(obj *CompositePodGroupSchedulingPolicy) bool { + if obj == nil { + return false + } + return obj.Gang != nil + }); len(e) != 0 { + errs = append(errs, e...) + } + + { // field CompositePodGroupSchedulingPolicy.Basic + fn := func( + fldPath *field.Path, + obj, oldObj *CompositeBasicSchedulingPolicy, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupSchedulingPolicy) *CompositeBasicSchedulingPolicy { + return oldObj.Basic + }) + errs = append(errs, fn(fldPath.Child("basic"), obj.Basic, oldVal, oldObj != nil)...) + } + + { // field CompositePodGroupSchedulingPolicy.Gang + fn := func( + fldPath *field.Path, + obj, oldObj *CompositeGangSchedulingPolicy, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.UpdatePointer(ctx, op, fldPath, obj, oldObj, validate.NoSet, validate.NoUnset).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_CompositeGangSchedulingPolicy(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupSchedulingPolicy) *CompositeGangSchedulingPolicy { + return oldObj.Gang + }) + errs = append(errs, fn(fldPath.Child("gang"), obj.Gang, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_CompositePodGroupSpec validates an instance of CompositePodGroupSpec according +// to declarative validation rules in the API schema. +func Validate_CompositePodGroupSpec( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *CompositePodGroupSpec) (errs field.ErrorList) { + + { // field CompositePodGroupSpec.ParentCompositePodGroupName + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.LongName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupSpec) *string { + return oldObj.ParentCompositePodGroupName + }) + errs = append(errs, fn(fldPath.Child("parentCompositePodGroupName"), obj.ParentCompositePodGroupName, oldVal, oldObj != nil)...) + } + + { // field CompositePodGroupSpec.WorkloadRef + fn := func( + fldPath *field.Path, + obj, oldObj *WorkloadReference, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.RequiredPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_WorkloadReference(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupSpec) *WorkloadReference { + return oldObj.WorkloadRef + }) + errs = append(errs, fn(fldPath.Child("workloadRef"), obj.WorkloadRef, oldVal, oldObj != nil)...) + } + + { // field CompositePodGroupSpec.SchedulingPolicy + fn := func( + fldPath *field.Path, + obj, oldObj *CompositePodGroupSchedulingPolicy, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_CompositePodGroupSchedulingPolicy(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupSpec) *CompositePodGroupSchedulingPolicy { + return &oldObj.SchedulingPolicy + }) + errs = append(errs, fn(fldPath.Child("schedulingPolicy"), &obj.SchedulingPolicy, oldVal, oldObj != nil)...) + } + + { // field CompositePodGroupSpec.SchedulingConstraints + fn := func( + fldPath *field.Path, + obj, oldObj *CompositePodGroupSchedulingConstraints, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_CompositePodGroupSchedulingConstraints(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupSpec) *CompositePodGroupSchedulingConstraints { + return oldObj.SchedulingConstraints + }) + errs = append(errs, fn(fldPath.Child("schedulingConstraints"), obj.SchedulingConstraints, oldVal, oldObj != nil)...) + } + + { // field CompositePodGroupSpec.DisruptionMode + fn := func( + fldPath *field.Path, + obj, oldObj *CompositeDisruptionMode, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + // optional fields with default values are effectively required + if e := validate.RequiredPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_CompositeDisruptionMode(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupSpec) *CompositeDisruptionMode { + return oldObj.DisruptionMode + }) + errs = append(errs, fn(fldPath.Child("disruptionMode"), obj.DisruptionMode, oldVal, oldObj != nil)...) + } + + { // field CompositePodGroupSpec.PriorityClassName + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.LongName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupSpec) *string { + return &oldObj.PriorityClassName + }) + errs = append(errs, fn(fldPath.Child("priorityClassName"), &obj.PriorityClassName, oldVal, oldObj != nil)...) + } + + { // field CompositePodGroupSpec.Priority + fn := func( + fldPath *field.Path, + obj, oldObj *int32, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.Maximum(ctx, op, fldPath, obj, oldObj, 1000000000); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupSpec) *int32 { + return oldObj.Priority + }) + errs = append(errs, fn(fldPath.Child("priority"), obj.Priority, oldVal, oldObj != nil)...) + } + + { // field CompositePodGroupSpec.PreemptionPolicy + fn := func( + fldPath *field.Path, + obj, oldObj *PreemptionPolicy, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "PodGroupPreemptionPolicy", false, validate.ForbiddenPointer).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "PodGroupPreemptionPolicy", false, validate.OptionalPointer).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "PodGroupPreemptionPolicy", true, validate.OptionalPointer).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_PreemptionPolicy(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupSpec) *PreemptionPolicy { + return oldObj.PreemptionPolicy + }) + errs = append(errs, fn(fldPath.Child("preemptionPolicy"), obj.PreemptionPolicy, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_CompositePodGroupStatus validates an instance of CompositePodGroupStatus according +// to declarative validation rules in the API schema. +func Validate_CompositePodGroupStatus( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *CompositePodGroupStatus) (errs field.ErrorList) { + + { // field CompositePodGroupStatus.Conditions + fn := func( + fldPath *field.Path, + obj, oldObj []v1.Condition, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with map semantics require unique keys + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, + func(a *v1.Condition, b *v1.Condition) bool { return a.Type == b.Type }).MarkAlpha(); len(e) != 0 { + errs = append(errs, e...) + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, + func(a *v1.Condition, b *v1.Condition) bool { return a.Type == b.Type }, validate.SemanticDeepEqual, validation.Validate_Condition); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupStatus) []v1.Condition { + return oldObj.Conditions + }) + errs = append(errs, fn(fldPath.Child("conditions"), obj.Conditions, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_CompositePodGroupTemplate validates an instance of CompositePodGroupTemplate according +// to declarative validation rules in the API schema. +func Validate_CompositePodGroupTemplate( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *CompositePodGroupTemplate) (errs field.ErrorList) { + + { // field CompositePodGroupTemplate.Name + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.ShortName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupTemplate) *string { + return &oldObj.Name + }) + errs = append(errs, fn(fldPath.Child("name"), &obj.Name, oldVal, oldObj != nil)...) + } + + { // field CompositePodGroupTemplate.SchedulingPolicy + fn := func( + fldPath *field.Path, + obj, oldObj *CompositePodGroupSchedulingPolicy, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call the type's validation function + errs = append(errs, Validate_CompositePodGroupSchedulingPolicy(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupTemplate) *CompositePodGroupSchedulingPolicy { + return &oldObj.SchedulingPolicy + }) + errs = append(errs, fn(fldPath.Child("schedulingPolicy"), &obj.SchedulingPolicy, oldVal, oldObj != nil)...) + } + + { // field CompositePodGroupTemplate.SchedulingConstraints + fn := func( + fldPath *field.Path, + obj, oldObj *CompositePodGroupSchedulingConstraints, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_CompositePodGroupSchedulingConstraints(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupTemplate) *CompositePodGroupSchedulingConstraints { + return oldObj.SchedulingConstraints + }) + errs = append(errs, fn(fldPath.Child("schedulingConstraints"), obj.SchedulingConstraints, oldVal, oldObj != nil)...) + } + + { // field CompositePodGroupTemplate.DisruptionMode + fn := func( + fldPath *field.Path, + obj, oldObj *CompositeDisruptionMode, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_CompositeDisruptionMode(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupTemplate) *CompositeDisruptionMode { + return oldObj.DisruptionMode + }) + errs = append(errs, fn(fldPath.Child("disruptionMode"), obj.DisruptionMode, oldVal, oldObj != nil)...) + } + + { // field CompositePodGroupTemplate.PriorityClassName + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.LongName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupTemplate) *string { + return &oldObj.PriorityClassName + }) + errs = append(errs, fn(fldPath.Child("priorityClassName"), &obj.PriorityClassName, oldVal, oldObj != nil)...) + } + + { // field CompositePodGroupTemplate.Priority + fn := func( + fldPath *field.Path, + obj, oldObj *int32, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.Maximum(ctx, op, fldPath, obj, oldObj, 1000000000); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupTemplate) *int32 { + return oldObj.Priority + }) + errs = append(errs, fn(fldPath.Child("priority"), obj.Priority, oldVal, oldObj != nil)...) + } + + { // field CompositePodGroupTemplate.PreemptionPolicy + fn := func( + fldPath *field.Path, + obj, oldObj *PreemptionPolicy, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "PodGroupPreemptionPolicy", false, validate.ForbiddenPointer).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "PodGroupPreemptionPolicy", false, validate.OptionalPointer).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "PodGroupPreemptionPolicy", true, validate.OptionalPointer).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_PreemptionPolicy(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupTemplate) *PreemptionPolicy { + return oldObj.PreemptionPolicy + }) + errs = append(errs, fn(fldPath.Child("preemptionPolicy"), obj.PreemptionPolicy, oldVal, oldObj != nil)...) + } + + { // field CompositePodGroupTemplate.PodGroupTemplates + fn := func( + fldPath *field.Path, + obj, oldObj []PodGroupTemplate, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.ValSliceUpdate(ctx, op, fldPath, obj, oldObj, + func(a *PodGroupTemplate, b *PodGroupTemplate) bool { return a.Name == b.Name }, validate.NoAddItem, validate.NoRemoveItem).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with map semantics require unique keys + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, + func(a *PodGroupTemplate, b *PodGroupTemplate) bool { return a.Name == b.Name }); len(e) != 0 { + errs = append(errs, e...) + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, + func(a *PodGroupTemplate, b *PodGroupTemplate) bool { return a.Name == b.Name }, validate.SemanticDeepEqual, Validate_PodGroupTemplate); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupTemplate) []PodGroupTemplate { + return oldObj.PodGroupTemplates + }) + errs = append(errs, fn(fldPath.Child("podGroupTemplates"), obj.PodGroupTemplates, oldVal, oldObj != nil)...) + } + + { // field CompositePodGroupTemplate.CompositePodGroupTemplates + fn := func( + fldPath *field.Path, + obj, oldObj []CompositePodGroupTemplate, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.ValSliceUpdate(ctx, op, fldPath, obj, oldObj, + func(a *CompositePodGroupTemplate, b *CompositePodGroupTemplate) bool { return a.Name == b.Name }, validate.NoAddItem, validate.NoRemoveItem).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with map semantics require unique keys + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, + func(a *CompositePodGroupTemplate, b *CompositePodGroupTemplate) bool { return a.Name == b.Name }); len(e) != 0 { + errs = append(errs, e...) + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, + func(a *CompositePodGroupTemplate, b *CompositePodGroupTemplate) bool { return a.Name == b.Name }, validate.SemanticDeepEqual, Validate_CompositePodGroupTemplate); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *CompositePodGroupTemplate) []CompositePodGroupTemplate { + return oldObj.CompositePodGroupTemplates + }) + errs = append(errs, fn(fldPath.Child("compositePodGroupTemplates"), obj.CompositePodGroupTemplates, oldVal, oldObj != nil)...) + } + + return errs +} + +var unionMembershipFor_k8s_io_api_scheduling_v1alpha3_DisruptionMode_ = validate.NewUnionMembership(validate.NewUnionMember("single"), validate.NewUnionMember("all")) + +// Validate_DisruptionMode validates an instance of DisruptionMode according +// to declarative validation rules in the API schema. +func Validate_DisruptionMode( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *DisruptionMode) (errs field.ErrorList) { + + if e := validate.Union(ctx, op, fldPath, obj, oldObj, unionMembershipFor_k8s_io_api_scheduling_v1alpha3_DisruptionMode_, + func(obj *DisruptionMode) bool { + if obj == nil { + return false + } + return obj.Single != nil + }, + func(obj *DisruptionMode) bool { + if obj == nil { + return false + } + return obj.All != nil + }); len(e) != 0 { + errs = append(errs, e...) + } + + { // field DisruptionMode.Single + fn := func( + fldPath *field.Path, + obj, oldObj *SingleDisruptionMode, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DisruptionMode) *SingleDisruptionMode { + return oldObj.Single + }) + errs = append(errs, fn(fldPath.Child("single"), obj.Single, oldVal, oldObj != nil)...) + } + + { // field DisruptionMode.All + fn := func( + fldPath *field.Path, + obj, oldObj *AllDisruptionMode, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *DisruptionMode) *AllDisruptionMode { + return oldObj.All + }) + errs = append(errs, fn(fldPath.Child("all"), obj.All, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_GangSchedulingPolicy validates an instance of GangSchedulingPolicy according +// to declarative validation rules in the API schema. +func Validate_GangSchedulingPolicy( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *GangSchedulingPolicy) (errs field.ErrorList) { + + { // field GangSchedulingPolicy.MinCount + fn := func( + fldPath *field.Path, + obj, oldObj *int32, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.Minimum(ctx, op, fldPath, obj, oldObj, 1); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *GangSchedulingPolicy) *int32 { + return &oldObj.MinCount + }) + errs = append(errs, fn(fldPath.Child("minCount"), &obj.MinCount, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_PodGroup validates an instance of PodGroup according +// to declarative validation rules in the API schema. +func Validate_PodGroup( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *PodGroup) (errs field.ErrorList) { + + // field PodGroup.TypeMeta has no validation + + { // field PodGroup.ObjectMeta + fn := func( + fldPath *field.Path, + obj, oldObj *v1.ObjectMeta, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call the type's validation function + errs = append(errs, validation.Validate_ObjectMeta(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroup) *v1.ObjectMeta { + return &oldObj.ObjectMeta + }) + errs = append(errs, fn(fldPath.Child("metadata"), &obj.ObjectMeta, oldVal, oldObj != nil)...) + } + + { // field PodGroup.Spec + fn := func( + fldPath *field.Path, + obj, oldObj *PodGroupSpec, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call the type's validation function + errs = append(errs, Validate_PodGroupSpec(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroup) *PodGroupSpec { + return &oldObj.Spec + }) + errs = append(errs, fn(fldPath.Child("spec"), &obj.Spec, oldVal, oldObj != nil)...) + } + + { // field PodGroup.Status + fn := func( + fldPath *field.Path, + obj, oldObj *PodGroupStatus, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call the type's validation function + errs = append(errs, Validate_PodGroupStatus(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroup) *PodGroupStatus { + return &oldObj.Status + }) + errs = append(errs, fn(fldPath.Child("status"), &obj.Status, oldVal, oldObj != nil)...) + } + + return errs +} + +var unionMembershipFor_k8s_io_api_scheduling_v1alpha3_PodGroupResourceClaim_ = validate.NewUnionMembership(validate.NewUnionMember("resourceClaimName"), validate.NewUnionMember("resourceClaimTemplateName")) + +// Validate_PodGroupResourceClaim validates an instance of PodGroupResourceClaim according +// to declarative validation rules in the API schema. +func Validate_PodGroupResourceClaim( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *PodGroupResourceClaim) (errs field.ErrorList) { + + if e := validate.Union(ctx, op, fldPath, obj, oldObj, unionMembershipFor_k8s_io_api_scheduling_v1alpha3_PodGroupResourceClaim_, + func(obj *PodGroupResourceClaim) bool { + if obj == nil { + return false + } + return obj.ResourceClaimName != nil + }, + func(obj *PodGroupResourceClaim) bool { + if obj == nil { + return false + } + return obj.ResourceClaimTemplateName != nil + }); len(e) != 0 { + errs = append(errs, e...) + } + + { // field PodGroupResourceClaim.Name + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.ShortName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupResourceClaim) *string { + return &oldObj.Name + }) + errs = append(errs, fn(fldPath.Child("name"), &obj.Name, oldVal, oldObj != nil)...) + } + + { // field PodGroupResourceClaim.ResourceClaimName + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.LongName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupResourceClaim) *string { + return oldObj.ResourceClaimName + }) + errs = append(errs, fn(fldPath.Child("resourceClaimName"), obj.ResourceClaimName, oldVal, oldObj != nil)...) + } + + { // field PodGroupResourceClaim.ResourceClaimTemplateName + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.LongName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupResourceClaim) *string { + return oldObj.ResourceClaimTemplateName + }) + errs = append(errs, fn(fldPath.Child("resourceClaimTemplateName"), obj.ResourceClaimTemplateName, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_PodGroupResourceClaimStatus validates an instance of PodGroupResourceClaimStatus according +// to declarative validation rules in the API schema. +func Validate_PodGroupResourceClaimStatus( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *PodGroupResourceClaimStatus) (errs field.ErrorList) { + + // field PodGroupResourceClaimStatus.Name has no validation + + { // field PodGroupResourceClaimStatus.ResourceClaimName + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.LongName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupResourceClaimStatus) *string { + return oldObj.ResourceClaimName + }) + errs = append(errs, fn(fldPath.Child("resourceClaimName"), obj.ResourceClaimName, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_PodGroupSchedulingConstraints validates an instance of PodGroupSchedulingConstraints according +// to declarative validation rules in the API schema. +func Validate_PodGroupSchedulingConstraints( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *PodGroupSchedulingConstraints) (errs field.ErrorList) { + + { // field PodGroupSchedulingConstraints.Topology + fn := func( + fldPath *field.Path, + obj, oldObj []TopologyConstraint, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 1).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_TopologyConstraint); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupSchedulingConstraints) []TopologyConstraint { + return oldObj.Topology + }) + errs = append(errs, fn(fldPath.Child("topology"), obj.Topology, oldVal, oldObj != nil)...) + } + + return errs +} + +var unionMembershipFor_k8s_io_api_scheduling_v1alpha3_PodGroupSchedulingPolicy_ = validate.NewUnionMembership(validate.NewUnionMember("basic"), validate.NewUnionMember("gang")) + +// Validate_PodGroupSchedulingPolicy validates an instance of PodGroupSchedulingPolicy according +// to declarative validation rules in the API schema. +func Validate_PodGroupSchedulingPolicy( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *PodGroupSchedulingPolicy) (errs field.ErrorList) { + + if e := validate.Union(ctx, op, fldPath, obj, oldObj, unionMembershipFor_k8s_io_api_scheduling_v1alpha3_PodGroupSchedulingPolicy_, + func(obj *PodGroupSchedulingPolicy) bool { + if obj == nil { + return false + } + return obj.Basic != nil + }, + func(obj *PodGroupSchedulingPolicy) bool { + if obj == nil { + return false + } + return obj.Gang != nil + }); len(e) != 0 { + errs = append(errs, e...) + } + + { // field PodGroupSchedulingPolicy.Basic + fn := func( + fldPath *field.Path, + obj, oldObj *BasicSchedulingPolicy, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupSchedulingPolicy) *BasicSchedulingPolicy { + return oldObj.Basic + }) + errs = append(errs, fn(fldPath.Child("basic"), obj.Basic, oldVal, oldObj != nil)...) + } + + { // field PodGroupSchedulingPolicy.Gang + fn := func( + fldPath *field.Path, + obj, oldObj *GangSchedulingPolicy, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.UpdatePointer(ctx, op, fldPath, obj, oldObj, validate.NoSet, validate.NoUnset).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_GangSchedulingPolicy(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupSchedulingPolicy) *GangSchedulingPolicy { + return oldObj.Gang + }) + errs = append(errs, fn(fldPath.Child("gang"), obj.Gang, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_PodGroupSpec validates an instance of PodGroupSpec according +// to declarative validation rules in the API schema. +func Validate_PodGroupSpec( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *PodGroupSpec) (errs field.ErrorList) { + + if e := validate.DependentRequired(ctx, op, fldPath, obj, oldObj, "parentCompositePodGroupName", + func(obj *PodGroupSpec) bool { + if obj == nil { + return false + } + return obj.ParentCompositePodGroupName != nil + }, "workloadRef", + func(obj *PodGroupSpec) bool { + if obj == nil { + return false + } + return obj.WorkloadRef != nil + }).MarkAlpha(); len(e) != 0 { + errs = append(errs, e...) + } + + { // field PodGroupSpec.ParentCompositePodGroupName + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "CompositePodGroup", false, validate.ForbiddenPointer).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "CompositePodGroup", false, validate.OptionalPointer).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "CompositePodGroup", true, validate.OptionalPointer).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.LongName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupSpec) *string { + return oldObj.ParentCompositePodGroupName + }) + errs = append(errs, fn(fldPath.Child("parentCompositePodGroupName"), obj.ParentCompositePodGroupName, oldVal, oldObj != nil)...) + } + + { // field PodGroupSpec.WorkloadRef + fn := func( + fldPath *field.Path, + obj, oldObj *WorkloadReference, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_WorkloadReference(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupSpec) *WorkloadReference { + return oldObj.WorkloadRef + }) + errs = append(errs, fn(fldPath.Child("workloadRef"), obj.WorkloadRef, oldVal, oldObj != nil)...) + } + + { // field PodGroupSpec.SchedulingPolicy + fn := func( + fldPath *field.Path, + obj, oldObj *PodGroupSchedulingPolicy, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call the type's validation function + errs = append(errs, Validate_PodGroupSchedulingPolicy(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupSpec) *PodGroupSchedulingPolicy { + return &oldObj.SchedulingPolicy + }) + errs = append(errs, fn(fldPath.Child("schedulingPolicy"), &obj.SchedulingPolicy, oldVal, oldObj != nil)...) + } + + { // field PodGroupSpec.SchedulingConstraints + fn := func( + fldPath *field.Path, + obj, oldObj *PodGroupSchedulingConstraints, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "TopologyAwareWorkloadScheduling", false, validate.ForbiddenPointer).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "TopologyAwareWorkloadScheduling", false, validate.OptionalPointer).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "TopologyAwareWorkloadScheduling", true, validate.OptionalPointer).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "TopologyAwareWorkloadScheduling", true, validate.Immutable).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_PodGroupSchedulingConstraints(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupSpec) *PodGroupSchedulingConstraints { + return oldObj.SchedulingConstraints + }) + errs = append(errs, fn(fldPath.Child("schedulingConstraints"), obj.SchedulingConstraints, oldVal, oldObj != nil)...) + } + + { // field PodGroupSpec.ResourceClaims + fn := func( + fldPath *field.Path, + obj, oldObj []PodGroupResourceClaim, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with map semantics require unique keys + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, + func(a *PodGroupResourceClaim, b *PodGroupResourceClaim) bool { return a.Name == b.Name }); len(e) != 0 { + errs = append(errs, e...) + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, + func(a *PodGroupResourceClaim, b *PodGroupResourceClaim) bool { return a.Name == b.Name }, validate.SemanticDeepEqual, Validate_PodGroupResourceClaim); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupSpec) []PodGroupResourceClaim { + return oldObj.ResourceClaims + }) + errs = append(errs, fn(fldPath.Child("resourceClaims"), obj.ResourceClaims, oldVal, oldObj != nil)...) + } + + { // field PodGroupSpec.DisruptionMode + fn := func( + fldPath *field.Path, + obj, oldObj *DisruptionMode, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + // optional fields with default values are effectively required + if e := validate.RequiredPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_DisruptionMode(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupSpec) *DisruptionMode { + return oldObj.DisruptionMode + }) + errs = append(errs, fn(fldPath.Child("disruptionMode"), obj.DisruptionMode, oldVal, oldObj != nil)...) + } + + { // field PodGroupSpec.PriorityClassName + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.LongName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupSpec) *string { + return &oldObj.PriorityClassName + }) + errs = append(errs, fn(fldPath.Child("priorityClassName"), &obj.PriorityClassName, oldVal, oldObj != nil)...) + } + + { // field PodGroupSpec.Priority + fn := func( + fldPath *field.Path, + obj, oldObj *int32, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.Maximum(ctx, op, fldPath, obj, oldObj, 1000000000); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupSpec) *int32 { + return oldObj.Priority + }) + errs = append(errs, fn(fldPath.Child("priority"), obj.Priority, oldVal, oldObj != nil)...) + } + + { // field PodGroupSpec.PreemptionPolicy + fn := func( + fldPath *field.Path, + obj, oldObj *PreemptionPolicy, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "PodGroupPreemptionPolicy", false, validate.ForbiddenPointer).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "PodGroupPreemptionPolicy", false, validate.OptionalPointer).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "PodGroupPreemptionPolicy", true, validate.OptionalPointer).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_PreemptionPolicy(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupSpec) *PreemptionPolicy { + return oldObj.PreemptionPolicy + }) + errs = append(errs, fn(fldPath.Child("preemptionPolicy"), obj.PreemptionPolicy, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_PodGroupStatus validates an instance of PodGroupStatus according +// to declarative validation rules in the API schema. +func Validate_PodGroupStatus( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *PodGroupStatus) (errs field.ErrorList) { + + { // field PodGroupStatus.Conditions + fn := func( + fldPath *field.Path, + obj, oldObj []v1.Condition, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with map semantics require unique keys + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, + func(a *v1.Condition, b *v1.Condition) bool { return a.Type == b.Type }).MarkAlpha(); len(e) != 0 { + errs = append(errs, e...) + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, + func(a *v1.Condition, b *v1.Condition) bool { return a.Type == b.Type }, validate.SemanticDeepEqual, validation.Validate_Condition); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupStatus) []v1.Condition { + return oldObj.Conditions + }) + errs = append(errs, fn(fldPath.Child("conditions"), obj.Conditions, oldVal, oldObj != nil)...) + } + + { // field PodGroupStatus.ResourceClaimStatuses + fn := func( + fldPath *field.Path, + obj, oldObj []PodGroupResourceClaimStatus, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with map semantics require unique keys + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, + func(a *PodGroupResourceClaimStatus, b *PodGroupResourceClaimStatus) bool { return a.Name == b.Name }); len(e) != 0 { + errs = append(errs, e...) + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, + func(a *PodGroupResourceClaimStatus, b *PodGroupResourceClaimStatus) bool { return a.Name == b.Name }, validate.SemanticDeepEqual, Validate_PodGroupResourceClaimStatus); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupStatus) []PodGroupResourceClaimStatus { + return oldObj.ResourceClaimStatuses + }) + errs = append(errs, fn(fldPath.Child("resourceClaimStatuses"), obj.ResourceClaimStatuses, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_PodGroupTemplate validates an instance of PodGroupTemplate according +// to declarative validation rules in the API schema. +func Validate_PodGroupTemplate( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *PodGroupTemplate) (errs field.ErrorList) { + + { // field PodGroupTemplate.Name + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.ShortName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupTemplate) *string { + return &oldObj.Name + }) + errs = append(errs, fn(fldPath.Child("name"), &obj.Name, oldVal, oldObj != nil)...) + } + + { // field PodGroupTemplate.SchedulingPolicy + fn := func( + fldPath *field.Path, + obj, oldObj *PodGroupSchedulingPolicy, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call the type's validation function + errs = append(errs, Validate_PodGroupSchedulingPolicy(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupTemplate) *PodGroupSchedulingPolicy { + return &oldObj.SchedulingPolicy + }) + errs = append(errs, fn(fldPath.Child("schedulingPolicy"), &obj.SchedulingPolicy, oldVal, oldObj != nil)...) + } + + { // field PodGroupTemplate.SchedulingConstraints + fn := func( + fldPath *field.Path, + obj, oldObj *PodGroupSchedulingConstraints, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "TopologyAwareWorkloadScheduling", false, validate.ForbiddenPointer).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "TopologyAwareWorkloadScheduling", false, validate.OptionalPointer).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "TopologyAwareWorkloadScheduling", true, validate.OptionalPointer).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_PodGroupSchedulingConstraints(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupTemplate) *PodGroupSchedulingConstraints { + return oldObj.SchedulingConstraints + }) + errs = append(errs, fn(fldPath.Child("schedulingConstraints"), obj.SchedulingConstraints, oldVal, oldObj != nil)...) + } + + { // field PodGroupTemplate.ResourceClaims + fn := func( + fldPath *field.Path, + obj, oldObj []PodGroupResourceClaim, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 4).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with map semantics require unique keys + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, + func(a *PodGroupResourceClaim, b *PodGroupResourceClaim) bool { return a.Name == b.Name }); len(e) != 0 { + errs = append(errs, e...) + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, + func(a *PodGroupResourceClaim, b *PodGroupResourceClaim) bool { return a.Name == b.Name }, validate.SemanticDeepEqual, Validate_PodGroupResourceClaim); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupTemplate) []PodGroupResourceClaim { + return oldObj.ResourceClaims + }) + errs = append(errs, fn(fldPath.Child("resourceClaims"), obj.ResourceClaims, oldVal, oldObj != nil)...) + } + + { // field PodGroupTemplate.DisruptionMode + fn := func( + fldPath *field.Path, + obj, oldObj *DisruptionMode, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_DisruptionMode(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupTemplate) *DisruptionMode { + return oldObj.DisruptionMode + }) + errs = append(errs, fn(fldPath.Child("disruptionMode"), obj.DisruptionMode, oldVal, oldObj != nil)...) + } + + { // field PodGroupTemplate.PriorityClassName + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.LongName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupTemplate) *string { + return &oldObj.PriorityClassName + }) + errs = append(errs, fn(fldPath.Child("priorityClassName"), &obj.PriorityClassName, oldVal, oldObj != nil)...) + } + + { // field PodGroupTemplate.Priority + fn := func( + fldPath *field.Path, + obj, oldObj *int32, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.Maximum(ctx, op, fldPath, obj, oldObj, 1000000000); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupTemplate) *int32 { + return oldObj.Priority + }) + errs = append(errs, fn(fldPath.Child("priority"), obj.Priority, oldVal, oldObj != nil)...) + } + + { // field PodGroupTemplate.PreemptionPolicy + fn := func( + fldPath *field.Path, + obj, oldObj *PreemptionPolicy, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "PodGroupPreemptionPolicy", false, validate.ForbiddenPointer).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "PodGroupPreemptionPolicy", false, validate.OptionalPointer).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "PodGroupPreemptionPolicy", true, validate.OptionalPointer).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_PreemptionPolicy(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *PodGroupTemplate) *PreemptionPolicy { + return oldObj.PreemptionPolicy + }) + errs = append(errs, fn(fldPath.Child("preemptionPolicy"), obj.PreemptionPolicy, oldVal, oldObj != nil)...) + } + + return errs +} + +var symbolsForPreemptionPolicy = sets.New(PreemptLowerPriority, PreemptNever) + +// Validate_PreemptionPolicy validates an instance of PreemptionPolicy according +// to declarative validation rules in the API schema. +func Validate_PreemptionPolicy( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *PreemptionPolicy) (errs field.ErrorList) { + + if e := validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForPreemptionPolicy, nil); len(e) != 0 { + errs = append(errs, e...) + } + + return errs +} + +// Validate_TopologyConstraint validates an instance of TopologyConstraint according +// to declarative validation rules in the API schema. +func Validate_TopologyConstraint( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *TopologyConstraint) (errs field.ErrorList) { + + { // field TopologyConstraint.Key + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.LabelKey(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *TopologyConstraint) *string { + return &oldObj.Key + }) + errs = append(errs, fn(fldPath.Child("key"), &obj.Key, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_TypedLocalObjectReference validates an instance of TypedLocalObjectReference according +// to declarative validation rules in the API schema. +func Validate_TypedLocalObjectReference( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *TypedLocalObjectReference) (errs field.ErrorList) { + + { // field TypedLocalObjectReference.APIGroup + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.LongName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *TypedLocalObjectReference) *string { + return &oldObj.APIGroup + }) + errs = append(errs, fn(fldPath.Child("apiGroup"), &obj.APIGroup, oldVal, oldObj != nil)...) + } + + { // field TypedLocalObjectReference.Kind + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.PathSegmentName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *TypedLocalObjectReference) *string { + return &oldObj.Kind + }) + errs = append(errs, fn(fldPath.Child("kind"), &obj.Kind, oldVal, oldObj != nil)...) + } + + { // field TypedLocalObjectReference.Name + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.PathSegmentName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *TypedLocalObjectReference) *string { + return &oldObj.Name + }) + errs = append(errs, fn(fldPath.Child("name"), &obj.Name, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_Workload validates an instance of Workload according +// to declarative validation rules in the API schema. +func Validate_Workload( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *Workload) (errs field.ErrorList) { + + // field Workload.TypeMeta has no validation + + { // field Workload.ObjectMeta + fn := func( + fldPath *field.Path, + obj, oldObj *v1.ObjectMeta, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call the type's validation function + errs = append(errs, validation.Validate_ObjectMeta(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *Workload) *v1.ObjectMeta { + return &oldObj.ObjectMeta + }) + errs = append(errs, fn(fldPath.Child("metadata"), &obj.ObjectMeta, oldVal, oldObj != nil)...) + } + + { // field Workload.Spec + fn := func( + fldPath *field.Path, + obj, oldObj *WorkloadSpec, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call the type's validation function + errs = append(errs, Validate_WorkloadSpec(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *Workload) *WorkloadSpec { + return &oldObj.Spec + }) + errs = append(errs, fn(fldPath.Child("spec"), &obj.Spec, oldVal, oldObj != nil)...) + } + + return errs +} + +var unionMembershipFor_k8s_io_api_scheduling_v1alpha3_WorkloadCompositePodGroupDisruptionMode_ = validate.NewUnionMembership(validate.NewUnionMember("single"), validate.NewUnionMember("all")) + +// Validate_WorkloadCompositePodGroupDisruptionMode validates an instance of WorkloadCompositePodGroupDisruptionMode according +// to declarative validation rules in the API schema. +func Validate_WorkloadCompositePodGroupDisruptionMode( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *WorkloadCompositePodGroupDisruptionMode) (errs field.ErrorList) { + + if e := validate.Union(ctx, op, fldPath, obj, oldObj, unionMembershipFor_k8s_io_api_scheduling_v1alpha3_WorkloadCompositePodGroupDisruptionMode_, + func(obj *WorkloadCompositePodGroupDisruptionMode) bool { + if obj == nil { + return false + } + return obj.Single != nil + }, + func(obj *WorkloadCompositePodGroupDisruptionMode) bool { + if obj == nil { + return false + } + return obj.All != nil + }); len(e) != 0 { + errs = append(errs, e...) + } + + { // field WorkloadCompositePodGroupDisruptionMode.Single + fn := func( + fldPath *field.Path, + obj, oldObj *WorkloadCompositePodGroupSingleDisruptionMode, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadCompositePodGroupDisruptionMode) *WorkloadCompositePodGroupSingleDisruptionMode { + return oldObj.Single + }) + errs = append(errs, fn(fldPath.Child("single"), obj.Single, oldVal, oldObj != nil)...) + } + + { // field WorkloadCompositePodGroupDisruptionMode.All + fn := func( + fldPath *field.Path, + obj, oldObj *WorkloadCompositePodGroupAllDisruptionMode, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadCompositePodGroupDisruptionMode) *WorkloadCompositePodGroupAllDisruptionMode { + return oldObj.All + }) + errs = append(errs, fn(fldPath.Child("all"), obj.All, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_WorkloadCompositePodGroupGangSchedulingPolicy validates an instance of WorkloadCompositePodGroupGangSchedulingPolicy according +// to declarative validation rules in the API schema. +func Validate_WorkloadCompositePodGroupGangSchedulingPolicy( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *WorkloadCompositePodGroupGangSchedulingPolicy) (errs field.ErrorList) { + + { // field WorkloadCompositePodGroupGangSchedulingPolicy.MinGroupCount + fn := func( + fldPath *field.Path, + obj, oldObj *int32, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.Minimum(ctx, op, fldPath, obj, oldObj, 1); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadCompositePodGroupGangSchedulingPolicy) *int32 { + return oldObj.MinGroupCount + }) + errs = append(errs, fn(fldPath.Child("minGroupCount"), obj.MinGroupCount, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_WorkloadCompositePodGroupSchedulingConstraints validates an instance of WorkloadCompositePodGroupSchedulingConstraints according +// to declarative validation rules in the API schema. +func Validate_WorkloadCompositePodGroupSchedulingConstraints( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *WorkloadCompositePodGroupSchedulingConstraints) (errs field.ErrorList) { + + { // field WorkloadCompositePodGroupSchedulingConstraints.Topology + fn := func( + fldPath *field.Path, + obj, oldObj []TopologyConstraint, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 1).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_TopologyConstraint); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadCompositePodGroupSchedulingConstraints) []TopologyConstraint { + return oldObj.Topology + }) + errs = append(errs, fn(fldPath.Child("topology"), obj.Topology, oldVal, oldObj != nil)...) + } + + return errs +} + +var unionMembershipFor_k8s_io_api_scheduling_v1alpha3_WorkloadCompositePodGroupSchedulingPolicy_ = validate.NewUnionMembership(validate.NewUnionMember("basic"), validate.NewUnionMember("gang")) + +// Validate_WorkloadCompositePodGroupSchedulingPolicy validates an instance of WorkloadCompositePodGroupSchedulingPolicy according +// to declarative validation rules in the API schema. +func Validate_WorkloadCompositePodGroupSchedulingPolicy( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *WorkloadCompositePodGroupSchedulingPolicy) (errs field.ErrorList) { + + if e := validate.Union(ctx, op, fldPath, obj, oldObj, unionMembershipFor_k8s_io_api_scheduling_v1alpha3_WorkloadCompositePodGroupSchedulingPolicy_, + func(obj *WorkloadCompositePodGroupSchedulingPolicy) bool { + if obj == nil { + return false + } + return obj.Basic != nil + }, + func(obj *WorkloadCompositePodGroupSchedulingPolicy) bool { + if obj == nil { + return false + } + return obj.Gang != nil + }); len(e) != 0 { + errs = append(errs, e...) + } + + { // field WorkloadCompositePodGroupSchedulingPolicy.Basic + fn := func( + fldPath *field.Path, + obj, oldObj *WorkloadCompositePodGroupBasicSchedulingPolicy, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadCompositePodGroupSchedulingPolicy) *WorkloadCompositePodGroupBasicSchedulingPolicy { + return oldObj.Basic + }) + errs = append(errs, fn(fldPath.Child("basic"), obj.Basic, oldVal, oldObj != nil)...) + } + + { // field WorkloadCompositePodGroupSchedulingPolicy.Gang + fn := func( + fldPath *field.Path, + obj, oldObj *WorkloadCompositePodGroupGangSchedulingPolicy, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_WorkloadCompositePodGroupGangSchedulingPolicy(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadCompositePodGroupSchedulingPolicy) *WorkloadCompositePodGroupGangSchedulingPolicy { + return oldObj.Gang + }) + errs = append(errs, fn(fldPath.Child("gang"), obj.Gang, oldVal, oldObj != nil)...) + } + + return errs +} + +var unionMembershipFor_k8s_io_api_scheduling_v1alpha3_WorkloadPodGroupDisruptionMode_ = validate.NewUnionMembership(validate.NewUnionMember("single"), validate.NewUnionMember("all")) + +// Validate_WorkloadPodGroupDisruptionMode validates an instance of WorkloadPodGroupDisruptionMode according +// to declarative validation rules in the API schema. +func Validate_WorkloadPodGroupDisruptionMode( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *WorkloadPodGroupDisruptionMode) (errs field.ErrorList) { + + if e := validate.Union(ctx, op, fldPath, obj, oldObj, unionMembershipFor_k8s_io_api_scheduling_v1alpha3_WorkloadPodGroupDisruptionMode_, + func(obj *WorkloadPodGroupDisruptionMode) bool { + if obj == nil { + return false + } + return obj.Single != nil + }, + func(obj *WorkloadPodGroupDisruptionMode) bool { + if obj == nil { + return false + } + return obj.All != nil + }); len(e) != 0 { + errs = append(errs, e...) + } + + { // field WorkloadPodGroupDisruptionMode.Single + fn := func( + fldPath *field.Path, + obj, oldObj *WorkloadPodGroupSingleDisruptionMode, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadPodGroupDisruptionMode) *WorkloadPodGroupSingleDisruptionMode { + return oldObj.Single + }) + errs = append(errs, fn(fldPath.Child("single"), obj.Single, oldVal, oldObj != nil)...) + } + + { // field WorkloadPodGroupDisruptionMode.All + fn := func( + fldPath *field.Path, + obj, oldObj *WorkloadPodGroupAllDisruptionMode, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadPodGroupDisruptionMode) *WorkloadPodGroupAllDisruptionMode { + return oldObj.All + }) + errs = append(errs, fn(fldPath.Child("all"), obj.All, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_WorkloadPodGroupGangSchedulingPolicy validates an instance of WorkloadPodGroupGangSchedulingPolicy according +// to declarative validation rules in the API schema. +func Validate_WorkloadPodGroupGangSchedulingPolicy( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *WorkloadPodGroupGangSchedulingPolicy) (errs field.ErrorList) { + + { // field WorkloadPodGroupGangSchedulingPolicy.MinCount + fn := func( + fldPath *field.Path, + obj, oldObj *int32, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.Minimum(ctx, op, fldPath, obj, oldObj, 1); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadPodGroupGangSchedulingPolicy) *int32 { + return oldObj.MinCount + }) + errs = append(errs, fn(fldPath.Child("minCount"), obj.MinCount, oldVal, oldObj != nil)...) + } + + return errs +} + +var unionMembershipFor_k8s_io_api_scheduling_v1alpha3_WorkloadPodGroupResourceClaim_ = validate.NewUnionMembership(validate.NewUnionMember("resourceClaimName"), validate.NewUnionMember("resourceClaimTemplateName")) + +// Validate_WorkloadPodGroupResourceClaim validates an instance of WorkloadPodGroupResourceClaim according +// to declarative validation rules in the API schema. +func Validate_WorkloadPodGroupResourceClaim( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *WorkloadPodGroupResourceClaim) (errs field.ErrorList) { + + if e := validate.Union(ctx, op, fldPath, obj, oldObj, unionMembershipFor_k8s_io_api_scheduling_v1alpha3_WorkloadPodGroupResourceClaim_, + func(obj *WorkloadPodGroupResourceClaim) bool { + if obj == nil { + return false + } + return obj.ResourceClaimName != nil + }, + func(obj *WorkloadPodGroupResourceClaim) bool { + if obj == nil { + return false + } + return obj.ResourceClaimTemplateName != nil + }); len(e) != 0 { + errs = append(errs, e...) + } + + { // field WorkloadPodGroupResourceClaim.Name + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.ShortName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadPodGroupResourceClaim) *string { + return &oldObj.Name + }) + errs = append(errs, fn(fldPath.Child("name"), &obj.Name, oldVal, oldObj != nil)...) + } + + { // field WorkloadPodGroupResourceClaim.ResourceClaimName + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.LongName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadPodGroupResourceClaim) *string { + return oldObj.ResourceClaimName + }) + errs = append(errs, fn(fldPath.Child("resourceClaimName"), obj.ResourceClaimName, oldVal, oldObj != nil)...) + } + + { // field WorkloadPodGroupResourceClaim.ResourceClaimTemplateName + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.LongName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadPodGroupResourceClaim) *string { + return oldObj.ResourceClaimTemplateName + }) + errs = append(errs, fn(fldPath.Child("resourceClaimTemplateName"), obj.ResourceClaimTemplateName, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_WorkloadPodGroupSchedulingConstraints validates an instance of WorkloadPodGroupSchedulingConstraints according +// to declarative validation rules in the API schema. +func Validate_WorkloadPodGroupSchedulingConstraints( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *WorkloadPodGroupSchedulingConstraints) (errs field.ErrorList) { + + { // field WorkloadPodGroupSchedulingConstraints.Topology + fn := func( + fldPath *field.Path, + obj, oldObj []TopologyConstraint, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 1).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_TopologyConstraint); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadPodGroupSchedulingConstraints) []TopologyConstraint { + return oldObj.Topology + }) + errs = append(errs, fn(fldPath.Child("topology"), obj.Topology, oldVal, oldObj != nil)...) + } + + return errs +} + +var unionMembershipFor_k8s_io_api_scheduling_v1alpha3_WorkloadPodGroupSchedulingPolicy_ = validate.NewUnionMembership(validate.NewUnionMember("basic"), validate.NewUnionMember("gang")) + +// Validate_WorkloadPodGroupSchedulingPolicy validates an instance of WorkloadPodGroupSchedulingPolicy according +// to declarative validation rules in the API schema. +func Validate_WorkloadPodGroupSchedulingPolicy( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *WorkloadPodGroupSchedulingPolicy) (errs field.ErrorList) { + + if e := validate.Union(ctx, op, fldPath, obj, oldObj, unionMembershipFor_k8s_io_api_scheduling_v1alpha3_WorkloadPodGroupSchedulingPolicy_, + func(obj *WorkloadPodGroupSchedulingPolicy) bool { + if obj == nil { + return false + } + return obj.Basic != nil + }, + func(obj *WorkloadPodGroupSchedulingPolicy) bool { + if obj == nil { + return false + } + return obj.Gang != nil + }); len(e) != 0 { + errs = append(errs, e...) + } + + { // field WorkloadPodGroupSchedulingPolicy.Basic + fn := func( + fldPath *field.Path, + obj, oldObj *WorkloadPodGroupBasicSchedulingPolicy, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadPodGroupSchedulingPolicy) *WorkloadPodGroupBasicSchedulingPolicy { + return oldObj.Basic + }) + errs = append(errs, fn(fldPath.Child("basic"), obj.Basic, oldVal, oldObj != nil)...) + } + + { // field WorkloadPodGroupSchedulingPolicy.Gang + fn := func( + fldPath *field.Path, + obj, oldObj *WorkloadPodGroupGangSchedulingPolicy, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_WorkloadPodGroupGangSchedulingPolicy(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadPodGroupSchedulingPolicy) *WorkloadPodGroupGangSchedulingPolicy { + return oldObj.Gang + }) + errs = append(errs, fn(fldPath.Child("gang"), obj.Gang, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_WorkloadReference validates an instance of WorkloadReference according +// to declarative validation rules in the API schema. +func Validate_WorkloadReference( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *WorkloadReference) (errs field.ErrorList) { + + { // field WorkloadReference.WorkloadName + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.LongName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadReference) *string { + return &oldObj.WorkloadName + }) + errs = append(errs, fn(fldPath.Child("workloadName"), &obj.WorkloadName, oldVal, oldObj != nil)...) + } + + { // field WorkloadReference.TemplateName + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.ShortName(ctx, op, fldPath, obj, oldObj); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadReference) *string { + return &oldObj.TemplateName + }) + errs = append(errs, fn(fldPath.Child("templateName"), &obj.TemplateName, oldVal, oldObj != nil)...) + } + + return errs +} + +var unionMembershipFor_k8s_io_api_scheduling_v1alpha3_WorkloadSpec_ = validate.NewUnionMembership(validate.NewUnionMember("podGroupTemplates"), validate.NewUnionMember("compositePodGroupTemplates")) + +// Validate_WorkloadSpec validates an instance of WorkloadSpec according +// to declarative validation rules in the API schema. +func Validate_WorkloadSpec( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *WorkloadSpec) (errs field.ErrorList) { + + if e := validate.Union(ctx, op, fldPath, obj, oldObj, unionMembershipFor_k8s_io_api_scheduling_v1alpha3_WorkloadSpec_, + func(obj *WorkloadSpec) bool { + if obj == nil { + return false + } + return len(obj.PodGroupTemplates) != 0 + }, + func(obj *WorkloadSpec) bool { + if obj == nil { + return false + } + return len(obj.CompositePodGroupTemplates) != 0 + }); len(e) != 0 { + errs = append(errs, e...) + } + + { // field WorkloadSpec.ControllerRef + fn := func( + fldPath *field.Path, + obj, oldObj *TypedLocalObjectReference, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_TypedLocalObjectReference(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadSpec) *TypedLocalObjectReference { + return oldObj.ControllerRef + }) + errs = append(errs, fn(fldPath.Child("controllerRef"), obj.ControllerRef, oldVal, oldObj != nil)...) + } + + { // field WorkloadSpec.PodGroupTemplates + fn := func( + fldPath *field.Path, + obj, oldObj []PodGroupTemplate, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.ValSliceUpdate(ctx, op, fldPath, obj, oldObj, + func(a *PodGroupTemplate, b *PodGroupTemplate) bool { return a.Name == b.Name }, validate.NoAddItem, validate.NoRemoveItem).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with map semantics require unique keys + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, + func(a *PodGroupTemplate, b *PodGroupTemplate) bool { return a.Name == b.Name }); len(e) != 0 { + errs = append(errs, e...) + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, + func(a *PodGroupTemplate, b *PodGroupTemplate) bool { return a.Name == b.Name }, validate.SemanticDeepEqual, Validate_PodGroupTemplate); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadSpec) []PodGroupTemplate { + return oldObj.PodGroupTemplates + }) + errs = append(errs, fn(fldPath.Child("podGroupTemplates"), obj.PodGroupTemplates, oldVal, oldObj != nil)...) + } + + { // field WorkloadSpec.CompositePodGroupTemplates + fn := func( + fldPath *field.Path, + obj, oldObj []CompositePodGroupTemplate, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "CompositePodGroup", false, validate.ForbiddenSlice).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "CompositePodGroup", false, validate.OptionalSlice).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.IfOption(ctx, op, fldPath, obj, oldObj, "CompositePodGroup", true, validate.OptionalSlice).MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.MaxItems(ctx, op, fldPath, obj, oldObj, 8).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if e := validate.ValSliceUpdate(ctx, op, fldPath, obj, oldObj, + func(a *CompositePodGroupTemplate, b *CompositePodGroupTemplate) bool { return a.Name == b.Name }, validate.NoAddItem, validate.NoRemoveItem).MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // lists with map semantics require unique keys + if e := validate.ValSliceUnique(ctx, op, fldPath, obj, oldObj, + func(a *CompositePodGroupTemplate, b *CompositePodGroupTemplate) bool { return a.Name == b.Name }); len(e) != 0 { + errs = append(errs, e...) + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, + func(a *CompositePodGroupTemplate, b *CompositePodGroupTemplate) bool { return a.Name == b.Name }, validate.SemanticDeepEqual, Validate_CompositePodGroupTemplate); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *WorkloadSpec) []CompositePodGroupTemplate { + return oldObj.CompositePodGroupTemplates + }) + errs = append(errs, fn(fldPath.Child("compositePodGroupTemplates"), obj.CompositePodGroupTemplates, oldVal, oldObj != nil)...) + } + + return errs +} diff --git a/vendor/k8s.io/api/scheduling/v1beta1/generated.pb.go b/vendor/k8s.io/api/scheduling/v1beta1/generated.pb.go index cd25ded408..d8572d3c01 100644 --- a/vendor/k8s.io/api/scheduling/v1beta1/generated.pb.go +++ b/vendor/k8s.io/api/scheduling/v1beta1/generated.pb.go @@ -25,17 +25,76 @@ import ( io "io" k8s_io_api_core_v1 "k8s.io/api/core/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" math_bits "math/bits" reflect "reflect" strings "strings" ) +func (m *AllCompositeDisruptionMode) Reset() { *m = AllCompositeDisruptionMode{} } + +func (m *AllDisruptionMode) Reset() { *m = AllDisruptionMode{} } + +func (m *BasicSchedulingPolicy) Reset() { *m = BasicSchedulingPolicy{} } + +func (m *CompositeBasicSchedulingPolicy) Reset() { *m = CompositeBasicSchedulingPolicy{} } + +func (m *CompositeDisruptionMode) Reset() { *m = CompositeDisruptionMode{} } + +func (m *CompositeGangSchedulingPolicy) Reset() { *m = CompositeGangSchedulingPolicy{} } + +func (m *CompositePodGroupSchedulingConstraints) Reset() { + *m = CompositePodGroupSchedulingConstraints{} +} + +func (m *CompositePodGroupSchedulingPolicy) Reset() { *m = CompositePodGroupSchedulingPolicy{} } + +func (m *CompositePodGroupTemplate) Reset() { *m = CompositePodGroupTemplate{} } + +func (m *DisruptionMode) Reset() { *m = DisruptionMode{} } + +func (m *GangSchedulingPolicy) Reset() { *m = GangSchedulingPolicy{} } + +func (m *PodGroup) Reset() { *m = PodGroup{} } + +func (m *PodGroupList) Reset() { *m = PodGroupList{} } + +func (m *PodGroupResourceClaim) Reset() { *m = PodGroupResourceClaim{} } + +func (m *PodGroupResourceClaimStatus) Reset() { *m = PodGroupResourceClaimStatus{} } + +func (m *PodGroupSchedulingConstraints) Reset() { *m = PodGroupSchedulingConstraints{} } + +func (m *PodGroupSchedulingPolicy) Reset() { *m = PodGroupSchedulingPolicy{} } + +func (m *PodGroupSpec) Reset() { *m = PodGroupSpec{} } + +func (m *PodGroupStatus) Reset() { *m = PodGroupStatus{} } + +func (m *PodGroupTemplate) Reset() { *m = PodGroupTemplate{} } + func (m *PriorityClass) Reset() { *m = PriorityClass{} } func (m *PriorityClassList) Reset() { *m = PriorityClassList{} } -func (m *PriorityClass) Marshal() (dAtA []byte, err error) { +func (m *SingleCompositeDisruptionMode) Reset() { *m = SingleCompositeDisruptionMode{} } + +func (m *SingleDisruptionMode) Reset() { *m = SingleDisruptionMode{} } + +func (m *TopologyConstraint) Reset() { *m = TopologyConstraint{} } + +func (m *TypedLocalObjectReference) Reset() { *m = TypedLocalObjectReference{} } + +func (m *Workload) Reset() { *m = Workload{} } + +func (m *WorkloadList) Reset() { *m = WorkloadList{} } + +func (m *WorkloadReference) Reset() { *m = WorkloadReference{} } + +func (m *WorkloadSpec) Reset() { *m = WorkloadSpec{} } + +func (m *AllCompositeDisruptionMode) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -45,53 +104,162 @@ func (m *PriorityClass) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PriorityClass) MarshalTo(dAtA []byte) (int, error) { +func (m *AllCompositeDisruptionMode) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PriorityClass) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AllCompositeDisruptionMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.PreemptionPolicy != nil { - i -= len(*m.PreemptionPolicy) - copy(dAtA[i:], *m.PreemptionPolicy) - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PreemptionPolicy))) - i-- - dAtA[i] = 0x2a + return len(dAtA) - i, nil +} + +func (m *AllDisruptionMode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x22 - i-- - if m.GlobalDefault { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + return dAtA[:n], nil +} + +func (m *AllDisruptionMode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AllDisruptionMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *BasicSchedulingPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - i-- - dAtA[i] = 0x18 - i = encodeVarintGenerated(dAtA, i, uint64(m.Value)) - i-- - dAtA[i] = 0x10 - { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + return dAtA[:n], nil +} + +func (m *BasicSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BasicSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *CompositeBasicSchedulingPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompositeBasicSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompositeBasicSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *CompositeDisruptionMode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompositeDisruptionMode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompositeDisruptionMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.All != nil { + { + size, err := m.All.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Single != nil { + { + size, err := m.Single.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CompositeGangSchedulingPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *CompositeGangSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompositeGangSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.MinGroupCount)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 return len(dAtA) - i, nil } -func (m *PriorityClassList) Marshal() (dAtA []byte, err error) { +func (m *CompositePodGroupSchedulingConstraints) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -101,20 +269,20 @@ func (m *PriorityClassList) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PriorityClassList) MarshalTo(dAtA []byte) (int, error) { +func (m *CompositePodGroupSchedulingConstraints) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PriorityClassList) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *CompositePodGroupSchedulingConstraints) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Topology) > 0 { + for iNdEx := len(m.Topology) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Topology[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -122,114 +290,5354 @@ func (m *PriorityClassList) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + dAtA[i] = 0xa } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { - offset -= sovGenerated(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *CompositePodGroupSchedulingPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *PriorityClass) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - n += 1 + sovGenerated(uint64(m.Value)) - n += 2 - l = len(m.Description) - n += 1 + l + sovGenerated(uint64(l)) - if m.PreemptionPolicy != nil { - l = len(*m.PreemptionPolicy) - n += 1 + l + sovGenerated(uint64(l)) - } - return n + +func (m *CompositePodGroupSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PriorityClassList) Size() (n int) { - if m == nil { - return 0 - } +func (m *CompositePodGroupSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) + if m.Gang != nil { + { + size, err := m.Gang.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } - return n + if m.Basic != nil { + { + size, err := m.Basic.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func sovGenerated(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (m *CompositePodGroupTemplate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil } -func sozGenerated(x uint64) (n int) { - return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + +func (m *CompositePodGroupTemplate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (this *PriorityClass) String() string { - if this == nil { + +func (m *CompositePodGroupTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CompositePodGroupTemplates) > 0 { + for iNdEx := len(m.CompositePodGroupTemplates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CompositePodGroupTemplates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if len(m.PodGroupTemplates) > 0 { + for iNdEx := len(m.PodGroupTemplates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PodGroupTemplates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if m.PreemptionPolicy != nil { + i -= len(*m.PreemptionPolicy) + copy(dAtA[i:], *m.PreemptionPolicy) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PreemptionPolicy))) + i-- + dAtA[i] = 0x3a + } + if m.Priority != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Priority)) + i-- + dAtA[i] = 0x30 + } + i -= len(m.PriorityClassName) + copy(dAtA[i:], m.PriorityClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PriorityClassName))) + i-- + dAtA[i] = 0x2a + if m.DisruptionMode != nil { + { + size, err := m.DisruptionMode.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.SchedulingConstraints != nil { + { + size, err := m.SchedulingConstraints.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + { + size, err := m.SchedulingPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *DisruptionMode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DisruptionMode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DisruptionMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.All != nil { + { + size, err := m.All.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Single != nil { + { + size, err := m.Single.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GangSchedulingPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GangSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GangSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.MinCount)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} + +func (m *PodGroup) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodGroup) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PodGroupList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodGroupList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodGroupList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PodGroupResourceClaim) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodGroupResourceClaim) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodGroupResourceClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ResourceClaimTemplateName != nil { + i -= len(*m.ResourceClaimTemplateName) + copy(dAtA[i:], *m.ResourceClaimTemplateName) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ResourceClaimTemplateName))) + i-- + dAtA[i] = 0x1a + } + if m.ResourceClaimName != nil { + i -= len(*m.ResourceClaimName) + copy(dAtA[i:], *m.ResourceClaimName) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ResourceClaimName))) + i-- + dAtA[i] = 0x12 + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PodGroupResourceClaimStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodGroupResourceClaimStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodGroupResourceClaimStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ResourceClaimName != nil { + i -= len(*m.ResourceClaimName) + copy(dAtA[i:], *m.ResourceClaimName) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ResourceClaimName))) + i-- + dAtA[i] = 0x12 + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PodGroupSchedulingConstraints) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodGroupSchedulingConstraints) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodGroupSchedulingConstraints) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Topology) > 0 { + for iNdEx := len(m.Topology) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Topology[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PodGroupSchedulingPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodGroupSchedulingPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodGroupSchedulingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Gang != nil { + { + size, err := m.Gang.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Basic != nil { + { + size, err := m.Basic.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PodGroupSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodGroupSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodGroupSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PreemptionPolicy != nil { + i -= len(*m.PreemptionPolicy) + copy(dAtA[i:], *m.PreemptionPolicy) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PreemptionPolicy))) + i-- + dAtA[i] = 0x4a + } + if m.Priority != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Priority)) + i-- + dAtA[i] = 0x40 + } + i -= len(m.PriorityClassName) + copy(dAtA[i:], m.PriorityClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PriorityClassName))) + i-- + dAtA[i] = 0x3a + if m.DisruptionMode != nil { + { + size, err := m.DisruptionMode.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.ResourceClaims) > 0 { + for iNdEx := len(m.ResourceClaims) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResourceClaims[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if m.SchedulingConstraints != nil { + { + size, err := m.SchedulingConstraints.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + { + size, err := m.SchedulingPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.WorkloadRef != nil { + { + size, err := m.WorkloadRef.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ParentCompositePodGroupName != nil { + i -= len(*m.ParentCompositePodGroupName) + copy(dAtA[i:], *m.ParentCompositePodGroupName) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.ParentCompositePodGroupName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PodGroupStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodGroupStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodGroupStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ResourceClaimStatuses) > 0 { + for iNdEx := len(m.ResourceClaimStatuses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResourceClaimStatuses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Conditions) > 0 { + for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PodGroupTemplate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodGroupTemplate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodGroupTemplate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PreemptionPolicy != nil { + i -= len(*m.PreemptionPolicy) + copy(dAtA[i:], *m.PreemptionPolicy) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PreemptionPolicy))) + i-- + dAtA[i] = 0x42 + } + if m.Priority != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.Priority)) + i-- + dAtA[i] = 0x38 + } + i -= len(m.PriorityClassName) + copy(dAtA[i:], m.PriorityClassName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PriorityClassName))) + i-- + dAtA[i] = 0x32 + if m.DisruptionMode != nil { + { + size, err := m.DisruptionMode.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.ResourceClaims) > 0 { + for iNdEx := len(m.ResourceClaims) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResourceClaims[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.SchedulingConstraints != nil { + { + size, err := m.SchedulingConstraints.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + { + size, err := m.SchedulingPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PriorityClass) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PriorityClass) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PriorityClass) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PreemptionPolicy != nil { + i -= len(*m.PreemptionPolicy) + copy(dAtA[i:], *m.PreemptionPolicy) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PreemptionPolicy))) + i-- + dAtA[i] = 0x2a + } + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x22 + i-- + if m.GlobalDefault { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + i = encodeVarintGenerated(dAtA, i, uint64(m.Value)) + i-- + dAtA[i] = 0x10 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PriorityClassList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PriorityClassList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PriorityClassList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *SingleCompositeDisruptionMode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SingleCompositeDisruptionMode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SingleCompositeDisruptionMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *SingleDisruptionMode) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SingleDisruptionMode) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SingleDisruptionMode) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *TopologyConstraint) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TopologyConstraint) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TopologyConstraint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *TypedLocalObjectReference) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TypedLocalObjectReference) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TypedLocalObjectReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0x12 + i -= len(m.APIGroup) + copy(dAtA[i:], m.APIGroup) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIGroup))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Workload) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Workload) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Workload) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *WorkloadList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *WorkloadReference) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadReference) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.TemplateName) + copy(dAtA[i:], m.TemplateName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.TemplateName))) + i-- + dAtA[i] = 0x12 + i -= len(m.WorkloadName) + copy(dAtA[i:], m.WorkloadName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.WorkloadName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *WorkloadSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CompositePodGroupTemplates) > 0 { + for iNdEx := len(m.CompositePodGroupTemplates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CompositePodGroupTemplates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.PodGroupTemplates) > 0 { + for iNdEx := len(m.PodGroupTemplates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PodGroupTemplates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.ControllerRef != nil { + { + size, err := m.ControllerRef.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { + offset -= sovGenerated(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AllCompositeDisruptionMode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *AllDisruptionMode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *BasicSchedulingPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *CompositeBasicSchedulingPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *CompositeDisruptionMode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Single != nil { + l = m.Single.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.All != nil { + l = m.All.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *CompositeGangSchedulingPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.MinGroupCount)) + return n +} + +func (m *CompositePodGroupSchedulingConstraints) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Topology) > 0 { + for _, e := range m.Topology { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *CompositePodGroupSchedulingPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Basic != nil { + l = m.Basic.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Gang != nil { + l = m.Gang.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *CompositePodGroupTemplate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = m.SchedulingPolicy.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.SchedulingConstraints != nil { + l = m.SchedulingConstraints.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.DisruptionMode != nil { + l = m.DisruptionMode.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.PriorityClassName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Priority != nil { + n += 1 + sovGenerated(uint64(*m.Priority)) + } + if m.PreemptionPolicy != nil { + l = len(*m.PreemptionPolicy) + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.PodGroupTemplates) > 0 { + for _, e := range m.PodGroupTemplates { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.CompositePodGroupTemplates) > 0 { + for _, e := range m.CompositePodGroupTemplates { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *DisruptionMode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Single != nil { + l = m.Single.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.All != nil { + l = m.All.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *GangSchedulingPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovGenerated(uint64(m.MinCount)) + return n +} + +func (m *PodGroup) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *PodGroupList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PodGroupResourceClaim) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if m.ResourceClaimName != nil { + l = len(*m.ResourceClaimName) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.ResourceClaimTemplateName != nil { + l = len(*m.ResourceClaimTemplateName) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PodGroupResourceClaimStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if m.ResourceClaimName != nil { + l = len(*m.ResourceClaimName) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PodGroupSchedulingConstraints) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Topology) > 0 { + for _, e := range m.Topology { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PodGroupSchedulingPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Basic != nil { + l = m.Basic.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Gang != nil { + l = m.Gang.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PodGroupSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParentCompositePodGroupName != nil { + l = len(*m.ParentCompositePodGroupName) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.WorkloadRef != nil { + l = m.WorkloadRef.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = m.SchedulingPolicy.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.SchedulingConstraints != nil { + l = m.SchedulingConstraints.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.ResourceClaims) > 0 { + for _, e := range m.ResourceClaims { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.DisruptionMode != nil { + l = m.DisruptionMode.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.PriorityClassName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Priority != nil { + n += 1 + sovGenerated(uint64(*m.Priority)) + } + if m.PreemptionPolicy != nil { + l = len(*m.PreemptionPolicy) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PodGroupStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.ResourceClaimStatuses) > 0 { + for _, e := range m.ResourceClaimStatuses { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *PodGroupTemplate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = m.SchedulingPolicy.Size() + n += 1 + l + sovGenerated(uint64(l)) + if m.SchedulingConstraints != nil { + l = m.SchedulingConstraints.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.ResourceClaims) > 0 { + for _, e := range m.ResourceClaims { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if m.DisruptionMode != nil { + l = m.DisruptionMode.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + l = len(m.PriorityClassName) + n += 1 + l + sovGenerated(uint64(l)) + if m.Priority != nil { + n += 1 + sovGenerated(uint64(*m.Priority)) + } + if m.PreemptionPolicy != nil { + l = len(*m.PreemptionPolicy) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PriorityClass) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.Value)) + n += 2 + l = len(m.Description) + n += 1 + l + sovGenerated(uint64(l)) + if m.PreemptionPolicy != nil { + l = len(*m.PreemptionPolicy) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *PriorityClassList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *SingleCompositeDisruptionMode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *SingleDisruptionMode) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *TopologyConstraint) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *TypedLocalObjectReference) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.APIGroup) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Kind) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *Workload) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *WorkloadList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *WorkloadReference) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.WorkloadName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.TemplateName) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *WorkloadSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ControllerRef != nil { + l = m.ControllerRef.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if len(m.PodGroupTemplates) > 0 { + for _, e := range m.PodGroupTemplates { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.CompositePodGroupTemplates) > 0 { + for _, e := range m.CompositePodGroupTemplates { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func sovGenerated(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenerated(x uint64) (n int) { + return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *AllCompositeDisruptionMode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AllCompositeDisruptionMode{`, + `}`, + }, "") + return s +} +func (this *AllDisruptionMode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AllDisruptionMode{`, + `}`, + }, "") + return s +} +func (this *BasicSchedulingPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BasicSchedulingPolicy{`, + `}`, + }, "") + return s +} +func (this *CompositeBasicSchedulingPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CompositeBasicSchedulingPolicy{`, + `}`, + }, "") + return s +} +func (this *CompositeDisruptionMode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CompositeDisruptionMode{`, + `Single:` + strings.Replace(this.Single.String(), "SingleCompositeDisruptionMode", "SingleCompositeDisruptionMode", 1) + `,`, + `All:` + strings.Replace(this.All.String(), "AllCompositeDisruptionMode", "AllCompositeDisruptionMode", 1) + `,`, + `}`, + }, "") + return s +} +func (this *CompositeGangSchedulingPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CompositeGangSchedulingPolicy{`, + `MinGroupCount:` + fmt.Sprintf("%v", this.MinGroupCount) + `,`, + `}`, + }, "") + return s +} +func (this *CompositePodGroupSchedulingConstraints) String() string { + if this == nil { + return "nil" + } + repeatedStringForTopology := "[]TopologyConstraint{" + for _, f := range this.Topology { + repeatedStringForTopology += strings.Replace(strings.Replace(f.String(), "TopologyConstraint", "TopologyConstraint", 1), `&`, ``, 1) + "," + } + repeatedStringForTopology += "}" + s := strings.Join([]string{`&CompositePodGroupSchedulingConstraints{`, + `Topology:` + repeatedStringForTopology + `,`, + `}`, + }, "") + return s +} +func (this *CompositePodGroupSchedulingPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CompositePodGroupSchedulingPolicy{`, + `Basic:` + strings.Replace(this.Basic.String(), "CompositeBasicSchedulingPolicy", "CompositeBasicSchedulingPolicy", 1) + `,`, + `Gang:` + strings.Replace(this.Gang.String(), "CompositeGangSchedulingPolicy", "CompositeGangSchedulingPolicy", 1) + `,`, + `}`, + }, "") + return s +} +func (this *CompositePodGroupTemplate) String() string { + if this == nil { + return "nil" + } + repeatedStringForPodGroupTemplates := "[]PodGroupTemplate{" + for _, f := range this.PodGroupTemplates { + repeatedStringForPodGroupTemplates += strings.Replace(strings.Replace(f.String(), "PodGroupTemplate", "PodGroupTemplate", 1), `&`, ``, 1) + "," + } + repeatedStringForPodGroupTemplates += "}" + repeatedStringForCompositePodGroupTemplates := "[]CompositePodGroupTemplate{" + for _, f := range this.CompositePodGroupTemplates { + repeatedStringForCompositePodGroupTemplates += strings.Replace(strings.Replace(f.String(), "CompositePodGroupTemplate", "CompositePodGroupTemplate", 1), `&`, ``, 1) + "," + } + repeatedStringForCompositePodGroupTemplates += "}" + s := strings.Join([]string{`&CompositePodGroupTemplate{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `SchedulingPolicy:` + strings.Replace(strings.Replace(this.SchedulingPolicy.String(), "CompositePodGroupSchedulingPolicy", "CompositePodGroupSchedulingPolicy", 1), `&`, ``, 1) + `,`, + `SchedulingConstraints:` + strings.Replace(this.SchedulingConstraints.String(), "CompositePodGroupSchedulingConstraints", "CompositePodGroupSchedulingConstraints", 1) + `,`, + `DisruptionMode:` + strings.Replace(this.DisruptionMode.String(), "CompositeDisruptionMode", "CompositeDisruptionMode", 1) + `,`, + `PriorityClassName:` + fmt.Sprintf("%v", this.PriorityClassName) + `,`, + `Priority:` + valueToStringGenerated(this.Priority) + `,`, + `PreemptionPolicy:` + valueToStringGenerated(this.PreemptionPolicy) + `,`, + `PodGroupTemplates:` + repeatedStringForPodGroupTemplates + `,`, + `CompositePodGroupTemplates:` + repeatedStringForCompositePodGroupTemplates + `,`, + `}`, + }, "") + return s +} +func (this *DisruptionMode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DisruptionMode{`, + `Single:` + strings.Replace(this.Single.String(), "SingleDisruptionMode", "SingleDisruptionMode", 1) + `,`, + `All:` + strings.Replace(this.All.String(), "AllDisruptionMode", "AllDisruptionMode", 1) + `,`, + `}`, + }, "") + return s +} +func (this *GangSchedulingPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&GangSchedulingPolicy{`, + `MinCount:` + fmt.Sprintf("%v", this.MinCount) + `,`, + `}`, + }, "") + return s +} +func (this *PodGroup) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodGroup{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "PodGroupSpec", "PodGroupSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "PodGroupStatus", "PodGroupStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *PodGroupList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]PodGroup{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "PodGroup", "PodGroup", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&PodGroupList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *PodGroupResourceClaim) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodGroupResourceClaim{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `ResourceClaimName:` + valueToStringGenerated(this.ResourceClaimName) + `,`, + `ResourceClaimTemplateName:` + valueToStringGenerated(this.ResourceClaimTemplateName) + `,`, + `}`, + }, "") + return s +} +func (this *PodGroupResourceClaimStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodGroupResourceClaimStatus{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `ResourceClaimName:` + valueToStringGenerated(this.ResourceClaimName) + `,`, + `}`, + }, "") + return s +} +func (this *PodGroupSchedulingConstraints) String() string { + if this == nil { + return "nil" + } + repeatedStringForTopology := "[]TopologyConstraint{" + for _, f := range this.Topology { + repeatedStringForTopology += strings.Replace(strings.Replace(f.String(), "TopologyConstraint", "TopologyConstraint", 1), `&`, ``, 1) + "," + } + repeatedStringForTopology += "}" + s := strings.Join([]string{`&PodGroupSchedulingConstraints{`, + `Topology:` + repeatedStringForTopology + `,`, + `}`, + }, "") + return s +} +func (this *PodGroupSchedulingPolicy) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodGroupSchedulingPolicy{`, + `Basic:` + strings.Replace(this.Basic.String(), "BasicSchedulingPolicy", "BasicSchedulingPolicy", 1) + `,`, + `Gang:` + strings.Replace(this.Gang.String(), "GangSchedulingPolicy", "GangSchedulingPolicy", 1) + `,`, + `}`, + }, "") + return s +} +func (this *PodGroupSpec) String() string { + if this == nil { + return "nil" + } + repeatedStringForResourceClaims := "[]PodGroupResourceClaim{" + for _, f := range this.ResourceClaims { + repeatedStringForResourceClaims += strings.Replace(strings.Replace(f.String(), "PodGroupResourceClaim", "PodGroupResourceClaim", 1), `&`, ``, 1) + "," + } + repeatedStringForResourceClaims += "}" + s := strings.Join([]string{`&PodGroupSpec{`, + `ParentCompositePodGroupName:` + valueToStringGenerated(this.ParentCompositePodGroupName) + `,`, + `WorkloadRef:` + strings.Replace(this.WorkloadRef.String(), "WorkloadReference", "WorkloadReference", 1) + `,`, + `SchedulingPolicy:` + strings.Replace(strings.Replace(this.SchedulingPolicy.String(), "PodGroupSchedulingPolicy", "PodGroupSchedulingPolicy", 1), `&`, ``, 1) + `,`, + `SchedulingConstraints:` + strings.Replace(this.SchedulingConstraints.String(), "PodGroupSchedulingConstraints", "PodGroupSchedulingConstraints", 1) + `,`, + `ResourceClaims:` + repeatedStringForResourceClaims + `,`, + `DisruptionMode:` + strings.Replace(this.DisruptionMode.String(), "DisruptionMode", "DisruptionMode", 1) + `,`, + `PriorityClassName:` + fmt.Sprintf("%v", this.PriorityClassName) + `,`, + `Priority:` + valueToStringGenerated(this.Priority) + `,`, + `PreemptionPolicy:` + valueToStringGenerated(this.PreemptionPolicy) + `,`, + `}`, + }, "") + return s +} +func (this *PodGroupStatus) String() string { + if this == nil { + return "nil" + } + repeatedStringForConditions := "[]Condition{" + for _, f := range this.Conditions { + repeatedStringForConditions += fmt.Sprintf("%v", f) + "," + } + repeatedStringForConditions += "}" + repeatedStringForResourceClaimStatuses := "[]PodGroupResourceClaimStatus{" + for _, f := range this.ResourceClaimStatuses { + repeatedStringForResourceClaimStatuses += strings.Replace(strings.Replace(f.String(), "PodGroupResourceClaimStatus", "PodGroupResourceClaimStatus", 1), `&`, ``, 1) + "," + } + repeatedStringForResourceClaimStatuses += "}" + s := strings.Join([]string{`&PodGroupStatus{`, + `Conditions:` + repeatedStringForConditions + `,`, + `ResourceClaimStatuses:` + repeatedStringForResourceClaimStatuses + `,`, + `}`, + }, "") + return s +} +func (this *PodGroupTemplate) String() string { + if this == nil { + return "nil" + } + repeatedStringForResourceClaims := "[]PodGroupResourceClaim{" + for _, f := range this.ResourceClaims { + repeatedStringForResourceClaims += strings.Replace(strings.Replace(f.String(), "PodGroupResourceClaim", "PodGroupResourceClaim", 1), `&`, ``, 1) + "," + } + repeatedStringForResourceClaims += "}" + s := strings.Join([]string{`&PodGroupTemplate{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `SchedulingPolicy:` + strings.Replace(strings.Replace(this.SchedulingPolicy.String(), "PodGroupSchedulingPolicy", "PodGroupSchedulingPolicy", 1), `&`, ``, 1) + `,`, + `SchedulingConstraints:` + strings.Replace(this.SchedulingConstraints.String(), "PodGroupSchedulingConstraints", "PodGroupSchedulingConstraints", 1) + `,`, + `ResourceClaims:` + repeatedStringForResourceClaims + `,`, + `DisruptionMode:` + strings.Replace(this.DisruptionMode.String(), "DisruptionMode", "DisruptionMode", 1) + `,`, + `PriorityClassName:` + fmt.Sprintf("%v", this.PriorityClassName) + `,`, + `Priority:` + valueToStringGenerated(this.Priority) + `,`, + `PreemptionPolicy:` + valueToStringGenerated(this.PreemptionPolicy) + `,`, + `}`, + }, "") + return s +} +func (this *PriorityClass) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PriorityClass{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `GlobalDefault:` + fmt.Sprintf("%v", this.GlobalDefault) + `,`, + `Description:` + fmt.Sprintf("%v", this.Description) + `,`, + `PreemptionPolicy:` + valueToStringGenerated(this.PreemptionPolicy) + `,`, + `}`, + }, "") + return s +} +func (this *PriorityClassList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]PriorityClass{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "PriorityClass", "PriorityClass", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&PriorityClassList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *SingleCompositeDisruptionMode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SingleCompositeDisruptionMode{`, + `}`, + }, "") + return s +} +func (this *SingleDisruptionMode) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&SingleDisruptionMode{`, + `}`, + }, "") + return s +} +func (this *TopologyConstraint) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TopologyConstraint{`, + `Key:` + fmt.Sprintf("%v", this.Key) + `,`, + `}`, + }, "") + return s +} +func (this *TypedLocalObjectReference) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TypedLocalObjectReference{`, + `APIGroup:` + fmt.Sprintf("%v", this.APIGroup) + `,`, + `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} +func (this *Workload) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Workload{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "WorkloadSpec", "WorkloadSpec", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *WorkloadList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]Workload{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "Workload", "Workload", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&WorkloadList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *WorkloadReference) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&WorkloadReference{`, + `WorkloadName:` + fmt.Sprintf("%v", this.WorkloadName) + `,`, + `TemplateName:` + fmt.Sprintf("%v", this.TemplateName) + `,`, + `}`, + }, "") + return s +} +func (this *WorkloadSpec) String() string { + if this == nil { + return "nil" + } + repeatedStringForPodGroupTemplates := "[]PodGroupTemplate{" + for _, f := range this.PodGroupTemplates { + repeatedStringForPodGroupTemplates += strings.Replace(strings.Replace(f.String(), "PodGroupTemplate", "PodGroupTemplate", 1), `&`, ``, 1) + "," + } + repeatedStringForPodGroupTemplates += "}" + repeatedStringForCompositePodGroupTemplates := "[]CompositePodGroupTemplate{" + for _, f := range this.CompositePodGroupTemplates { + repeatedStringForCompositePodGroupTemplates += strings.Replace(strings.Replace(f.String(), "CompositePodGroupTemplate", "CompositePodGroupTemplate", 1), `&`, ``, 1) + "," + } + repeatedStringForCompositePodGroupTemplates += "}" + s := strings.Join([]string{`&WorkloadSpec{`, + `ControllerRef:` + strings.Replace(this.ControllerRef.String(), "TypedLocalObjectReference", "TypedLocalObjectReference", 1) + `,`, + `PodGroupTemplates:` + repeatedStringForPodGroupTemplates + `,`, + `CompositePodGroupTemplates:` + repeatedStringForCompositePodGroupTemplates + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { return "nil" } - s := strings.Join([]string{`&PriorityClass{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `GlobalDefault:` + fmt.Sprintf("%v", this.GlobalDefault) + `,`, - `Description:` + fmt.Sprintf("%v", this.Description) + `,`, - `PreemptionPolicy:` + valueToStringGenerated(this.PreemptionPolicy) + `,`, - `}`, - }, "") - return s + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *AllCompositeDisruptionMode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AllCompositeDisruptionMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllCompositeDisruptionMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AllDisruptionMode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AllDisruptionMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllDisruptionMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BasicSchedulingPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BasicSchedulingPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BasicSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompositeBasicSchedulingPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompositeBasicSchedulingPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompositeBasicSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompositeDisruptionMode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompositeDisruptionMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompositeDisruptionMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Single", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Single == nil { + m.Single = &SingleCompositeDisruptionMode{} + } + if err := m.Single.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field All", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.All == nil { + m.All = &AllCompositeDisruptionMode{} + } + if err := m.All.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompositeGangSchedulingPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompositeGangSchedulingPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompositeGangSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinGroupCount", wireType) + } + m.MinGroupCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinGroupCount |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompositePodGroupSchedulingConstraints) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompositePodGroupSchedulingConstraints: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompositePodGroupSchedulingConstraints: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topology", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topology = append(m.Topology, TopologyConstraint{}) + if err := m.Topology[len(m.Topology)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompositePodGroupSchedulingPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompositePodGroupSchedulingPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompositePodGroupSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Basic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Basic == nil { + m.Basic = &CompositeBasicSchedulingPolicy{} + } + if err := m.Basic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gang", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Gang == nil { + m.Gang = &CompositeGangSchedulingPolicy{} + } + if err := m.Gang.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompositePodGroupTemplate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompositePodGroupTemplate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompositePodGroupTemplate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchedulingPolicy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SchedulingPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchedulingConstraints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SchedulingConstraints == nil { + m.SchedulingConstraints = &CompositePodGroupSchedulingConstraints{} + } + if err := m.SchedulingConstraints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisruptionMode", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DisruptionMode == nil { + m.DisruptionMode = &CompositeDisruptionMode{} + } + if err := m.DisruptionMode.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PriorityClassName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PriorityClassName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Priority = &v + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PreemptionPolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := PreemptionPolicy(dAtA[iNdEx:postIndex]) + m.PreemptionPolicy = &s + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PodGroupTemplates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PodGroupTemplates = append(m.PodGroupTemplates, PodGroupTemplate{}) + if err := m.PodGroupTemplates[len(m.PodGroupTemplates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompositePodGroupTemplates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CompositePodGroupTemplates = append(m.CompositePodGroupTemplates, CompositePodGroupTemplate{}) + if err := m.CompositePodGroupTemplates[len(m.CompositePodGroupTemplates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DisruptionMode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DisruptionMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DisruptionMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Single", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Single == nil { + m.Single = &SingleDisruptionMode{} + } + if err := m.Single.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field All", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.All == nil { + m.All = &AllDisruptionMode{} + } + if err := m.All.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GangSchedulingPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GangSchedulingPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GangSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinCount", wireType) + } + m.MinCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinCount |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodGroup) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodGroup: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodGroup: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodGroupList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodGroupList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodGroupList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, PodGroup{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodGroupResourceClaim) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodGroupResourceClaim: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodGroupResourceClaim: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.ResourceClaimName = &s + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimTemplateName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.ResourceClaimTemplateName = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodGroupResourceClaimStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodGroupResourceClaimStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodGroupResourceClaimStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.ResourceClaimName = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodGroupSchedulingConstraints) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodGroupSchedulingConstraints: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodGroupSchedulingConstraints: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Topology", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Topology = append(m.Topology, TopologyConstraint{}) + if err := m.Topology[len(m.Topology)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodGroupSchedulingPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodGroupSchedulingPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodGroupSchedulingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Basic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Basic == nil { + m.Basic = &BasicSchedulingPolicy{} + } + if err := m.Basic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gang", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Gang == nil { + m.Gang = &GangSchedulingPolicy{} + } + if err := m.Gang.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodGroupSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodGroupSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodGroupSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParentCompositePodGroupName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.ParentCompositePodGroupName = &s + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WorkloadRef", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.WorkloadRef == nil { + m.WorkloadRef = &WorkloadReference{} + } + if err := m.WorkloadRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchedulingPolicy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SchedulingPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchedulingConstraints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SchedulingConstraints == nil { + m.SchedulingConstraints = &PodGroupSchedulingConstraints{} + } + if err := m.SchedulingConstraints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaims", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResourceClaims = append(m.ResourceClaims, PodGroupResourceClaim{}) + if err := m.ResourceClaims[len(m.ResourceClaims)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisruptionMode", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DisruptionMode == nil { + m.DisruptionMode = &DisruptionMode{} + } + if err := m.DisruptionMode.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PriorityClassName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PriorityClassName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Priority = &v + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PreemptionPolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := PreemptionPolicy(dAtA[iNdEx:postIndex]) + m.PreemptionPolicy = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodGroupStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodGroupStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodGroupStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Conditions = append(m.Conditions, v1.Condition{}) + if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimStatuses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResourceClaimStatuses = append(m.ResourceClaimStatuses, PodGroupResourceClaimStatus{}) + if err := m.ResourceClaimStatuses[len(m.ResourceClaimStatuses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodGroupTemplate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodGroupTemplate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodGroupTemplate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchedulingPolicy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SchedulingPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchedulingConstraints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SchedulingConstraints == nil { + m.SchedulingConstraints = &PodGroupSchedulingConstraints{} + } + if err := m.SchedulingConstraints.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaims", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResourceClaims = append(m.ResourceClaims, PodGroupResourceClaim{}) + if err := m.ResourceClaims[len(m.ResourceClaims)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisruptionMode", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DisruptionMode == nil { + m.DisruptionMode = &DisruptionMode{} + } + if err := m.DisruptionMode.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PriorityClassName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PriorityClassName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Priority = &v + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PreemptionPolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := PreemptionPolicy(dAtA[iNdEx:postIndex]) + m.PreemptionPolicy = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PriorityClass) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PriorityClass: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PriorityClass: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + m.Value = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Value |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GlobalDefault", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.GlobalDefault = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PreemptionPolicy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := k8s_io_api_core_v1.PreemptionPolicy(dAtA[iNdEx:postIndex]) + m.PreemptionPolicy = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PriorityClassList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PriorityClassList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PriorityClassList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, PriorityClass{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SingleCompositeDisruptionMode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SingleCompositeDisruptionMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SingleCompositeDisruptionMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } -func (this *PriorityClassList) String() string { - if this == nil { - return "nil" +func (m *SingleDisruptionMode) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SingleDisruptionMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SingleDisruptionMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } - repeatedStringForItems := "[]PriorityClass{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "PriorityClass", "PriorityClass", 1), `&`, ``, 1) + "," + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TopologyConstraint) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TopologyConstraint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TopologyConstraint: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TypedLocalObjectReference) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TypedLocalObjectReference: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TypedLocalObjectReference: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field APIGroup", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.APIGroup = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } - repeatedStringForItems += "}" - s := strings.Join([]string{`&PriorityClassList{`, - `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `}`, - }, "") - return s -} -func valueToStringGenerated(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" + + if iNdEx > l { + return io.ErrUnexpectedEOF } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) + return nil } -func (m *PriorityClass) Unmarshal(dAtA []byte) error { +func (m *Workload) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -252,10 +5660,10 @@ func (m *PriorityClass) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PriorityClass: wiretype end group for non-group") + return fmt.Errorf("proto: Workload: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PriorityClass: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Workload: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -292,10 +5700,10 @@ func (m *PriorityClass) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) } - m.Value = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -305,16 +5713,80 @@ func (m *PriorityClass) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Value |= int32(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GlobalDefault", wireType) + if msglen < 0 { + return ErrInvalidLengthGenerated } - var v int + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -324,15 +5796,112 @@ func (m *PriorityClass) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.GlobalDefault = bool(v != 0) - case 4: + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, Workload{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadReference) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadReference: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadReference: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WorkloadName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -360,11 +5929,11 @@ func (m *PriorityClass) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Description = string(dAtA[iNdEx:postIndex]) + m.WorkloadName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PreemptionPolicy", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TemplateName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -392,8 +5961,7 @@ func (m *PriorityClass) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := k8s_io_api_core_v1.PreemptionPolicy(dAtA[iNdEx:postIndex]) - m.PreemptionPolicy = &s + m.TemplateName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -416,7 +5984,7 @@ func (m *PriorityClass) Unmarshal(dAtA []byte) error { } return nil } -func (m *PriorityClassList) Unmarshal(dAtA []byte) error { +func (m *WorkloadSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -439,15 +6007,15 @@ func (m *PriorityClassList) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PriorityClassList: wiretype end group for non-group") + return fmt.Errorf("proto: WorkloadSpec: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PriorityClassList: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WorkloadSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ControllerRef", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -474,13 +6042,16 @@ func (m *PriorityClassList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.ControllerRef == nil { + m.ControllerRef = &TypedLocalObjectReference{} + } + if err := m.ControllerRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PodGroupTemplates", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -507,8 +6078,42 @@ func (m *PriorityClassList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, PriorityClass{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.PodGroupTemplates = append(m.PodGroupTemplates, PodGroupTemplate{}) + if err := m.PodGroupTemplates[len(m.PodGroupTemplates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompositePodGroupTemplates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CompositePodGroupTemplates = append(m.CompositePodGroupTemplates, CompositePodGroupTemplate{}) + if err := m.CompositePodGroupTemplates[len(m.CompositePodGroupTemplates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/vendor/k8s.io/api/scheduling/v1beta1/generated.proto b/vendor/k8s.io/api/scheduling/v1beta1/generated.proto index 0e701be549..656841e41d 100644 --- a/vendor/k8s.io/api/scheduling/v1beta1/generated.proto +++ b/vendor/k8s.io/api/scheduling/v1beta1/generated.proto @@ -29,11 +29,651 @@ import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; // Package-wide variables from generator "generated". option go_package = "k8s.io/api/scheduling/v1beta1"; +// AllCompositeDisruptionMode means that children of a CompositePodGroup can only be +// disrupted or preempted together. +message AllCompositeDisruptionMode { +} + +// AllDisruptionMode specifies that children can only be disrupted together. +message AllDisruptionMode { +} + +// BasicSchedulingPolicy indicates that standard Kubernetes +// scheduling behavior should be used. +message BasicSchedulingPolicy { +} + +// CompositeBasicSchedulingPolicy indicates that the groups belonging to the composite group +// should be scheduled independently. +message CompositeBasicSchedulingPolicy { +} + +// CompositeDisruptionMode defines how individual entities within a composite pod group can be disrupted. +// Exactly one mode must be set. +// +// +union +message CompositeDisruptionMode { + // single specifies that children groups can be disrupted independently from each other. + // + // +optional + // +k8s:optional + // +k8s:unionMember + optional SingleCompositeDisruptionMode single = 1; + + // all specifies that all children groups can only be disrupted together. + // + // +optional + // +k8s:optional + // +k8s:unionMember + optional AllCompositeDisruptionMode all = 2; +} + +// CompositeGangSchedulingPolicy indicates that the groups belonging to the composite group +// should be scheduled using all-or-nothing semantics. +message CompositeGangSchedulingPolicy { + // minGroupCount is the minimum number of child groups that must be schedulable + // or scheduled at the same time for the scheduler to admit the entire group. + // It must be a positive integer. + // + // +required + // +k8s:required + // +k8s:minimum=1 + optional int32 minGroupCount = 1; +} + +// CompositePodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a CompositePodGroup. +message CompositePodGroupSchedulingConstraints { + // topology defines the topology constraints for the composite pod group. + // Currently only a single topology constraint can be specified. This may change in the future. + // + // +optional + // +k8s:optional + // +k8s:maxItems=1 + // +listType=atomic + // +k8s:listType=atomic + repeated TopologyConstraint topology = 1; +} + +// CompositePodGroupSchedulingPolicy defines the scheduling configuration for a CompositePodGroup. +// Exactly one policy must be set. +// +// +union +message CompositePodGroupSchedulingPolicy { + // basic specifies that the groups of this composite group should be scheduled independently. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + // +k8s:unionMember + optional CompositeBasicSchedulingPolicy basic = 1; + + // gang specifies that the groups of this composite group should be scheduled using + // all-or-nothing semantics. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:update=NoSet + // +k8s:update=NoUnset + optional CompositeGangSchedulingPolicy gang = 2; +} + +// CompositePodGroupTemplate represents a template for a CompositePodGroup with a scheduling policy. +message CompositePodGroupTemplate { + // name is a unique identifier for the CompositePodGroupTemplate within the Workload. + // It must be a DNS label. This field is required. + // + // +required + // +k8s:required + // +k8s:format=k8s-short-name + optional string name = 1; + + // schedulingPolicy defines the scheduling policy for this template. + // + // +required + optional CompositePodGroupSchedulingPolicy schedulingPolicy = 2; + + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this CompositePodGroupTemplate. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + optional CompositePodGroupSchedulingConstraints schedulingConstraints = 3; + + // disruptionMode defines the mode in which a given CompositePodGroup can be disrupted. + // One of Single, All. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + optional CompositeDisruptionMode disruptionMode = 4; + + // priorityClassName indicates the priority that should be considered when scheduling + // a composite pod group created from this template. If no priority class is specified, + // admission control can set this to the global default priority class if it exists. + // Otherwise, composite pod groups created from this template will have the priority set + // to zero. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:format=k8s-long-name + // +k8s:immutable + optional string priorityClassName = 5; + + // priority is the value of priority of composite pod groups created from this template. + // Various system components use this field to find the priority of the composite pod group. + // When Priority Admission Controller is enabled, it prevents users from setting this field. + // The admission controller populates this field from PriorityClassName. + // The higher the value, the higher the priority. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:maximum=1000000000 # HighestUserDefinablePriority + // +k8s:immutable + optional int32 priority = 6; + + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + // + // +featureGate=PodGroupPreemptionPolicy + // +optional + // +k8s:immutable + // +k8s:ifDisabled("PodGroupPreemptionPolicy")=+k8s:forbidden + // +k8s:ifEnabled("PodGroupPreemptionPolicy")=+k8s:optional + optional string preemptionPolicy = 7; + + // podGroupTemplates is the list of templates for children PodGroups. + // The maximum number of templates is 8. At least one entry in CompositePodGroupTemplates + // or PodGroupTemplates must be set. + // + // +optional + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=8 + // +k8s:update=NoAddItem + // +k8s:update=NoRemoveItem + repeated PodGroupTemplate podGroupTemplates = 8; + + // compositePodGroupTemplates is the list of templates for children CompositePodGroups. + // The maximum number of templates is 8. At least one entry in CompositePodGroupTemplates + // or PodGroupTemplates must be set. + // + // +optional + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=8 + // +k8s:update=NoAddItem + // +k8s:update=NoRemoveItem + repeated CompositePodGroupTemplate compositePodGroupTemplates = 9; +} + +// DisruptionMode defines how individual entities within a group can be disrupted. +// Exactly one mode can be set. +// +// +union +message DisruptionMode { + // single specifies that children can be disrupted independently from each other. + // + // +optional + // +k8s:optional + // +k8s:unionMember + optional SingleDisruptionMode single = 1; + + // all specifies that all children can only be disrupted together. + // + // +optional + // +k8s:optional + // +k8s:unionMember + optional AllDisruptionMode all = 2; +} + +// GangSchedulingPolicy defines the parameters for gang scheduling. +message GangSchedulingPolicy { + // minCount is the minimum number of pods that must be schedulable or scheduled + // at the same time for the scheduler to admit the entire group. + // It must be a positive integer. This field is mutable to support workload scaling. + // + // Note that the scheduler operates on an eventually consistent model. Updates + // to minCount may not be immediately reflected in scheduling decisions due to + // propagation delays. If minCount is updated while a scheduling cycle is in + // progress for that group, the new value may not take effect until the next + // cycle. Moreover, minCount is only enforced during scheduling, meaning that + // modifications to this field do not affect already-scheduled pods, applying + // only to those evaluated in future cycles. + // + // +required + // +k8s:required + // +k8s:minimum=1 + optional int32 minCount = 1; +} + +// PodGroup represents a runtime instance of pods grouped together. +// PodGroups are created by workload controllers (Job, LWS, JobSet, etc...) from +// Workload.podGroupTemplates. +// PodGroup API enablement is toggled by the GenericWorkload feature gate. +message PodGroup { + // metadata is the standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // spec defines the desired state of the PodGroup. + // + // +required + optional PodGroupSpec spec = 2; + + // status represents the current observed state of the PodGroup. + // + // +optional + optional PodGroupStatus status = 3; +} + +// PodGroupList contains a list of PodGroup resources. +message PodGroupList { + // Standard list metadata. + // + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // Items is the list of PodGroups. + repeated PodGroup items = 2; +} + +// PodGroupResourceClaim references exactly one ResourceClaim, either directly +// or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim +// for the PodGroup. +// +// It adds a name to it that uniquely identifies the ResourceClaim inside the PodGroup. +// Pods that need access to the ResourceClaim define a matching reference in its +// own Spec.ResourceClaims. The Pod's claim must match all fields of the +// PodGroup's claim exactly. +message PodGroupResourceClaim { + // name uniquely identifies this resource claim inside the PodGroup. + // This must be a DNS_LABEL. + // + // +required + // +k8s:required + // +k8s:format=k8s-short-name + optional string name = 1; + + // resourceClaimName is the name of a ResourceClaim object in the same + // namespace as this PodGroup. The ResourceClaim will be reserved for the + // PodGroup instead of its individual pods. + // + // Exactly one of ResourceClaimName and ResourceClaimTemplateName must + // be set. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:format=k8s-long-name + optional string resourceClaimName = 2; + + // resourceClaimTemplateName is the name of a ResourceClaimTemplate + // object in the same namespace as this PodGroup. + // + // The template will be used to create a new ResourceClaim, which will + // be bound to this PodGroup. When this PodGroup is deleted, the ResourceClaim + // will also be deleted. The PodGroup 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 podgroup.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. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:format=k8s-long-name + optional string resourceClaimTemplateName = 3; +} + +// PodGroupResourceClaimStatus is stored in the PodGroupStatus for each +// PodGroupResourceClaim which references a ResourceClaimTemplate. It stores the +// generated name for the corresponding ResourceClaim. +message PodGroupResourceClaimStatus { + // name uniquely identifies this resource claim inside the PodGroup. This + // must match the name of an entry in podgroup.spec.resourceClaims, which + // implies that the string must be a DNS_LABEL. + // + // +required + optional string name = 1; + + // resourceClaimName is the name of the ResourceClaim that was generated for + // the PodGroup in the namespace of the PodGroup. If this is unset, then + // generating a ResourceClaim was not necessary. The + // podgroup.spec.resourceClaims entry can be ignored in this case. + // + // +optional + // +k8s:optional + // +k8s:format=k8s-long-name + optional string resourceClaimName = 2; +} + +// PodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a PodGroup. +message PodGroupSchedulingConstraints { + // topology defines the topology constraints for the pod group. + // Currently only a single topology constraint can be specified. This may change in the future. + // + // +optional + // +k8s:optional + // +k8s:maxItems=1 + // +listType=atomic + // +k8s:listType=atomic + repeated TopologyConstraint topology = 1; +} + +// PodGroupSchedulingPolicy defines the scheduling configuration for a PodGroup. +// Exactly one policy must be set. The policy is chosen at creation time by setting either the +// Basic or Gang field. The PodGroup may not change policy after creation. +// Fields within chosen policy may be updated after creation when their individual fields allow it. +// +// +union +message PodGroupSchedulingPolicy { + // basic specifies that the pods in this group should be scheduled using + // standard Kubernetes scheduling behavior. Setting this field at group creation time + // opts this group to basic scheduling; this field cannot be changed afterward. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:immutable + optional BasicSchedulingPolicy basic = 1; + + // gang specifies that the pods in this group should be scheduled using + // all-or-nothing semantics. Setting this field at group creation time + // opts this group to gang scheduling; this field cannot be set or unset afterward. + // The minCount field within Gang scheduling policy remains mutable after group creation. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:update=NoSet + // +k8s:update=NoUnset + optional GangSchedulingPolicy gang = 2; +} + +// PodGroupSpec defines the desired state of a PodGroup. +message PodGroupSpec { + // parentCompositePodGroupName contains the name of the parent composite pod group + // within the same namespace as this pod group. + // If it's nil, then this pod group is a root of a workload's hierarchy. + // This field is used only when the CompositePodGroup feature gate is enabled. + // This field is immutable. + // + // +featureGate=CompositePodGroup + // +optional + // +k8s:ifDisabled(CompositePodGroup)=+k8s:forbidden + // +k8s:ifEnabled(CompositePodGroup)=+k8s:optional + // +k8s:immutable + // +k8s:format=k8s-long-name + // +k8s:alpha(since: "1.37")=+k8s:dependentRequired("workloadRef") + optional string parentCompositePodGroupName = 1; + + // workloadRef references an optional PodGroup template within the Workload + // object that was used to create the PodGroup. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + optional WorkloadReference workloadRef = 2; + + // schedulingPolicy defines the scheduling policy for this instance of the PodGroup. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // + // +required + optional PodGroupSchedulingPolicy schedulingPolicy = 3; + + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroup. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // This field is immutable. + // This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. + // + // +featureGate=TopologyAwareWorkloadScheduling + // +optional + // +k8s:ifDisabled(TopologyAwareWorkloadScheduling)=+k8s:forbidden + // +k8s:ifEnabled(TopologyAwareWorkloadScheduling)=+k8s:optional + // +k8s:ifEnabled(TopologyAwareWorkloadScheduling)=+k8s:immutable + optional PodGroupSchedulingConstraints schedulingConstraints = 4; + + // resourceClaims defines which ResourceClaims may be shared among Pods in + // the group. Pods consume the devices allocated to a PodGroup's claim by + // defining a claim in its own Spec.ResourceClaims that matches the + // PodGroup's claim exactly. The claim must have the same name and refer to + // the same ResourceClaim or ResourceClaimTemplate. + // + // This is a beta-level field and requires that the + // DRAWorkloadResourceClaims feature gate is enabled. + // + // This field is immutable. + // + // +optional + // +patchMergeKey=name + // +patchStrategy=merge,retainKeys + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=4 + // +k8s:immutable + // +featureGate=DRAWorkloadResourceClaims + repeated PodGroupResourceClaim resourceClaims = 5; + + // disruptionMode defines the mode in which a given PodGroup can be disrupted. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // One of Single, All. Defaults to Single if unset. + // This field is immutable. + // + // +default={"single": {}} + // +optional + // +k8s:optional + // +k8s:immutable + optional DisruptionMode disruptionMode = 6; + + // priorityClassName defines the priority that should be considered when scheduling this pod group. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // Otherwise, it is validated and resolved similarly to the PriorityClassName on PodGroupTemplate + // (i.e. if no priority class is specified, admission control can set this to the global default + // priority class if it exists. Otherwise, the pod group's priority will be zero). + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + // +k8s:format=k8s-long-name + optional string priorityClassName = 7; + + // priority is the value of priority of this pod group. Various system components + // use this field to find the priority of the pod group. When Priority Admission + // Controller is enabled, it prevents users from setting this field. The admission + // controller populates this field from PriorityClassName. + // The higher the value, the higher the priority. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + // +k8s:maximum=1000000000 # HighestUserDefinablePriority + optional int32 priority = 8; + + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. + // When Priority Admission Controller is enabled, it populates this field from PriorityClassName, + // and defaults to PreemptLowerPriority if value is unset in PriorityClass. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + // + // +featureGate=PodGroupPreemptionPolicy + // +optional + // +k8s:immutable + // +k8s:ifDisabled("PodGroupPreemptionPolicy")=+k8s:forbidden + // +k8s:ifEnabled("PodGroupPreemptionPolicy")=+k8s:optional + optional string preemptionPolicy = 9; +} + +// PodGroupStatus represents information about the status of a pod group. +message PodGroupStatus { + // conditions represent the latest observations of the PodGroup's state. + // + // Known condition types: + // - "PodGroupInitiallyScheduled": Indicates whether the scheduling requirement has been satisfied. + // Once this condition transitions to True, it serves as a terminal state and will never revert to False, + // even if pods are subsequently evicted and group constraints are no longer met. + // - "DisruptionTarget": Indicates whether the PodGroup is about to be terminated + // due to disruption such as preemption. + // + // Known reasons for the PodGroupInitiallyScheduled condition: + // - "Unschedulable": The PodGroup cannot be scheduled due to resource constraints, + // affinity/anti-affinity rules, or insufficient capacity for the gang. + // - "SchedulerError": The PodGroup cannot be scheduled due to some internal error + // that happened during scheduling, for example due to nodeAffinity parsing errors. + // + // Known reasons for the DisruptionTarget condition: + // - "PreemptionByScheduler": The PodGroup was preempted by the scheduler to make room for + // higher-priority PodGroups or Pods. + // + // +optional + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type + repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1; + + // resourceClaimStatuses is status of resource claims. + // +optional + // +patchMergeKey=name + // +patchStrategy=merge,retainKeys + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=4 + // +featureGate=DRAWorkloadResourceClaims + repeated PodGroupResourceClaimStatus resourceClaimStatuses = 2; +} + +// PodGroupTemplate represents a template for a set of pods with a scheduling policy. +message PodGroupTemplate { + // name is a unique identifier for the PodGroupTemplate within the Workload. + // It must be a DNS label. This field is immutable. + // + // +required + // +k8s:required + // +k8s:format=k8s-short-name + optional string name = 1; + + // schedulingPolicy defines the scheduling policy for this PodGroupTemplate. + // + // +required + optional PodGroupSchedulingPolicy schedulingPolicy = 2; + + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroupTemplate. + // This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. + // This field is immutable. + // + // +featureGate=TopologyAwareWorkloadScheduling + // +optional + // +k8s:ifDisabled(TopologyAwareWorkloadScheduling)=+k8s:forbidden + // +k8s:ifEnabled(TopologyAwareWorkloadScheduling)=+k8s:optional + // +k8s:immutable + optional PodGroupSchedulingConstraints schedulingConstraints = 3; + + // resourceClaims defines which ResourceClaims may be shared among Pods in + // the group. Pods consume the devices allocated to a PodGroup's claim by + // defining a claim in its own Spec.ResourceClaims that matches the + // PodGroup's claim exactly. The claim must have the same name and refer to + // the same ResourceClaim or ResourceClaimTemplate. + // + // This is a beta-level field and requires that the + // DRAWorkloadResourceClaims feature gate is enabled. + // + // This field is immutable. + // + // +optional + // +patchMergeKey=name + // +patchStrategy=merge,retainKeys + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=4 + // +featureGate=DRAWorkloadResourceClaims + // +k8s:immutable + repeated PodGroupResourceClaim resourceClaims = 4; + + // disruptionMode defines the mode in which a given PodGroup can be disrupted. + // One of Single, All. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + optional DisruptionMode disruptionMode = 5; + + // priorityClassName indicates the priority that should be considered when scheduling + // a pod group created from this template. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:format=k8s-long-name + // +k8s:immutable + optional string priorityClassName = 6; + + // priority is the value of priority of pod groups created from this template. Various + // system components use this field to find the priority of the pod group. + // The higher the value, the higher the priority. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:maximum=1000000000 # HighestUserDefinablePriority + // +k8s:immutable + optional int32 priority = 7; + + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + // + // +featureGate=PodGroupPreemptionPolicy + // +optional + // +k8s:immutable + // +k8s:ifDisabled("PodGroupPreemptionPolicy")=+k8s:forbidden + // +k8s:ifEnabled("PodGroupPreemptionPolicy")=+k8s:optional + optional string preemptionPolicy = 8; +} + // DEPRECATED - This group version of PriorityClass is deprecated by scheduling.k8s.io/v1/PriorityClass. // PriorityClass defines mapping from a priority class name to the priority // integer value. The value can be any valid integer. message PriorityClass { - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -74,3 +714,155 @@ message PriorityClassList { repeated PriorityClass items = 2; } +// SingleCompositeDisruptionMode means that individual children of a CompositePodGroup +// can be disrupted or preempted independently. +message SingleCompositeDisruptionMode { +} + +// SingleDisruptionMode specifies that children can be disrupted independently. +message SingleDisruptionMode { +} + +// TopologyConstraint defines a topology constraint for a PodGroup. +message TopologyConstraint { + // key specifies the key of the node label representing the topology domain. + // All pods within the PodGroup must be colocated within the same domain instance. + // Different PodGroups can land on different domain instances even if they derive from the same PodGroupTemplate. + // Examples: "topology.kubernetes.io/rack" + // + // +required + // +k8s:required + // +k8s:format=k8s-label-key + optional string key = 1; +} + +// TypedLocalObjectReference allows to reference typed object inside the same namespace. +message TypedLocalObjectReference { + // apiGroup is the group for the resource being referenced. + // If apiGroup is empty, the specified Kind must be in the core API group. + // For any other third-party types, setting apiGroup is required. + // It must be a DNS subdomain. + // + // +optional + // +k8s:optional + // +k8s:format=k8s-long-name + optional string apiGroup = 1; + + // kind is the type of resource being referenced. + // It must be a path segment name. + // + // +required + // +k8s:required + // +k8s:format=k8s-path-segment-name + optional string kind = 2; + + // name is the name of resource being referenced. + // It must be a path segment name. + // + // +required + // +k8s:required + // +k8s:format=k8s-path-segment-name + optional string name = 3; +} + +// Workload allows for expressing scheduling constraints that should be used +// when managing the lifecycle of workloads from the scheduling perspective, +// including scheduling, preemption, eviction and other phases. +// Workload API enablement is toggled by the GenericWorkload feature gate. +message Workload { + // metadata is the standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // spec defines the desired behavior of a Workload. + // + // +required + optional WorkloadSpec spec = 2; +} + +// WorkloadList contains a list of Workload resources. +message WorkloadList { + // metadata is the standard list metadata. + // + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // items is the list of Workloads. + repeated Workload items = 2; +} + +// WorkloadReference references the Workload object together with the template +// that was used to create a particular PodGroup. +message WorkloadReference { + // workloadName is the name of the Workload object that contains a template + // that was used when creating a pod group. It must + // be a DNS name. + // This field is required. + // + // +required + // +k8s:required + // +k8s:format=k8s-long-name + optional string workloadName = 1; + + // templateName is the name of a template within the Workload object that + // was used to create a pod group. It must be a DNS label. + // This field is required. + // + // +required + // +k8s:required + // +k8s:format=k8s-short-name + optional string templateName = 2; +} + +// WorkloadSpec defines the desired state of a Workload. +message WorkloadSpec { + // controllerRef is an optional reference to the controlling object, such as a + // Deployment or Job. This field is intended for use by tools like CLIs + // to provide a link back to the original workload definition. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + optional TypedLocalObjectReference controllerRef = 1; + + // podGroupTemplates is the list of templates that make up the Workload. + // The maximum number of templates is 8. Templates cannot be added or removed after the workload is created. + // Existing templates may still be updated where their individual fields allow it. + // Exactly one of CompositePodGroupTemplates and PodGroupTemplates must be set. + // + // +optional + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:unionMember + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=8 + // +k8s:update=NoAddItem + // +k8s:update=NoRemoveItem + repeated PodGroupTemplate podGroupTemplates = 2; + + // compositePodGroupTemplates is the list of CompositePodGroup templates that make up the Workload. + // The maximum number of templates is 8. This field is immutable. + // Exactly one of CompositePodGroupTemplates and PodGroupTemplates must be set. + // + // This field is used only when the CompositePodGroup feature gate is enabled. + // + // +featureGate=CompositePodGroup + // +optional + // +listType=map + // +listMapKey=name + // +k8s:ifDisabled("CompositePodGroup")=+k8s:forbidden + // +k8s:ifEnabled("CompositePodGroup")=+k8s:optional + // +k8s:unionMember + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=8 + // +k8s:update=NoAddItem + // +k8s:update=NoRemoveItem + repeated CompositePodGroupTemplate compositePodGroupTemplates = 3; +} + diff --git a/vendor/k8s.io/api/scheduling/v1beta1/register.go b/vendor/k8s.io/api/scheduling/v1beta1/register.go index fb26557bbb..c2e75d9071 100644 --- a/vendor/k8s.io/api/scheduling/v1beta1/register.go +++ b/vendor/k8s.io/api/scheduling/v1beta1/register.go @@ -46,6 +46,10 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &PriorityClass{}, &PriorityClassList{}, + &Workload{}, + &WorkloadList{}, + &PodGroup{}, + &PodGroupList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/vendor/k8s.io/api/scheduling/v1beta1/types.go b/vendor/k8s.io/api/scheduling/v1beta1/types.go index 8a7a2058f0..57eeac9486 100644 --- a/vendor/k8s.io/api/scheduling/v1beta1/types.go +++ b/vendor/k8s.io/api/scheduling/v1beta1/types.go @@ -33,8 +33,8 @@ import ( // PriorityClass defines mapping from a priority class name to the priority // integer value. The value can be any valid integer. type PriorityClass struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` @@ -72,7 +72,7 @@ type PriorityClass struct { // PriorityClassList is a collection of priority classes. type PriorityClassList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -81,3 +81,869 @@ type PriorityClassList struct { // items is the list of PriorityClasses Items []PriorityClass `json:"items" protobuf:"bytes,2,rep,name=items"` } + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.37 + +// Workload allows for expressing scheduling constraints that should be used +// when managing the lifecycle of workloads from the scheduling perspective, +// including scheduling, preemption, eviction and other phases. +// Workload API enablement is toggled by the GenericWorkload feature gate. +type Workload struct { + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // spec defines the desired behavior of a Workload. + // + // +required + Spec WorkloadSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.37 + +// WorkloadList contains a list of Workload resources. +type WorkloadList struct { + metav1.TypeMeta `json:""` + // metadata is the standard list metadata. + // + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // items is the list of Workloads. + Items []Workload `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +const ( + // WorkloadMaxPodGroupTemplates is the maximum number of pod group templates per Workload. + WorkloadMaxPodGroupTemplates = 8 + // WorkloadMaxTreeDepth is the maximum allowed depth for a tree of (composite) pod group templates in a Workload. + WorkloadMaxTreeDepth = 4 +) + +// WorkloadSpec defines the desired state of a Workload. +type WorkloadSpec struct { + // controllerRef is an optional reference to the controlling object, such as a + // Deployment or Job. This field is intended for use by tools like CLIs + // to provide a link back to the original workload definition. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + ControllerRef *TypedLocalObjectReference `json:"controllerRef,omitempty" protobuf:"bytes,1,opt,name=controllerRef"` + + // podGroupTemplates is the list of templates that make up the Workload. + // The maximum number of templates is 8. Templates cannot be added or removed after the workload is created. + // Existing templates may still be updated where their individual fields allow it. + // Exactly one of CompositePodGroupTemplates and PodGroupTemplates must be set. + // + // +optional + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:unionMember + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=8 + // +k8s:update=NoAddItem + // +k8s:update=NoRemoveItem + PodGroupTemplates []PodGroupTemplate `json:"podGroupTemplates" protobuf:"bytes,2,rep,name=podGroupTemplates"` + + // compositePodGroupTemplates is the list of CompositePodGroup templates that make up the Workload. + // The maximum number of templates is 8. This field is immutable. + // Exactly one of CompositePodGroupTemplates and PodGroupTemplates must be set. + // + // This field is used only when the CompositePodGroup feature gate is enabled. + // + // +featureGate=CompositePodGroup + // +optional + // +listType=map + // +listMapKey=name + // +k8s:ifDisabled("CompositePodGroup")=+k8s:forbidden + // +k8s:ifEnabled("CompositePodGroup")=+k8s:optional + // +k8s:unionMember + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=8 + // +k8s:update=NoAddItem + // +k8s:update=NoRemoveItem + CompositePodGroupTemplates []CompositePodGroupTemplate `json:"compositePodGroupTemplates,omitempty" protobuf:"bytes,3,rep,name=compositePodGroupTemplates"` +} + +// TypedLocalObjectReference allows to reference typed object inside the same namespace. +type TypedLocalObjectReference struct { + // apiGroup is the group for the resource being referenced. + // If apiGroup is empty, the specified Kind must be in the core API group. + // For any other third-party types, setting apiGroup is required. + // It must be a DNS subdomain. + // + // +optional + // +k8s:optional + // +k8s:format=k8s-long-name + APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,1,opt,name=apiGroup"` + // kind is the type of resource being referenced. + // It must be a path segment name. + // + // +required + // +k8s:required + // +k8s:format=k8s-path-segment-name + Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"` + // name is the name of resource being referenced. + // It must be a path segment name. + // + // +required + // +k8s:required + // +k8s:format=k8s-path-segment-name + Name string `json:"name" protobuf:"bytes,3,opt,name=name"` +} + +// MaxPodGroupResourceClaims is the maximum number of resource claims for a +// PodGroup or a Workload's PodGroupTemplate. +const MaxPodGroupResourceClaims = 4 + +// PodGroupTemplate represents a template for a set of pods with a scheduling policy. +type PodGroupTemplate struct { + // name is a unique identifier for the PodGroupTemplate within the Workload. + // It must be a DNS label. This field is immutable. + // + // +required + // +k8s:required + // +k8s:format=k8s-short-name + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + + // schedulingPolicy defines the scheduling policy for this PodGroupTemplate. + // + // +required + SchedulingPolicy PodGroupSchedulingPolicy `json:"schedulingPolicy" protobuf:"bytes,2,opt,name=schedulingPolicy"` + + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroupTemplate. + // This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. + // This field is immutable. + // + // +featureGate=TopologyAwareWorkloadScheduling + // +optional + // +k8s:ifDisabled(TopologyAwareWorkloadScheduling)=+k8s:forbidden + // +k8s:ifEnabled(TopologyAwareWorkloadScheduling)=+k8s:optional + // +k8s:immutable + SchedulingConstraints *PodGroupSchedulingConstraints `json:"schedulingConstraints" protobuf:"bytes,3,opt,name=schedulingConstraints"` + + // resourceClaims defines which ResourceClaims may be shared among Pods in + // the group. Pods consume the devices allocated to a PodGroup's claim by + // defining a claim in its own Spec.ResourceClaims that matches the + // PodGroup's claim exactly. The claim must have the same name and refer to + // the same ResourceClaim or ResourceClaimTemplate. + // + // This is a beta-level field and requires that the + // DRAWorkloadResourceClaims feature gate is enabled. + // + // This field is immutable. + // + // +optional + // +patchMergeKey=name + // +patchStrategy=merge,retainKeys + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=4 + // +featureGate=DRAWorkloadResourceClaims + // +k8s:immutable + ResourceClaims []PodGroupResourceClaim `json:"resourceClaims,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name" protobuf:"bytes,4,rep,name=resourceClaims"` + + // disruptionMode defines the mode in which a given PodGroup can be disrupted. + // One of Single, All. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + DisruptionMode *DisruptionMode `json:"disruptionMode,omitempty" protobuf:"bytes,5,opt,name=disruptionMode"` + + // priorityClassName indicates the priority that should be considered when scheduling + // a pod group created from this template. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:format=k8s-long-name + // +k8s:immutable + PriorityClassName string `json:"priorityClassName,omitempty" protobuf:"bytes,6,opt,name=priorityClassName"` + + // priority is the value of priority of pod groups created from this template. Various + // system components use this field to find the priority of the pod group. + // The higher the value, the higher the priority. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:maximum=1000000000 # HighestUserDefinablePriority + // +k8s:immutable + Priority *int32 `json:"priority,omitempty" protobuf:"varint,7,opt,name=priority"` + + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + // + // +featureGate=PodGroupPreemptionPolicy + // +optional + // +k8s:immutable + // +k8s:ifDisabled("PodGroupPreemptionPolicy")=+k8s:forbidden + // +k8s:ifEnabled("PodGroupPreemptionPolicy")=+k8s:optional + PreemptionPolicy *PreemptionPolicy `json:"preemptionPolicy,omitempty" protobuf:"bytes,8,opt,name=preemptionPolicy"` +} + +// CompositePodGroupTemplate represents a template for a CompositePodGroup with a scheduling policy. +type CompositePodGroupTemplate struct { + // name is a unique identifier for the CompositePodGroupTemplate within the Workload. + // It must be a DNS label. This field is required. + // + // +required + // +k8s:required + // +k8s:format=k8s-short-name + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + + // schedulingPolicy defines the scheduling policy for this template. + // + // +required + SchedulingPolicy CompositePodGroupSchedulingPolicy `json:"schedulingPolicy" protobuf:"bytes,2,opt,name=schedulingPolicy"` + + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this CompositePodGroupTemplate. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + SchedulingConstraints *CompositePodGroupSchedulingConstraints `json:"schedulingConstraints,omitempty" protobuf:"bytes,3,opt,name=schedulingConstraints"` + + // disruptionMode defines the mode in which a given CompositePodGroup can be disrupted. + // One of Single, All. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + DisruptionMode *CompositeDisruptionMode `json:"disruptionMode,omitempty" protobuf:"bytes,4,opt,name=disruptionMode"` + + // priorityClassName indicates the priority that should be considered when scheduling + // a composite pod group created from this template. If no priority class is specified, + // admission control can set this to the global default priority class if it exists. + // Otherwise, composite pod groups created from this template will have the priority set + // to zero. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:format=k8s-long-name + // +k8s:immutable + PriorityClassName string `json:"priorityClassName,omitempty" protobuf:"bytes,5,opt,name=priorityClassName"` + + // priority is the value of priority of composite pod groups created from this template. + // Various system components use this field to find the priority of the composite pod group. + // When Priority Admission Controller is enabled, it prevents users from setting this field. + // The admission controller populates this field from PriorityClassName. + // The higher the value, the higher the priority. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:maximum=1000000000 # HighestUserDefinablePriority + // +k8s:immutable + Priority *int32 `json:"priority,omitempty" protobuf:"varint,6,opt,name=priority"` + + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + // + // +featureGate=PodGroupPreemptionPolicy + // +optional + // +k8s:immutable + // +k8s:ifDisabled("PodGroupPreemptionPolicy")=+k8s:forbidden + // +k8s:ifEnabled("PodGroupPreemptionPolicy")=+k8s:optional + PreemptionPolicy *PreemptionPolicy `json:"preemptionPolicy,omitempty" protobuf:"bytes,7,opt,name=preemptionPolicy"` + + // podGroupTemplates is the list of templates for children PodGroups. + // The maximum number of templates is 8. At least one entry in CompositePodGroupTemplates + // or PodGroupTemplates must be set. + // + // +optional + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=8 + // +k8s:update=NoAddItem + // +k8s:update=NoRemoveItem + PodGroupTemplates []PodGroupTemplate `json:"podGroupTemplates,omitempty" protobuf:"bytes,8,rep,name=podGroupTemplates"` + + // compositePodGroupTemplates is the list of templates for children CompositePodGroups. + // The maximum number of templates is 8. At least one entry in CompositePodGroupTemplates + // or PodGroupTemplates must be set. + // + // +optional + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=8 + // +k8s:update=NoAddItem + // +k8s:update=NoRemoveItem + CompositePodGroupTemplates []CompositePodGroupTemplate `json:"compositePodGroupTemplates,omitempty" protobuf:"bytes,9,rep,name=compositePodGroupTemplates"` +} + +// PodGroupSchedulingPolicy defines the scheduling configuration for a PodGroup. +// Exactly one policy must be set. The policy is chosen at creation time by setting either the +// Basic or Gang field. The PodGroup may not change policy after creation. +// Fields within chosen policy may be updated after creation when their individual fields allow it. +// +// +union +type PodGroupSchedulingPolicy struct { + // basic specifies that the pods in this group should be scheduled using + // standard Kubernetes scheduling behavior. Setting this field at group creation time + // opts this group to basic scheduling; this field cannot be changed afterward. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:immutable + Basic *BasicSchedulingPolicy `json:"basic,omitempty" protobuf:"bytes,1,opt,name=basic"` + + // gang specifies that the pods in this group should be scheduled using + // all-or-nothing semantics. Setting this field at group creation time + // opts this group to gang scheduling; this field cannot be set or unset afterward. + // The minCount field within Gang scheduling policy remains mutable after group creation. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:update=NoSet + // +k8s:update=NoUnset + Gang *GangSchedulingPolicy `json:"gang,omitempty" protobuf:"bytes,2,opt,name=gang"` +} + +// BasicSchedulingPolicy indicates that standard Kubernetes +// scheduling behavior should be used. +type BasicSchedulingPolicy struct { + // This is intentionally empty. Its presence indicates that the basic + // scheduling policy should be applied. In the future, new fields may appear, + // describing such constraints on a pod group level without "all or nothing" + // (gang) scheduling. +} + +// GangSchedulingPolicy defines the parameters for gang scheduling. +type GangSchedulingPolicy struct { + // minCount is the minimum number of pods that must be schedulable or scheduled + // at the same time for the scheduler to admit the entire group. + // It must be a positive integer. This field is mutable to support workload scaling. + // + // Note that the scheduler operates on an eventually consistent model. Updates + // to minCount may not be immediately reflected in scheduling decisions due to + // propagation delays. If minCount is updated while a scheduling cycle is in + // progress for that group, the new value may not take effect until the next + // cycle. Moreover, minCount is only enforced during scheduling, meaning that + // modifications to this field do not affect already-scheduled pods, applying + // only to those evaluated in future cycles. + // + // +required + // +k8s:required + // +k8s:minimum=1 + MinCount int32 `json:"minCount" protobuf:"varint,1,opt,name=minCount"` +} + +// PodGroupResourceClaim references exactly one ResourceClaim, either directly +// or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim +// for the PodGroup. +// +// It adds a name to it that uniquely identifies the ResourceClaim inside the PodGroup. +// Pods that need access to the ResourceClaim define a matching reference in its +// own Spec.ResourceClaims. The Pod's claim must match all fields of the +// PodGroup's claim exactly. +type PodGroupResourceClaim struct { + // name uniquely identifies this resource claim inside the PodGroup. + // This must be a DNS_LABEL. + // + // +required + // +k8s:required + // +k8s:format=k8s-short-name + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + + // resourceClaimName is the name of a ResourceClaim object in the same + // namespace as this PodGroup. The ResourceClaim will be reserved for the + // PodGroup instead of its individual pods. + // + // Exactly one of ResourceClaimName and ResourceClaimTemplateName must + // be set. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:format=k8s-long-name + ResourceClaimName *string `json:"resourceClaimName,omitempty" protobuf:"bytes,2,opt,name=resourceClaimName"` + + // resourceClaimTemplateName is the name of a ResourceClaimTemplate + // object in the same namespace as this PodGroup. + // + // The template will be used to create a new ResourceClaim, which will + // be bound to this PodGroup. When this PodGroup is deleted, the ResourceClaim + // will also be deleted. The PodGroup 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 podgroup.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. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:format=k8s-long-name + ResourceClaimTemplateName *string `json:"resourceClaimTemplateName,omitempty" protobuf:"bytes,3,opt,name=resourceClaimTemplateName"` +} + +// DisruptionMode defines how individual entities within a group can be disrupted. +// Exactly one mode can be set. +// +// +union +type DisruptionMode struct { + // single specifies that children can be disrupted independently from each other. + // + // +optional + // +k8s:optional + // +k8s:unionMember + Single *SingleDisruptionMode `json:"single,omitempty" protobuf:"bytes,1,opt,name=single"` + + // all specifies that all children can only be disrupted together. + // + // +optional + // +k8s:optional + // +k8s:unionMember + All *AllDisruptionMode `json:"all,omitempty" protobuf:"bytes,2,opt,name=all"` +} + +// SingleDisruptionMode specifies that children can be disrupted independently. +type SingleDisruptionMode struct { + // Intentionally empty now. +} + +// AllDisruptionMode specifies that children can only be disrupted together. +type AllDisruptionMode struct { + // Intentionally empty now. +} + +// PreemptionPolicy describes a policy for if/when to preempt a pod. +// +enum +// +k8s:enum +type PreemptionPolicy string + +const ( + // PreemptLowerPriority means that pod can preempt other pods with lower priority. + PreemptLowerPriority PreemptionPolicy = "PreemptLowerPriority" + // PreemptNever means that pod never preempts other pods with lower priority. + PreemptNever PreemptionPolicy = "Never" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.37 +// +k8s:supportsSubresource="/status" + +// PodGroup represents a runtime instance of pods grouped together. +// PodGroups are created by workload controllers (Job, LWS, JobSet, etc...) from +// Workload.podGroupTemplates. +// PodGroup API enablement is toggled by the GenericWorkload feature gate. +type PodGroup struct { + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // spec defines the desired state of the PodGroup. + // + // +required + Spec PodGroupSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` + + // status represents the current observed state of the PodGroup. + // + // +optional + Status PodGroupStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.37 + +// PodGroupList contains a list of PodGroup resources. +type PodGroupList struct { + metav1.TypeMeta `json:""` + // Standard list metadata. + // + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Items is the list of PodGroups. + Items []PodGroup `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// PodGroupSpec defines the desired state of a PodGroup. +type PodGroupSpec struct { + // parentCompositePodGroupName contains the name of the parent composite pod group + // within the same namespace as this pod group. + // If it's nil, then this pod group is a root of a workload's hierarchy. + // This field is used only when the CompositePodGroup feature gate is enabled. + // This field is immutable. + // + // +featureGate=CompositePodGroup + // +optional + // +k8s:ifDisabled(CompositePodGroup)=+k8s:forbidden + // +k8s:ifEnabled(CompositePodGroup)=+k8s:optional + // +k8s:immutable + // +k8s:format=k8s-long-name + // +k8s:alpha(since: "1.37")=+k8s:dependentRequired("workloadRef") + ParentCompositePodGroupName *string `json:"parentCompositePodGroupName,omitempty" protobuf:"bytes,1,opt,name=parentCompositePodGroupName"` + + // workloadRef references an optional PodGroup template within the Workload + // object that was used to create the PodGroup. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + WorkloadRef *WorkloadReference `json:"workloadRef,omitempty" protobuf:"bytes,2,opt,name=workloadRef"` + + // schedulingPolicy defines the scheduling policy for this instance of the PodGroup. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // + // +required + SchedulingPolicy PodGroupSchedulingPolicy `json:"schedulingPolicy" protobuf:"bytes,3,opt,name=schedulingPolicy"` + + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroup. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // This field is immutable. + // This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. + // + // +featureGate=TopologyAwareWorkloadScheduling + // +optional + // +k8s:ifDisabled(TopologyAwareWorkloadScheduling)=+k8s:forbidden + // +k8s:ifEnabled(TopologyAwareWorkloadScheduling)=+k8s:optional + // +k8s:ifEnabled(TopologyAwareWorkloadScheduling)=+k8s:immutable + SchedulingConstraints *PodGroupSchedulingConstraints `json:"schedulingConstraints,omitempty" protobuf:"bytes,4,opt,name=schedulingConstraints"` + + // resourceClaims defines which ResourceClaims may be shared among Pods in + // the group. Pods consume the devices allocated to a PodGroup's claim by + // defining a claim in its own Spec.ResourceClaims that matches the + // PodGroup's claim exactly. The claim must have the same name and refer to + // the same ResourceClaim or ResourceClaimTemplate. + // + // This is a beta-level field and requires that the + // DRAWorkloadResourceClaims feature gate is enabled. + // + // This field is immutable. + // + // +optional + // +patchMergeKey=name + // +patchStrategy=merge,retainKeys + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=4 + // +k8s:immutable + // +featureGate=DRAWorkloadResourceClaims + ResourceClaims []PodGroupResourceClaim `json:"resourceClaims,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name" protobuf:"bytes,5,rep,name=resourceClaims"` + + // disruptionMode defines the mode in which a given PodGroup can be disrupted. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // One of Single, All. Defaults to Single if unset. + // This field is immutable. + // + // +default={"single": {}} + // +optional + // +k8s:optional + // +k8s:immutable + DisruptionMode *DisruptionMode `json:"disruptionMode,omitempty" protobuf:"bytes,6,opt,name=disruptionMode"` + + // priorityClassName defines the priority that should be considered when scheduling this pod group. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // Otherwise, it is validated and resolved similarly to the PriorityClassName on PodGroupTemplate + // (i.e. if no priority class is specified, admission control can set this to the global default + // priority class if it exists. Otherwise, the pod group's priority will be zero). + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + // +k8s:format=k8s-long-name + PriorityClassName string `json:"priorityClassName,omitempty" protobuf:"bytes,7,opt,name=priorityClassName"` + + // priority is the value of priority of this pod group. Various system components + // use this field to find the priority of the pod group. When Priority Admission + // Controller is enabled, it prevents users from setting this field. The admission + // controller populates this field from PriorityClassName. + // The higher the value, the higher the priority. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + // +k8s:maximum=1000000000 # HighestUserDefinablePriority + Priority *int32 `json:"priority,omitempty" protobuf:"varint,8,opt,name=priority"` + + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. + // When Priority Admission Controller is enabled, it populates this field from PriorityClassName, + // and defaults to PreemptLowerPriority if value is unset in PriorityClass. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + // + // +featureGate=PodGroupPreemptionPolicy + // +optional + // +k8s:immutable + // +k8s:ifDisabled("PodGroupPreemptionPolicy")=+k8s:forbidden + // +k8s:ifEnabled("PodGroupPreemptionPolicy")=+k8s:optional + PreemptionPolicy *PreemptionPolicy `json:"preemptionPolicy,omitempty" protobuf:"bytes,9,opt,name=preemptionPolicy"` +} + +// PodGroupStatus represents information about the status of a pod group. +type PodGroupStatus struct { + // conditions represent the latest observations of the PodGroup's state. + // + // Known condition types: + // - "PodGroupInitiallyScheduled": Indicates whether the scheduling requirement has been satisfied. + // Once this condition transitions to True, it serves as a terminal state and will never revert to False, + // even if pods are subsequently evicted and group constraints are no longer met. + // - "DisruptionTarget": Indicates whether the PodGroup is about to be terminated + // due to disruption such as preemption. + // + // Known reasons for the PodGroupInitiallyScheduled condition: + // - "Unschedulable": The PodGroup cannot be scheduled due to resource constraints, + // affinity/anti-affinity rules, or insufficient capacity for the gang. + // - "SchedulerError": The PodGroup cannot be scheduled due to some internal error + // that happened during scheduling, for example due to nodeAffinity parsing errors. + // + // Known reasons for the DisruptionTarget condition: + // - "PreemptionByScheduler": The PodGroup was preempted by the scheduler to make room for + // higher-priority PodGroups or Pods. + // + // +optional + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` + + // resourceClaimStatuses is status of resource claims. + // +optional + // +patchMergeKey=name + // +patchStrategy=merge,retainKeys + // +listType=map + // +listMapKey=name + // +k8s:optional + // +k8s:listType=map + // +k8s:listMapKey=name + // +k8s:maxItems=4 + // +featureGate=DRAWorkloadResourceClaims + ResourceClaimStatuses []PodGroupResourceClaimStatus `json:"resourceClaimStatuses,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name" protobuf:"bytes,2,rep,name=resourceClaimStatuses"` +} + +// Well-known condition types for PodGroups. +const ( + // PodGroupInitiallyScheduled represents status of the scheduling process for this PodGroup till first success. + PodGroupInitiallyScheduled string = "PodGroupInitiallyScheduled" + // DisruptionTarget indicates the PodGroup is about to be terminated due to disruption + // such as preemption. + DisruptionTarget string = "DisruptionTarget" +) + +// Well-known condition reasons for PodGroups. +const ( + // Unschedulable reason in the PodGroupInitiallyScheduled condition indicates that the PodGroup cannot be scheduled + // due to resource constraints, affinity/anti-affinity rules, or insufficient capacity for the PodGroup. + PodGroupReasonUnschedulable string = "Unschedulable" + // SchedulerError reason in the PodGroupInitiallyScheduled condition means that some internal error happens + // during scheduling, for example due to nodeAffinity parsing errors. + PodGroupReasonSchedulerError string = "SchedulerError" + // PreemptionByScheduler reason in the DisruptionTarget condition indicates the PodGroup was preempted + // to make room for higher-priority PodGroups or Pods. + PodGroupReasonPreemptionByScheduler string = "PreemptionByScheduler" +) + +// PodGroupResourceClaimStatus is stored in the PodGroupStatus for each +// PodGroupResourceClaim which references a ResourceClaimTemplate. It stores the +// generated name for the corresponding ResourceClaim. +type PodGroupResourceClaimStatus struct { + // name uniquely identifies this resource claim inside the PodGroup. This + // must match the name of an entry in podgroup.spec.resourceClaims, which + // implies that the string must be a DNS_LABEL. + // + // +required + Name string `json:"name" protobuf:"bytes,1,name=name"` + + // resourceClaimName is the name of the ResourceClaim that was generated for + // the PodGroup in the namespace of the PodGroup. If this is unset, then + // generating a ResourceClaim was not necessary. The + // podgroup.spec.resourceClaims entry can be ignored in this case. + // + // +optional + // +k8s:optional + // +k8s:format=k8s-long-name + ResourceClaimName *string `json:"resourceClaimName,omitempty" protobuf:"bytes,2,opt,name=resourceClaimName"` +} + +// WorkloadReference references the Workload object together with the template +// that was used to create a particular PodGroup. +type WorkloadReference struct { + // workloadName is the name of the Workload object that contains a template + // that was used when creating a pod group. It must + // be a DNS name. + // This field is required. + // + // +required + // +k8s:required + // +k8s:format=k8s-long-name + WorkloadName string `json:"workloadName" protobuf:"bytes,1,opt,name=workloadName"` + + // templateName is the name of a template within the Workload object that + // was used to create a pod group. It must be a DNS label. + // This field is required. + // + // +required + // +k8s:required + // +k8s:format=k8s-short-name + TemplateName string `json:"templateName" protobuf:"bytes,2,opt,name=templateName"` +} + +// PodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a PodGroup. +type PodGroupSchedulingConstraints struct { + // topology defines the topology constraints for the pod group. + // Currently only a single topology constraint can be specified. This may change in the future. + // + // +optional + // +k8s:optional + // +k8s:maxItems=1 + // +listType=atomic + // +k8s:listType=atomic + Topology []TopologyConstraint `json:"topology,omitempty" protobuf:"bytes,1,rep,name=topology"` +} + +// TopologyConstraint defines a topology constraint for a PodGroup. +type TopologyConstraint struct { + // key specifies the key of the node label representing the topology domain. + // All pods within the PodGroup must be colocated within the same domain instance. + // Different PodGroups can land on different domain instances even if they derive from the same PodGroupTemplate. + // Examples: "topology.kubernetes.io/rack" + // + // +required + // +k8s:required + // +k8s:format=k8s-label-key + Key string `json:"key" protobuf:"bytes,1,opt,name=key"` +} + +// CompositePodGroupSchedulingPolicy defines the scheduling configuration for a CompositePodGroup. +// Exactly one policy must be set. +// +// +union +type CompositePodGroupSchedulingPolicy struct { + // basic specifies that the groups of this composite group should be scheduled independently. + // This field is immutable. + // + // +optional + // +k8s:optional + // +k8s:immutable + // +k8s:unionMember + Basic *CompositeBasicSchedulingPolicy `json:"basic,omitempty" protobuf:"bytes,1,opt,name=basic"` + + // gang specifies that the groups of this composite group should be scheduled using + // all-or-nothing semantics. + // + // +optional + // +k8s:optional + // +k8s:unionMember + // +k8s:update=NoSet + // +k8s:update=NoUnset + Gang *CompositeGangSchedulingPolicy `json:"gang,omitempty" protobuf:"bytes,2,opt,name=gang"` +} + +// CompositeBasicSchedulingPolicy indicates that the groups belonging to the composite group +// should be scheduled independently. +type CompositeBasicSchedulingPolicy struct { + // This is intentionally empty. Its presence indicates that the basic group + // scheduling policy should be applied. In the future, new fields may appear, + // describing such constraints on a composite pod group level without "all or + // nothing" (gang) scheduling. +} + +// CompositeGangSchedulingPolicy indicates that the groups belonging to the composite group +// should be scheduled using all-or-nothing semantics. +type CompositeGangSchedulingPolicy struct { + // minGroupCount is the minimum number of child groups that must be schedulable + // or scheduled at the same time for the scheduler to admit the entire group. + // It must be a positive integer. + // + // +required + // +k8s:required + // +k8s:minimum=1 + MinGroupCount int32 `json:"minGroupCount" protobuf:"varint,1,req,name=minGroupCount"` +} + +// CompositeDisruptionMode defines how individual entities within a composite pod group can be disrupted. +// Exactly one mode must be set. +// +// +union +type CompositeDisruptionMode struct { + // single specifies that children groups can be disrupted independently from each other. + // + // +optional + // +k8s:optional + // +k8s:unionMember + Single *SingleCompositeDisruptionMode `json:"single,omitempty" protobuf:"bytes,1,opt,name=single"` + + // all specifies that all children groups can only be disrupted together. + // + // +optional + // +k8s:optional + // +k8s:unionMember + All *AllCompositeDisruptionMode `json:"all,omitempty" protobuf:"bytes,2,opt,name=all"` +} + +// SingleCompositeDisruptionMode means that individual children of a CompositePodGroup +// can be disrupted or preempted independently. +type SingleCompositeDisruptionMode struct { + // This is intentionally empty. +} + +// AllCompositeDisruptionMode means that children of a CompositePodGroup can only be +// disrupted or preempted together. +type AllCompositeDisruptionMode struct { + // This is intentionally empty. +} + +// CompositePodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a CompositePodGroup. +type CompositePodGroupSchedulingConstraints struct { + // topology defines the topology constraints for the composite pod group. + // Currently only a single topology constraint can be specified. This may change in the future. + // + // +optional + // +k8s:optional + // +k8s:maxItems=1 + // +listType=atomic + // +k8s:listType=atomic + Topology []TopologyConstraint `json:"topology,omitempty" protobuf:"bytes,1,rep,name=topology"` +} diff --git a/vendor/k8s.io/api/scheduling/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/scheduling/v1beta1/types_swagger_doc_generated.go index f42008eb91..e514c6950a 100644 --- a/vendor/k8s.io/api/scheduling/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/scheduling/v1beta1/types_swagger_doc_generated.go @@ -27,9 +27,219 @@ package v1beta1 // Those methods can be generated by using hack/update-codegen.sh // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. +var map_AllCompositeDisruptionMode = map[string]string{ + "": "AllCompositeDisruptionMode means that children of a CompositePodGroup can only be disrupted or preempted together.", +} + +func (AllCompositeDisruptionMode) SwaggerDoc() map[string]string { + return map_AllCompositeDisruptionMode +} + +var map_AllDisruptionMode = map[string]string{ + "": "AllDisruptionMode specifies that children can only be disrupted together.", +} + +func (AllDisruptionMode) SwaggerDoc() map[string]string { + return map_AllDisruptionMode +} + +var map_BasicSchedulingPolicy = map[string]string{ + "": "BasicSchedulingPolicy indicates that standard Kubernetes scheduling behavior should be used.", +} + +func (BasicSchedulingPolicy) SwaggerDoc() map[string]string { + return map_BasicSchedulingPolicy +} + +var map_CompositeBasicSchedulingPolicy = map[string]string{ + "": "CompositeBasicSchedulingPolicy indicates that the groups belonging to the composite group should be scheduled independently.", +} + +func (CompositeBasicSchedulingPolicy) SwaggerDoc() map[string]string { + return map_CompositeBasicSchedulingPolicy +} + +var map_CompositeDisruptionMode = map[string]string{ + "": "CompositeDisruptionMode defines how individual entities within a composite pod group can be disrupted. Exactly one mode must be set.", + "single": "single specifies that children groups can be disrupted independently from each other.", + "all": "all specifies that all children groups can only be disrupted together.", +} + +func (CompositeDisruptionMode) SwaggerDoc() map[string]string { + return map_CompositeDisruptionMode +} + +var map_CompositeGangSchedulingPolicy = map[string]string{ + "": "CompositeGangSchedulingPolicy indicates that the groups belonging to the composite group should be scheduled using all-or-nothing semantics.", + "minGroupCount": "minGroupCount is the minimum number of child groups that must be schedulable or scheduled at the same time for the scheduler to admit the entire group. It must be a positive integer.", +} + +func (CompositeGangSchedulingPolicy) SwaggerDoc() map[string]string { + return map_CompositeGangSchedulingPolicy +} + +var map_CompositePodGroupSchedulingConstraints = map[string]string{ + "": "CompositePodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a CompositePodGroup.", + "topology": "topology defines the topology constraints for the composite pod group. Currently only a single topology constraint can be specified. This may change in the future.", +} + +func (CompositePodGroupSchedulingConstraints) SwaggerDoc() map[string]string { + return map_CompositePodGroupSchedulingConstraints +} + +var map_CompositePodGroupSchedulingPolicy = map[string]string{ + "": "CompositePodGroupSchedulingPolicy defines the scheduling configuration for a CompositePodGroup. Exactly one policy must be set.", + "basic": "basic specifies that the groups of this composite group should be scheduled independently. This field is immutable.", + "gang": "gang specifies that the groups of this composite group should be scheduled using all-or-nothing semantics.", +} + +func (CompositePodGroupSchedulingPolicy) SwaggerDoc() map[string]string { + return map_CompositePodGroupSchedulingPolicy +} + +var map_CompositePodGroupTemplate = map[string]string{ + "": "CompositePodGroupTemplate represents a template for a CompositePodGroup with a scheduling policy.", + "name": "name is a unique identifier for the CompositePodGroupTemplate within the Workload. It must be a DNS label. This field is required.", + "schedulingPolicy": "schedulingPolicy defines the scheduling policy for this template.", + "schedulingConstraints": "schedulingConstraints defines optional scheduling constraints (e.g. topology) for this CompositePodGroupTemplate. This field is immutable.", + "disruptionMode": "disruptionMode defines the mode in which a given CompositePodGroup can be disrupted. One of Single, All. This field is immutable.", + "priorityClassName": "priorityClassName indicates the priority that should be considered when scheduling a composite pod group created from this template. If no priority class is specified, admission control can set this to the global default priority class if it exists. Otherwise, composite pod groups created from this template will have the priority set to zero. This field is immutable.", + "priority": "priority is the value of priority of composite pod groups created from this template. Various system components use this field to find the priority of the composite pod group. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. This field is immutable.", + "preemptionPolicy": "preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. One of Never, PreemptLowerPriority. This field is immutable. This field is available only when the PodGroupPreemptionPolicy feature gate is enabled.", + "podGroupTemplates": "podGroupTemplates is the list of templates for children PodGroups. The maximum number of templates is 8. At least one entry in CompositePodGroupTemplates or PodGroupTemplates must be set.", + "compositePodGroupTemplates": "compositePodGroupTemplates is the list of templates for children CompositePodGroups. The maximum number of templates is 8. At least one entry in CompositePodGroupTemplates or PodGroupTemplates must be set.", +} + +func (CompositePodGroupTemplate) SwaggerDoc() map[string]string { + return map_CompositePodGroupTemplate +} + +var map_DisruptionMode = map[string]string{ + "": "DisruptionMode defines how individual entities within a group can be disrupted. Exactly one mode can be set.", + "single": "single specifies that children can be disrupted independently from each other.", + "all": "all specifies that all children can only be disrupted together.", +} + +func (DisruptionMode) SwaggerDoc() map[string]string { + return map_DisruptionMode +} + +var map_GangSchedulingPolicy = map[string]string{ + "": "GangSchedulingPolicy defines the parameters for gang scheduling.", + "minCount": "minCount is the minimum number of pods that must be schedulable or scheduled at the same time for the scheduler to admit the entire group. It must be a positive integer. This field is mutable to support workload scaling.\n\nNote that the scheduler operates on an eventually consistent model. Updates to minCount may not be immediately reflected in scheduling decisions due to propagation delays. If minCount is updated while a scheduling cycle is in progress for that group, the new value may not take effect until the next cycle. Moreover, minCount is only enforced during scheduling, meaning that modifications to this field do not affect already-scheduled pods, applying only to those evaluated in future cycles.", +} + +func (GangSchedulingPolicy) SwaggerDoc() map[string]string { + return map_GangSchedulingPolicy +} + +var map_PodGroup = map[string]string{ + "": "PodGroup represents a runtime instance of pods grouped together. PodGroups are created by workload controllers (Job, LWS, JobSet, etc...) from Workload.podGroupTemplates. PodGroup API enablement is toggled by the GenericWorkload feature gate.", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec defines the desired state of the PodGroup.", + "status": "status represents the current observed state of the PodGroup.", +} + +func (PodGroup) SwaggerDoc() map[string]string { + return map_PodGroup +} + +var map_PodGroupList = map[string]string{ + "": "PodGroupList contains a list of PodGroup resources.", + "metadata": "Standard list metadata.", + "items": "Items is the list of PodGroups.", +} + +func (PodGroupList) SwaggerDoc() map[string]string { + return map_PodGroupList +} + +var map_PodGroupResourceClaim = map[string]string{ + "": "PodGroupResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the PodGroup.\n\nIt adds a name to it that uniquely identifies the ResourceClaim inside the PodGroup. Pods that need access to the ResourceClaim define a matching reference in its own Spec.ResourceClaims. The Pod's claim must match all fields of the PodGroup's claim exactly.", + "name": "name uniquely identifies this resource claim inside the PodGroup. This must be a DNS_LABEL.", + "resourceClaimName": "resourceClaimName is the name of a ResourceClaim object in the same namespace as this PodGroup. The ResourceClaim will be reserved for the PodGroup instead of its individual pods.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.", + "resourceClaimTemplateName": "resourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this PodGroup.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this PodGroup. When this PodGroup is deleted, the ResourceClaim will also be deleted. The PodGroup 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 podgroup.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.", +} + +func (PodGroupResourceClaim) SwaggerDoc() map[string]string { + return map_PodGroupResourceClaim +} + +var map_PodGroupResourceClaimStatus = map[string]string{ + "": "PodGroupResourceClaimStatus is stored in the PodGroupStatus for each PodGroupResourceClaim which references a ResourceClaimTemplate. It stores the generated name for the corresponding ResourceClaim.", + "name": "name uniquely identifies this resource claim inside the PodGroup. This must match the name of an entry in podgroup.spec.resourceClaims, which implies that the string must be a DNS_LABEL.", + "resourceClaimName": "resourceClaimName is the name of the ResourceClaim that was generated for the PodGroup in the namespace of the PodGroup. If this is unset, then generating a ResourceClaim was not necessary. The podgroup.spec.resourceClaims entry can be ignored in this case.", +} + +func (PodGroupResourceClaimStatus) SwaggerDoc() map[string]string { + return map_PodGroupResourceClaimStatus +} + +var map_PodGroupSchedulingConstraints = map[string]string{ + "": "PodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a PodGroup.", + "topology": "topology defines the topology constraints for the pod group. Currently only a single topology constraint can be specified. This may change in the future.", +} + +func (PodGroupSchedulingConstraints) SwaggerDoc() map[string]string { + return map_PodGroupSchedulingConstraints +} + +var map_PodGroupSchedulingPolicy = map[string]string{ + "": "PodGroupSchedulingPolicy defines the scheduling configuration for a PodGroup. Exactly one policy must be set. The policy is chosen at creation time by setting either the Basic or Gang field. The PodGroup may not change policy after creation. Fields within chosen policy may be updated after creation when their individual fields allow it.", + "basic": "basic specifies that the pods in this group should be scheduled using standard Kubernetes scheduling behavior. Setting this field at group creation time opts this group to basic scheduling; this field cannot be changed afterward.", + "gang": "gang specifies that the pods in this group should be scheduled using all-or-nothing semantics. Setting this field at group creation time opts this group to gang scheduling; this field cannot be set or unset afterward. The minCount field within Gang scheduling policy remains mutable after group creation.", +} + +func (PodGroupSchedulingPolicy) SwaggerDoc() map[string]string { + return map_PodGroupSchedulingPolicy +} + +var map_PodGroupSpec = map[string]string{ + "": "PodGroupSpec defines the desired state of a PodGroup.", + "parentCompositePodGroupName": "parentCompositePodGroupName contains the name of the parent composite pod group within the same namespace as this pod group. If it's nil, then this pod group is a root of a workload's hierarchy. This field is used only when the CompositePodGroup feature gate is enabled. This field is immutable.", + "workloadRef": "workloadRef references an optional PodGroup template within the Workload object that was used to create the PodGroup. This field is immutable.", + "schedulingPolicy": "schedulingPolicy defines the scheduling policy for this instance of the PodGroup. Controllers are expected to fill this field by copying it from a PodGroupTemplate.", + "schedulingConstraints": "schedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroup. Controllers are expected to fill this field by copying it from a PodGroupTemplate. This field is immutable. This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled.", + "resourceClaims": "resourceClaims defines which ResourceClaims may be shared among Pods in the group. Pods consume the devices allocated to a PodGroup's claim by defining a claim in its own Spec.ResourceClaims that matches the PodGroup's claim exactly. The claim must have the same name and refer to the same ResourceClaim or ResourceClaimTemplate.\n\nThis is a beta-level field and requires that the DRAWorkloadResourceClaims feature gate is enabled.\n\nThis field is immutable.", + "disruptionMode": "disruptionMode defines the mode in which a given PodGroup can be disrupted. Controllers are expected to fill this field by copying it from a PodGroupTemplate. One of Single, All. Defaults to Single if unset. This field is immutable.", + "priorityClassName": "priorityClassName defines the priority that should be considered when scheduling this pod group. Controllers are expected to fill this field by copying it from a PodGroupTemplate. Otherwise, it is validated and resolved similarly to the PriorityClassName on PodGroupTemplate (i.e. if no priority class is specified, admission control can set this to the global default priority class if it exists. Otherwise, the pod group's priority will be zero). This field is immutable.", + "priority": "priority is the value of priority of this pod group. Various system components use this field to find the priority of the pod group. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. This field is immutable.", + "preemptionPolicy": "preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. When Priority Admission Controller is enabled, it populates this field from PriorityClassName, and defaults to PreemptLowerPriority if value is unset in PriorityClass. This field is immutable. This field is available only when the PodGroupPreemptionPolicy feature gate is enabled.", +} + +func (PodGroupSpec) SwaggerDoc() map[string]string { + return map_PodGroupSpec +} + +var map_PodGroupStatus = map[string]string{ + "": "PodGroupStatus represents information about the status of a pod group.", + "conditions": "conditions represent the latest observations of the PodGroup's state.\n\nKnown condition types: - \"PodGroupInitiallyScheduled\": Indicates whether the scheduling requirement has been satisfied. Once this condition transitions to True, it serves as a terminal state and will never revert to False, even if pods are subsequently evicted and group constraints are no longer met. - \"DisruptionTarget\": Indicates whether the PodGroup is about to be terminated\n due to disruption such as preemption.\n\nKnown reasons for the PodGroupInitiallyScheduled condition: - \"Unschedulable\": The PodGroup cannot be scheduled due to resource constraints,\n affinity/anti-affinity rules, or insufficient capacity for the gang.\n- \"SchedulerError\": The PodGroup cannot be scheduled due to some internal error\n that happened during scheduling, for example due to nodeAffinity parsing errors.\n\nKnown reasons for the DisruptionTarget condition: - \"PreemptionByScheduler\": The PodGroup was preempted by the scheduler to make room for\n higher-priority PodGroups or Pods.", + "resourceClaimStatuses": "resourceClaimStatuses is status of resource claims.", +} + +func (PodGroupStatus) SwaggerDoc() map[string]string { + return map_PodGroupStatus +} + +var map_PodGroupTemplate = map[string]string{ + "": "PodGroupTemplate represents a template for a set of pods with a scheduling policy.", + "name": "name is a unique identifier for the PodGroupTemplate within the Workload. It must be a DNS label. This field is immutable.", + "schedulingPolicy": "schedulingPolicy defines the scheduling policy for this PodGroupTemplate.", + "schedulingConstraints": "schedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroupTemplate. This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. This field is immutable.", + "resourceClaims": "resourceClaims defines which ResourceClaims may be shared among Pods in the group. Pods consume the devices allocated to a PodGroup's claim by defining a claim in its own Spec.ResourceClaims that matches the PodGroup's claim exactly. The claim must have the same name and refer to the same ResourceClaim or ResourceClaimTemplate.\n\nThis is a beta-level field and requires that the DRAWorkloadResourceClaims feature gate is enabled.\n\nThis field is immutable.", + "disruptionMode": "disruptionMode defines the mode in which a given PodGroup can be disrupted. One of Single, All. This field is immutable.", + "priorityClassName": "priorityClassName indicates the priority that should be considered when scheduling a pod group created from this template. This field is immutable.", + "priority": "priority is the value of priority of pod groups created from this template. Various system components use this field to find the priority of the pod group. The higher the value, the higher the priority. This field is immutable.", + "preemptionPolicy": "preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. One of Never, PreemptLowerPriority. This field is immutable. This field is available only when the PodGroupPreemptionPolicy feature gate is enabled.", +} + +func (PodGroupTemplate) SwaggerDoc() map[string]string { + return map_PodGroupTemplate +} + var map_PriorityClass = map[string]string{ "": "DEPRECATED - This group version of PriorityClass is deprecated by scheduling.k8s.io/v1/PriorityClass. PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "value": "value represents the integer value of this priority class. This is the actual priority that pods receive when they have the name of this class in their pod spec.", "globalDefault": "globalDefault specifies whether this PriorityClass should be considered as the default priority for pods that do not have any priority class. Only one PriorityClass can be marked as `globalDefault`. However, if more than one PriorityClasses exists with their `globalDefault` field set to true, the smallest value of such global default PriorityClasses will be used as the default priority.", "description": "description is an arbitrary string that usually provides guidelines on when this priority class should be used.", @@ -50,4 +260,81 @@ func (PriorityClassList) SwaggerDoc() map[string]string { return map_PriorityClassList } +var map_SingleCompositeDisruptionMode = map[string]string{ + "": "SingleCompositeDisruptionMode means that individual children of a CompositePodGroup can be disrupted or preempted independently.", +} + +func (SingleCompositeDisruptionMode) SwaggerDoc() map[string]string { + return map_SingleCompositeDisruptionMode +} + +var map_SingleDisruptionMode = map[string]string{ + "": "SingleDisruptionMode specifies that children can be disrupted independently.", +} + +func (SingleDisruptionMode) SwaggerDoc() map[string]string { + return map_SingleDisruptionMode +} + +var map_TopologyConstraint = map[string]string{ + "": "TopologyConstraint defines a topology constraint for a PodGroup.", + "key": "key specifies the key of the node label representing the topology domain. All pods within the PodGroup must be colocated within the same domain instance. Different PodGroups can land on different domain instances even if they derive from the same PodGroupTemplate. Examples: \"topology.kubernetes.io/rack\"", +} + +func (TopologyConstraint) SwaggerDoc() map[string]string { + return map_TopologyConstraint +} + +var map_TypedLocalObjectReference = map[string]string{ + "": "TypedLocalObjectReference allows to reference typed object inside the same namespace.", + "apiGroup": "apiGroup is the group for the resource being referenced. If apiGroup is empty, the specified Kind must be in the core API group. For any other third-party types, setting apiGroup is required. It must be a DNS subdomain.", + "kind": "kind is the type of resource being referenced. It must be a path segment name.", + "name": "name is the name of resource being referenced. It must be a path segment name.", +} + +func (TypedLocalObjectReference) SwaggerDoc() map[string]string { + return map_TypedLocalObjectReference +} + +var map_Workload = map[string]string{ + "": "Workload allows for expressing scheduling constraints that should be used when managing the lifecycle of workloads from the scheduling perspective, including scheduling, preemption, eviction and other phases. Workload API enablement is toggled by the GenericWorkload feature gate.", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec defines the desired behavior of a Workload.", +} + +func (Workload) SwaggerDoc() map[string]string { + return map_Workload +} + +var map_WorkloadList = map[string]string{ + "": "WorkloadList contains a list of Workload resources.", + "metadata": "metadata is the standard list metadata.", + "items": "items is the list of Workloads.", +} + +func (WorkloadList) SwaggerDoc() map[string]string { + return map_WorkloadList +} + +var map_WorkloadReference = map[string]string{ + "": "WorkloadReference references the Workload object together with the template that was used to create a particular PodGroup.", + "workloadName": "workloadName is the name of the Workload object that contains a template that was used when creating a pod group. It must be a DNS name. This field is required.", + "templateName": "templateName is the name of a template within the Workload object that was used to create a pod group. It must be a DNS label. This field is required.", +} + +func (WorkloadReference) SwaggerDoc() map[string]string { + return map_WorkloadReference +} + +var map_WorkloadSpec = map[string]string{ + "": "WorkloadSpec defines the desired state of a Workload.", + "controllerRef": "controllerRef is an optional reference to the controlling object, such as a Deployment or Job. This field is intended for use by tools like CLIs to provide a link back to the original workload definition. This field is immutable.", + "podGroupTemplates": "podGroupTemplates is the list of templates that make up the Workload. The maximum number of templates is 8. Templates cannot be added or removed after the workload is created. Existing templates may still be updated where their individual fields allow it. Exactly one of CompositePodGroupTemplates and PodGroupTemplates must be set.", + "compositePodGroupTemplates": "compositePodGroupTemplates is the list of CompositePodGroup templates that make up the Workload. The maximum number of templates is 8. This field is immutable. Exactly one of CompositePodGroupTemplates and PodGroupTemplates must be set.\n\nThis field is used only when the CompositePodGroup feature gate is enabled.", +} + +func (WorkloadSpec) SwaggerDoc() map[string]string { + return map_WorkloadSpec +} + // AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/k8s.io/api/scheduling/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/scheduling/v1beta1/zz_generated.deepcopy.go index ff38c9854f..aacc643ad0 100644 --- a/vendor/k8s.io/api/scheduling/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/scheduling/v1beta1/zz_generated.deepcopy.go @@ -22,10 +22,540 @@ limitations under the License. package v1beta1 import ( - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllCompositeDisruptionMode) DeepCopyInto(out *AllCompositeDisruptionMode) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllCompositeDisruptionMode. +func (in *AllCompositeDisruptionMode) DeepCopy() *AllCompositeDisruptionMode { + if in == nil { + return nil + } + out := new(AllCompositeDisruptionMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllDisruptionMode) DeepCopyInto(out *AllDisruptionMode) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllDisruptionMode. +func (in *AllDisruptionMode) DeepCopy() *AllDisruptionMode { + if in == nil { + return nil + } + out := new(AllDisruptionMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BasicSchedulingPolicy) DeepCopyInto(out *BasicSchedulingPolicy) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicSchedulingPolicy. +func (in *BasicSchedulingPolicy) DeepCopy() *BasicSchedulingPolicy { + if in == nil { + return nil + } + out := new(BasicSchedulingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CompositeBasicSchedulingPolicy) DeepCopyInto(out *CompositeBasicSchedulingPolicy) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositeBasicSchedulingPolicy. +func (in *CompositeBasicSchedulingPolicy) DeepCopy() *CompositeBasicSchedulingPolicy { + if in == nil { + return nil + } + out := new(CompositeBasicSchedulingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CompositeDisruptionMode) DeepCopyInto(out *CompositeDisruptionMode) { + *out = *in + if in.Single != nil { + in, out := &in.Single, &out.Single + *out = new(SingleCompositeDisruptionMode) + **out = **in + } + if in.All != nil { + in, out := &in.All, &out.All + *out = new(AllCompositeDisruptionMode) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositeDisruptionMode. +func (in *CompositeDisruptionMode) DeepCopy() *CompositeDisruptionMode { + if in == nil { + return nil + } + out := new(CompositeDisruptionMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CompositeGangSchedulingPolicy) DeepCopyInto(out *CompositeGangSchedulingPolicy) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositeGangSchedulingPolicy. +func (in *CompositeGangSchedulingPolicy) DeepCopy() *CompositeGangSchedulingPolicy { + if in == nil { + return nil + } + out := new(CompositeGangSchedulingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CompositePodGroupSchedulingConstraints) DeepCopyInto(out *CompositePodGroupSchedulingConstraints) { + *out = *in + if in.Topology != nil { + in, out := &in.Topology, &out.Topology + *out = make([]TopologyConstraint, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositePodGroupSchedulingConstraints. +func (in *CompositePodGroupSchedulingConstraints) DeepCopy() *CompositePodGroupSchedulingConstraints { + if in == nil { + return nil + } + out := new(CompositePodGroupSchedulingConstraints) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CompositePodGroupSchedulingPolicy) DeepCopyInto(out *CompositePodGroupSchedulingPolicy) { + *out = *in + if in.Basic != nil { + in, out := &in.Basic, &out.Basic + *out = new(CompositeBasicSchedulingPolicy) + **out = **in + } + if in.Gang != nil { + in, out := &in.Gang, &out.Gang + *out = new(CompositeGangSchedulingPolicy) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositePodGroupSchedulingPolicy. +func (in *CompositePodGroupSchedulingPolicy) DeepCopy() *CompositePodGroupSchedulingPolicy { + if in == nil { + return nil + } + out := new(CompositePodGroupSchedulingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CompositePodGroupTemplate) DeepCopyInto(out *CompositePodGroupTemplate) { + *out = *in + in.SchedulingPolicy.DeepCopyInto(&out.SchedulingPolicy) + if in.SchedulingConstraints != nil { + in, out := &in.SchedulingConstraints, &out.SchedulingConstraints + *out = new(CompositePodGroupSchedulingConstraints) + (*in).DeepCopyInto(*out) + } + if in.DisruptionMode != nil { + in, out := &in.DisruptionMode, &out.DisruptionMode + *out = new(CompositeDisruptionMode) + (*in).DeepCopyInto(*out) + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int32) + **out = **in + } + if in.PreemptionPolicy != nil { + in, out := &in.PreemptionPolicy, &out.PreemptionPolicy + *out = new(PreemptionPolicy) + **out = **in + } + if in.PodGroupTemplates != nil { + in, out := &in.PodGroupTemplates, &out.PodGroupTemplates + *out = make([]PodGroupTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.CompositePodGroupTemplates != nil { + in, out := &in.CompositePodGroupTemplates, &out.CompositePodGroupTemplates + *out = make([]CompositePodGroupTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompositePodGroupTemplate. +func (in *CompositePodGroupTemplate) DeepCopy() *CompositePodGroupTemplate { + if in == nil { + return nil + } + out := new(CompositePodGroupTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DisruptionMode) DeepCopyInto(out *DisruptionMode) { + *out = *in + if in.Single != nil { + in, out := &in.Single, &out.Single + *out = new(SingleDisruptionMode) + **out = **in + } + if in.All != nil { + in, out := &in.All, &out.All + *out = new(AllDisruptionMode) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionMode. +func (in *DisruptionMode) DeepCopy() *DisruptionMode { + if in == nil { + return nil + } + out := new(DisruptionMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GangSchedulingPolicy) DeepCopyInto(out *GangSchedulingPolicy) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GangSchedulingPolicy. +func (in *GangSchedulingPolicy) DeepCopy() *GangSchedulingPolicy { + if in == nil { + return nil + } + out := new(GangSchedulingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodGroup) DeepCopyInto(out *PodGroup) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroup. +func (in *PodGroup) DeepCopy() *PodGroup { + if in == nil { + return nil + } + out := new(PodGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PodGroup) 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 *PodGroupList) DeepCopyInto(out *PodGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PodGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupList. +func (in *PodGroupList) DeepCopy() *PodGroupList { + if in == nil { + return nil + } + out := new(PodGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PodGroupList) 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 *PodGroupResourceClaim) DeepCopyInto(out *PodGroupResourceClaim) { + *out = *in + if in.ResourceClaimName != nil { + in, out := &in.ResourceClaimName, &out.ResourceClaimName + *out = new(string) + **out = **in + } + if in.ResourceClaimTemplateName != nil { + in, out := &in.ResourceClaimTemplateName, &out.ResourceClaimTemplateName + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupResourceClaim. +func (in *PodGroupResourceClaim) DeepCopy() *PodGroupResourceClaim { + if in == nil { + return nil + } + out := new(PodGroupResourceClaim) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodGroupResourceClaimStatus) DeepCopyInto(out *PodGroupResourceClaimStatus) { + *out = *in + if in.ResourceClaimName != nil { + in, out := &in.ResourceClaimName, &out.ResourceClaimName + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupResourceClaimStatus. +func (in *PodGroupResourceClaimStatus) DeepCopy() *PodGroupResourceClaimStatus { + if in == nil { + return nil + } + out := new(PodGroupResourceClaimStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodGroupSchedulingConstraints) DeepCopyInto(out *PodGroupSchedulingConstraints) { + *out = *in + if in.Topology != nil { + in, out := &in.Topology, &out.Topology + *out = make([]TopologyConstraint, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupSchedulingConstraints. +func (in *PodGroupSchedulingConstraints) DeepCopy() *PodGroupSchedulingConstraints { + if in == nil { + return nil + } + out := new(PodGroupSchedulingConstraints) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodGroupSchedulingPolicy) DeepCopyInto(out *PodGroupSchedulingPolicy) { + *out = *in + if in.Basic != nil { + in, out := &in.Basic, &out.Basic + *out = new(BasicSchedulingPolicy) + **out = **in + } + if in.Gang != nil { + in, out := &in.Gang, &out.Gang + *out = new(GangSchedulingPolicy) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupSchedulingPolicy. +func (in *PodGroupSchedulingPolicy) DeepCopy() *PodGroupSchedulingPolicy { + if in == nil { + return nil + } + out := new(PodGroupSchedulingPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodGroupSpec) DeepCopyInto(out *PodGroupSpec) { + *out = *in + if in.ParentCompositePodGroupName != nil { + in, out := &in.ParentCompositePodGroupName, &out.ParentCompositePodGroupName + *out = new(string) + **out = **in + } + if in.WorkloadRef != nil { + in, out := &in.WorkloadRef, &out.WorkloadRef + *out = new(WorkloadReference) + **out = **in + } + in.SchedulingPolicy.DeepCopyInto(&out.SchedulingPolicy) + if in.SchedulingConstraints != nil { + in, out := &in.SchedulingConstraints, &out.SchedulingConstraints + *out = new(PodGroupSchedulingConstraints) + (*in).DeepCopyInto(*out) + } + if in.ResourceClaims != nil { + in, out := &in.ResourceClaims, &out.ResourceClaims + *out = make([]PodGroupResourceClaim, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DisruptionMode != nil { + in, out := &in.DisruptionMode, &out.DisruptionMode + *out = new(DisruptionMode) + (*in).DeepCopyInto(*out) + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int32) + **out = **in + } + if in.PreemptionPolicy != nil { + in, out := &in.PreemptionPolicy, &out.PreemptionPolicy + *out = new(PreemptionPolicy) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupSpec. +func (in *PodGroupSpec) DeepCopy() *PodGroupSpec { + if in == nil { + return nil + } + out := new(PodGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodGroupStatus) DeepCopyInto(out *PodGroupStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ResourceClaimStatuses != nil { + in, out := &in.ResourceClaimStatuses, &out.ResourceClaimStatuses + *out = make([]PodGroupResourceClaimStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupStatus. +func (in *PodGroupStatus) DeepCopy() *PodGroupStatus { + if in == nil { + return nil + } + out := new(PodGroupStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodGroupTemplate) DeepCopyInto(out *PodGroupTemplate) { + *out = *in + in.SchedulingPolicy.DeepCopyInto(&out.SchedulingPolicy) + if in.SchedulingConstraints != nil { + in, out := &in.SchedulingConstraints, &out.SchedulingConstraints + *out = new(PodGroupSchedulingConstraints) + (*in).DeepCopyInto(*out) + } + if in.ResourceClaims != nil { + in, out := &in.ResourceClaims, &out.ResourceClaims + *out = make([]PodGroupResourceClaim, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DisruptionMode != nil { + in, out := &in.DisruptionMode, &out.DisruptionMode + *out = new(DisruptionMode) + (*in).DeepCopyInto(*out) + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int32) + **out = **in + } + if in.PreemptionPolicy != nil { + in, out := &in.PreemptionPolicy, &out.PreemptionPolicy + *out = new(PreemptionPolicy) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupTemplate. +func (in *PodGroupTemplate) DeepCopy() *PodGroupTemplate { + if in == nil { + return nil + } + out := new(PodGroupTemplate) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PriorityClass) DeepCopyInto(out *PriorityClass) { *out = *in @@ -33,7 +563,7 @@ func (in *PriorityClass) DeepCopyInto(out *PriorityClass) { in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) if in.PreemptionPolicy != nil { in, out := &in.PreemptionPolicy, &out.PreemptionPolicy - *out = new(v1.PreemptionPolicy) + *out = new(corev1.PreemptionPolicy) **out = **in } return @@ -89,3 +619,178 @@ func (in *PriorityClassList) DeepCopyObject() runtime.Object { } return nil } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SingleCompositeDisruptionMode) DeepCopyInto(out *SingleCompositeDisruptionMode) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SingleCompositeDisruptionMode. +func (in *SingleCompositeDisruptionMode) DeepCopy() *SingleCompositeDisruptionMode { + if in == nil { + return nil + } + out := new(SingleCompositeDisruptionMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SingleDisruptionMode) DeepCopyInto(out *SingleDisruptionMode) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SingleDisruptionMode. +func (in *SingleDisruptionMode) DeepCopy() *SingleDisruptionMode { + if in == nil { + return nil + } + out := new(SingleDisruptionMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TopologyConstraint) DeepCopyInto(out *TopologyConstraint) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TopologyConstraint. +func (in *TopologyConstraint) DeepCopy() *TopologyConstraint { + if in == nil { + return nil + } + out := new(TopologyConstraint) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TypedLocalObjectReference) DeepCopyInto(out *TypedLocalObjectReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TypedLocalObjectReference. +func (in *TypedLocalObjectReference) DeepCopy() *TypedLocalObjectReference { + if in == nil { + return nil + } + out := new(TypedLocalObjectReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Workload) DeepCopyInto(out *Workload) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workload. +func (in *Workload) DeepCopy() *Workload { + if in == nil { + return nil + } + out := new(Workload) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Workload) 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 *WorkloadList) DeepCopyInto(out *WorkloadList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Workload, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadList. +func (in *WorkloadList) DeepCopy() *WorkloadList { + if in == nil { + return nil + } + out := new(WorkloadList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *WorkloadList) 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 *WorkloadReference) DeepCopyInto(out *WorkloadReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadReference. +func (in *WorkloadReference) DeepCopy() *WorkloadReference { + if in == nil { + return nil + } + out := new(WorkloadReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadSpec) DeepCopyInto(out *WorkloadSpec) { + *out = *in + if in.ControllerRef != nil { + in, out := &in.ControllerRef, &out.ControllerRef + *out = new(TypedLocalObjectReference) + **out = **in + } + if in.PodGroupTemplates != nil { + in, out := &in.PodGroupTemplates, &out.PodGroupTemplates + *out = make([]PodGroupTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.CompositePodGroupTemplates != nil { + in, out := &in.CompositePodGroupTemplates, &out.CompositePodGroupTemplates + *out = make([]CompositePodGroupTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadSpec. +func (in *WorkloadSpec) DeepCopy() *WorkloadSpec { + if in == nil { + return nil + } + out := new(WorkloadSpec) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/k8s.io/api/scheduling/v1beta1/zz_generated.model_name.go b/vendor/k8s.io/api/scheduling/v1beta1/zz_generated.model_name.go index 16f40100cc..be01a4c3eb 100644 --- a/vendor/k8s.io/api/scheduling/v1beta1/zz_generated.model_name.go +++ b/vendor/k8s.io/api/scheduling/v1beta1/zz_generated.model_name.go @@ -21,6 +21,106 @@ limitations under the License. package v1beta1 +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AllCompositeDisruptionMode) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.AllCompositeDisruptionMode" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AllDisruptionMode) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.AllDisruptionMode" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in BasicSchedulingPolicy) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.BasicSchedulingPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CompositeBasicSchedulingPolicy) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.CompositeBasicSchedulingPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CompositeDisruptionMode) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.CompositeDisruptionMode" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CompositeGangSchedulingPolicy) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.CompositeGangSchedulingPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CompositePodGroupSchedulingConstraints) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.CompositePodGroupSchedulingConstraints" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CompositePodGroupSchedulingPolicy) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.CompositePodGroupSchedulingPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CompositePodGroupTemplate) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.CompositePodGroupTemplate" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DisruptionMode) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.DisruptionMode" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GangSchedulingPolicy) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.GangSchedulingPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodGroup) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.PodGroup" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodGroupList) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.PodGroupList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodGroupResourceClaim) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.PodGroupResourceClaim" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodGroupResourceClaimStatus) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.PodGroupResourceClaimStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodGroupSchedulingConstraints) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.PodGroupSchedulingConstraints" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodGroupSchedulingPolicy) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.PodGroupSchedulingPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodGroupSpec) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.PodGroupSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodGroupStatus) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.PodGroupStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodGroupTemplate) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.PodGroupTemplate" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in PriorityClass) OpenAPIModelName() string { return "io.k8s.api.scheduling.v1beta1.PriorityClass" @@ -30,3 +130,43 @@ func (in PriorityClass) OpenAPIModelName() string { func (in PriorityClassList) OpenAPIModelName() string { return "io.k8s.api.scheduling.v1beta1.PriorityClassList" } + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SingleCompositeDisruptionMode) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.SingleCompositeDisruptionMode" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SingleDisruptionMode) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.SingleDisruptionMode" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TopologyConstraint) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.TopologyConstraint" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TypedLocalObjectReference) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.TypedLocalObjectReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Workload) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.Workload" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadList) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.WorkloadList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadReference) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.WorkloadReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WorkloadSpec) OpenAPIModelName() string { + return "io.k8s.api.scheduling.v1beta1.WorkloadSpec" +} diff --git a/vendor/k8s.io/api/scheduling/v1beta1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/scheduling/v1beta1/zz_generated.prerelease-lifecycle.go index 15aefb1085..25f1136129 100644 --- a/vendor/k8s.io/api/scheduling/v1beta1/zz_generated.prerelease-lifecycle.go +++ b/vendor/k8s.io/api/scheduling/v1beta1/zz_generated.prerelease-lifecycle.go @@ -25,6 +25,42 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" ) +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *PodGroup) APILifecycleIntroduced() (major, minor int) { + return 1, 37 +} + +// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. +func (in *PodGroup) APILifecycleDeprecated() (major, minor int) { + return 1, 40 +} + +// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. +func (in *PodGroup) APILifecycleRemoved() (major, minor int) { + return 1, 43 +} + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *PodGroupList) APILifecycleIntroduced() (major, minor int) { + return 1, 37 +} + +// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. +func (in *PodGroupList) APILifecycleDeprecated() (major, minor int) { + return 1, 40 +} + +// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. +func (in *PodGroupList) APILifecycleRemoved() (major, minor int) { + return 1, 43 +} + // APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. func (in *PriorityClass) APILifecycleIntroduced() (major, minor int) { @@ -72,3 +108,39 @@ func (in *PriorityClassList) APILifecycleReplacement() schema.GroupVersionKind { func (in *PriorityClassList) APILifecycleRemoved() (major, minor int) { return 1, 22 } + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *Workload) APILifecycleIntroduced() (major, minor int) { + return 1, 37 +} + +// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. +func (in *Workload) APILifecycleDeprecated() (major, minor int) { + return 1, 40 +} + +// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. +func (in *Workload) APILifecycleRemoved() (major, minor int) { + return 1, 43 +} + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *WorkloadList) APILifecycleIntroduced() (major, minor int) { + return 1, 37 +} + +// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. +func (in *WorkloadList) APILifecycleDeprecated() (major, minor int) { + return 1, 40 +} + +// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. +func (in *WorkloadList) APILifecycleRemoved() (major, minor int) { + return 1, 43 +} diff --git a/vendor/k8s.io/api/storage/v1/generated.pb.go b/vendor/k8s.io/api/storage/v1/generated.pb.go index 5fc7d55a5b..4a6e5222f2 100644 --- a/vendor/k8s.io/api/storage/v1/generated.pb.go +++ b/vendor/k8s.io/api/storage/v1/generated.pb.go @@ -49,6 +49,8 @@ func (m *CSINodeList) Reset() { *m = CSINodeList{} } func (m *CSINodeSpec) Reset() { *m = CSINodeSpec{} } +func (m *CSINodeStatus) Reset() { *m = CSINodeStatus{} } + func (m *CSIStorageCapacity) Reset() { *m = CSIStorageCapacity{} } func (m *CSIStorageCapacityList) Reset() { *m = CSIStorageCapacityList{} } @@ -57,6 +59,10 @@ func (m *StorageClass) Reset() { *m = StorageClass{} } func (m *StorageClassList) Reset() { *m = StorageClassList{} } +func (m *StorageHealth) Reset() { *m = StorageHealth{} } + +func (m *StorageHealthCondition) Reset() { *m = StorageHealthCondition{} } + func (m *TokenRequest) Reset() { *m = TokenRequest{} } func (m *VolumeAttachment) Reset() { *m = VolumeAttachment{} } @@ -315,6 +321,16 @@ func (m *CSINode) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a { size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -476,6 +492,43 @@ func (m *CSINodeSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *CSINodeStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CSINodeStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CSINodeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.StorageHealth) > 0 { + for iNdEx := len(m.StorageHealth) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.StorageHealth[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *CSIStorageCapacity) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -753,6 +806,110 @@ func (m *StorageClassList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *StorageHealth) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StorageHealth) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StorageHealth) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.HealthConditions) > 0 { + for iNdEx := len(m.HealthConditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.HealthConditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *StorageHealthCondition) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StorageHealthCondition) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StorageHealthCondition) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.LastTransitionTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + if m.VolumeMode != nil { + i -= len(*m.VolumeMode) + copy(dAtA[i:], *m.VolumeMode) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.VolumeMode))) + i-- + dAtA[i] = 0x2a + } + if m.AccessMode != nil { + i -= len(*m.AccessMode) + copy(dAtA[i:], *m.AccessMode) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.AccessMode))) + i-- + dAtA[i] = 0x22 + } + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x1a + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0x12 + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *TokenRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1330,6 +1487,8 @@ func (m *CSINode) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = m.Spec.Size() n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -1388,6 +1547,21 @@ func (m *CSINodeSpec) Size() (n int) { return n } +func (m *CSINodeStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.StorageHealth) > 0 { + for _, e := range m.StorageHealth { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + func (m *CSIStorageCapacity) Size() (n int) { if m == nil { return 0 @@ -1491,6 +1665,48 @@ func (m *StorageClassList) Size() (n int) { return n } +func (m *StorageHealth) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.HealthConditions) > 0 { + for _, e := range m.HealthConditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *StorageHealthCondition) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Status) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Reason) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Message) + n += 1 + l + sovGenerated(uint64(l)) + if m.AccessMode != nil { + l = len(*m.AccessMode) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.VolumeMode != nil { + l = len(*m.VolumeMode) + n += 1 + l + sovGenerated(uint64(l)) + } + l = m.LastTransitionTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m *TokenRequest) Size() (n int) { if m == nil { return 0 @@ -1726,6 +1942,7 @@ func (this *CSINode) String() string { s := strings.Join([]string{`&CSINode{`, `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "CSINodeSpec", "CSINodeSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "CSINodeStatus", "CSINodeStatus", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -1774,6 +1991,21 @@ func (this *CSINodeSpec) String() string { }, "") return s } +func (this *CSINodeStatus) String() string { + if this == nil { + return "nil" + } + repeatedStringForStorageHealth := "[]StorageHealth{" + for _, f := range this.StorageHealth { + repeatedStringForStorageHealth += strings.Replace(strings.Replace(f.String(), "StorageHealth", "StorageHealth", 1), `&`, ``, 1) + "," + } + repeatedStringForStorageHealth += "}" + s := strings.Join([]string{`&CSINodeStatus{`, + `StorageHealth:` + repeatedStringForStorageHealth + `,`, + `}`, + }, "") + return s +} func (this *CSIStorageCapacity) String() string { if this == nil { return "nil" @@ -1852,6 +2084,37 @@ func (this *StorageClassList) String() string { }, "") return s } +func (this *StorageHealth) String() string { + if this == nil { + return "nil" + } + repeatedStringForHealthConditions := "[]StorageHealthCondition{" + for _, f := range this.HealthConditions { + repeatedStringForHealthConditions += strings.Replace(strings.Replace(f.String(), "StorageHealthCondition", "StorageHealthCondition", 1), `&`, ``, 1) + "," + } + repeatedStringForHealthConditions += "}" + s := strings.Join([]string{`&StorageHealth{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `HealthConditions:` + repeatedStringForHealthConditions + `,`, + `}`, + }, "") + return s +} +func (this *StorageHealthCondition) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&StorageHealthCondition{`, + `Status:` + fmt.Sprintf("%v", this.Status) + `,`, + `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, + `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + `AccessMode:` + valueToStringGenerated(this.AccessMode) + `,`, + `VolumeMode:` + valueToStringGenerated(this.VolumeMode) + `,`, + `LastTransitionTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastTransitionTime), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} func (this *TokenRequest) String() string { if this == nil { return "nil" @@ -2649,6 +2912,39 @@ func (m *CSINode) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -3053,7 +3349,7 @@ func (m *CSINodeSpec) Unmarshal(dAtA []byte) error { } return nil } -func (m *CSIStorageCapacity) Unmarshal(dAtA []byte) error { +func (m *CSINodeStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3076,15 +3372,15 @@ func (m *CSIStorageCapacity) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CSIStorageCapacity: wiretype end group for non-group") + return fmt.Errorf("proto: CSINodeStatus: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CSIStorageCapacity: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: CSINodeStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StorageHealth", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3111,30 +3407,114 @@ func (m *CSIStorageCapacity) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.StorageHealth = append(m.StorageHealth, StorageHealth{}) + if err := m.StorageHealth[len(m.StorageHealth)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeTopology", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err } - if msglen < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CSIStorageCapacity) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CSIStorageCapacity: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CSIStorageCapacity: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeTopology", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + msglen @@ -3905,6 +4285,367 @@ func (m *StorageClassList) Unmarshal(dAtA []byte) error { } return nil } +func (m *StorageHealth) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StorageHealth: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StorageHealth: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HealthConditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HealthConditions = append(m.HealthConditions, StorageHealthCondition{}) + if err := m.HealthConditions[len(m.HealthConditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StorageHealthCondition) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StorageHealthCondition: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StorageHealthCondition: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = StorageHealthStatusType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessMode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := k8s_io_api_core_v1.PersistentVolumeAccessMode(dAtA[iNdEx:postIndex]) + m.AccessMode = &s + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VolumeMode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := k8s_io_api_core_v1.PersistentVolumeMode(dAtA[iNdEx:postIndex]) + m.VolumeMode = &s + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *TokenRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/vendor/k8s.io/api/storage/v1/generated.proto b/vendor/k8s.io/api/storage/v1/generated.proto index d6bc969bb3..dc3855e235 100644 --- a/vendor/k8s.io/api/storage/v1/generated.proto +++ b/vendor/k8s.io/api/storage/v1/generated.proto @@ -36,7 +36,7 @@ option go_package = "k8s.io/api/storage/v1"; // Kubelet uses this object to determine whether pod information needs to be passed on mount. // CSIDriver objects are non-namespaced. message CSIDriver { - // Standard object metadata. + // metadata is the standard object metadata. // metadata.Name indicates the name of the CSI driver that this object // refers to; it MUST be the same name returned by the CSI GetPluginName() // call for that driver. @@ -124,6 +124,8 @@ message CSIDriverSpec { // // +optional // +listType=set + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:immutable repeated string volumeLifecycleModes = 3; // storageCapacity indicates that the CSI volume driver wants pod scheduling to consider the storage @@ -250,7 +252,7 @@ message CSIDriverSpec { // +optional optional bool serviceAccountTokenInSecrets = 10; - // PreventPodSchedulingIfMissing indicates that the CSI driver wants to prevent pod + // preventPodSchedulingIfMissing indicates that the CSI driver wants to prevent pod // scheduling if the CSI driver on the node is missing. // // Enabling this option will prevent the scheduler (or any other @@ -265,7 +267,7 @@ message CSIDriverSpec { // newly created node may be rejected by the scheduler because of missing CSI driver // information from the node. // - // This is an alpha feature and requires the VolumeLimitScaling feature gate to be enabled. + // This is a beta feature and requires the VolumeLimitScaling feature gate to be enabled. // Default is "false". // +featureGate=VolumeLimitScaling // +optional @@ -282,12 +284,16 @@ message CSIDriverSpec { // enough that it doesn't create this object. // CSINode has an OwnerReference that points to the corresponding node object. message CSINode { - // Standard object's metadata. + // metadata is the standard object metadata. // metadata.name must be the Kubernetes node name. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec is the specification of CSINode optional CSINodeSpec spec = 2; + + // status contains health and status information for the node's storage. + // +optional + optional CSINodeStatus status = 3; } // CSINodeDriver holds information about the specification of one CSI driver installed on a node @@ -350,6 +356,18 @@ message CSINodeSpec { repeated CSINodeDriver drivers = 1; } +// CSINodeStatus contains health and status information for storage on a node. +message CSINodeStatus { + // storageHealth contains backend health reports for CSI drivers registered on the node. + // +optional + // +listType=map + // +listMapKey=name + // +patchMergeKey=name + // +patchStrategy=merge + // +featureGate=CSIVolumeHealth + repeated StorageHealth storageHealth = 1; +} + // CSIStorageCapacity stores the result of one CSI GetCapacity call. // For a given StorageClass, this describes the available capacity in a // particular topology segment. This can be used when considering where to @@ -375,7 +393,7 @@ message CSINodeSpec { // the scheduler assumes that capacity is insufficient and tries some other // node. message CSIStorageCapacity { - // Standard object's metadata. + // metadata is the standard object metadata. // The name has no particular meaning. It must be a DNS subdomain (dots allowed, 253 characters). // To ensure that there are no conflicts with other CSI drivers on the cluster, // the recommendation is to use csisc-, a generated name, or a reverse-domain name @@ -448,29 +466,29 @@ message CSIStorageCapacityList { // StorageClasses are non-namespaced; the name of the storage class // according to etcd is in ObjectMeta.Name. message StorageClass { - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // provisioner indicates the type of the provisioner. // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:immutable optional string provisioner = 2; // parameters holds the parameters for the provisioner that should // create volumes of this storage class. // +optional - // +k8s:alpha(since: "1.36")=+k8s:immutable - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:optional map parameters = 3; // reclaimPolicy controls the reclaimPolicy for dynamically provisioned PersistentVolumes of this storage class. // Defaults to Delete. // +optional - // +k8s:alpha(since: "1.36")=+k8s:immutable - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:optional optional string reclaimPolicy = 4; // mountOptions controls the mountOptions for dynamically provisioned PersistentVolumes of this storage class. @@ -488,8 +506,8 @@ message StorageClass { // provisioned and bound. When unset, VolumeBindingImmediate is used. // This field is only honored by servers that enable the VolumeScheduling feature. // +optional - // +k8s:alpha(since: "1.36")=+k8s:immutable - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:optional optional string volumeBindingMode = 7; // allowedTopologies restrict the node topologies where volumes can be dynamically provisioned. @@ -512,6 +530,50 @@ message StorageClassList { repeated StorageClass items = 2; } +// StorageHealth contains storage backend health reported by a CSI driver on a node. +message StorageHealth { + // name is the CSI driver name, matching CSINodeDriver.name. + // +required + optional string name = 1; + + // healthConditions are the adverse storage backend conditions reported by the CSI driver. + // At most 16 conditions may be reported. + // +optional + // +listType=atomic + repeated StorageHealthCondition healthConditions = 2; +} + +// StorageHealthCondition represents an adverse health condition reported +// by a CSI driver for its storage backend on a node. +message StorageHealthCondition { + // status is the health status category. + // One of "StorageUnreachable", "StorageDegraded". + // +required + optional string status = 1; + + // reason is a brief CamelCase machine-parseable reason. + // Maximum permitted length of a reason is 256 characters. + // +required + optional string reason = 2; + + // message is a human-readable description. + // +optional + // Maximum permitted length of a message is 1024 characters. + optional string message = 3; + + // accessMode is the access mode affected. Nil means all access modes are affected. + // +optional + optional string accessMode = 4; + + // volumeMode is the volume mode affected. Nil means both are affected. + // +optional + optional string volumeMode = 5; + + // lastTransitionTime is when this condition first appeared at its current state. + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 6; +} + // TokenRequest contains parameters of a service account token. message TokenRequest { // audience is the intended audience of the token in "TokenRequestSpec". @@ -530,14 +592,14 @@ message TokenRequest { // // VolumeAttachment objects are non-namespaced. message VolumeAttachment { - // Standard object metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec represents specification of the desired attach/detach volume behavior. // Populated by the Kubernetes system. - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:immutable // +required optional VolumeAttachmentSpec spec = 2; @@ -583,9 +645,9 @@ message VolumeAttachmentSpec { // attacher indicates the name of the volume driver that MUST handle this // request. This is the name returned by GetPluginName(). // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format="k8s-long-name-caseless" - // +k8s:alpha(since: "1.36")=+k8s:maxLength=63 + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format="k8s-long-name-caseless" + // +k8s:beta(since: "1.37")=+k8s:maxLength=63 optional string attacher = 1; // source represents the volume that should be attached. @@ -627,12 +689,12 @@ message VolumeAttachmentStatus { // defined by the CSI driver. The class can be specified during dynamic provisioning // of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning. message VolumeAttributesClass { - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Name of the CSI driver + // driverName is the name of the CSI driver // This field is immutable. optional string driverName = 2; diff --git a/vendor/k8s.io/api/storage/v1/types.go b/vendor/k8s.io/api/storage/v1/types.go index c65ebed4ec..f5499b8106 100644 --- a/vendor/k8s.io/api/storage/v1/types.go +++ b/vendor/k8s.io/api/storage/v1/types.go @@ -33,31 +33,31 @@ import ( // StorageClasses are non-namespaced; the name of the storage class // according to etcd is in ObjectMeta.Name. type StorageClass struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // provisioner indicates the type of the provisioner. // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:immutable Provisioner string `json:"provisioner" protobuf:"bytes,2,opt,name=provisioner"` // parameters holds the parameters for the provisioner that should // create volumes of this storage class. // +optional - // +k8s:alpha(since: "1.36")=+k8s:immutable - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:optional Parameters map[string]string `json:"parameters,omitempty" protobuf:"bytes,3,rep,name=parameters"` // reclaimPolicy controls the reclaimPolicy for dynamically provisioned PersistentVolumes of this storage class. // Defaults to Delete. // +optional - // +k8s:alpha(since: "1.36")=+k8s:immutable - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:optional ReclaimPolicy *v1.PersistentVolumeReclaimPolicy `json:"reclaimPolicy,omitempty" protobuf:"bytes,4,opt,name=reclaimPolicy,casttype=k8s.io/api/core/v1.PersistentVolumeReclaimPolicy"` // mountOptions controls the mountOptions for dynamically provisioned PersistentVolumes of this storage class. @@ -75,8 +75,8 @@ type StorageClass struct { // provisioned and bound. When unset, VolumeBindingImmediate is used. // This field is only honored by servers that enable the VolumeScheduling feature. // +optional - // +k8s:alpha(since: "1.36")=+k8s:immutable - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:optional VolumeBindingMode *VolumeBindingMode `json:"volumeBindingMode,omitempty" protobuf:"bytes,7,opt,name=volumeBindingMode"` // allowedTopologies restrict the node topologies where volumes can be dynamically provisioned. @@ -93,7 +93,7 @@ type StorageClass struct { // StorageClassList is a collection of storage classes. type StorageClassList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -131,16 +131,16 @@ const ( // // VolumeAttachment objects are non-namespaced. type VolumeAttachment struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec represents specification of the desired attach/detach volume behavior. // Populated by the Kubernetes system. - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:immutable // +required Spec VolumeAttachmentSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` @@ -156,7 +156,7 @@ type VolumeAttachment struct { // VolumeAttachmentList is a collection of VolumeAttachment objects. type VolumeAttachmentList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -172,9 +172,9 @@ type VolumeAttachmentSpec struct { // attacher indicates the name of the volume driver that MUST handle this // request. This is the name returned by GetPluginName(). // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format="k8s-long-name-caseless" - // +k8s:alpha(since: "1.36")=+k8s:maxLength=63 + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format="k8s-long-name-caseless" + // +k8s:beta(since: "1.37")=+k8s:maxLength=63 Attacher string `json:"attacher" protobuf:"bytes,1,opt,name=attacher"` // source represents the volume that should be attached. @@ -263,9 +263,9 @@ type VolumeError struct { // Kubelet uses this object to determine whether pod information needs to be passed on mount. // CSIDriver objects are non-namespaced. type CSIDriver struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object metadata. + // metadata is the standard object metadata. // metadata.Name indicates the name of the CSI driver that this object // refers to; it MUST be the same name returned by the CSI GetPluginName() // call for that driver. @@ -284,7 +284,7 @@ type CSIDriver struct { // CSIDriverList is a collection of CSIDriver objects. type CSIDriverList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -358,6 +358,8 @@ type CSIDriverSpec struct { // // +optional // +listType=set + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:immutable VolumeLifecycleModes []VolumeLifecycleMode `json:"volumeLifecycleModes,omitempty" protobuf:"bytes,3,opt,name=volumeLifecycleModes"` // storageCapacity indicates that the CSI volume driver wants pod scheduling to consider the storage @@ -484,7 +486,7 @@ type CSIDriverSpec struct { // +optional ServiceAccountTokenInSecrets *bool `json:"serviceAccountTokenInSecrets,omitempty" protobuf:"varint,10,opt,name=serviceAccountTokenInSecrets"` - // PreventPodSchedulingIfMissing indicates that the CSI driver wants to prevent pod + // preventPodSchedulingIfMissing indicates that the CSI driver wants to prevent pod // scheduling if the CSI driver on the node is missing. // // Enabling this option will prevent the scheduler (or any other @@ -499,7 +501,7 @@ type CSIDriverSpec struct { // newly created node may be rejected by the scheduler because of missing CSI driver // information from the node. // - // This is an alpha feature and requires the VolumeLimitScaling feature gate to be enabled. + // This is a beta feature and requires the VolumeLimitScaling feature gate to be enabled. // Default is "false". // +featureGate=VolumeLimitScaling // +optional @@ -580,6 +582,7 @@ const ( // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.17 +// +k8s:supportsSubresource="/status" // CSINode holds information about all CSI drivers installed on a node. // CSI drivers do not need to create the CSINode object directly. As long as @@ -591,14 +594,18 @@ const ( // enough that it doesn't create this object. // CSINode has an OwnerReference that points to the corresponding node object. type CSINode struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object's metadata. + // metadata is the standard object metadata. // metadata.name must be the Kubernetes node name. metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec is the specification of CSINode Spec CSINodeSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` + + // status contains health and status information for the node's storage. + // +optional + Status CSINodeStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } // CSINodeSpec holds information about the specification of all CSI drivers installed on a node @@ -660,12 +667,73 @@ type VolumeNodeResources struct { Count *int32 `json:"count,omitempty" protobuf:"varint,1,opt,name=count"` } +// StorageHealthStatusType describes the health status category of a storage backend. +// +enum +type StorageHealthStatusType string + +const ( + // StorageUnreachable indicates the storage backend is unreachable. + StorageUnreachable StorageHealthStatusType = "StorageUnreachable" + // StorageDegraded indicates the storage backend is functioning with reduced capability. + StorageDegraded StorageHealthStatusType = "StorageDegraded" +) + +// StorageHealthCondition represents an adverse health condition reported +// by a CSI driver for its storage backend on a node. +type StorageHealthCondition struct { + // status is the health status category. + // One of "StorageUnreachable", "StorageDegraded". + // +required + Status StorageHealthStatusType `json:"status" protobuf:"bytes,1,opt,name=status,casttype=StorageHealthStatusType"` + // reason is a brief CamelCase machine-parseable reason. + // Maximum permitted length of a reason is 256 characters. + // +required + Reason string `json:"reason" protobuf:"bytes,2,opt,name=reason"` + // message is a human-readable description. + // +optional + // Maximum permitted length of a message is 1024 characters. + Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"` + // accessMode is the access mode affected. Nil means all access modes are affected. + // +optional + AccessMode *v1.PersistentVolumeAccessMode `json:"accessMode,omitempty" protobuf:"bytes,4,opt,name=accessMode,casttype=k8s.io/api/core/v1.PersistentVolumeAccessMode"` + // volumeMode is the volume mode affected. Nil means both are affected. + // +optional + VolumeMode *v1.PersistentVolumeMode `json:"volumeMode,omitempty" protobuf:"bytes,5,opt,name=volumeMode,casttype=k8s.io/api/core/v1.PersistentVolumeMode"` + // lastTransitionTime is when this condition first appeared at its current state. + // +optional + LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,6,opt,name=lastTransitionTime"` +} + +// StorageHealth contains storage backend health reported by a CSI driver on a node. +type StorageHealth struct { + // name is the CSI driver name, matching CSINodeDriver.name. + // +required + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + // healthConditions are the adverse storage backend conditions reported by the CSI driver. + // At most 16 conditions may be reported. + // +optional + // +listType=atomic + HealthConditions []StorageHealthCondition `json:"healthConditions,omitempty" protobuf:"bytes,2,rep,name=healthConditions"` +} + +// CSINodeStatus contains health and status information for storage on a node. +type CSINodeStatus struct { + // storageHealth contains backend health reports for CSI drivers registered on the node. + // +optional + // +listType=map + // +listMapKey=name + // +patchMergeKey=name + // +patchStrategy=merge + // +featureGate=CSIVolumeHealth + StorageHealth []StorageHealth `json:"storageHealth,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,1,rep,name=storageHealth"` +} + // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.17 // CSINodeList is a collection of CSINode objects. type CSINodeList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -705,9 +773,9 @@ type CSINodeList struct { // the scheduler assumes that capacity is insufficient and tries some other // node. type CSIStorageCapacity struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object's metadata. + // metadata is the standard object metadata. // The name has no particular meaning. It must be a DNS subdomain (dots allowed, 253 characters). // To ensure that there are no conflicts with other CSI drivers on the cluster, // the recommendation is to use csisc-, a generated name, or a reverse-domain name @@ -768,7 +836,7 @@ type CSIStorageCapacity struct { // CSIStorageCapacityList is a collection of CSIStorageCapacity objects. type CSIStorageCapacityList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -788,14 +856,14 @@ type CSIStorageCapacityList struct { // defined by the CSI driver. The class can be specified during dynamic provisioning // of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning. type VolumeAttributesClass struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Name of the CSI driver + // driverName is the name of the CSI driver // This field is immutable. DriverName string `json:"driverName" protobuf:"bytes,2,opt,name=driverName"` @@ -820,7 +888,7 @@ type VolumeAttributesClass struct { // VolumeAttributesClassList is a collection of VolumeAttributesClass objects. type VolumeAttributesClassList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata diff --git a/vendor/k8s.io/api/storage/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/storage/v1/types_swagger_doc_generated.go index 47a7e92492..62a910422f 100644 --- a/vendor/k8s.io/api/storage/v1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/storage/v1/types_swagger_doc_generated.go @@ -29,7 +29,7 @@ package v1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_CSIDriver = map[string]string{ "": "CSIDriver captures information about a Container Storage Interface (CSI) volume driver deployed on the cluster. Kubernetes attach detach controller uses this object to determine whether attach is required. Kubelet uses this object to determine whether pod information needs to be passed on mount. CSIDriver objects are non-namespaced.", - "metadata": "Standard object metadata. metadata.Name indicates the name of the CSI driver that this object refers to; it MUST be the same name returned by the CSI GetPluginName() call for that driver. The driver name must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), dots (.), and alphanumerics between. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. metadata.Name indicates the name of the CSI driver that this object refers to; it MUST be the same name returned by the CSI GetPluginName() call for that driver. The driver name must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), dots (.), and alphanumerics between. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec represents the specification of the CSI Driver.", } @@ -59,7 +59,7 @@ var map_CSIDriverSpec = map[string]string{ "seLinuxMount": "seLinuxMount specifies if the CSI driver supports \"-o context\" mount option.\n\nWhen \"true\", the CSI driver must ensure that all volumes provided by this CSI driver can be mounted separately with different `-o context` options. This is typical for storage backends that provide volumes as filesystems on block devices or as independent shared volumes. Kubernetes will call NodeStage / NodePublish with \"-o context=xyz\" mount option when mounting a ReadWriteOncePod volume used in Pod that has explicitly set SELinux context. In the future, it may be expanded to other volume AccessModes. In any case, Kubernetes will ensure that the volume is mounted only with a single SELinux context.\n\nWhen \"false\", Kubernetes won't pass any special SELinux mount options to the driver. This is typical for volumes that represent subdirectories of a bigger shared filesystem.\n\nDefault is \"false\".", "nodeAllocatableUpdatePeriodSeconds": "nodeAllocatableUpdatePeriodSeconds specifies the interval between periodic updates of the CSINode allocatable capacity for this driver. When set, both periodic updates and updates triggered by capacity-related failures are enabled. If not set, no updates occur (neither periodic nor upon detecting capacity-related failures), and the allocatable.count remains static. The minimum allowed value for this field is 10 seconds.\n\nThis feature requires the MutableCSINodeAllocatableCount feature gate to be enabled.\n\nThis field is mutable.", "serviceAccountTokenInSecrets": "serviceAccountTokenInSecrets is an opt-in for CSI drivers to indicate that service account tokens should be passed via the Secrets field in NodePublishVolumeRequest instead of the VolumeContext field. The CSI specification provides a dedicated Secrets field for sensitive information like tokens, which is the appropriate mechanism for handling credentials. This addresses security concerns where sensitive tokens were being logged as part of volume context.\n\nWhen \"true\", kubelet will pass the tokens only in the Secrets field with the key \"csi.storage.k8s.io/serviceAccount.tokens\". The CSI driver must be updated to read tokens from the Secrets field instead of VolumeContext.\n\nWhen \"false\" or not set, kubelet will pass the tokens in VolumeContext with the key \"csi.storage.k8s.io/serviceAccount.tokens\" (existing behavior). This maintains backward compatibility with existing CSI drivers.\n\nThis field can only be set when TokenRequests is configured. The API server will reject CSIDriver specs that set this field without TokenRequests.\n\nDefault behavior if unset is to pass tokens in the VolumeContext field.", - "preventPodSchedulingIfMissing": "PreventPodSchedulingIfMissing indicates that the CSI driver wants to prevent pod scheduling if the CSI driver on the node is missing.\n\nEnabling this option will prevent the scheduler (or any other component which embeds default scheduler such as cluster-autoscaler) from scheduling pods to nodes where CSI driver is not installed.\n\nFor components(such as cluster-autoscaler) that embed the scheduler and run pod placement simulations using scheduler plugins, they MUST be aware of CSI driver registration information via CSINode object. They must create simulated CSINode objects in addition to Node objects during scheduling simulation, otherwise if PreventPodSchedulingIfMissing is enabled globally for CSIDriver object, any newly created node may be rejected by the scheduler because of missing CSI driver information from the node.\n\nThis is an alpha feature and requires the VolumeLimitScaling feature gate to be enabled. Default is \"false\".", + "preventPodSchedulingIfMissing": "preventPodSchedulingIfMissing indicates that the CSI driver wants to prevent pod scheduling if the CSI driver on the node is missing.\n\nEnabling this option will prevent the scheduler (or any other component which embeds default scheduler such as cluster-autoscaler) from scheduling pods to nodes where CSI driver is not installed.\n\nFor components(such as cluster-autoscaler) that embed the scheduler and run pod placement simulations using scheduler plugins, they MUST be aware of CSI driver registration information via CSINode object. They must create simulated CSINode objects in addition to Node objects during scheduling simulation, otherwise if PreventPodSchedulingIfMissing is enabled globally for CSIDriver object, any newly created node may be rejected by the scheduler because of missing CSI driver information from the node.\n\nThis is a beta feature and requires the VolumeLimitScaling feature gate to be enabled. Default is \"false\".", } func (CSIDriverSpec) SwaggerDoc() map[string]string { @@ -68,8 +68,9 @@ func (CSIDriverSpec) SwaggerDoc() map[string]string { var map_CSINode = map[string]string{ "": "CSINode holds information about all CSI drivers installed on a node. CSI drivers do not need to create the CSINode object directly. As long as they use the node-driver-registrar sidecar container, the kubelet will automatically populate the CSINode object for the CSI driver as part of kubelet plugin registration. CSINode has the same name as a node. If the object is missing, it means either there are no CSI Drivers available on the node, or the Kubelet version is low enough that it doesn't create this object. CSINode has an OwnerReference that points to the corresponding node object.", - "metadata": "Standard object's metadata. metadata.name must be the Kubernetes node name.", + "metadata": "metadata is the standard object metadata. metadata.name must be the Kubernetes node name.", "spec": "spec is the specification of CSINode", + "status": "status contains health and status information for the node's storage.", } func (CSINode) SwaggerDoc() map[string]string { @@ -107,9 +108,18 @@ func (CSINodeSpec) SwaggerDoc() map[string]string { return map_CSINodeSpec } +var map_CSINodeStatus = map[string]string{ + "": "CSINodeStatus contains health and status information for storage on a node.", + "storageHealth": "storageHealth contains backend health reports for CSI drivers registered on the node.", +} + +func (CSINodeStatus) SwaggerDoc() map[string]string { + return map_CSINodeStatus +} + var map_CSIStorageCapacity = map[string]string{ "": "CSIStorageCapacity stores the result of one CSI GetCapacity call. For a given StorageClass, this describes the available capacity in a particular topology segment. This can be used when considering where to instantiate new PersistentVolumes.\n\nFor example this can express things like: - StorageClass \"standard\" has \"1234 GiB\" available in \"topology.kubernetes.io/zone=us-east1\" - StorageClass \"localssd\" has \"10 GiB\" available in \"kubernetes.io/hostname=knode-abc123\"\n\nThe following three cases all imply that no capacity is available for a certain combination: - no object exists with suitable topology and storage class name - such an object exists, but the capacity is unset - such an object exists, but the capacity is zero\n\nThe producer of these objects can decide which approach is more suitable.\n\nThey are consumed by the kube-scheduler when a CSI driver opts into capacity-aware scheduling with CSIDriverSpec.StorageCapacity. The scheduler compares the MaximumVolumeSize against the requested size of pending volumes to filter out unsuitable nodes. If MaximumVolumeSize is unset, it falls back to a comparison against the less precise Capacity. If that is also unset, the scheduler assumes that capacity is insufficient and tries some other node.", - "metadata": "Standard object's metadata. The name has no particular meaning. It must be a DNS subdomain (dots allowed, 253 characters). To ensure that there are no conflicts with other CSI drivers on the cluster, the recommendation is to use csisc-, a generated name, or a reverse-domain name which ends with the unique CSI driver name.\n\nObjects are namespaced.\n\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. The name has no particular meaning. It must be a DNS subdomain (dots allowed, 253 characters). To ensure that there are no conflicts with other CSI drivers on the cluster, the recommendation is to use csisc-, a generated name, or a reverse-domain name which ends with the unique CSI driver name.\n\nObjects are namespaced.\n\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "nodeTopology": "nodeTopology defines which nodes have access to the storage for which capacity was reported. If not set, the storage is not accessible from any node in the cluster. If empty, the storage is accessible from all nodes. This field is immutable.", "storageClassName": "storageClassName represents the name of the StorageClass that the reported capacity applies to. It must meet the same requirements as the name of a StorageClass object (non-empty, DNS subdomain). If that object no longer exists, the CSIStorageCapacity object is obsolete and should be removed by its creator. This field is immutable.", "capacity": "capacity is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields.\n\nThe semantic is currently (CSI spec 1.2) defined as: The available capacity, in bytes, of the storage that can be used to provision volumes. If not set, that information is currently unavailable.", @@ -132,7 +142,7 @@ func (CSIStorageCapacityList) SwaggerDoc() map[string]string { var map_StorageClass = map[string]string{ "": "StorageClass describes the parameters for a class of storage for which PersistentVolumes can be dynamically provisioned.\n\nStorageClasses are non-namespaced; the name of the storage class according to etcd is in ObjectMeta.Name.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "provisioner": "provisioner indicates the type of the provisioner.", "parameters": "parameters holds the parameters for the provisioner that should create volumes of this storage class.", "reclaimPolicy": "reclaimPolicy controls the reclaimPolicy for dynamically provisioned PersistentVolumes of this storage class. Defaults to Delete.", @@ -156,6 +166,30 @@ func (StorageClassList) SwaggerDoc() map[string]string { return map_StorageClassList } +var map_StorageHealth = map[string]string{ + "": "StorageHealth contains storage backend health reported by a CSI driver on a node.", + "name": "name is the CSI driver name, matching CSINodeDriver.name.", + "healthConditions": "healthConditions are the adverse storage backend conditions reported by the CSI driver. At most 16 conditions may be reported.", +} + +func (StorageHealth) SwaggerDoc() map[string]string { + return map_StorageHealth +} + +var map_StorageHealthCondition = map[string]string{ + "": "StorageHealthCondition represents an adverse health condition reported by a CSI driver for its storage backend on a node.", + "status": "status is the health status category. One of \"StorageUnreachable\", \"StorageDegraded\".", + "reason": "reason is a brief CamelCase machine-parseable reason. Maximum permitted length of a reason is 256 characters.", + "message": "message is a human-readable description. Maximum permitted length of a message is 1024 characters.", + "accessMode": "accessMode is the access mode affected. Nil means all access modes are affected.", + "volumeMode": "volumeMode is the volume mode affected. Nil means both are affected.", + "lastTransitionTime": "lastTransitionTime is when this condition first appeared at its current state.", +} + +func (StorageHealthCondition) SwaggerDoc() map[string]string { + return map_StorageHealthCondition +} + var map_TokenRequest = map[string]string{ "": "TokenRequest contains parameters of a service account token.", "audience": "audience is the intended audience of the token in \"TokenRequestSpec\". It will default to the audiences of kube apiserver.", @@ -168,7 +202,7 @@ func (TokenRequest) SwaggerDoc() map[string]string { var map_VolumeAttachment = map[string]string{ "": "VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node.\n\nVolumeAttachment objects are non-namespaced.", - "metadata": "Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec represents specification of the desired attach/detach volume behavior. Populated by the Kubernetes system.", "status": "status represents status of the VolumeAttachment request. Populated by the entity completing the attach or detach operation, i.e. the external-attacher.", } @@ -190,6 +224,7 @@ func (VolumeAttachmentList) SwaggerDoc() map[string]string { var map_VolumeAttachmentSource = map[string]string{ "": "VolumeAttachmentSource represents a volume that should be attached. Right now only PersistentVolumes can be attached via external attacher, in the future we may allow also inline volumes in pods. Exactly one member can be set.", "persistentVolumeName": "persistentVolumeName represents the name of the persistent volume to attach.", + "inlineVolumeSpec": "inlineVolumeSpec contains all the information necessary to attach a persistent volume defined by a pod's inline VolumeSource. This field is populated only for the CSIMigration feature. It contains translated fields from a pod's inline VolumeSource to a PersistentVolumeSpec. This field is beta-level and is only honored by servers that enabled the CSIMigration feature.", } func (VolumeAttachmentSource) SwaggerDoc() map[string]string { @@ -221,8 +256,8 @@ func (VolumeAttachmentStatus) SwaggerDoc() map[string]string { var map_VolumeAttributesClass = map[string]string{ "": "VolumeAttributesClass represents a specification of mutable volume attributes defined by the CSI driver. The class can be specified during dynamic provisioning of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "driverName": "Name of the CSI driver This field is immutable.", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "driverName": "driverName is the name of the CSI driver This field is immutable.", "parameters": "parameters hold volume attributes defined by the CSI driver. These values are opaque to the Kubernetes and are passed directly to the CSI driver. The underlying storage provider supports changing these attributes on an existing volume, however the parameters field itself is immutable. To invoke a volume update, a new VolumeAttributesClass should be created with new parameters, and the PersistentVolumeClaim should be updated to reference the new VolumeAttributesClass.\n\nThis field is required and must contain at least one key/value pair. The keys cannot be empty, and the maximum number of parameters is 512, with a cumulative max size of 256K. If the CSI driver rejects invalid parameters, the target PersistentVolumeClaim will be set to an \"Infeasible\" state in the modifyVolumeStatus field.", } diff --git a/vendor/k8s.io/api/storage/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/storage/v1/zz_generated.deepcopy.go index aa3ffd0686..1df3b47555 100644 --- a/vendor/k8s.io/api/storage/v1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/storage/v1/zz_generated.deepcopy.go @@ -166,6 +166,7 @@ func (in *CSINode) DeepCopyInto(out *CSINode) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) return } @@ -269,6 +270,29 @@ func (in *CSINodeSpec) DeepCopy() *CSINodeSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CSINodeStatus) DeepCopyInto(out *CSINodeStatus) { + *out = *in + if in.StorageHealth != nil { + in, out := &in.StorageHealth, &out.StorageHealth + *out = make([]StorageHealth, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CSINodeStatus. +func (in *CSINodeStatus) DeepCopy() *CSINodeStatus { + if in == nil { + return nil + } + out := new(CSINodeStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CSIStorageCapacity) DeepCopyInto(out *CSIStorageCapacity) { *out = *in @@ -436,6 +460,56 @@ func (in *StorageClassList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StorageHealth) DeepCopyInto(out *StorageHealth) { + *out = *in + if in.HealthConditions != nil { + in, out := &in.HealthConditions, &out.HealthConditions + *out = make([]StorageHealthCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageHealth. +func (in *StorageHealth) DeepCopy() *StorageHealth { + if in == nil { + return nil + } + out := new(StorageHealth) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StorageHealthCondition) DeepCopyInto(out *StorageHealthCondition) { + *out = *in + if in.AccessMode != nil { + in, out := &in.AccessMode, &out.AccessMode + *out = new(corev1.PersistentVolumeAccessMode) + **out = **in + } + if in.VolumeMode != nil { + in, out := &in.VolumeMode, &out.VolumeMode + *out = new(corev1.PersistentVolumeMode) + **out = **in + } + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageHealthCondition. +func (in *StorageHealthCondition) DeepCopy() *StorageHealthCondition { + if in == nil { + return nil + } + out := new(StorageHealthCondition) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TokenRequest) DeepCopyInto(out *TokenRequest) { *out = *in diff --git a/vendor/k8s.io/api/storage/v1/zz_generated.model_name.go b/vendor/k8s.io/api/storage/v1/zz_generated.model_name.go index 6ef6371006..4eaabcbc31 100644 --- a/vendor/k8s.io/api/storage/v1/zz_generated.model_name.go +++ b/vendor/k8s.io/api/storage/v1/zz_generated.model_name.go @@ -56,6 +56,11 @@ func (in CSINodeSpec) OpenAPIModelName() string { return "io.k8s.api.storage.v1.CSINodeSpec" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CSINodeStatus) OpenAPIModelName() string { + return "io.k8s.api.storage.v1.CSINodeStatus" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in CSIStorageCapacity) OpenAPIModelName() string { return "io.k8s.api.storage.v1.CSIStorageCapacity" @@ -76,6 +81,16 @@ func (in StorageClassList) OpenAPIModelName() string { return "io.k8s.api.storage.v1.StorageClassList" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in StorageHealth) OpenAPIModelName() string { + return "io.k8s.api.storage.v1.StorageHealth" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in StorageHealthCondition) OpenAPIModelName() string { + return "io.k8s.api.storage.v1.StorageHealthCondition" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in TokenRequest) OpenAPIModelName() string { return "io.k8s.api.storage.v1.TokenRequest" diff --git a/vendor/k8s.io/api/storage/v1alpha1/generated.proto b/vendor/k8s.io/api/storage/v1alpha1/generated.proto index 837d011640..dae07a7010 100644 --- a/vendor/k8s.io/api/storage/v1alpha1/generated.proto +++ b/vendor/k8s.io/api/storage/v1alpha1/generated.proto @@ -55,7 +55,7 @@ option go_package = "k8s.io/api/storage/v1alpha1"; // the scheduler assumes that capacity is insufficient and tries some other // node. message CSIStorageCapacity { - // Standard object's metadata. The name has no particular meaning. It must be + // metadata is the standard object metadata. The name has no particular meaning. It must be // be a DNS subdomain (dots allowed, 253 characters). To ensure that // there are no conflicts with other CSI drivers on the cluster, the recommendation // is to use csisc-, a generated name, or a reverse-domain name which ends @@ -127,14 +127,14 @@ message CSIStorageCapacityList { // // VolumeAttachment objects are non-namespaced. message VolumeAttachment { - // Standard object metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec represents specification of the desired attach/detach volume behavior. // Populated by the Kubernetes system. - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:immutable // +required optional VolumeAttachmentSpec spec = 2; @@ -180,9 +180,9 @@ message VolumeAttachmentSpec { // attacher indicates the name of the volume driver that MUST handle this // request. This is the name returned by GetPluginName(). // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format="k8s-long-name-caseless" - // +k8s:alpha(since: "1.36")=+k8s:maxLength=63 + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format="k8s-long-name-caseless" + // +k8s:beta(since: "1.37")=+k8s:maxLength=63 optional string attacher = 1; // source represents the volume that should be attached. @@ -224,12 +224,12 @@ message VolumeAttachmentStatus { // defined by the CSI driver. The class can be specified during dynamic provisioning // of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning. message VolumeAttributesClass { - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Name of the CSI driver + // driverName is the name of the CSI driver // This field is immutable. optional string driverName = 2; diff --git a/vendor/k8s.io/api/storage/v1alpha1/types.go b/vendor/k8s.io/api/storage/v1alpha1/types.go index 286ac42aaa..655dea1984 100644 --- a/vendor/k8s.io/api/storage/v1alpha1/types.go +++ b/vendor/k8s.io/api/storage/v1alpha1/types.go @@ -35,16 +35,16 @@ import ( // // VolumeAttachment objects are non-namespaced. type VolumeAttachment struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec represents specification of the desired attach/detach volume behavior. // Populated by the Kubernetes system. - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:immutable // +required Spec VolumeAttachmentSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` @@ -62,7 +62,7 @@ type VolumeAttachment struct { // VolumeAttachmentList is a collection of VolumeAttachment objects. type VolumeAttachmentList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -78,9 +78,9 @@ type VolumeAttachmentSpec struct { // attacher indicates the name of the volume driver that MUST handle this // request. This is the name returned by GetPluginName(). // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format="k8s-long-name-caseless" - // +k8s:alpha(since: "1.36")=+k8s:maxLength=63 + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format="k8s-long-name-caseless" + // +k8s:beta(since: "1.37")=+k8s:maxLength=63 Attacher string `json:"attacher" protobuf:"bytes,1,opt,name=attacher"` // source represents the volume that should be attached. @@ -189,9 +189,9 @@ type VolumeError struct { // the scheduler assumes that capacity is insufficient and tries some other // node. type CSIStorageCapacity struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object's metadata. The name has no particular meaning. It must be + // metadata is the standard object metadata. The name has no particular meaning. It must be // be a DNS subdomain (dots allowed, 253 characters). To ensure that // there are no conflicts with other CSI drivers on the cluster, the recommendation // is to use csisc-, a generated name, or a reverse-domain name which ends @@ -254,7 +254,7 @@ type CSIStorageCapacity struct { // CSIStorageCapacityList is a collection of CSIStorageCapacity objects. type CSIStorageCapacityList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -276,14 +276,14 @@ type CSIStorageCapacityList struct { // defined by the CSI driver. The class can be specified during dynamic provisioning // of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning. type VolumeAttributesClass struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Name of the CSI driver + // driverName is the name of the CSI driver // This field is immutable. DriverName string `json:"driverName" protobuf:"bytes,2,opt,name=driverName"` @@ -310,7 +310,7 @@ type VolumeAttributesClass struct { // VolumeAttributesClassList is a collection of VolumeAttributesClass objects. type VolumeAttributesClassList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata diff --git a/vendor/k8s.io/api/storage/v1alpha1/types_swagger_doc_generated.go b/vendor/k8s.io/api/storage/v1alpha1/types_swagger_doc_generated.go index 713498b372..ff86ad26e8 100644 --- a/vendor/k8s.io/api/storage/v1alpha1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/storage/v1alpha1/types_swagger_doc_generated.go @@ -29,7 +29,7 @@ package v1alpha1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_CSIStorageCapacity = map[string]string{ "": "CSIStorageCapacity stores the result of one CSI GetCapacity call. For a given StorageClass, this describes the available capacity in a particular topology segment. This can be used when considering where to instantiate new PersistentVolumes.\n\nFor example this can express things like: - StorageClass \"standard\" has \"1234 GiB\" available in \"topology.kubernetes.io/zone=us-east1\" - StorageClass \"localssd\" has \"10 GiB\" available in \"kubernetes.io/hostname=knode-abc123\"\n\nThe following three cases all imply that no capacity is available for a certain combination: - no object exists with suitable topology and storage class name - such an object exists, but the capacity is unset - such an object exists, but the capacity is zero\n\nThe producer of these objects can decide which approach is more suitable.\n\nThey are consumed by the kube-scheduler when a CSI driver opts into capacity-aware scheduling with CSIDriverSpec.StorageCapacity. The scheduler compares the MaximumVolumeSize against the requested size of pending volumes to filter out unsuitable nodes. If MaximumVolumeSize is unset, it falls back to a comparison against the less precise Capacity. If that is also unset, the scheduler assumes that capacity is insufficient and tries some other node.", - "metadata": "Standard object's metadata. The name has no particular meaning. It must be be a DNS subdomain (dots allowed, 253 characters). To ensure that there are no conflicts with other CSI drivers on the cluster, the recommendation is to use csisc-, a generated name, or a reverse-domain name which ends with the unique CSI driver name.\n\nObjects are namespaced.\n\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. The name has no particular meaning. It must be be a DNS subdomain (dots allowed, 253 characters). To ensure that there are no conflicts with other CSI drivers on the cluster, the recommendation is to use csisc-, a generated name, or a reverse-domain name which ends with the unique CSI driver name.\n\nObjects are namespaced.\n\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "nodeTopology": "nodeTopology defines which nodes have access to the storage for which capacity was reported. If not set, the storage is not accessible from any node in the cluster. If empty, the storage is accessible from all nodes. This field is immutable.", "storageClassName": "storageClassName represents the name of the StorageClass that the reported capacity applies to. It must meet the same requirements as the name of a StorageClass object (non-empty, DNS subdomain). If that object no longer exists, the CSIStorageCapacity object is obsolete and should be removed by its creator. This field is immutable.", "capacity": "capacity is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields.\n\nThe semantic is currently (CSI spec 1.2) defined as: The available capacity, in bytes, of the storage that can be used to provision volumes. If not set, that information is currently unavailable.", @@ -52,7 +52,7 @@ func (CSIStorageCapacityList) SwaggerDoc() map[string]string { var map_VolumeAttachment = map[string]string{ "": "VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node.\n\nVolumeAttachment objects are non-namespaced.", - "metadata": "Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec represents specification of the desired attach/detach volume behavior. Populated by the Kubernetes system.", "status": "status represents status of the VolumeAttachment request. Populated by the entity completing the attach or detach operation, i.e. the external-attacher.", } @@ -74,6 +74,7 @@ func (VolumeAttachmentList) SwaggerDoc() map[string]string { var map_VolumeAttachmentSource = map[string]string{ "": "VolumeAttachmentSource represents a volume that should be attached. Right now only PersistentVolumes can be attached via external attacher, in the future we may allow also inline volumes in pods. Exactly one member can be set.", "persistentVolumeName": "persistentVolumeName represents the name of the persistent volume to attach.", + "inlineVolumeSpec": "inlineVolumeSpec contains all the information necessary to attach a persistent volume defined by a pod's inline VolumeSource. This field is populated only for the CSIMigration feature. It contains translated fields from a pod's inline VolumeSource to a PersistentVolumeSpec. This field is alpha-level and is only honored by servers that enabled the CSIMigration feature.", } func (VolumeAttachmentSource) SwaggerDoc() map[string]string { @@ -105,8 +106,8 @@ func (VolumeAttachmentStatus) SwaggerDoc() map[string]string { var map_VolumeAttributesClass = map[string]string{ "": "VolumeAttributesClass represents a specification of mutable volume attributes defined by the CSI driver. The class can be specified during dynamic provisioning of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "driverName": "Name of the CSI driver This field is immutable.", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "driverName": "driverName is the name of the CSI driver This field is immutable.", "parameters": "parameters hold volume attributes defined by the CSI driver. These values are opaque to the Kubernetes and are passed directly to the CSI driver. The underlying storage provider supports changing these attributes on an existing volume, however the parameters field itself is immutable. To invoke a volume update, a new VolumeAttributesClass should be created with new parameters, and the PersistentVolumeClaim should be updated to reference the new VolumeAttributesClass.\n\nThis field is required and must contain at least one key/value pair. The keys cannot be empty, and the maximum number of parameters is 512, with a cumulative max size of 256K. If the CSI driver rejects invalid parameters, the target PersistentVolumeClaim will be set to an \"Infeasible\" state in the modifyVolumeStatus field.", } diff --git a/vendor/k8s.io/api/storage/v1beta1/generated.pb.go b/vendor/k8s.io/api/storage/v1beta1/generated.pb.go index 7fd08783aa..dff4bae5e3 100644 --- a/vendor/k8s.io/api/storage/v1beta1/generated.pb.go +++ b/vendor/k8s.io/api/storage/v1beta1/generated.pb.go @@ -49,6 +49,8 @@ func (m *CSINodeList) Reset() { *m = CSINodeList{} } func (m *CSINodeSpec) Reset() { *m = CSINodeSpec{} } +func (m *CSINodeStatus) Reset() { *m = CSINodeStatus{} } + func (m *CSIStorageCapacity) Reset() { *m = CSIStorageCapacity{} } func (m *CSIStorageCapacityList) Reset() { *m = CSIStorageCapacityList{} } @@ -57,6 +59,10 @@ func (m *StorageClass) Reset() { *m = StorageClass{} } func (m *StorageClassList) Reset() { *m = StorageClassList{} } +func (m *StorageHealth) Reset() { *m = StorageHealth{} } + +func (m *StorageHealthCondition) Reset() { *m = StorageHealthCondition{} } + func (m *TokenRequest) Reset() { *m = TokenRequest{} } func (m *VolumeAttachment) Reset() { *m = VolumeAttachment{} } @@ -315,6 +321,16 @@ func (m *CSINode) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a { size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -476,6 +492,43 @@ func (m *CSINodeSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *CSINodeStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CSINodeStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CSINodeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.StorageHealth) > 0 { + for iNdEx := len(m.StorageHealth) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.StorageHealth[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *CSIStorageCapacity) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -753,6 +806,110 @@ func (m *StorageClassList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *StorageHealth) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StorageHealth) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StorageHealth) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.HealthConditions) > 0 { + for iNdEx := len(m.HealthConditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.HealthConditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *StorageHealthCondition) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StorageHealthCondition) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StorageHealthCondition) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.LastTransitionTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + if m.VolumeMode != nil { + i -= len(*m.VolumeMode) + copy(dAtA[i:], *m.VolumeMode) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.VolumeMode))) + i-- + dAtA[i] = 0x2a + } + if m.AccessMode != nil { + i -= len(*m.AccessMode) + copy(dAtA[i:], *m.AccessMode) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.AccessMode))) + i-- + dAtA[i] = 0x22 + } + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x1a + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0x12 + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *TokenRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1330,6 +1487,8 @@ func (m *CSINode) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = m.Spec.Size() n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -1388,6 +1547,21 @@ func (m *CSINodeSpec) Size() (n int) { return n } +func (m *CSINodeStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.StorageHealth) > 0 { + for _, e := range m.StorageHealth { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + func (m *CSIStorageCapacity) Size() (n int) { if m == nil { return 0 @@ -1491,6 +1665,48 @@ func (m *StorageClassList) Size() (n int) { return n } +func (m *StorageHealth) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.HealthConditions) > 0 { + for _, e := range m.HealthConditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *StorageHealthCondition) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Status) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Reason) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Message) + n += 1 + l + sovGenerated(uint64(l)) + if m.AccessMode != nil { + l = len(*m.AccessMode) + n += 1 + l + sovGenerated(uint64(l)) + } + if m.VolumeMode != nil { + l = len(*m.VolumeMode) + n += 1 + l + sovGenerated(uint64(l)) + } + l = m.LastTransitionTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m *TokenRequest) Size() (n int) { if m == nil { return 0 @@ -1726,6 +1942,7 @@ func (this *CSINode) String() string { s := strings.Join([]string{`&CSINode{`, `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "CSINodeSpec", "CSINodeSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "CSINodeStatus", "CSINodeStatus", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -1774,6 +1991,21 @@ func (this *CSINodeSpec) String() string { }, "") return s } +func (this *CSINodeStatus) String() string { + if this == nil { + return "nil" + } + repeatedStringForStorageHealth := "[]StorageHealth{" + for _, f := range this.StorageHealth { + repeatedStringForStorageHealth += strings.Replace(strings.Replace(f.String(), "StorageHealth", "StorageHealth", 1), `&`, ``, 1) + "," + } + repeatedStringForStorageHealth += "}" + s := strings.Join([]string{`&CSINodeStatus{`, + `StorageHealth:` + repeatedStringForStorageHealth + `,`, + `}`, + }, "") + return s +} func (this *CSIStorageCapacity) String() string { if this == nil { return "nil" @@ -1852,6 +2084,37 @@ func (this *StorageClassList) String() string { }, "") return s } +func (this *StorageHealth) String() string { + if this == nil { + return "nil" + } + repeatedStringForHealthConditions := "[]StorageHealthCondition{" + for _, f := range this.HealthConditions { + repeatedStringForHealthConditions += strings.Replace(strings.Replace(f.String(), "StorageHealthCondition", "StorageHealthCondition", 1), `&`, ``, 1) + "," + } + repeatedStringForHealthConditions += "}" + s := strings.Join([]string{`&StorageHealth{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `HealthConditions:` + repeatedStringForHealthConditions + `,`, + `}`, + }, "") + return s +} +func (this *StorageHealthCondition) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&StorageHealthCondition{`, + `Status:` + fmt.Sprintf("%v", this.Status) + `,`, + `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, + `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + `AccessMode:` + valueToStringGenerated(this.AccessMode) + `,`, + `VolumeMode:` + valueToStringGenerated(this.VolumeMode) + `,`, + `LastTransitionTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastTransitionTime), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} func (this *TokenRequest) String() string { if this == nil { return "nil" @@ -2649,6 +2912,39 @@ func (m *CSINode) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -3053,7 +3349,7 @@ func (m *CSINodeSpec) Unmarshal(dAtA []byte) error { } return nil } -func (m *CSIStorageCapacity) Unmarshal(dAtA []byte) error { +func (m *CSINodeStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3076,15 +3372,15 @@ func (m *CSIStorageCapacity) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CSIStorageCapacity: wiretype end group for non-group") + return fmt.Errorf("proto: CSINodeStatus: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CSIStorageCapacity: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: CSINodeStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StorageHealth", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3111,30 +3407,114 @@ func (m *CSIStorageCapacity) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.StorageHealth = append(m.StorageHealth, StorageHealth{}) + if err := m.StorageHealth[len(m.StorageHealth)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeTopology", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err } - if msglen < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CSIStorageCapacity) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CSIStorageCapacity: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CSIStorageCapacity: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeTopology", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + msglen @@ -3905,6 +4285,367 @@ func (m *StorageClassList) Unmarshal(dAtA []byte) error { } return nil } +func (m *StorageHealth) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StorageHealth: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StorageHealth: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HealthConditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HealthConditions = append(m.HealthConditions, StorageHealthCondition{}) + if err := m.HealthConditions[len(m.HealthConditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StorageHealthCondition) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StorageHealthCondition: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StorageHealthCondition: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = StorageHealthStatusType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessMode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := k8s_io_api_core_v1.PersistentVolumeAccessMode(dAtA[iNdEx:postIndex]) + m.AccessMode = &s + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VolumeMode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := k8s_io_api_core_v1.PersistentVolumeMode(dAtA[iNdEx:postIndex]) + m.VolumeMode = &s + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *TokenRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/vendor/k8s.io/api/storage/v1beta1/generated.proto b/vendor/k8s.io/api/storage/v1beta1/generated.proto index 3cae755fb4..6c85957063 100644 --- a/vendor/k8s.io/api/storage/v1beta1/generated.proto +++ b/vendor/k8s.io/api/storage/v1beta1/generated.proto @@ -39,7 +39,7 @@ option go_package = "k8s.io/api/storage/v1beta1"; // Kubelet uses this object to determine whether pod information needs to be passed on mount. // CSIDriver objects are non-namespaced. message CSIDriver { - // Standard object metadata. + // metadata is the standard object metadata. // metadata.Name indicates the name of the CSI driver that this object // refers to; it MUST be the same name returned by the CSI GetPluginName() // call for that driver. @@ -127,6 +127,8 @@ message CSIDriverSpec { // // +optional // +listType=atomic + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:immutable repeated string volumeLifecycleModes = 3; // storageCapacity indicates that the CSI volume driver wants pod scheduling to consider the storage @@ -252,7 +254,7 @@ message CSIDriverSpec { // +optional optional bool serviceAccountTokenInSecrets = 10; - // PreventPodSchedulingIfMissing indicates that the CSI driver wants to prevent pod + // preventPodSchedulingIfMissing indicates that the CSI driver wants to prevent pod // scheduling if the CSI driver on the node is missing. // // Enabling this option will prevent the scheduler (or any other @@ -267,7 +269,7 @@ message CSIDriverSpec { // newly created node may be rejected by the scheduler because of missing CSI driver // information from the node. // - // This is an alpha feature and requires the VolumeLimitScaling feature gate to be enabled. + // This is a beta feature and requires the VolumeLimitScaling feature gate to be enabled. // Default is "false". // +featureGate=VolumeLimitScaling // +optional @@ -286,11 +288,16 @@ message CSIDriverSpec { // enough that it doesn't create this object. // CSINode has an OwnerReference that points to the corresponding node object. message CSINode { + // metadata is the standard object metadata. // metadata.name must be the Kubernetes node name. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec is the specification of CSINode optional CSINodeSpec spec = 2; + + // status contains health and status information for the node's storage. + // +optional + optional CSINodeStatus status = 3; } // CSINodeDriver holds information about the specification of one CSI driver installed on a node @@ -352,6 +359,18 @@ message CSINodeSpec { repeated CSINodeDriver drivers = 1; } +// CSINodeStatus contains health and status information for storage on a node. +message CSINodeStatus { + // storageHealth contains backend health reports for CSI drivers registered on the node. + // +optional + // +listType=map + // +listMapKey=name + // +patchMergeKey=name + // +patchStrategy=merge + // +featureGate=CSIVolumeHealth + repeated StorageHealth storageHealth = 1; +} + // CSIStorageCapacity stores the result of one CSI GetCapacity call. // For a given StorageClass, this describes the available capacity in a // particular topology segment. This can be used when considering where to @@ -377,7 +396,7 @@ message CSINodeSpec { // the scheduler assumes that capacity is insufficient and tries some other // node. message CSIStorageCapacity { - // Standard object's metadata. The name has no particular meaning. It must be + // metadata is the standard object metadata. The name has no particular meaning. It must be // be a DNS subdomain (dots allowed, 253 characters). To ensure that // there are no conflicts with other CSI drivers on the cluster, the recommendation // is to use csisc-, a generated name, or a reverse-domain name which ends @@ -450,29 +469,29 @@ message CSIStorageCapacityList { // StorageClasses are non-namespaced; the name of the storage class // according to etcd is in ObjectMeta.Name. message StorageClass { - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // provisioner indicates the type of the provisioner. // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:immutable optional string provisioner = 2; // parameters holds the parameters for the provisioner that should // create volumes of this storage class. // +optional - // +k8s:alpha(since: "1.36")=+k8s:immutable - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:optional map parameters = 3; // reclaimPolicy controls the reclaimPolicy for dynamically provisioned PersistentVolumes of this storage class. // Defaults to Delete. // +optional - // +k8s:alpha(since: "1.36")=+k8s:immutable - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:optional optional string reclaimPolicy = 4; // mountOptions controls the mountOptions for dynamically provisioned PersistentVolumes of this storage class. @@ -490,8 +509,8 @@ message StorageClass { // provisioned and bound. When unset, VolumeBindingImmediate is used. // This field is only honored by servers that enable the VolumeScheduling feature. // +optional - // +k8s:alpha(since: "1.36")=+k8s:immutable - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:optional optional string volumeBindingMode = 7; // allowedTopologies restrict the node topologies where volumes can be dynamically provisioned. @@ -514,6 +533,50 @@ message StorageClassList { repeated StorageClass items = 2; } +// StorageHealth contains storage backend health reported by a CSI driver on a node. +message StorageHealth { + // name is the CSI driver name, matching CSINodeDriver.name. + // +required + optional string name = 1; + + // healthConditions are the adverse storage backend conditions reported by the CSI driver. + // At most 16 conditions may be reported. + // +optional + // +listType=atomic + repeated StorageHealthCondition healthConditions = 2; +} + +// StorageHealthCondition represents an adverse health condition reported +// by a CSI driver for its storage backend on a node. +message StorageHealthCondition { + // status is the health status category. + // One of "StorageUnreachable", "StorageDegraded". + // +required + optional string status = 1; + + // reason is a brief CamelCase machine-parseable reason. + // +required + // Maximum permitted length of a reason is 256 characters. + optional string reason = 2; + + // message is a human-readable description. + // +optional + // Maximum permitted length of a message is 1024 characters. + optional string message = 3; + + // accessMode is the access mode affected. Nil means all access modes are affected. + // +optional + optional string accessMode = 4; + + // volumeMode is the volume mode affected. Nil means both are affected. + // +optional + optional string volumeMode = 5; + + // lastTransitionTime is when this condition first appeared at its current state. + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 6; +} + // TokenRequest contains parameters of a service account token. message TokenRequest { // audience is the intended audience of the token in "TokenRequestSpec". @@ -532,14 +595,14 @@ message TokenRequest { // // VolumeAttachment objects are non-namespaced. message VolumeAttachment { - // Standard object metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // spec represents specification of the desired attach/detach volume behavior. // Populated by the Kubernetes system. - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:immutable // +required optional VolumeAttachmentSpec spec = 2; @@ -585,9 +648,9 @@ message VolumeAttachmentSpec { // attacher indicates the name of the volume driver that MUST handle this // request. This is the name returned by GetPluginName(). // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format="k8s-long-name-caseless" - // +k8s:alpha(since: "1.36")=+k8s:maxLength=63 + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format="k8s-long-name-caseless" + // +k8s:beta(since: "1.37")=+k8s:maxLength=63 optional string attacher = 1; // source represents the volume that should be attached. @@ -629,12 +692,12 @@ message VolumeAttachmentStatus { // defined by the CSI driver. The class can be specified during dynamic provisioning // of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning. message VolumeAttributesClass { - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Name of the CSI driver + // driverName is the name of the CSI driver // This field is immutable. optional string driverName = 2; diff --git a/vendor/k8s.io/api/storage/v1beta1/types.go b/vendor/k8s.io/api/storage/v1beta1/types.go index 0c33e218e7..3a05ad4b36 100644 --- a/vendor/k8s.io/api/storage/v1beta1/types.go +++ b/vendor/k8s.io/api/storage/v1beta1/types.go @@ -35,31 +35,31 @@ import ( // StorageClasses are non-namespaced; the name of the storage class // according to etcd is in ObjectMeta.Name. type StorageClass struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // provisioner indicates the type of the provisioner. // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:immutable Provisioner string `json:"provisioner" protobuf:"bytes,2,opt,name=provisioner"` // parameters holds the parameters for the provisioner that should // create volumes of this storage class. // +optional - // +k8s:alpha(since: "1.36")=+k8s:immutable - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:optional Parameters map[string]string `json:"parameters,omitempty" protobuf:"bytes,3,rep,name=parameters"` // reclaimPolicy controls the reclaimPolicy for dynamically provisioned PersistentVolumes of this storage class. // Defaults to Delete. // +optional - // +k8s:alpha(since: "1.36")=+k8s:immutable - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:optional ReclaimPolicy *v1.PersistentVolumeReclaimPolicy `json:"reclaimPolicy,omitempty" protobuf:"bytes,4,opt,name=reclaimPolicy,casttype=k8s.io/api/core/v1.PersistentVolumeReclaimPolicy"` // mountOptions controls the mountOptions for dynamically provisioned PersistentVolumes of this storage class. @@ -77,8 +77,8 @@ type StorageClass struct { // provisioned and bound. When unset, VolumeBindingImmediate is used. // This field is only honored by servers that enable the VolumeScheduling feature. // +optional - // +k8s:alpha(since: "1.36")=+k8s:immutable - // +k8s:alpha(since: "1.36")=+k8s:optional + // +k8s:beta(since: "1.37")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:optional VolumeBindingMode *VolumeBindingMode `json:"volumeBindingMode,omitempty" protobuf:"bytes,7,opt,name=volumeBindingMode"` // allowedTopologies restrict the node topologies where volumes can be dynamically provisioned. @@ -97,7 +97,7 @@ type StorageClass struct { // StorageClassList is a collection of storage classes. type StorageClassList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -136,16 +136,16 @@ const ( // // VolumeAttachment objects are non-namespaced. type VolumeAttachment struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec represents specification of the desired attach/detach volume behavior. // Populated by the Kubernetes system. - // +k8s:alpha(since: "1.36")=+k8s:immutable + // +k8s:beta(since: "1.37")=+k8s:immutable // +required Spec VolumeAttachmentSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` @@ -163,7 +163,7 @@ type VolumeAttachment struct { // VolumeAttachmentList is a collection of VolumeAttachment objects. type VolumeAttachmentList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -179,9 +179,9 @@ type VolumeAttachmentSpec struct { // attacher indicates the name of the volume driver that MUST handle this // request. This is the name returned by GetPluginName(). // +required - // +k8s:alpha(since: "1.36")=+k8s:required - // +k8s:alpha(since: "1.36")=+k8s:format="k8s-long-name-caseless" - // +k8s:alpha(since: "1.36")=+k8s:maxLength=63 + // +k8s:beta(since: "1.37")=+k8s:required + // +k8s:beta(since: "1.37")=+k8s:format="k8s-long-name-caseless" + // +k8s:beta(since: "1.37")=+k8s:maxLength=63 Attacher string `json:"attacher" protobuf:"bytes,1,opt,name=attacher"` // source represents the volume that should be attached. @@ -275,9 +275,9 @@ type VolumeError struct { // Kubelet uses this object to determine whether pod information needs to be passed on mount. // CSIDriver objects are non-namespaced. type CSIDriver struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object metadata. + // metadata is the standard object metadata. // metadata.Name indicates the name of the CSI driver that this object // refers to; it MUST be the same name returned by the CSI GetPluginName() // call for that driver. @@ -298,7 +298,7 @@ type CSIDriver struct { // CSIDriverList is a collection of CSIDriver objects. type CSIDriverList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -372,6 +372,8 @@ type CSIDriverSpec struct { // // +optional // +listType=atomic + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:immutable VolumeLifecycleModes []VolumeLifecycleMode `json:"volumeLifecycleModes,omitempty" protobuf:"bytes,3,opt,name=volumeLifecycleModes"` // storageCapacity indicates that the CSI volume driver wants pod scheduling to consider the storage @@ -497,7 +499,7 @@ type CSIDriverSpec struct { // +optional ServiceAccountTokenInSecrets *bool `json:"serviceAccountTokenInSecrets,omitempty" protobuf:"varint,10,opt,name=serviceAccountTokenInSecrets"` - // PreventPodSchedulingIfMissing indicates that the CSI driver wants to prevent pod + // preventPodSchedulingIfMissing indicates that the CSI driver wants to prevent pod // scheduling if the CSI driver on the node is missing. // // Enabling this option will prevent the scheduler (or any other @@ -512,7 +514,7 @@ type CSIDriverSpec struct { // newly created node may be rejected by the scheduler because of missing CSI driver // information from the node. // - // This is an alpha feature and requires the VolumeLimitScaling feature gate to be enabled. + // This is a beta feature and requires the VolumeLimitScaling feature gate to be enabled. // Default is "false". // +featureGate=VolumeLimitScaling // +optional @@ -591,6 +593,7 @@ const ( // +k8s:prerelease-lifecycle-gen:deprecated=1.17 // +k8s:prerelease-lifecycle-gen:removed=1.22 // +k8s:prerelease-lifecycle-gen:replacement=storage.k8s.io,v1,CSINode +// +k8s:supportsSubresource="/status" // DEPRECATED - This group version of CSINode is deprecated by storage/v1/CSINode. // See the release notes for more information. @@ -604,13 +607,18 @@ const ( // enough that it doesn't create this object. // CSINode has an OwnerReference that points to the corresponding node object. type CSINode struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` + // metadata is the standard object metadata. // metadata.name must be the Kubernetes node name. metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // spec is the specification of CSINode Spec CSINodeSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` + + // status contains health and status information for the node's storage. + // +optional + Status CSINodeStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } // CSINodeSpec holds information about the specification of all CSI drivers installed on a node @@ -671,6 +679,67 @@ type VolumeNodeResources struct { Count *int32 `json:"count,omitempty" protobuf:"varint,1,opt,name=count"` } +// StorageHealthStatusType describes the health status category of a storage backend. +// +enum +type StorageHealthStatusType string + +const ( + // StorageUnreachable indicates the storage backend is unreachable. + StorageUnreachable StorageHealthStatusType = "StorageUnreachable" + // StorageDegraded indicates the storage backend is functioning with reduced capability. + StorageDegraded StorageHealthStatusType = "StorageDegraded" +) + +// StorageHealthCondition represents an adverse health condition reported +// by a CSI driver for its storage backend on a node. +type StorageHealthCondition struct { + // status is the health status category. + // One of "StorageUnreachable", "StorageDegraded". + // +required + Status StorageHealthStatusType `json:"status" protobuf:"bytes,1,opt,name=status,casttype=StorageHealthStatusType"` + // reason is a brief CamelCase machine-parseable reason. + // +required + // Maximum permitted length of a reason is 256 characters. + Reason string `json:"reason" protobuf:"bytes,2,opt,name=reason"` + // message is a human-readable description. + // +optional + // Maximum permitted length of a message is 1024 characters. + Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"` + // accessMode is the access mode affected. Nil means all access modes are affected. + // +optional + AccessMode *v1.PersistentVolumeAccessMode `json:"accessMode,omitempty" protobuf:"bytes,4,opt,name=accessMode,casttype=k8s.io/api/core/v1.PersistentVolumeAccessMode"` + // volumeMode is the volume mode affected. Nil means both are affected. + // +optional + VolumeMode *v1.PersistentVolumeMode `json:"volumeMode,omitempty" protobuf:"bytes,5,opt,name=volumeMode,casttype=k8s.io/api/core/v1.PersistentVolumeMode"` + // lastTransitionTime is when this condition first appeared at its current state. + // +optional + LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,6,opt,name=lastTransitionTime"` +} + +// StorageHealth contains storage backend health reported by a CSI driver on a node. +type StorageHealth struct { + // name is the CSI driver name, matching CSINodeDriver.name. + // +required + Name string `json:"name" protobuf:"bytes,1,opt,name=name"` + // healthConditions are the adverse storage backend conditions reported by the CSI driver. + // At most 16 conditions may be reported. + // +optional + // +listType=atomic + HealthConditions []StorageHealthCondition `json:"healthConditions,omitempty" protobuf:"bytes,2,rep,name=healthConditions"` +} + +// CSINodeStatus contains health and status information for storage on a node. +type CSINodeStatus struct { + // storageHealth contains backend health reports for CSI drivers registered on the node. + // +optional + // +listType=map + // +listMapKey=name + // +patchMergeKey=name + // +patchStrategy=merge + // +featureGate=CSIVolumeHealth + StorageHealth []StorageHealth `json:"storageHealth,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,1,rep,name=storageHealth"` +} + // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.14 // +k8s:prerelease-lifecycle-gen:deprecated=1.17 @@ -679,7 +748,7 @@ type VolumeNodeResources struct { // CSINodeList is a collection of CSINode objects. type CSINodeList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -721,9 +790,9 @@ type CSINodeList struct { // the scheduler assumes that capacity is insufficient and tries some other // node. type CSIStorageCapacity struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object's metadata. The name has no particular meaning. It must be + // metadata is the standard object metadata. The name has no particular meaning. It must be // be a DNS subdomain (dots allowed, 253 characters). To ensure that // there are no conflicts with other CSI drivers on the cluster, the recommendation // is to use csisc-, a generated name, or a reverse-domain name which ends @@ -786,7 +855,7 @@ type CSIStorageCapacity struct { // CSIStorageCapacityList is a collection of CSIStorageCapacity objects. type CSIStorageCapacityList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -808,14 +877,14 @@ type CSIStorageCapacityList struct { // defined by the CSI driver. The class can be specified during dynamic provisioning // of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning. type VolumeAttributesClass struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` - // Standard object's metadata. + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Name of the CSI driver + // driverName is the name of the CSI driver // This field is immutable. DriverName string `json:"driverName" protobuf:"bytes,2,opt,name=driverName"` @@ -842,7 +911,7 @@ type VolumeAttributesClass struct { // VolumeAttributesClassList is a collection of VolumeAttributesClass objects. type VolumeAttributesClassList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata diff --git a/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go index 80b68839b4..8a12d1f8c0 100644 --- a/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/storage/v1beta1/types_swagger_doc_generated.go @@ -29,7 +29,7 @@ package v1beta1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_CSIDriver = map[string]string{ "": "CSIDriver captures information about a Container Storage Interface (CSI) volume driver deployed on the cluster. CSI drivers do not need to create the CSIDriver object directly. Instead they may use the cluster-driver-registrar sidecar container. When deployed with a CSI driver it automatically creates a CSIDriver object representing the driver. Kubernetes attach detach controller uses this object to determine whether attach is required. Kubelet uses this object to determine whether pod information needs to be passed on mount. CSIDriver objects are non-namespaced.", - "metadata": "Standard object metadata. metadata.Name indicates the name of the CSI driver that this object refers to; it MUST be the same name returned by the CSI GetPluginName() call for that driver. The driver name must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), dots (.), and alphanumerics between. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. metadata.Name indicates the name of the CSI driver that this object refers to; it MUST be the same name returned by the CSI GetPluginName() call for that driver. The driver name must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), dots (.), and alphanumerics between. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec represents the specification of the CSI Driver.", } @@ -59,7 +59,7 @@ var map_CSIDriverSpec = map[string]string{ "seLinuxMount": "seLinuxMount specifies if the CSI driver supports \"-o context\" mount option.\n\nWhen \"true\", the CSI driver must ensure that all volumes provided by this CSI driver can be mounted separately with different `-o context` options. This is typical for storage backends that provide volumes as filesystems on block devices or as independent shared volumes. Kubernetes will call NodeStage / NodePublish with \"-o context=xyz\" mount option when mounting a ReadWriteOncePod volume used in Pod that has explicitly set SELinux context. In the future, it may be expanded to other volume AccessModes. In any case, Kubernetes will ensure that the volume is mounted only with a single SELinux context.\n\nWhen \"false\", Kubernetes won't pass any special SELinux mount options to the driver. This is typical for volumes that represent subdirectories of a bigger shared filesystem.\n\nDefault is \"false\".", "nodeAllocatableUpdatePeriodSeconds": "nodeAllocatableUpdatePeriodSeconds specifies the interval between periodic updates of the CSINode allocatable capacity for this driver. When set, both periodic updates and updates triggered by capacity-related failures are enabled. If not set, no updates occur (neither periodic nor upon detecting capacity-related failures), and the allocatable.count remains static. The minimum allowed value for this field is 10 seconds.\n\nThis is a beta feature and requires the MutableCSINodeAllocatableCount feature gate to be enabled.\n\nThis field is mutable.", "serviceAccountTokenInSecrets": "serviceAccountTokenInSecrets is an opt-in for CSI drivers to indicate that service account tokens should be passed via the Secrets field in NodePublishVolumeRequest instead of the VolumeContext field. The CSI specification provides a dedicated Secrets field for sensitive information like tokens, which is the appropriate mechanism for handling credentials. This addresses security concerns where sensitive tokens were being logged as part of volume context.\n\nWhen \"true\", kubelet will pass the tokens only in the Secrets field with the key \"csi.storage.k8s.io/serviceAccount.tokens\". The CSI driver must be updated to read tokens from the Secrets field instead of VolumeContext.\n\nWhen \"false\" or not set, kubelet will pass the tokens in VolumeContext with the key \"csi.storage.k8s.io/serviceAccount.tokens\" (existing behavior). This maintains backward compatibility with existing CSI drivers.\n\nThis field can only be set when TokenRequests is configured. The API server will reject CSIDriver specs that set this field without TokenRequests.\n\nDefault behavior if unset is to pass tokens in the VolumeContext field.", - "preventPodSchedulingIfMissing": "PreventPodSchedulingIfMissing indicates that the CSI driver wants to prevent pod scheduling if the CSI driver on the node is missing.\n\nEnabling this option will prevent the scheduler (or any other component which embeds default scheduler such as cluster-autoscaler) from scheduling pods to nodes where CSI driver is not installed.\n\nFor components(such as cluster-autoscaler) that embed the scheduler and run pod placement simulations using scheduler plugins, they MUST be aware of CSI driver registration information via CSINode object. They must create simulated CSINode objects in addition to Node objects during scheduling simulation, otherwise if PreventPodSchedulingIfMissing is enabled globally for CSIDriver object, any newly created node may be rejected by the scheduler because of missing CSI driver information from the node.\n\nThis is an alpha feature and requires the VolumeLimitScaling feature gate to be enabled. Default is \"false\".", + "preventPodSchedulingIfMissing": "preventPodSchedulingIfMissing indicates that the CSI driver wants to prevent pod scheduling if the CSI driver on the node is missing.\n\nEnabling this option will prevent the scheduler (or any other component which embeds default scheduler such as cluster-autoscaler) from scheduling pods to nodes where CSI driver is not installed.\n\nFor components(such as cluster-autoscaler) that embed the scheduler and run pod placement simulations using scheduler plugins, they MUST be aware of CSI driver registration information via CSINode object. They must create simulated CSINode objects in addition to Node objects during scheduling simulation, otherwise if PreventPodSchedulingIfMissing is enabled globally for CSIDriver object, any newly created node may be rejected by the scheduler because of missing CSI driver information from the node.\n\nThis is a beta feature and requires the VolumeLimitScaling feature gate to be enabled. Default is \"false\".", } func (CSIDriverSpec) SwaggerDoc() map[string]string { @@ -68,8 +68,9 @@ func (CSIDriverSpec) SwaggerDoc() map[string]string { var map_CSINode = map[string]string{ "": "DEPRECATED - This group version of CSINode is deprecated by storage/v1/CSINode. See the release notes for more information. CSINode holds information about all CSI drivers installed on a node. CSI drivers do not need to create the CSINode object directly. As long as they use the node-driver-registrar sidecar container, the kubelet will automatically populate the CSINode object for the CSI driver as part of kubelet plugin registration. CSINode has the same name as a node. If the object is missing, it means either there are no CSI Drivers available on the node, or the Kubelet version is low enough that it doesn't create this object. CSINode has an OwnerReference that points to the corresponding node object.", - "metadata": "metadata.name must be the Kubernetes node name.", + "metadata": "metadata is the standard object metadata. metadata.name must be the Kubernetes node name.", "spec": "spec is the specification of CSINode", + "status": "status contains health and status information for the node's storage.", } func (CSINode) SwaggerDoc() map[string]string { @@ -107,9 +108,18 @@ func (CSINodeSpec) SwaggerDoc() map[string]string { return map_CSINodeSpec } +var map_CSINodeStatus = map[string]string{ + "": "CSINodeStatus contains health and status information for storage on a node.", + "storageHealth": "storageHealth contains backend health reports for CSI drivers registered on the node.", +} + +func (CSINodeStatus) SwaggerDoc() map[string]string { + return map_CSINodeStatus +} + var map_CSIStorageCapacity = map[string]string{ "": "CSIStorageCapacity stores the result of one CSI GetCapacity call. For a given StorageClass, this describes the available capacity in a particular topology segment. This can be used when considering where to instantiate new PersistentVolumes.\n\nFor example this can express things like: - StorageClass \"standard\" has \"1234 GiB\" available in \"topology.kubernetes.io/zone=us-east1\" - StorageClass \"localssd\" has \"10 GiB\" available in \"kubernetes.io/hostname=knode-abc123\"\n\nThe following three cases all imply that no capacity is available for a certain combination: - no object exists with suitable topology and storage class name - such an object exists, but the capacity is unset - such an object exists, but the capacity is zero\n\nThe producer of these objects can decide which approach is more suitable.\n\nThey are consumed by the kube-scheduler when a CSI driver opts into capacity-aware scheduling with CSIDriverSpec.StorageCapacity. The scheduler compares the MaximumVolumeSize against the requested size of pending volumes to filter out unsuitable nodes. If MaximumVolumeSize is unset, it falls back to a comparison against the less precise Capacity. If that is also unset, the scheduler assumes that capacity is insufficient and tries some other node.", - "metadata": "Standard object's metadata. The name has no particular meaning. It must be be a DNS subdomain (dots allowed, 253 characters). To ensure that there are no conflicts with other CSI drivers on the cluster, the recommendation is to use csisc-, a generated name, or a reverse-domain name which ends with the unique CSI driver name.\n\nObjects are namespaced.\n\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. The name has no particular meaning. It must be be a DNS subdomain (dots allowed, 253 characters). To ensure that there are no conflicts with other CSI drivers on the cluster, the recommendation is to use csisc-, a generated name, or a reverse-domain name which ends with the unique CSI driver name.\n\nObjects are namespaced.\n\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "nodeTopology": "nodeTopology defines which nodes have access to the storage for which capacity was reported. If not set, the storage is not accessible from any node in the cluster. If empty, the storage is accessible from all nodes. This field is immutable.", "storageClassName": "storageClassName represents the name of the StorageClass that the reported capacity applies to. It must meet the same requirements as the name of a StorageClass object (non-empty, DNS subdomain). If that object no longer exists, the CSIStorageCapacity object is obsolete and should be removed by its creator. This field is immutable.", "capacity": "capacity is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields.\n\nThe semantic is currently (CSI spec 1.2) defined as: The available capacity, in bytes, of the storage that can be used to provision volumes. If not set, that information is currently unavailable.", @@ -132,7 +142,7 @@ func (CSIStorageCapacityList) SwaggerDoc() map[string]string { var map_StorageClass = map[string]string{ "": "StorageClass describes the parameters for a class of storage for which PersistentVolumes can be dynamically provisioned.\n\nStorageClasses are non-namespaced; the name of the storage class according to etcd is in ObjectMeta.Name.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "provisioner": "provisioner indicates the type of the provisioner.", "parameters": "parameters holds the parameters for the provisioner that should create volumes of this storage class.", "reclaimPolicy": "reclaimPolicy controls the reclaimPolicy for dynamically provisioned PersistentVolumes of this storage class. Defaults to Delete.", @@ -156,6 +166,30 @@ func (StorageClassList) SwaggerDoc() map[string]string { return map_StorageClassList } +var map_StorageHealth = map[string]string{ + "": "StorageHealth contains storage backend health reported by a CSI driver on a node.", + "name": "name is the CSI driver name, matching CSINodeDriver.name.", + "healthConditions": "healthConditions are the adverse storage backend conditions reported by the CSI driver. At most 16 conditions may be reported.", +} + +func (StorageHealth) SwaggerDoc() map[string]string { + return map_StorageHealth +} + +var map_StorageHealthCondition = map[string]string{ + "": "StorageHealthCondition represents an adverse health condition reported by a CSI driver for its storage backend on a node.", + "status": "status is the health status category. One of \"StorageUnreachable\", \"StorageDegraded\".", + "reason": "reason is a brief CamelCase machine-parseable reason. Maximum permitted length of a reason is 256 characters.", + "message": "message is a human-readable description. Maximum permitted length of a message is 1024 characters.", + "accessMode": "accessMode is the access mode affected. Nil means all access modes are affected.", + "volumeMode": "volumeMode is the volume mode affected. Nil means both are affected.", + "lastTransitionTime": "lastTransitionTime is when this condition first appeared at its current state.", +} + +func (StorageHealthCondition) SwaggerDoc() map[string]string { + return map_StorageHealthCondition +} + var map_TokenRequest = map[string]string{ "": "TokenRequest contains parameters of a service account token.", "audience": "audience is the intended audience of the token in \"TokenRequestSpec\". It will default to the audiences of kube apiserver.", @@ -168,7 +202,7 @@ func (TokenRequest) SwaggerDoc() map[string]string { var map_VolumeAttachment = map[string]string{ "": "VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node.\n\nVolumeAttachment objects are non-namespaced.", - "metadata": "Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", "spec": "spec represents specification of the desired attach/detach volume behavior. Populated by the Kubernetes system.", "status": "status represents status of the VolumeAttachment request. Populated by the entity completing the attach or detach operation, i.e. the external-attacher.", } @@ -190,6 +224,7 @@ func (VolumeAttachmentList) SwaggerDoc() map[string]string { var map_VolumeAttachmentSource = map[string]string{ "": "VolumeAttachmentSource represents a volume that should be attached. Right now only PersistentVolumes can be attached via external attacher, in the future we may allow also inline volumes in pods. Exactly one member can be set.", "persistentVolumeName": "persistentVolumeName represents the name of the persistent volume to attach.", + "inlineVolumeSpec": "inlineVolumeSpec contains all the information necessary to attach a persistent volume defined by a pod's inline VolumeSource. This field is populated only for the CSIMigration feature. It contains translated fields from a pod's inline VolumeSource to a PersistentVolumeSpec. This field is beta-level and is only honored by servers that enabled the CSIMigration feature.", } func (VolumeAttachmentSource) SwaggerDoc() map[string]string { @@ -221,8 +256,8 @@ func (VolumeAttachmentStatus) SwaggerDoc() map[string]string { var map_VolumeAttributesClass = map[string]string{ "": "VolumeAttributesClass represents a specification of mutable volume attributes defined by the CSI driver. The class can be specified during dynamic provisioning of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "driverName": "Name of the CSI driver This field is immutable.", + "metadata": "metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "driverName": "driverName is the name of the CSI driver This field is immutable.", "parameters": "parameters hold volume attributes defined by the CSI driver. These values are opaque to the Kubernetes and are passed directly to the CSI driver. The underlying storage provider supports changing these attributes on an existing volume, however the parameters field itself is immutable. To invoke a volume update, a new VolumeAttributesClass should be created with new parameters, and the PersistentVolumeClaim should be updated to reference the new VolumeAttributesClass.\n\nThis field is required and must contain at least one key/value pair. The keys cannot be empty, and the maximum number of parameters is 512, with a cumulative max size of 256K. If the CSI driver rejects invalid parameters, the target PersistentVolumeClaim will be set to an \"Infeasible\" state in the modifyVolumeStatus field.", } diff --git a/vendor/k8s.io/api/storage/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/storage/v1beta1/zz_generated.deepcopy.go index ca28e0340c..88b0581780 100644 --- a/vendor/k8s.io/api/storage/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/storage/v1beta1/zz_generated.deepcopy.go @@ -166,6 +166,7 @@ func (in *CSINode) DeepCopyInto(out *CSINode) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) return } @@ -269,6 +270,29 @@ func (in *CSINodeSpec) DeepCopy() *CSINodeSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CSINodeStatus) DeepCopyInto(out *CSINodeStatus) { + *out = *in + if in.StorageHealth != nil { + in, out := &in.StorageHealth, &out.StorageHealth + *out = make([]StorageHealth, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CSINodeStatus. +func (in *CSINodeStatus) DeepCopy() *CSINodeStatus { + if in == nil { + return nil + } + out := new(CSINodeStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CSIStorageCapacity) DeepCopyInto(out *CSIStorageCapacity) { *out = *in @@ -436,6 +460,56 @@ func (in *StorageClassList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StorageHealth) DeepCopyInto(out *StorageHealth) { + *out = *in + if in.HealthConditions != nil { + in, out := &in.HealthConditions, &out.HealthConditions + *out = make([]StorageHealthCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageHealth. +func (in *StorageHealth) DeepCopy() *StorageHealth { + if in == nil { + return nil + } + out := new(StorageHealth) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StorageHealthCondition) DeepCopyInto(out *StorageHealthCondition) { + *out = *in + if in.AccessMode != nil { + in, out := &in.AccessMode, &out.AccessMode + *out = new(corev1.PersistentVolumeAccessMode) + **out = **in + } + if in.VolumeMode != nil { + in, out := &in.VolumeMode, &out.VolumeMode + *out = new(corev1.PersistentVolumeMode) + **out = **in + } + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageHealthCondition. +func (in *StorageHealthCondition) DeepCopy() *StorageHealthCondition { + if in == nil { + return nil + } + out := new(StorageHealthCondition) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TokenRequest) DeepCopyInto(out *TokenRequest) { *out = *in diff --git a/vendor/k8s.io/api/storage/v1beta1/zz_generated.model_name.go b/vendor/k8s.io/api/storage/v1beta1/zz_generated.model_name.go index 8453d86b22..fe654676ba 100644 --- a/vendor/k8s.io/api/storage/v1beta1/zz_generated.model_name.go +++ b/vendor/k8s.io/api/storage/v1beta1/zz_generated.model_name.go @@ -56,6 +56,11 @@ func (in CSINodeSpec) OpenAPIModelName() string { return "io.k8s.api.storage.v1beta1.CSINodeSpec" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CSINodeStatus) OpenAPIModelName() string { + return "io.k8s.api.storage.v1beta1.CSINodeStatus" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in CSIStorageCapacity) OpenAPIModelName() string { return "io.k8s.api.storage.v1beta1.CSIStorageCapacity" @@ -76,6 +81,16 @@ func (in StorageClassList) OpenAPIModelName() string { return "io.k8s.api.storage.v1beta1.StorageClassList" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in StorageHealth) OpenAPIModelName() string { + return "io.k8s.api.storage.v1beta1.StorageHealth" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in StorageHealthCondition) OpenAPIModelName() string { + return "io.k8s.api.storage.v1beta1.StorageHealthCondition" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in TokenRequest) OpenAPIModelName() string { return "io.k8s.api.storage.v1beta1.TokenRequest" diff --git a/vendor/k8s.io/api/apidiscovery/v2beta1/doc.go b/vendor/k8s.io/api/storagemigration/v1/doc.go similarity index 81% rename from vendor/k8s.io/api/apidiscovery/v2beta1/doc.go rename to vendor/k8s.io/api/storagemigration/v1/doc.go index 244986bb41..4c122fa5ca 100644 --- a/vendor/k8s.io/api/apidiscovery/v2beta1/doc.go +++ b/vendor/k8s.io/api/storagemigration/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Kubernetes Authors. +Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,8 +18,8 @@ limitations under the License. // +k8s:protobuf-gen=package // +k8s:openapi-gen=true // +k8s:prerelease-lifecycle-gen=true -// +k8s:openapi-model-package=io.k8s.api.apidiscovery.v2beta1 +// +k8s:openapi-model-package=io.k8s.api.storagemigration.v1 -// +groupName=apidiscovery.k8s.io +// +groupName=storagemigration.k8s.io -package v2beta1 +package v1 diff --git a/vendor/k8s.io/api/storagemigration/v1/generated.pb.go b/vendor/k8s.io/api/storagemigration/v1/generated.pb.go new file mode 100644 index 0000000000..9f4e58652b --- /dev/null +++ b/vendor/k8s.io/api/storagemigration/v1/generated.pb.go @@ -0,0 +1,904 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: k8s.io/api/storagemigration/v1/generated.proto + +package v1 + +import ( + fmt "fmt" + + io "io" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + math_bits "math/bits" + reflect "reflect" + strings "strings" +) + +func (m *StorageVersionMigration) Reset() { *m = StorageVersionMigration{} } + +func (m *StorageVersionMigrationList) Reset() { *m = StorageVersionMigrationList{} } + +func (m *StorageVersionMigrationSpec) Reset() { *m = StorageVersionMigrationSpec{} } + +func (m *StorageVersionMigrationStatus) Reset() { *m = StorageVersionMigrationStatus{} } + +func (m *StorageVersionMigration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StorageVersionMigration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StorageVersionMigration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *StorageVersionMigrationList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StorageVersionMigrationList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StorageVersionMigrationList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *StorageVersionMigrationSpec) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StorageVersionMigrationSpec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StorageVersionMigrationSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *StorageVersionMigrationStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StorageVersionMigrationStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StorageVersionMigrationStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.ResourceVersion) + copy(dAtA[i:], m.ResourceVersion) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ResourceVersion))) + i-- + dAtA[i] = 0x12 + if len(m.Conditions) > 0 { + for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { + offset -= sovGenerated(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *StorageVersionMigration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Spec.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *StorageVersionMigrationList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *StorageVersionMigrationSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Resource.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *StorageVersionMigrationStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.ResourceVersion) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func sovGenerated(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenerated(x uint64) (n int) { + return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *StorageVersionMigration) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&StorageVersionMigration{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "StorageVersionMigrationSpec", "StorageVersionMigrationSpec", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "StorageVersionMigrationStatus", "StorageVersionMigrationStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *StorageVersionMigrationList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]StorageVersionMigration{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "StorageVersionMigration", "StorageVersionMigration", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&StorageVersionMigrationList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} +func (this *StorageVersionMigrationSpec) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&StorageVersionMigrationSpec{`, + `Resource:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Resource), "GroupResource", "v1.GroupResource", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *StorageVersionMigrationStatus) String() string { + if this == nil { + return "nil" + } + repeatedStringForConditions := "[]Condition{" + for _, f := range this.Conditions { + repeatedStringForConditions += fmt.Sprintf("%v", f) + "," + } + repeatedStringForConditions += "}" + s := strings.Join([]string{`&StorageVersionMigrationStatus{`, + `Conditions:` + repeatedStringForConditions + `,`, + `ResourceVersion:` + fmt.Sprintf("%v", this.ResourceVersion) + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *StorageVersionMigration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StorageVersionMigration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StorageVersionMigration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StorageVersionMigrationList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StorageVersionMigrationList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StorageVersionMigrationList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, StorageVersionMigration{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StorageVersionMigrationSpec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StorageVersionMigrationSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StorageVersionMigrationSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StorageVersionMigrationStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StorageVersionMigrationStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StorageVersionMigrationStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Conditions = append(m.Conditions, v1.Condition{}) + if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResourceVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenerated(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenerated + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenerated + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") +) diff --git a/vendor/k8s.io/api/storagemigration/v1/generated.proto b/vendor/k8s.io/api/storagemigration/v1/generated.proto new file mode 100644 index 0000000000..ada3c15113 --- /dev/null +++ b/vendor/k8s.io/api/storagemigration/v1/generated.proto @@ -0,0 +1,86 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + + +// This file was autogenerated by go-to-protobuf. Do not edit it manually! + +syntax = "proto2"; + +package k8s.io.api.storagemigration.v1; + +import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; +import "k8s.io/apimachinery/pkg/runtime/generated.proto"; +import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; + +// Package-wide variables from generator "generated". +option go_package = "k8s.io/api/storagemigration/v1"; + +// StorageVersionMigration represents a migration of stored data to the latest +// storage version. +// +k8s:supportsSubresource="/status" +message StorageVersionMigration { + // Standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + // Specification of the migration. + // +optional + optional StorageVersionMigrationSpec spec = 2; + + // Status of the migration. + // +optional + optional StorageVersionMigrationStatus status = 3; +} + +// StorageVersionMigrationList is a collection of storage version migrations. +message StorageVersionMigrationList { + // Standard list metadata + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; + + // Items is the list of StorageVersionMigration + repeated StorageVersionMigration items = 2; +} + +// Spec of the storage version migration. +message StorageVersionMigrationSpec { + // The resource that is being migrated. The migrator sends requests to + // the endpoint serving the resource. + // Immutable. + optional .k8s.io.apimachinery.pkg.apis.meta.v1.GroupResource resource = 1; +} + +// Status of the storage version migration. +message StorageVersionMigrationStatus { + // The latest available observations of the migration's current state. + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type + repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1; + + // ResourceVersion to compare with the GC cache for performing the migration. + // This is the current resource version of given group, version and resource when + // kube-controller-manager first observes this StorageVersionMigration resource. + optional string resourceVersion = 2; +} + diff --git a/vendor/k8s.io/api/apidiscovery/v2beta1/register.go b/vendor/k8s.io/api/storagemigration/v1/register.go similarity index 77% rename from vendor/k8s.io/api/apidiscovery/v2beta1/register.go rename to vendor/k8s.io/api/storagemigration/v1/register.go index f7cef10812..d03db0c4db 100644 --- a/vendor/k8s.io/api/apidiscovery/v2beta1/register.go +++ b/vendor/k8s.io/api/storagemigration/v1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Kubernetes Authors. +Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,19 +14,20 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v2beta1 +package v1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// GroupName is the group name for this API. -const GroupName = "apidiscovery.k8s.io" +// GroupName is the group name use in this package +const GroupName = "storagemigration.k8s.io" // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v2beta1"} +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} // Kind takes an unqualified kind and returns a Group qualified GroupKind func Kind(kind string) schema.GroupKind { @@ -39,18 +40,19 @@ func Resource(resource string) schema.GroupResource { } var ( - // SchemeBuilder installs the api group to a scheme - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - // AddToScheme adds api to a scheme - AddToScheme = SchemeBuilder.AddToScheme + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + localSchemeBuilder = &SchemeBuilder + AddToScheme = localSchemeBuilder.AddToScheme ) // Adds the list of known types to the given scheme. func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, - &APIGroupDiscoveryList{}, - &APIGroupDiscovery{}, + &StorageVersionMigration{}, + &StorageVersionMigrationList{}, ) + + // Add the watch version that applies metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil } diff --git a/vendor/k8s.io/api/storagemigration/v1/types.go b/vendor/k8s.io/api/storagemigration/v1/types.go new file mode 100644 index 0000000000..cead674391 --- /dev/null +++ b/vendor/k8s.io/api/storagemigration/v1/types.go @@ -0,0 +1,95 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.37 + +// StorageVersionMigration represents a migration of stored data to the latest +// storage version. +// +k8s:supportsSubresource="/status" +type StorageVersionMigration struct { + metav1.TypeMeta `json:""` + // Standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // Specification of the migration. + // +optional + Spec StorageVersionMigrationSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + // Status of the migration. + // +optional + Status StorageVersionMigrationStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` +} + +// Spec of the storage version migration. +type StorageVersionMigrationSpec struct { + // The resource that is being migrated. The migrator sends requests to + // the endpoint serving the resource. + // Immutable. + Resource metav1.GroupResource `json:"resource" protobuf:"bytes,1,opt,name=resource"` +} + +type MigrationConditionType string + +const ( + // Indicates that the migration is running. + MigrationRunning MigrationConditionType = "Running" + // Indicates that the migration has completed successfully. + MigrationSucceeded MigrationConditionType = "Succeeded" + // Indicates that the migration has failed. + MigrationFailed MigrationConditionType = "Failed" +) + +// Status of the storage version migration. +type StorageVersionMigrationStatus struct { + // The latest available observations of the migration's current state. + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` + // ResourceVersion to compare with the GC cache for performing the migration. + // This is the current resource version of given group, version and resource when + // kube-controller-manager first observes this StorageVersionMigration resource. + ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,2,opt,name=resourceVersion"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:prerelease-lifecycle-gen:introduced=1.37 + +// StorageVersionMigrationList is a collection of storage version migrations. +type StorageVersionMigrationList struct { + metav1.TypeMeta `json:""` + + // Standard list metadata + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + // Items is the list of StorageVersionMigration + Items []StorageVersionMigration `json:"items" protobuf:"bytes,2,rep,name=items"` +} diff --git a/vendor/k8s.io/api/storagemigration/v1/types_swagger_doc_generated.go b/vendor/k8s.io/api/storagemigration/v1/types_swagger_doc_generated.go new file mode 100644 index 0000000000..a9ff380d84 --- /dev/null +++ b/vendor/k8s.io/api/storagemigration/v1/types_swagger_doc_generated.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +// This file contains a collection of methods that can be used from go-restful to +// generate Swagger API documentation for its models. Please read this PR for more +// information on the implementation: https://github.com/emicklei/go-restful/pull/215 +// +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. +// Any context after a --- is ignored. +// +// Those methods can be generated by using hack/update-codegen.sh + +// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. +var map_StorageVersionMigration = map[string]string{ + "": "StorageVersionMigration represents a migration of stored data to the latest storage version.", + "metadata": "Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "Specification of the migration.", + "status": "Status of the migration.", +} + +func (StorageVersionMigration) SwaggerDoc() map[string]string { + return map_StorageVersionMigration +} + +var map_StorageVersionMigrationList = map[string]string{ + "": "StorageVersionMigrationList is a collection of storage version migrations.", + "metadata": "Standard list metadata More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "items": "Items is the list of StorageVersionMigration", +} + +func (StorageVersionMigrationList) SwaggerDoc() map[string]string { + return map_StorageVersionMigrationList +} + +var map_StorageVersionMigrationSpec = map[string]string{ + "": "Spec of the storage version migration.", + "resource": "The resource that is being migrated. The migrator sends requests to the endpoint serving the resource. Immutable.", +} + +func (StorageVersionMigrationSpec) SwaggerDoc() map[string]string { + return map_StorageVersionMigrationSpec +} + +var map_StorageVersionMigrationStatus = map[string]string{ + "": "Status of the storage version migration.", + "conditions": "The latest available observations of the migration's current state.", + "resourceVersion": "ResourceVersion to compare with the GC cache for performing the migration. This is the current resource version of given group, version and resource when kube-controller-manager first observes this StorageVersionMigration resource.", +} + +func (StorageVersionMigrationStatus) SwaggerDoc() map[string]string { + return map_StorageVersionMigrationStatus +} + +// AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/k8s.io/api/storagemigration/v1/zz_generated.deepcopy.go b/vendor/k8s.io/api/storagemigration/v1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..10ef04a084 --- /dev/null +++ b/vendor/k8s.io/api/storagemigration/v1/zz_generated.deepcopy.go @@ -0,0 +1,128 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StorageVersionMigration) DeepCopyInto(out *StorageVersionMigration) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageVersionMigration. +func (in *StorageVersionMigration) DeepCopy() *StorageVersionMigration { + if in == nil { + return nil + } + out := new(StorageVersionMigration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *StorageVersionMigration) 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 *StorageVersionMigrationList) DeepCopyInto(out *StorageVersionMigrationList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]StorageVersionMigration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageVersionMigrationList. +func (in *StorageVersionMigrationList) DeepCopy() *StorageVersionMigrationList { + if in == nil { + return nil + } + out := new(StorageVersionMigrationList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *StorageVersionMigrationList) 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 *StorageVersionMigrationSpec) DeepCopyInto(out *StorageVersionMigrationSpec) { + *out = *in + out.Resource = in.Resource + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageVersionMigrationSpec. +func (in *StorageVersionMigrationSpec) DeepCopy() *StorageVersionMigrationSpec { + if in == nil { + return nil + } + out := new(StorageVersionMigrationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StorageVersionMigrationStatus) DeepCopyInto(out *StorageVersionMigrationStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageVersionMigrationStatus. +func (in *StorageVersionMigrationStatus) DeepCopy() *StorageVersionMigrationStatus { + if in == nil { + return nil + } + out := new(StorageVersionMigrationStatus) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/k8s.io/api/apidiscovery/v2beta1/zz_generated.model_name.go b/vendor/k8s.io/api/storagemigration/v1/zz_generated.model_name.go similarity index 57% rename from vendor/k8s.io/api/apidiscovery/v2beta1/zz_generated.model_name.go rename to vendor/k8s.io/api/storagemigration/v1/zz_generated.model_name.go index 8054db78a2..3c5ff9ded5 100644 --- a/vendor/k8s.io/api/apidiscovery/v2beta1/zz_generated.model_name.go +++ b/vendor/k8s.io/api/storagemigration/v1/zz_generated.model_name.go @@ -19,29 +19,24 @@ limitations under the License. // Code generated by openapi-gen. DO NOT EDIT. -package v2beta1 +package v1 // OpenAPIModelName returns the OpenAPI model name for this type. -func (in APIGroupDiscovery) OpenAPIModelName() string { - return "io.k8s.api.apidiscovery.v2beta1.APIGroupDiscovery" +func (in StorageVersionMigration) OpenAPIModelName() string { + return "io.k8s.api.storagemigration.v1.StorageVersionMigration" } // OpenAPIModelName returns the OpenAPI model name for this type. -func (in APIGroupDiscoveryList) OpenAPIModelName() string { - return "io.k8s.api.apidiscovery.v2beta1.APIGroupDiscoveryList" +func (in StorageVersionMigrationList) OpenAPIModelName() string { + return "io.k8s.api.storagemigration.v1.StorageVersionMigrationList" } // OpenAPIModelName returns the OpenAPI model name for this type. -func (in APIResourceDiscovery) OpenAPIModelName() string { - return "io.k8s.api.apidiscovery.v2beta1.APIResourceDiscovery" +func (in StorageVersionMigrationSpec) OpenAPIModelName() string { + return "io.k8s.api.storagemigration.v1.StorageVersionMigrationSpec" } // OpenAPIModelName returns the OpenAPI model name for this type. -func (in APISubresourceDiscovery) OpenAPIModelName() string { - return "io.k8s.api.apidiscovery.v2beta1.APISubresourceDiscovery" -} - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in APIVersionDiscovery) OpenAPIModelName() string { - return "io.k8s.api.apidiscovery.v2beta1.APIVersionDiscovery" +func (in StorageVersionMigrationStatus) OpenAPIModelName() string { + return "io.k8s.api.storagemigration.v1.StorageVersionMigrationStatus" } diff --git a/vendor/k8s.io/api/storagemigration/v1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/storagemigration/v1/zz_generated.prerelease-lifecycle.go new file mode 100644 index 0000000000..64eaaeddee --- /dev/null +++ b/vendor/k8s.io/api/storagemigration/v1/zz_generated.prerelease-lifecycle.go @@ -0,0 +1,34 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by prerelease-lifecycle-gen. DO NOT EDIT. + +package v1 + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *StorageVersionMigration) APILifecycleIntroduced() (major, minor int) { + return 1, 37 +} + +// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. +// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. +func (in *StorageVersionMigrationList) APILifecycleIntroduced() (major, minor int) { + return 1, 37 +} diff --git a/vendor/k8s.io/api/storagemigration/v1beta1/generated.proto b/vendor/k8s.io/api/storagemigration/v1beta1/generated.proto index d7d08d88c7..21fc7eab6c 100644 --- a/vendor/k8s.io/api/storagemigration/v1beta1/generated.proto +++ b/vendor/k8s.io/api/storagemigration/v1beta1/generated.proto @@ -30,6 +30,7 @@ option go_package = "k8s.io/api/storagemigration/v1beta1"; // StorageVersionMigration represents a migration of stored data to the latest // storage version. +// +k8s:supportsSubresource="/status" message StorageVersionMigration { // Standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -72,6 +73,9 @@ message StorageVersionMigrationStatus { // +listType=map // +listMapKey=type // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 1; // ResourceVersion to compare with the GC cache for performing the migration. diff --git a/vendor/k8s.io/api/storagemigration/v1beta1/types.go b/vendor/k8s.io/api/storagemigration/v1beta1/types.go index 9655f737ae..bbbbe9f54d 100644 --- a/vendor/k8s.io/api/storagemigration/v1beta1/types.go +++ b/vendor/k8s.io/api/storagemigration/v1beta1/types.go @@ -24,11 +24,14 @@ import ( // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.35 +// +k8s:prerelease-lifecycle-gen:deprecated=1.37 +// +k8s:prerelease-lifecycle-gen:replacement=storagemigration.k8s.io,v1,StorageVersionMigration // StorageVersionMigration represents a migration of stored data to the latest // storage version. +// +k8s:supportsSubresource="/status" type StorageVersionMigration struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -68,6 +71,9 @@ type StorageVersionMigrationStatus struct { // +listType=map // +listMapKey=type // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:listType=map + // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` // ResourceVersion to compare with the GC cache for performing the migration. // This is the current resource version of given group, version and resource when @@ -77,10 +83,12 @@ type StorageVersionMigrationStatus struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.35 +// +k8s:prerelease-lifecycle-gen:deprecated=1.37 +// +k8s:prerelease-lifecycle-gen:replacement=storagemigration.k8s.io,v1,StorageVersionMigrationList // StorageVersionMigrationList is a collection of storage version migrations. type StorageVersionMigrationList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard list metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata diff --git a/vendor/k8s.io/api/storagemigration/v1beta1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/storagemigration/v1beta1/zz_generated.prerelease-lifecycle.go index f52614f7d3..5962412fbb 100644 --- a/vendor/k8s.io/api/storagemigration/v1beta1/zz_generated.prerelease-lifecycle.go +++ b/vendor/k8s.io/api/storagemigration/v1beta1/zz_generated.prerelease-lifecycle.go @@ -21,6 +21,10 @@ limitations under the License. package v1beta1 +import ( + schema "k8s.io/apimachinery/pkg/runtime/schema" +) + // APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. func (in *StorageVersionMigration) APILifecycleIntroduced() (major, minor int) { @@ -30,13 +34,19 @@ func (in *StorageVersionMigration) APILifecycleIntroduced() (major, minor int) { // APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. func (in *StorageVersionMigration) APILifecycleDeprecated() (major, minor int) { - return 1, 38 + return 1, 37 +} + +// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. +// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=,," tags in types.go. +func (in *StorageVersionMigration) APILifecycleReplacement() schema.GroupVersionKind { + return schema.GroupVersionKind{Group: "storagemigration.k8s.io", Version: "v1", Kind: "StorageVersionMigration"} } // APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. func (in *StorageVersionMigration) APILifecycleRemoved() (major, minor int) { - return 1, 41 + return 1, 40 } // APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. @@ -48,11 +58,17 @@ func (in *StorageVersionMigrationList) APILifecycleIntroduced() (major, minor in // APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. func (in *StorageVersionMigrationList) APILifecycleDeprecated() (major, minor int) { - return 1, 38 + return 1, 37 +} + +// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. +// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=,," tags in types.go. +func (in *StorageVersionMigrationList) APILifecycleReplacement() schema.GroupVersionKind { + return schema.GroupVersionKind{Group: "storagemigration.k8s.io", Version: "v1", Kind: "StorageVersionMigrationList"} } // APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. // It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. func (in *StorageVersionMigrationList) APILifecycleRemoved() (major, minor int) { - return 1, 41 + return 1, 40 } diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types.go index b3a8ce7ef4..c0e968886a 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types.go @@ -402,7 +402,7 @@ const CustomResourceCleanupFinalizer = "customresourcecleanup.apiextensions.k8s. // CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format // <.spec.name>.<.spec.group>. type CustomResourceDefinition struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -420,7 +420,7 @@ type CustomResourceDefinition struct { // CustomResourceDefinitionList is a list of CustomResourceDefinition objects. type CustomResourceDefinitionList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -489,7 +489,7 @@ type CustomResourceSubresourceScale struct { // ConversionReview describes a conversion request/response. type ConversionReview struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // request describes the attributes for the conversion request. // +optional Request *ConversionRequest `json:"request,omitempty" protobuf:"bytes,1,opt,name=request"` diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.conversion.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.conversion.go index 4d02c8df03..29639388da 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.conversion.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.conversion.go @@ -276,12 +276,7 @@ func RegisterConversions(s *runtime.Scheme) error { } func autoConvert_v1_CustomResourceColumnDefinition_To_apiextensions_CustomResourceColumnDefinition(in *CustomResourceColumnDefinition, out *apiextensions.CustomResourceColumnDefinition, s conversion.Scope) error { - out.Name = in.Name - out.Type = in.Type - out.Format = in.Format - out.Description = in.Description - out.Priority = in.Priority - out.JSONPath = in.JSONPath + *out = *(*apiextensions.CustomResourceColumnDefinition)(unsafe.Pointer(in)) return nil } @@ -291,12 +286,7 @@ func Convert_v1_CustomResourceColumnDefinition_To_apiextensions_CustomResourceCo } func autoConvert_apiextensions_CustomResourceColumnDefinition_To_v1_CustomResourceColumnDefinition(in *apiextensions.CustomResourceColumnDefinition, out *CustomResourceColumnDefinition, s conversion.Scope) error { - out.Name = in.Name - out.Type = in.Type - out.Format = in.Format - out.Description = in.Description - out.Priority = in.Priority - out.JSONPath = in.JSONPath + *out = *(*CustomResourceColumnDefinition)(unsafe.Pointer(in)) return nil } @@ -351,12 +341,7 @@ func Convert_apiextensions_CustomResourceDefinition_To_v1_CustomResourceDefiniti } func autoConvert_v1_CustomResourceDefinitionCondition_To_apiextensions_CustomResourceDefinitionCondition(in *CustomResourceDefinitionCondition, out *apiextensions.CustomResourceDefinitionCondition, s conversion.Scope) error { - out.Type = apiextensions.CustomResourceDefinitionConditionType(in.Type) - out.Status = apiextensions.ConditionStatus(in.Status) - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - out.ObservedGeneration = in.ObservedGeneration + *out = *(*apiextensions.CustomResourceDefinitionCondition)(unsafe.Pointer(in)) return nil } @@ -366,12 +351,7 @@ func Convert_v1_CustomResourceDefinitionCondition_To_apiextensions_CustomResourc } func autoConvert_apiextensions_CustomResourceDefinitionCondition_To_v1_CustomResourceDefinitionCondition(in *apiextensions.CustomResourceDefinitionCondition, out *CustomResourceDefinitionCondition, s conversion.Scope) error { - out.Type = CustomResourceDefinitionConditionType(in.Type) - out.Status = ConditionStatus(in.Status) - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - out.ObservedGeneration = in.ObservedGeneration + *out = *(*CustomResourceDefinitionCondition)(unsafe.Pointer(in)) return nil } @@ -423,12 +403,7 @@ func Convert_apiextensions_CustomResourceDefinitionList_To_v1_CustomResourceDefi } func autoConvert_v1_CustomResourceDefinitionNames_To_apiextensions_CustomResourceDefinitionNames(in *CustomResourceDefinitionNames, out *apiextensions.CustomResourceDefinitionNames, s conversion.Scope) error { - out.Plural = in.Plural - out.Singular = in.Singular - out.ShortNames = *(*[]string)(unsafe.Pointer(&in.ShortNames)) - out.Kind = in.Kind - out.ListKind = in.ListKind - out.Categories = *(*[]string)(unsafe.Pointer(&in.Categories)) + *out = *(*apiextensions.CustomResourceDefinitionNames)(unsafe.Pointer(in)) return nil } @@ -438,12 +413,7 @@ func Convert_v1_CustomResourceDefinitionNames_To_apiextensions_CustomResourceDef } func autoConvert_apiextensions_CustomResourceDefinitionNames_To_v1_CustomResourceDefinitionNames(in *apiextensions.CustomResourceDefinitionNames, out *CustomResourceDefinitionNames, s conversion.Scope) error { - out.Plural = in.Plural - out.Singular = in.Singular - out.ShortNames = *(*[]string)(unsafe.Pointer(&in.ShortNames)) - out.Kind = in.Kind - out.ListKind = in.ListKind - out.Categories = *(*[]string)(unsafe.Pointer(&in.Categories)) + *out = *(*CustomResourceDefinitionNames)(unsafe.Pointer(in)) return nil } @@ -522,12 +492,7 @@ func autoConvert_apiextensions_CustomResourceDefinitionSpec_To_v1_CustomResource } func autoConvert_v1_CustomResourceDefinitionStatus_To_apiextensions_CustomResourceDefinitionStatus(in *CustomResourceDefinitionStatus, out *apiextensions.CustomResourceDefinitionStatus, s conversion.Scope) error { - out.Conditions = *(*[]apiextensions.CustomResourceDefinitionCondition)(unsafe.Pointer(&in.Conditions)) - if err := Convert_v1_CustomResourceDefinitionNames_To_apiextensions_CustomResourceDefinitionNames(&in.AcceptedNames, &out.AcceptedNames, s); err != nil { - return err - } - out.StoredVersions = *(*[]string)(unsafe.Pointer(&in.StoredVersions)) - out.ObservedGeneration = in.ObservedGeneration + *out = *(*apiextensions.CustomResourceDefinitionStatus)(unsafe.Pointer(in)) return nil } @@ -537,12 +502,7 @@ func Convert_v1_CustomResourceDefinitionStatus_To_apiextensions_CustomResourceDe } func autoConvert_apiextensions_CustomResourceDefinitionStatus_To_v1_CustomResourceDefinitionStatus(in *apiextensions.CustomResourceDefinitionStatus, out *CustomResourceDefinitionStatus, s conversion.Scope) error { - out.Conditions = *(*[]CustomResourceDefinitionCondition)(unsafe.Pointer(&in.Conditions)) - if err := Convert_apiextensions_CustomResourceDefinitionNames_To_v1_CustomResourceDefinitionNames(&in.AcceptedNames, &out.AcceptedNames, s); err != nil { - return err - } - out.StoredVersions = *(*[]string)(unsafe.Pointer(&in.StoredVersions)) - out.ObservedGeneration = in.ObservedGeneration + *out = *(*CustomResourceDefinitionStatus)(unsafe.Pointer(in)) return nil } @@ -604,9 +564,7 @@ func Convert_apiextensions_CustomResourceDefinitionVersion_To_v1_CustomResourceD } func autoConvert_v1_CustomResourceSubresourceScale_To_apiextensions_CustomResourceSubresourceScale(in *CustomResourceSubresourceScale, out *apiextensions.CustomResourceSubresourceScale, s conversion.Scope) error { - out.SpecReplicasPath = in.SpecReplicasPath - out.StatusReplicasPath = in.StatusReplicasPath - out.LabelSelectorPath = (*string)(unsafe.Pointer(in.LabelSelectorPath)) + *out = *(*apiextensions.CustomResourceSubresourceScale)(unsafe.Pointer(in)) return nil } @@ -616,9 +574,7 @@ func Convert_v1_CustomResourceSubresourceScale_To_apiextensions_CustomResourceSu } func autoConvert_apiextensions_CustomResourceSubresourceScale_To_v1_CustomResourceSubresourceScale(in *apiextensions.CustomResourceSubresourceScale, out *CustomResourceSubresourceScale, s conversion.Scope) error { - out.SpecReplicasPath = in.SpecReplicasPath - out.StatusReplicasPath = in.StatusReplicasPath - out.LabelSelectorPath = (*string)(unsafe.Pointer(in.LabelSelectorPath)) + *out = *(*CustomResourceSubresourceScale)(unsafe.Pointer(in)) return nil } @@ -628,6 +584,7 @@ func Convert_apiextensions_CustomResourceSubresourceScale_To_v1_CustomResourceSu } func autoConvert_v1_CustomResourceSubresourceStatus_To_apiextensions_CustomResourceSubresourceStatus(in *CustomResourceSubresourceStatus, out *apiextensions.CustomResourceSubresourceStatus, s conversion.Scope) error { + *out = *(*apiextensions.CustomResourceSubresourceStatus)(unsafe.Pointer(in)) return nil } @@ -637,6 +594,7 @@ func Convert_v1_CustomResourceSubresourceStatus_To_apiextensions_CustomResourceS } func autoConvert_apiextensions_CustomResourceSubresourceStatus_To_v1_CustomResourceSubresourceStatus(in *apiextensions.CustomResourceSubresourceStatus, out *CustomResourceSubresourceStatus, s conversion.Scope) error { + *out = *(*CustomResourceSubresourceStatus)(unsafe.Pointer(in)) return nil } @@ -646,8 +604,7 @@ func Convert_apiextensions_CustomResourceSubresourceStatus_To_v1_CustomResourceS } func autoConvert_v1_CustomResourceSubresources_To_apiextensions_CustomResourceSubresources(in *CustomResourceSubresources, out *apiextensions.CustomResourceSubresources, s conversion.Scope) error { - out.Status = (*apiextensions.CustomResourceSubresourceStatus)(unsafe.Pointer(in.Status)) - out.Scale = (*apiextensions.CustomResourceSubresourceScale)(unsafe.Pointer(in.Scale)) + *out = *(*apiextensions.CustomResourceSubresources)(unsafe.Pointer(in)) return nil } @@ -657,8 +614,7 @@ func Convert_v1_CustomResourceSubresources_To_apiextensions_CustomResourceSubres } func autoConvert_apiextensions_CustomResourceSubresources_To_v1_CustomResourceSubresources(in *apiextensions.CustomResourceSubresources, out *CustomResourceSubresources, s conversion.Scope) error { - out.Status = (*CustomResourceSubresourceStatus)(unsafe.Pointer(in.Status)) - out.Scale = (*CustomResourceSubresourceScale)(unsafe.Pointer(in.Scale)) + *out = *(*CustomResourceSubresources)(unsafe.Pointer(in)) return nil } @@ -704,8 +660,7 @@ func Convert_apiextensions_CustomResourceValidation_To_v1_CustomResourceValidati } func autoConvert_v1_ExternalDocumentation_To_apiextensions_ExternalDocumentation(in *ExternalDocumentation, out *apiextensions.ExternalDocumentation, s conversion.Scope) error { - out.Description = in.Description - out.URL = in.URL + *out = *(*apiextensions.ExternalDocumentation)(unsafe.Pointer(in)) return nil } @@ -715,8 +670,7 @@ func Convert_v1_ExternalDocumentation_To_apiextensions_ExternalDocumentation(in } func autoConvert_apiextensions_ExternalDocumentation_To_v1_ExternalDocumentation(in *apiextensions.ExternalDocumentation, out *ExternalDocumentation, s conversion.Scope) error { - out.Description = in.Description - out.URL = in.URL + *out = *(*ExternalDocumentation)(unsafe.Pointer(in)) return nil } @@ -1243,7 +1197,7 @@ func Convert_apiextensions_JSONSchemaPropsOrStringArray_To_v1_JSONSchemaPropsOrS } func autoConvert_v1_SelectableField_To_apiextensions_SelectableField(in *SelectableField, out *apiextensions.SelectableField, s conversion.Scope) error { - out.JSONPath = in.JSONPath + *out = *(*apiextensions.SelectableField)(unsafe.Pointer(in)) return nil } @@ -1253,7 +1207,7 @@ func Convert_v1_SelectableField_To_apiextensions_SelectableField(in *SelectableF } func autoConvert_apiextensions_SelectableField_To_v1_SelectableField(in *apiextensions.SelectableField, out *SelectableField, s conversion.Scope) error { - out.JSONPath = in.JSONPath + *out = *(*SelectableField)(unsafe.Pointer(in)) return nil } @@ -1293,12 +1247,7 @@ func Convert_apiextensions_ServiceReference_To_v1_ServiceReference(in *apiextens } func autoConvert_v1_ValidationRule_To_apiextensions_ValidationRule(in *ValidationRule, out *apiextensions.ValidationRule, s conversion.Scope) error { - out.Rule = in.Rule - out.Message = in.Message - out.MessageExpression = in.MessageExpression - out.Reason = (*apiextensions.FieldValueErrorReason)(unsafe.Pointer(in.Reason)) - out.FieldPath = in.FieldPath - out.OptionalOldSelf = (*bool)(unsafe.Pointer(in.OptionalOldSelf)) + *out = *(*apiextensions.ValidationRule)(unsafe.Pointer(in)) return nil } @@ -1308,12 +1257,7 @@ func Convert_v1_ValidationRule_To_apiextensions_ValidationRule(in *ValidationRul } func autoConvert_apiextensions_ValidationRule_To_v1_ValidationRule(in *apiextensions.ValidationRule, out *ValidationRule, s conversion.Scope) error { - out.Rule = in.Rule - out.Message = in.Message - out.MessageExpression = in.MessageExpression - out.Reason = (*FieldValueErrorReason)(unsafe.Pointer(in.Reason)) - out.FieldPath = in.FieldPath - out.OptionalOldSelf = (*bool)(unsafe.Pointer(in.OptionalOldSelf)) + *out = *(*ValidationRule)(unsafe.Pointer(in)) return nil } diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go index fb844903ed..e92c715a7a 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go @@ -442,7 +442,7 @@ const CustomResourceCleanupFinalizer = "customresourcecleanup.apiextensions.k8s. // <.spec.name>.<.spec.group>. // Deprecated in v1.16, planned for removal in v1.22. Use apiextensions.k8s.io/v1 CustomResourceDefinition instead. type CustomResourceDefinition struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional @@ -463,7 +463,7 @@ type CustomResourceDefinition struct { // CustomResourceDefinitionList is a list of CustomResourceDefinition objects. type CustomResourceDefinitionList struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Standard object's metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -536,7 +536,7 @@ type CustomResourceSubresourceScale struct { // ConversionReview describes a conversion request/response. type ConversionReview struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // request describes the attributes for the conversion request. // +optional Request *ConversionRequest `json:"request,omitempty" protobuf:"bytes,1,opt,name=request"` diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go index 5e388dc69b..85e1836c16 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go @@ -271,12 +271,7 @@ func RegisterConversions(s *runtime.Scheme) error { } func autoConvert_v1beta1_CustomResourceColumnDefinition_To_apiextensions_CustomResourceColumnDefinition(in *CustomResourceColumnDefinition, out *apiextensions.CustomResourceColumnDefinition, s conversion.Scope) error { - out.Name = in.Name - out.Type = in.Type - out.Format = in.Format - out.Description = in.Description - out.Priority = in.Priority - out.JSONPath = in.JSONPath + *out = *(*apiextensions.CustomResourceColumnDefinition)(unsafe.Pointer(in)) return nil } @@ -286,12 +281,7 @@ func Convert_v1beta1_CustomResourceColumnDefinition_To_apiextensions_CustomResou } func autoConvert_apiextensions_CustomResourceColumnDefinition_To_v1beta1_CustomResourceColumnDefinition(in *apiextensions.CustomResourceColumnDefinition, out *CustomResourceColumnDefinition, s conversion.Scope) error { - out.Name = in.Name - out.Type = in.Type - out.Format = in.Format - out.Description = in.Description - out.Priority = in.Priority - out.JSONPath = in.JSONPath + *out = *(*CustomResourceColumnDefinition)(unsafe.Pointer(in)) return nil } @@ -373,12 +363,7 @@ func Convert_apiextensions_CustomResourceDefinition_To_v1beta1_CustomResourceDef } func autoConvert_v1beta1_CustomResourceDefinitionCondition_To_apiextensions_CustomResourceDefinitionCondition(in *CustomResourceDefinitionCondition, out *apiextensions.CustomResourceDefinitionCondition, s conversion.Scope) error { - out.Type = apiextensions.CustomResourceDefinitionConditionType(in.Type) - out.Status = apiextensions.ConditionStatus(in.Status) - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - out.ObservedGeneration = in.ObservedGeneration + *out = *(*apiextensions.CustomResourceDefinitionCondition)(unsafe.Pointer(in)) return nil } @@ -388,12 +373,7 @@ func Convert_v1beta1_CustomResourceDefinitionCondition_To_apiextensions_CustomRe } func autoConvert_apiextensions_CustomResourceDefinitionCondition_To_v1beta1_CustomResourceDefinitionCondition(in *apiextensions.CustomResourceDefinitionCondition, out *CustomResourceDefinitionCondition, s conversion.Scope) error { - out.Type = CustomResourceDefinitionConditionType(in.Type) - out.Status = ConditionStatus(in.Status) - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - out.ObservedGeneration = in.ObservedGeneration + *out = *(*CustomResourceDefinitionCondition)(unsafe.Pointer(in)) return nil } @@ -445,12 +425,7 @@ func Convert_apiextensions_CustomResourceDefinitionList_To_v1beta1_CustomResourc } func autoConvert_v1beta1_CustomResourceDefinitionNames_To_apiextensions_CustomResourceDefinitionNames(in *CustomResourceDefinitionNames, out *apiextensions.CustomResourceDefinitionNames, s conversion.Scope) error { - out.Plural = in.Plural - out.Singular = in.Singular - out.ShortNames = *(*[]string)(unsafe.Pointer(&in.ShortNames)) - out.Kind = in.Kind - out.ListKind = in.ListKind - out.Categories = *(*[]string)(unsafe.Pointer(&in.Categories)) + *out = *(*apiextensions.CustomResourceDefinitionNames)(unsafe.Pointer(in)) return nil } @@ -460,12 +435,7 @@ func Convert_v1beta1_CustomResourceDefinitionNames_To_apiextensions_CustomResour } func autoConvert_apiextensions_CustomResourceDefinitionNames_To_v1beta1_CustomResourceDefinitionNames(in *apiextensions.CustomResourceDefinitionNames, out *CustomResourceDefinitionNames, s conversion.Scope) error { - out.Plural = in.Plural - out.Singular = in.Singular - out.ShortNames = *(*[]string)(unsafe.Pointer(&in.ShortNames)) - out.Kind = in.Kind - out.ListKind = in.ListKind - out.Categories = *(*[]string)(unsafe.Pointer(&in.Categories)) + *out = *(*CustomResourceDefinitionNames)(unsafe.Pointer(in)) return nil } @@ -571,12 +541,7 @@ func Convert_apiextensions_CustomResourceDefinitionSpec_To_v1beta1_CustomResourc } func autoConvert_v1beta1_CustomResourceDefinitionStatus_To_apiextensions_CustomResourceDefinitionStatus(in *CustomResourceDefinitionStatus, out *apiextensions.CustomResourceDefinitionStatus, s conversion.Scope) error { - out.Conditions = *(*[]apiextensions.CustomResourceDefinitionCondition)(unsafe.Pointer(&in.Conditions)) - if err := Convert_v1beta1_CustomResourceDefinitionNames_To_apiextensions_CustomResourceDefinitionNames(&in.AcceptedNames, &out.AcceptedNames, s); err != nil { - return err - } - out.StoredVersions = *(*[]string)(unsafe.Pointer(&in.StoredVersions)) - out.ObservedGeneration = in.ObservedGeneration + *out = *(*apiextensions.CustomResourceDefinitionStatus)(unsafe.Pointer(in)) return nil } @@ -586,12 +551,7 @@ func Convert_v1beta1_CustomResourceDefinitionStatus_To_apiextensions_CustomResou } func autoConvert_apiextensions_CustomResourceDefinitionStatus_To_v1beta1_CustomResourceDefinitionStatus(in *apiextensions.CustomResourceDefinitionStatus, out *CustomResourceDefinitionStatus, s conversion.Scope) error { - out.Conditions = *(*[]CustomResourceDefinitionCondition)(unsafe.Pointer(&in.Conditions)) - if err := Convert_apiextensions_CustomResourceDefinitionNames_To_v1beta1_CustomResourceDefinitionNames(&in.AcceptedNames, &out.AcceptedNames, s); err != nil { - return err - } - out.StoredVersions = *(*[]string)(unsafe.Pointer(&in.StoredVersions)) - out.ObservedGeneration = in.ObservedGeneration + *out = *(*CustomResourceDefinitionStatus)(unsafe.Pointer(in)) return nil } @@ -653,9 +613,7 @@ func Convert_apiextensions_CustomResourceDefinitionVersion_To_v1beta1_CustomReso } func autoConvert_v1beta1_CustomResourceSubresourceScale_To_apiextensions_CustomResourceSubresourceScale(in *CustomResourceSubresourceScale, out *apiextensions.CustomResourceSubresourceScale, s conversion.Scope) error { - out.SpecReplicasPath = in.SpecReplicasPath - out.StatusReplicasPath = in.StatusReplicasPath - out.LabelSelectorPath = (*string)(unsafe.Pointer(in.LabelSelectorPath)) + *out = *(*apiextensions.CustomResourceSubresourceScale)(unsafe.Pointer(in)) return nil } @@ -665,9 +623,7 @@ func Convert_v1beta1_CustomResourceSubresourceScale_To_apiextensions_CustomResou } func autoConvert_apiextensions_CustomResourceSubresourceScale_To_v1beta1_CustomResourceSubresourceScale(in *apiextensions.CustomResourceSubresourceScale, out *CustomResourceSubresourceScale, s conversion.Scope) error { - out.SpecReplicasPath = in.SpecReplicasPath - out.StatusReplicasPath = in.StatusReplicasPath - out.LabelSelectorPath = (*string)(unsafe.Pointer(in.LabelSelectorPath)) + *out = *(*CustomResourceSubresourceScale)(unsafe.Pointer(in)) return nil } @@ -677,6 +633,7 @@ func Convert_apiextensions_CustomResourceSubresourceScale_To_v1beta1_CustomResou } func autoConvert_v1beta1_CustomResourceSubresourceStatus_To_apiextensions_CustomResourceSubresourceStatus(in *CustomResourceSubresourceStatus, out *apiextensions.CustomResourceSubresourceStatus, s conversion.Scope) error { + *out = *(*apiextensions.CustomResourceSubresourceStatus)(unsafe.Pointer(in)) return nil } @@ -686,6 +643,7 @@ func Convert_v1beta1_CustomResourceSubresourceStatus_To_apiextensions_CustomReso } func autoConvert_apiextensions_CustomResourceSubresourceStatus_To_v1beta1_CustomResourceSubresourceStatus(in *apiextensions.CustomResourceSubresourceStatus, out *CustomResourceSubresourceStatus, s conversion.Scope) error { + *out = *(*CustomResourceSubresourceStatus)(unsafe.Pointer(in)) return nil } @@ -695,8 +653,7 @@ func Convert_apiextensions_CustomResourceSubresourceStatus_To_v1beta1_CustomReso } func autoConvert_v1beta1_CustomResourceSubresources_To_apiextensions_CustomResourceSubresources(in *CustomResourceSubresources, out *apiextensions.CustomResourceSubresources, s conversion.Scope) error { - out.Status = (*apiextensions.CustomResourceSubresourceStatus)(unsafe.Pointer(in.Status)) - out.Scale = (*apiextensions.CustomResourceSubresourceScale)(unsafe.Pointer(in.Scale)) + *out = *(*apiextensions.CustomResourceSubresources)(unsafe.Pointer(in)) return nil } @@ -706,8 +663,7 @@ func Convert_v1beta1_CustomResourceSubresources_To_apiextensions_CustomResourceS } func autoConvert_apiextensions_CustomResourceSubresources_To_v1beta1_CustomResourceSubresources(in *apiextensions.CustomResourceSubresources, out *CustomResourceSubresources, s conversion.Scope) error { - out.Status = (*CustomResourceSubresourceStatus)(unsafe.Pointer(in.Status)) - out.Scale = (*CustomResourceSubresourceScale)(unsafe.Pointer(in.Scale)) + *out = *(*CustomResourceSubresources)(unsafe.Pointer(in)) return nil } @@ -753,8 +709,7 @@ func Convert_apiextensions_CustomResourceValidation_To_v1beta1_CustomResourceVal } func autoConvert_v1beta1_ExternalDocumentation_To_apiextensions_ExternalDocumentation(in *ExternalDocumentation, out *apiextensions.ExternalDocumentation, s conversion.Scope) error { - out.Description = in.Description - out.URL = in.URL + *out = *(*apiextensions.ExternalDocumentation)(unsafe.Pointer(in)) return nil } @@ -764,8 +719,7 @@ func Convert_v1beta1_ExternalDocumentation_To_apiextensions_ExternalDocumentatio } func autoConvert_apiextensions_ExternalDocumentation_To_v1beta1_ExternalDocumentation(in *apiextensions.ExternalDocumentation, out *ExternalDocumentation, s conversion.Scope) error { - out.Description = in.Description - out.URL = in.URL + *out = *(*ExternalDocumentation)(unsafe.Pointer(in)) return nil } @@ -1292,7 +1246,7 @@ func Convert_apiextensions_JSONSchemaPropsOrStringArray_To_v1beta1_JSONSchemaPro } func autoConvert_v1beta1_SelectableField_To_apiextensions_SelectableField(in *SelectableField, out *apiextensions.SelectableField, s conversion.Scope) error { - out.JSONPath = in.JSONPath + *out = *(*apiextensions.SelectableField)(unsafe.Pointer(in)) return nil } @@ -1302,7 +1256,7 @@ func Convert_v1beta1_SelectableField_To_apiextensions_SelectableField(in *Select } func autoConvert_apiextensions_SelectableField_To_v1beta1_SelectableField(in *apiextensions.SelectableField, out *SelectableField, s conversion.Scope) error { - out.JSONPath = in.JSONPath + *out = *(*SelectableField)(unsafe.Pointer(in)) return nil } @@ -1342,12 +1296,7 @@ func Convert_apiextensions_ServiceReference_To_v1beta1_ServiceReference(in *apie } func autoConvert_v1beta1_ValidationRule_To_apiextensions_ValidationRule(in *ValidationRule, out *apiextensions.ValidationRule, s conversion.Scope) error { - out.Rule = in.Rule - out.Message = in.Message - out.MessageExpression = in.MessageExpression - out.Reason = (*apiextensions.FieldValueErrorReason)(unsafe.Pointer(in.Reason)) - out.FieldPath = in.FieldPath - out.OptionalOldSelf = (*bool)(unsafe.Pointer(in.OptionalOldSelf)) + *out = *(*apiextensions.ValidationRule)(unsafe.Pointer(in)) return nil } @@ -1357,12 +1306,7 @@ func Convert_v1beta1_ValidationRule_To_apiextensions_ValidationRule(in *Validati } func autoConvert_apiextensions_ValidationRule_To_v1beta1_ValidationRule(in *apiextensions.ValidationRule, out *ValidationRule, s conversion.Scope) error { - out.Rule = in.Rule - out.Message = in.Message - out.MessageExpression = in.MessageExpression - out.Reason = (*FieldValueErrorReason)(unsafe.Pointer(in.Reason)) - out.FieldPath = in.FieldPath - out.OptionalOldSelf = (*bool)(unsafe.Pointer(in.OptionalOldSelf)) + *out = *(*ValidationRule)(unsafe.Pointer(in)) return nil } diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinition.go index 4884c25237..0fd3d5369d 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinition.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1/customresourcedefinition.go @@ -19,8 +19,11 @@ limitations under the License. package v1 import ( + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + internal "k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/internal" apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -30,7 +33,7 @@ import ( // CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format // <.spec.name>.<.spec.group>. type CustomResourceDefinitionApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` @@ -50,6 +53,46 @@ func CustomResourceDefinition(name string) *CustomResourceDefinitionApplyConfigu return b } +// ExtractCustomResourceDefinitionFrom extracts the applied configuration owned by fieldManager from +// customResourceDefinition for the specified subresource. Pass an empty string for subresource to extract +// the main resource. Common subresources include "status", "scale", etc. +// customResourceDefinition must be a unmodified CustomResourceDefinition API object that was retrieved from the Kubernetes API. +// ExtractCustomResourceDefinitionFrom provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractCustomResourceDefinitionFrom(customResourceDefinition *apiextensionsv1.CustomResourceDefinition, fieldManager string, subresource string) (*CustomResourceDefinitionApplyConfiguration, error) { + b := &CustomResourceDefinitionApplyConfiguration{} + err := managedfields.ExtractInto(customResourceDefinition, internal.Parser().Type("io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinition"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(customResourceDefinition.Name) + + b.WithKind("CustomResourceDefinition") + b.WithAPIVersion("apiextensions.k8s.io/v1") + return b, nil +} + +// ExtractCustomResourceDefinition extracts the applied configuration owned by fieldManager from +// customResourceDefinition. If no managedFields are found in customResourceDefinition for fieldManager, a +// CustomResourceDefinitionApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// customResourceDefinition must be a unmodified CustomResourceDefinition API object that was retrieved from the Kubernetes API. +// ExtractCustomResourceDefinition provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractCustomResourceDefinition(customResourceDefinition *apiextensionsv1.CustomResourceDefinition, fieldManager string) (*CustomResourceDefinitionApplyConfiguration, error) { + return ExtractCustomResourceDefinitionFrom(customResourceDefinition, fieldManager, "") +} + +// ExtractCustomResourceDefinitionStatus extracts the applied configuration owned by fieldManager from +// customResourceDefinition for the status subresource. +func ExtractCustomResourceDefinitionStatus(customResourceDefinition *apiextensionsv1.CustomResourceDefinition, fieldManager string) (*CustomResourceDefinitionApplyConfiguration, error) { + return ExtractCustomResourceDefinitionFrom(customResourceDefinition, fieldManager, "status") +} + func (b CustomResourceDefinitionApplyConfiguration) IsApplyConfiguration() {} // WithKind sets the Kind field in the declarative configuration to the given value diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinition.go index 4838dafcb6..19a7711af1 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinition.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1/customresourcedefinition.go @@ -19,8 +19,11 @@ limitations under the License. package v1beta1 import ( + apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + internal "k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/internal" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -31,7 +34,7 @@ import ( // <.spec.name>.<.spec.group>. // Deprecated in v1.16, planned for removal in v1.22. Use apiextensions.k8s.io/v1 CustomResourceDefinition instead. type CustomResourceDefinitionApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` @@ -51,6 +54,46 @@ func CustomResourceDefinition(name string) *CustomResourceDefinitionApplyConfigu return b } +// ExtractCustomResourceDefinitionFrom extracts the applied configuration owned by fieldManager from +// customResourceDefinition for the specified subresource. Pass an empty string for subresource to extract +// the main resource. Common subresources include "status", "scale", etc. +// customResourceDefinition must be a unmodified CustomResourceDefinition API object that was retrieved from the Kubernetes API. +// ExtractCustomResourceDefinitionFrom provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractCustomResourceDefinitionFrom(customResourceDefinition *apiextensionsv1beta1.CustomResourceDefinition, fieldManager string, subresource string) (*CustomResourceDefinitionApplyConfiguration, error) { + b := &CustomResourceDefinitionApplyConfiguration{} + err := managedfields.ExtractInto(customResourceDefinition, internal.Parser().Type("io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinition"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(customResourceDefinition.Name) + + b.WithKind("CustomResourceDefinition") + b.WithAPIVersion("apiextensions.k8s.io/v1beta1") + return b, nil +} + +// ExtractCustomResourceDefinition extracts the applied configuration owned by fieldManager from +// customResourceDefinition. If no managedFields are found in customResourceDefinition for fieldManager, a +// CustomResourceDefinitionApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// customResourceDefinition must be a unmodified CustomResourceDefinition API object that was retrieved from the Kubernetes API. +// ExtractCustomResourceDefinition provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractCustomResourceDefinition(customResourceDefinition *apiextensionsv1beta1.CustomResourceDefinition, fieldManager string) (*CustomResourceDefinitionApplyConfiguration, error) { + return ExtractCustomResourceDefinitionFrom(customResourceDefinition, fieldManager, "") +} + +// ExtractCustomResourceDefinitionStatus extracts the applied configuration owned by fieldManager from +// customResourceDefinition for the status subresource. +func ExtractCustomResourceDefinitionStatus(customResourceDefinition *apiextensionsv1beta1.CustomResourceDefinition, fieldManager string) (*CustomResourceDefinitionApplyConfiguration, error) { + return ExtractCustomResourceDefinitionFrom(customResourceDefinition, fieldManager, "status") +} + func (b CustomResourceDefinitionApplyConfiguration) IsApplyConfiguration() {} // WithKind sets the Kind field in the declarative configuration to the given value diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/internal/internal.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/internal/internal.go new file mode 100644 index 0000000000..04927b8351 --- /dev/null +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/internal/internal.go @@ -0,0 +1,1250 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package internal + +import ( + fmt "fmt" + sync "sync" + + typed "sigs.k8s.io/structured-merge-diff/v6/typed" +) + +func Parser() *typed.Parser { + parserOnce.Do(func() { + var err error + parser, err = typed.NewParser(schemaYAML) + if err != nil { + panic(fmt.Sprintf("Failed to parse schema: %v", err)) + } + }) + return parser +} + +var parserOnce sync.Once +var parser *typed.Parser +var schemaYAML = typed.YAMLObject(`types: +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceColumnDefinition + map: + fields: + - name: description + type: + scalar: string + - name: format + type: + scalar: string + - name: jsonPath + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: priority + type: + scalar: numeric + - name: type + type: + scalar: string + default: "" +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceConversion + map: + fields: + - name: strategy + type: + scalar: string + default: "" + - name: webhook + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.WebhookConversion +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinition + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec + default: {} + - name: status + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionStatus + default: {} +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: observedGeneration + type: + scalar: numeric + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionNames + map: + fields: + - name: categories + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: kind + type: + scalar: string + default: "" + - name: listKind + type: + scalar: string + - name: plural + type: + scalar: string + default: "" + - name: shortNames + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: singular + type: + scalar: string +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec + map: + fields: + - name: conversion + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceConversion + - name: group + type: + scalar: string + default: "" + - name: names + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionNames + default: {} + - name: preserveUnknownFields + type: + scalar: boolean + - name: scope + type: + scalar: string + default: "" + - name: versions + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionVersion + elementRelationship: atomic +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionStatus + map: + fields: + - name: acceptedNames + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionNames + default: {} + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionCondition + elementRelationship: associative + keys: + - type + - name: observedGeneration + type: + scalar: numeric + - name: storedVersions + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionVersion + map: + fields: + - name: additionalPrinterColumns + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceColumnDefinition + elementRelationship: atomic + - name: deprecated + type: + scalar: boolean + - name: deprecationWarning + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: schema + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceValidation + - name: selectableFields + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.SelectableField + elementRelationship: atomic + - name: served + type: + scalar: boolean + default: false + - name: storage + type: + scalar: boolean + default: false + - name: subresources + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceSubresources +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceSubresourceScale + map: + fields: + - name: labelSelectorPath + type: + scalar: string + - name: specReplicasPath + type: + scalar: string + default: "" + - name: statusReplicasPath + type: + scalar: string + default: "" +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceSubresourceStatus + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceSubresources + map: + fields: + - name: scale + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceSubresourceScale + - name: status + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceSubresourceStatus +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceValidation + map: + fields: + - name: openAPIV3Schema + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.ExternalDocumentation + map: + fields: + - name: description + type: + scalar: string + - name: url + type: + scalar: string +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSON + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps + map: + fields: + - name: $ref + type: + scalar: string + - name: $schema + type: + scalar: string + - name: additionalItems + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrBool + - name: additionalProperties + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrBool + - name: allOf + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps + elementRelationship: atomic + - name: anyOf + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps + elementRelationship: atomic + - name: default + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSON + - name: definitions + type: + map: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps + - name: dependencies + type: + map: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrStringArray + - name: description + type: + scalar: string + - name: enum + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSON + elementRelationship: atomic + - name: example + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSON + - name: exclusiveMaximum + type: + scalar: boolean + - name: exclusiveMinimum + type: + scalar: boolean + - name: externalDocs + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.ExternalDocumentation + - name: format + type: + scalar: string + - name: id + type: + scalar: string + - name: items + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrArray + - name: maxItems + type: + scalar: numeric + - name: maxLength + type: + scalar: numeric + - name: maxProperties + type: + scalar: numeric + - name: maximum + type: + scalar: numeric + - name: minItems + type: + scalar: numeric + - name: minLength + type: + scalar: numeric + - name: minProperties + type: + scalar: numeric + - name: minimum + type: + scalar: numeric + - name: multipleOf + type: + scalar: numeric + - name: not + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps + - name: nullable + type: + scalar: boolean + - name: oneOf + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps + elementRelationship: atomic + - name: pattern + type: + scalar: string + - name: patternProperties + type: + map: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps + - name: properties + type: + map: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps + - name: required + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: title + type: + scalar: string + - name: type + type: + scalar: string + - name: uniqueItems + type: + scalar: boolean + - name: x-kubernetes-embedded-resource + type: + scalar: boolean + - name: x-kubernetes-int-or-string + type: + scalar: boolean + - name: x-kubernetes-list-map-keys + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: x-kubernetes-list-type + type: + scalar: string + - name: x-kubernetes-map-type + type: + scalar: string + - name: x-kubernetes-preserve-unknown-fields + type: + scalar: boolean + - name: x-kubernetes-validations + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.ValidationRule + elementRelationship: associative + keys: + - rule +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrArray + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrBool + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrStringArray + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.SelectableField + map: + fields: + - name: jsonPath + type: + scalar: string + default: "" +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.ServiceReference + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + default: "" + - name: path + type: + scalar: string + - name: port + type: + scalar: numeric +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.ValidationRule + map: + fields: + - name: fieldPath + type: + scalar: string + - name: message + type: + scalar: string + - name: messageExpression + type: + scalar: string + - name: optionalOldSelf + type: + scalar: boolean + - name: reason + type: + scalar: string + - name: rule + type: + scalar: string + default: "" +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.WebhookClientConfig + map: + fields: + - name: caBundle + type: + scalar: string + - name: service + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.ServiceReference + - name: url + type: + scalar: string +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.WebhookConversion + map: + fields: + - name: clientConfig + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.WebhookClientConfig + - name: conversionReviewVersions + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceColumnDefinition + map: + fields: + - name: JSONPath + type: + scalar: string + default: "" + - name: description + type: + scalar: string + - name: format + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: priority + type: + scalar: numeric + - name: type + type: + scalar: string + default: "" +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceConversion + map: + fields: + - name: conversionReviewVersions + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: strategy + type: + scalar: string + default: "" + - name: webhookClientConfig + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.WebhookClientConfig +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinition + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionSpec + default: {} + - name: status + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionStatus + default: {} +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: observedGeneration + type: + scalar: numeric + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionNames + map: + fields: + - name: categories + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: kind + type: + scalar: string + default: "" + - name: listKind + type: + scalar: string + - name: plural + type: + scalar: string + default: "" + - name: shortNames + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: singular + type: + scalar: string +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionSpec + map: + fields: + - name: additionalPrinterColumns + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceColumnDefinition + elementRelationship: atomic + - name: conversion + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceConversion + - name: group + type: + scalar: string + default: "" + - name: names + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionNames + default: {} + - name: preserveUnknownFields + type: + scalar: boolean + - name: scope + type: + scalar: string + default: "" + - name: selectableFields + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.SelectableField + elementRelationship: atomic + - name: subresources + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceSubresources + - name: validation + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceValidation + - name: version + type: + scalar: string + - name: versions + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionVersion + elementRelationship: atomic +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionStatus + map: + fields: + - name: acceptedNames + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionNames + default: {} + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionCondition + elementRelationship: associative + keys: + - type + - name: observedGeneration + type: + scalar: numeric + - name: storedVersions + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionVersion + map: + fields: + - name: additionalPrinterColumns + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceColumnDefinition + elementRelationship: atomic + - name: deprecated + type: + scalar: boolean + - name: deprecationWarning + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: schema + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceValidation + - name: selectableFields + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.SelectableField + elementRelationship: atomic + - name: served + type: + scalar: boolean + default: false + - name: storage + type: + scalar: boolean + default: false + - name: subresources + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceSubresources +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceSubresourceScale + map: + fields: + - name: labelSelectorPath + type: + scalar: string + - name: specReplicasPath + type: + scalar: string + default: "" + - name: statusReplicasPath + type: + scalar: string + default: "" +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceSubresourceStatus + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceSubresources + map: + fields: + - name: scale + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceSubresourceScale + - name: status + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceSubresourceStatus +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceValidation + map: + fields: + - name: openAPIV3Schema + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.ExternalDocumentation + map: + fields: + - name: description + type: + scalar: string + - name: url + type: + scalar: string +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSON + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps + map: + fields: + - name: $ref + type: + scalar: string + - name: $schema + type: + scalar: string + - name: additionalItems + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrBool + - name: additionalProperties + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrBool + - name: allOf + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps + elementRelationship: atomic + - name: anyOf + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps + elementRelationship: atomic + - name: default + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSON + - name: definitions + type: + map: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps + - name: dependencies + type: + map: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrStringArray + - name: description + type: + scalar: string + - name: enum + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSON + elementRelationship: atomic + - name: example + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSON + - name: exclusiveMaximum + type: + scalar: boolean + - name: exclusiveMinimum + type: + scalar: boolean + - name: externalDocs + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.ExternalDocumentation + - name: format + type: + scalar: string + - name: id + type: + scalar: string + - name: items + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrArray + - name: maxItems + type: + scalar: numeric + - name: maxLength + type: + scalar: numeric + - name: maxProperties + type: + scalar: numeric + - name: maximum + type: + scalar: numeric + - name: minItems + type: + scalar: numeric + - name: minLength + type: + scalar: numeric + - name: minProperties + type: + scalar: numeric + - name: minimum + type: + scalar: numeric + - name: multipleOf + type: + scalar: numeric + - name: not + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps + - name: nullable + type: + scalar: boolean + - name: oneOf + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps + elementRelationship: atomic + - name: pattern + type: + scalar: string + - name: patternProperties + type: + map: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps + - name: properties + type: + map: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps + - name: required + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: title + type: + scalar: string + - name: type + type: + scalar: string + - name: uniqueItems + type: + scalar: boolean + - name: x-kubernetes-embedded-resource + type: + scalar: boolean + - name: x-kubernetes-int-or-string + type: + scalar: boolean + - name: x-kubernetes-list-map-keys + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: x-kubernetes-list-type + type: + scalar: string + - name: x-kubernetes-map-type + type: + scalar: string + - name: x-kubernetes-preserve-unknown-fields + type: + scalar: boolean + - name: x-kubernetes-validations + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.ValidationRule + elementRelationship: associative + keys: + - rule +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrArray + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrBool + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrStringArray + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.SelectableField + map: + fields: + - name: jsonPath + type: + scalar: string + default: "" +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.ServiceReference + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + default: "" + - name: path + type: + scalar: string + - name: port + type: + scalar: numeric +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.ValidationRule + map: + fields: + - name: fieldPath + type: + scalar: string + - name: message + type: + scalar: string + - name: messageExpression + type: + scalar: string + - name: optionalOldSelf + type: + scalar: boolean + - name: reason + type: + scalar: string + - name: rule + type: + scalar: string + default: "" +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.WebhookClientConfig + map: + fields: + - name: caBundle + type: + scalar: string + - name: service + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.ServiceReference + - name: url + type: + scalar: string +- name: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1 + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry + map: + fields: + - name: apiVersion + type: + scalar: string + - name: fieldsType + type: + scalar: string + - name: fieldsV1 + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1 + - name: manager + type: + scalar: string + - name: operation + type: + scalar: string + - name: subresource + type: + scalar: string + - name: time + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time +- name: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + map: + fields: + - name: annotations + type: + map: + elementType: + scalar: string + - name: creationTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: deletionGracePeriodSeconds + type: + scalar: numeric + - name: deletionTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: finalizers + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: generateName + type: + scalar: string + - name: generation + type: + scalar: numeric + - name: labels + type: + map: + elementType: + scalar: string + - name: managedFields + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry + elementRelationship: atomic + - name: name + type: + scalar: string + - name: namespace + type: + scalar: string + - name: ownerReferences + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference + elementRelationship: associative + keys: + - uid + - name: resourceVersion + type: + scalar: string + - name: selfLink + type: + scalar: string + - name: uid + type: + scalar: string +- name: io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference + map: + fields: + - name: apiVersion + type: + scalar: string + default: "" + - name: blockOwnerDeletion + type: + scalar: boolean + - name: controller + type: + scalar: boolean + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: uid + type: + scalar: string + default: "" + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.apis.meta.v1.Time + scalar: untyped +- name: __untyped_atomic_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic +- name: __untyped_deduced_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +`) diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/clientset.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/clientset.go index 93dd79d63f..8e13f11bb7 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/clientset.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/clientset.go @@ -30,7 +30,7 @@ import ( ) type Interface interface { - Discovery() discovery.DiscoveryInterface + Discovery() discovery.DiscoveryInterfaces ApiextensionsV1() apiextensionsv1.ApiextensionsV1Interface ApiextensionsV1beta1() apiextensionsv1beta1.ApiextensionsV1beta1Interface } @@ -53,7 +53,7 @@ func (c *Clientset) ApiextensionsV1beta1() apiextensionsv1beta1.ApiextensionsV1b } // Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { +func (c *Clientset) Discovery() discovery.DiscoveryInterfaces { if c == nil { return nil } diff --git a/vendor/k8s.io/apimachinery/pkg/api/meta/interfaces.go b/vendor/k8s.io/apimachinery/pkg/api/meta/interfaces.go index a35ce3bd0a..628187eeeb 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/meta/interfaces.go +++ b/vendor/k8s.io/apimachinery/pkg/api/meta/interfaces.go @@ -17,6 +17,8 @@ limitations under the License. package meta import ( + "context" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" @@ -109,7 +111,9 @@ type RESTMapping struct { // to API groups. In other words, kinds and resources should not be assumed to be // unique across groups. // -// TODO: split into sub-interfaces +// RESTMapperWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use RESTMapperWithContext instead. type RESTMapper interface { // KindFor takes a partial resource and returns the single match. Returns an error if there are multiple matches KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) @@ -133,11 +137,114 @@ type RESTMapper interface { ResourceSingularizer(resource string) (singular string, err error) } +// RESTMapperWithContext allows clients to map resources to kind, and map kind and version +// to interfaces for manipulating those objects. It is primarily intended for +// consumers of Kubernetes compatible REST APIs as defined in docs/devel/api-conventions.md. +// +// The Kubernetes API provides versioned resources and object kinds which are scoped +// to API groups. In other words, kinds and resources should not be assumed to be +// unique across groups. +type RESTMapperWithContext interface { + // KindFor takes a partial resource and returns the single match. Returns an error if there are multiple matches + KindForWithContext(ctx context.Context, resource schema.GroupVersionResource) (schema.GroupVersionKind, error) + + // KindsFor takes a partial resource and returns the list of potential kinds in priority order + KindsForWithContext(ctx context.Context, resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error) + + // ResourceFor takes a partial resource and returns the single match. Returns an error if there are multiple matches + ResourceForWithContext(ctx context.Context, input schema.GroupVersionResource) (schema.GroupVersionResource, error) + + // ResourcesFor takes a partial resource and returns the list of potential resource in priority order + ResourcesForWithContext(ctx context.Context, input schema.GroupVersionResource) ([]schema.GroupVersionResource, error) + + // RESTMapping identifies a preferred resource mapping for the provided group kind. + RESTMappingWithContext(ctx context.Context, gk schema.GroupKind, versions ...string) (*RESTMapping, error) + // RESTMappings returns all resource mappings for the provided group kind if no + // version search is provided. Otherwise identifies a preferred resource mapping for + // the provided version(s). + RESTMappingsWithContext(ctx context.Context, gk schema.GroupKind, versions ...string) ([]*RESTMapping, error) + + ResourceSingularizerWithContext(ctx context.Context, resource string) (singular string, err error) +} + +func ToRESTMapperWithContext(m RESTMapper) RESTMapperWithContext { + if m == nil { + return nil + } + if m, ok := m.(RESTMapperWithContext); ok { + return m + } + return &restMapperWrapper{ + delegate: m, + } +} + +type restMapperWrapper struct { + delegate RESTMapper +} + +func (m *restMapperWrapper) KindForWithContext(ctx context.Context, resource schema.GroupVersionResource) (schema.GroupVersionKind, error) { + return m.delegate.KindFor(resource) +} +func (m *restMapperWrapper) KindsForWithContext(ctx context.Context, resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error) { + return m.delegate.KindsFor(resource) +} +func (m *restMapperWrapper) ResourceForWithContext(ctx context.Context, input schema.GroupVersionResource) (schema.GroupVersionResource, error) { + return m.delegate.ResourceFor(input) +} +func (m *restMapperWrapper) ResourcesForWithContext(ctx context.Context, input schema.GroupVersionResource) ([]schema.GroupVersionResource, error) { + return m.delegate.ResourcesFor(input) +} +func (m *restMapperWrapper) RESTMappingWithContext(ctx context.Context, gk schema.GroupKind, versions ...string) (*RESTMapping, error) { + return m.delegate.RESTMapping(gk, versions...) +} +func (m *restMapperWrapper) RESTMappingsWithContext(ctx context.Context, gk schema.GroupKind, versions ...string) ([]*RESTMapping, error) { + return m.delegate.RESTMappings(gk, versions...) +} +func (m *restMapperWrapper) ResourceSingularizerWithContext(ctx context.Context, resource string) (singular string, err error) { + return m.delegate.ResourceSingularizer(resource) +} + // ResettableRESTMapper is a RESTMapper which is capable of resetting itself // from discovery. // All rest mappers that delegate to other rest mappers must implement this interface and dynamically // check if the delegate mapper supports the Reset() operation. +// +// ResettableRESTMapperWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ResettableRESTMapperWithContext instead. type ResettableRESTMapper interface { RESTMapper Reset() } + +// ResettableRESTMapperWithContext is a RESTMapper which is capable of resetting itself +// from discovery. +// All rest mappers that delegate to other rest mappers must implement this interface and dynamically +// check if the delegate mapper supports the ResetWithContext() operation. +type ResettableRESTMapperWithContext interface { + RESTMapperWithContext + ResetWithContext(ctx context.Context) +} + +func ToResettableRESTMapperWithContext(m ResettableRESTMapper) ResettableRESTMapperWithContext { + if m == nil { + return nil + } + if m, ok := m.(ResettableRESTMapperWithContext); ok { + return m + } + return &resettableRESTMapperWrapper{ + RESTMapperWithContext: ToRESTMapperWithContext(m), + delegate: m, + } +} + +type resettableRESTMapperWrapper struct { + RESTMapperWithContext + delegate ResettableRESTMapper +} + +func (m *resettableRESTMapperWrapper) ResetWithContext(ctx context.Context) { + m.delegate.Reset() +} diff --git a/vendor/k8s.io/apimachinery/pkg/api/meta/meta.go b/vendor/k8s.io/apimachinery/pkg/api/meta/meta.go index 2551f07f5c..4bf24da522 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/meta/meta.go +++ b/vendor/k8s.io/apimachinery/pkg/api/meta/meta.go @@ -600,6 +600,7 @@ func (a genericAccessor) GetOwnerReferences() []metav1.OwnerReference { var ret []metav1.OwnerReference s := a.ownerReferences if s.Kind() != reflect.Pointer || s.Elem().Kind() != reflect.Slice { + //nolint:logcheck // Should not happen. klog.Errorf("expect %v to be a pointer to slice", s) return ret } @@ -608,6 +609,7 @@ func (a genericAccessor) GetOwnerReferences() []metav1.OwnerReference { ret = make([]metav1.OwnerReference, s.Len(), s.Len()+1) for i := 0; i < s.Len(); i++ { if err := extractFromOwnerReference(s.Index(i), &ret[i]); err != nil { + //nolint:logcheck // Should not happen. klog.Errorf("extractFromOwnerReference failed: %v", err) return ret } @@ -618,12 +620,14 @@ func (a genericAccessor) GetOwnerReferences() []metav1.OwnerReference { func (a genericAccessor) SetOwnerReferences(references []metav1.OwnerReference) { s := a.ownerReferences if s.Kind() != reflect.Pointer || s.Elem().Kind() != reflect.Slice { + //nolint:logcheck // Should not happen. klog.Errorf("expect %v to be a pointer to slice", s) } s = s.Elem() newReferences := reflect.MakeSlice(s.Type(), len(references), len(references)) for i := 0; i < len(references); i++ { if err := setOwnerReference(newReferences.Index(i), &references[i]); err != nil { + //nolint:logcheck // Should not happen. klog.Errorf("setOwnerReference failed: %v", err) return } diff --git a/vendor/k8s.io/apimachinery/pkg/api/meta/multirestmapper.go b/vendor/k8s.io/apimachinery/pkg/api/meta/multirestmapper.go index b7e9712505..2b2c143ce7 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/meta/multirestmapper.go +++ b/vendor/k8s.io/apimachinery/pkg/api/meta/multirestmapper.go @@ -17,6 +17,7 @@ limitations under the License. package meta import ( + "context" "fmt" "strings" @@ -25,13 +26,31 @@ import ( ) var ( - _ ResettableRESTMapper = MultiRESTMapper{} + _ ResettableRESTMapper = MultiRESTMapper{} + _ fmt.Stringer = MultiRESTMapper{} + _ ResettableRESTMapperWithContext = MultiRESTMapperWithContext{} + _ fmt.Stringer = MultiRESTMapperWithContext{} ) // MultiRESTMapper is a wrapper for multiple RESTMappers. +// +// MultiRESTMapperWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use MultiRESTMapperWithContext instead. type MultiRESTMapper []RESTMapper +// MultiRESTMapperWithContext is a wrapper for multiple RESTMapperWithContext instances. +type MultiRESTMapperWithContext []RESTMapperWithContext + func (m MultiRESTMapper) String() string { + return stringifyMapper("MultiRESTMapper", m) +} + +func (m MultiRESTMapperWithContext) String() string { + return stringifyMapper("MultiRESTMapperWithContext", m) +} + +func stringifyMapper[T any](typeName string, m []T) string { nested := make([]string, 0, len(m)) for _, t := range m { currString := fmt.Sprintf("%v", t) @@ -39,14 +58,93 @@ func (m MultiRESTMapper) String() string { nested = append(nested, strings.Join(splitStrings, "\n\t")) } - return fmt.Sprintf("MultiRESTMapper{\n\t%s\n}", strings.Join(nested, "\n\t")) + return fmt.Sprintf("%s{\n\t%s\n}", typeName, strings.Join(nested, "\n\t")) +} + +func ToMultiRESTMapperWithContext(m MultiRESTMapper) MultiRESTMapperWithContext { + if m == nil { + return nil + } + mc := make(MultiRESTMapperWithContext, len(m)) + for i, m := range m { + mc[i] = ToRESTMapperWithContext(m) + } + return mc } // ResourceSingularizer converts a REST resource name from plural to singular (e.g., from pods to pod) // This implementation supports multiple REST schemas and return the first match. +// +// MultiRESTMapperWithContext.ResourceSingularizerWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use MultiRESTMapperWithContext.ResourceSingularizerWithContext instead. func (m MultiRESTMapper) ResourceSingularizer(resource string) (singular string, err error) { + return ToMultiRESTMapperWithContext(m).ResourceSingularizerWithContext(context.Background(), resource) +} + +// MultiRESTMapperWithContext.ResourcesForWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use MultiRESTMapperWithContext.ResourcesForWithContext instead. +func (m MultiRESTMapper) ResourcesFor(resource schema.GroupVersionResource) ([]schema.GroupVersionResource, error) { + return ToMultiRESTMapperWithContext(m).ResourcesForWithContext(context.Background(), resource) +} + +// MultiRESTMapperWithContext.KindsForWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use MultiRESTMapperWithContext.KindsForWithContext instead. +func (m MultiRESTMapper) KindsFor(resource schema.GroupVersionResource) (gvk []schema.GroupVersionKind, err error) { + return ToMultiRESTMapperWithContext(m).KindsForWithContext(context.Background(), resource) +} + +// MultiRESTMapperWithContext.ResourceForWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use MultiRESTMapperWithContext.ResourceForWithContext instead. +func (m MultiRESTMapper) ResourceFor(resource schema.GroupVersionResource) (schema.GroupVersionResource, error) { + return ToMultiRESTMapperWithContext(m).ResourceForWithContext(context.Background(), resource) +} + +// MultiRESTMapperWithContext.KindForWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use MultiRESTMapperWithContext.KindForWithContext instead. +func (m MultiRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) { + return ToMultiRESTMapperWithContext(m).KindForWithContext(context.Background(), resource) +} + +// RESTMapping provides the REST mapping for the resource based on the +// kind and version. This implementation supports multiple REST schemas and +// return the first match. +// +// MultiRESTMapperWithContext.RESTMappingWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use MultiRESTMapperWithContext.RESTMappingWithContext instead. +func (m MultiRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*RESTMapping, error) { + return ToMultiRESTMapperWithContext(m).RESTMappingWithContext(context.Background(), gk, versions...) +} + +// RESTMappings returns all possible RESTMappings for the provided group kind, or an error +// if the type is not recognized. +// +// MultiRESTMapperWithContext.RESTMappingsWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use MultiRESTMapperWithContext.RESTMappingsWithContext instead. +func (m MultiRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*RESTMapping, error) { + return ToMultiRESTMapperWithContext(m).RESTMappingsWithContext(context.Background(), gk, versions...) +} + +// MultiRESTMapperWithContext.Reset is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use MultiRESTMapperWithContext.Reset instead. +func (m MultiRESTMapper) Reset() { for _, t := range m { - singular, err = t.ResourceSingularizer(resource) + MaybeResetRESTMapper(t) + } +} + +// ResourceSingularizer converts a REST resource name from plural to singular (e.g., from pods to pod) +// This implementation supports multiple REST schemas and return the first match. +func (m MultiRESTMapperWithContext) ResourceSingularizerWithContext(ctx context.Context, resource string) (singular string, err error) { + for _, t := range m { + singular, err = t.ResourceSingularizerWithContext(ctx, resource) if err == nil { return } @@ -54,10 +152,10 @@ func (m MultiRESTMapper) ResourceSingularizer(resource string) (singular string, return } -func (m MultiRESTMapper) ResourcesFor(resource schema.GroupVersionResource) ([]schema.GroupVersionResource, error) { +func (m MultiRESTMapperWithContext) ResourcesForWithContext(ctx context.Context, resource schema.GroupVersionResource) ([]schema.GroupVersionResource, error) { allGVRs := []schema.GroupVersionResource{} for _, t := range m { - gvrs, err := t.ResourcesFor(resource) + gvrs, err := t.ResourcesForWithContext(ctx, resource) // ignore "no match" errors, but any other error percolates back up if IsNoMatchError(err) { continue @@ -89,10 +187,10 @@ func (m MultiRESTMapper) ResourcesFor(resource schema.GroupVersionResource) ([]s return allGVRs, nil } -func (m MultiRESTMapper) KindsFor(resource schema.GroupVersionResource) (gvk []schema.GroupVersionKind, err error) { +func (m MultiRESTMapperWithContext) KindsForWithContext(ctx context.Context, resource schema.GroupVersionResource) (gvk []schema.GroupVersionKind, err error) { allGVKs := []schema.GroupVersionKind{} for _, t := range m { - gvks, err := t.KindsFor(resource) + gvks, err := t.KindsForWithContext(ctx, resource) // ignore "no match" errors, but any other error percolates back up if IsNoMatchError(err) { continue @@ -124,8 +222,8 @@ func (m MultiRESTMapper) KindsFor(resource schema.GroupVersionResource) (gvk []s return allGVKs, nil } -func (m MultiRESTMapper) ResourceFor(resource schema.GroupVersionResource) (schema.GroupVersionResource, error) { - resources, err := m.ResourcesFor(resource) +func (m MultiRESTMapperWithContext) ResourceForWithContext(ctx context.Context, resource schema.GroupVersionResource) (schema.GroupVersionResource, error) { + resources, err := m.ResourcesForWithContext(ctx, resource) if err != nil { return schema.GroupVersionResource{}, err } @@ -136,8 +234,8 @@ func (m MultiRESTMapper) ResourceFor(resource schema.GroupVersionResource) (sche return schema.GroupVersionResource{}, &AmbiguousResourceError{PartialResource: resource, MatchingResources: resources} } -func (m MultiRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) { - kinds, err := m.KindsFor(resource) +func (m MultiRESTMapperWithContext) KindForWithContext(ctx context.Context, resource schema.GroupVersionResource) (schema.GroupVersionKind, error) { + kinds, err := m.KindsForWithContext(ctx, resource) if err != nil { return schema.GroupVersionKind{}, err } @@ -151,12 +249,12 @@ func (m MultiRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.G // RESTMapping provides the REST mapping for the resource based on the // kind and version. This implementation supports multiple REST schemas and // return the first match. -func (m MultiRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*RESTMapping, error) { +func (m MultiRESTMapperWithContext) RESTMappingWithContext(ctx context.Context, gk schema.GroupKind, versions ...string) (*RESTMapping, error) { allMappings := []*RESTMapping{} errors := []error{} for _, t := range m { - currMapping, err := t.RESTMapping(gk, versions...) + currMapping, err := t.RESTMappingWithContext(ctx, gk, versions...) // ignore "no match" errors, but any other error percolates back up if IsNoMatchError(err) { continue @@ -188,12 +286,12 @@ func (m MultiRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (* // RESTMappings returns all possible RESTMappings for the provided group kind, or an error // if the type is not recognized. -func (m MultiRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*RESTMapping, error) { +func (m MultiRESTMapperWithContext) RESTMappingsWithContext(ctx context.Context, gk schema.GroupKind, versions ...string) ([]*RESTMapping, error) { var allMappings []*RESTMapping var errors []error for _, t := range m { - currMappings, err := t.RESTMappings(gk, versions...) + currMappings, err := t.RESTMappingsWithContext(ctx, gk, versions...) // ignore "no match" errors, but any other error percolates back up if IsNoMatchError(err) { continue @@ -213,8 +311,8 @@ func (m MultiRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ( return allMappings, nil } -func (m MultiRESTMapper) Reset() { +func (m MultiRESTMapperWithContext) ResetWithContext(ctx context.Context) { for _, t := range m { - MaybeResetRESTMapper(t) + MaybeResetRESTMapperWithContext(ctx, t) } } diff --git a/vendor/k8s.io/apimachinery/pkg/api/meta/priority.go b/vendor/k8s.io/apimachinery/pkg/api/meta/priority.go index 4f097c9c90..d152e7e322 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/meta/priority.go +++ b/vendor/k8s.io/apimachinery/pkg/api/meta/priority.go @@ -17,6 +17,7 @@ limitations under the License. package meta import ( + "context" "fmt" "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,11 +31,17 @@ const ( ) var ( - _ ResettableRESTMapper = PriorityRESTMapper{} + _ ResettableRESTMapper = PriorityRESTMapper{} + _ ResettableRESTMapperWithContext = PriorityRESTMapperWithContext{} + _ fmt.Stringer = PriorityRESTMapperWithContext{} ) // PriorityRESTMapper is a wrapper for automatically choosing a particular Resource or Kind // when multiple matches are possible +// +// PriorityRESTMapperWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use PriorityRESTMapperWithContext instead. type PriorityRESTMapper struct { // Delegate is the RESTMapper to use to locate all the Kind and Resource matches Delegate RESTMapper @@ -56,9 +63,100 @@ func (m PriorityRESTMapper) String() string { return fmt.Sprintf("PriorityRESTMapper{\n\t%v\n\t%v\n\t%v\n}", m.ResourcePriority, m.KindPriority, m.Delegate) } +// PriorityRESTMapperWithContext is a wrapper for automatically choosing a particular Resource or Kind +// when multiple matches are possible +type PriorityRESTMapperWithContext struct { + // Delegate is the RESTMapperWithContext to use to locate all the Kind and Resource matches + Delegate RESTMapperWithContext + + // ResourcePriority is a list of priority patterns to apply to matching resources. + // The list of all matching resources is narrowed based on the patterns until only one remains. + // A pattern with no matches is skipped. A pattern with more than one match uses its + // matches as the list to continue matching against. + ResourcePriority []schema.GroupVersionResource + + // KindPriority is a list of priority patterns to apply to matching kinds. + // The list of all matching kinds is narrowed based on the patterns until only one remains. + // A pattern with no matches is skipped. A pattern with more than one match uses its + // matches as the list to continue matching against. + KindPriority []schema.GroupVersionKind +} + +func (m PriorityRESTMapperWithContext) String() string { + return fmt.Sprintf("PriorityRESTMapperWithContext{\n\t%v\n\t%v\n\t%v\n}", m.ResourcePriority, m.KindPriority, m.Delegate) +} + +func ToPriorityRESTMapperWithContext(m PriorityRESTMapper) PriorityRESTMapperWithContext { + return PriorityRESTMapperWithContext{ + Delegate: ToRESTMapperWithContext(m.Delegate), + ResourcePriority: m.ResourcePriority, + KindPriority: m.KindPriority, + } +} + // ResourceFor finds all resources, then passes them through the ResourcePriority patterns to find a single matching hit. +// +// PriorityRESTMapperWithContext.ResourceForWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use PriorityRESTMapperWithContext.ResourceForWithContext instead. func (m PriorityRESTMapper) ResourceFor(partiallySpecifiedResource schema.GroupVersionResource) (schema.GroupVersionResource, error) { - originalGVRs, originalErr := m.Delegate.ResourcesFor(partiallySpecifiedResource) + return ToPriorityRESTMapperWithContext(m).ResourceForWithContext(context.Background(), partiallySpecifiedResource) +} + +// KindFor finds all kinds, then passes them through the KindPriority patterns to find a single matching hit. +// +// PriorityRESTMapperWithContext.KindForWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use PriorityRESTMapperWithContext.KindForWithContext instead. +func (m PriorityRESTMapper) KindFor(partiallySpecifiedResource schema.GroupVersionResource) (schema.GroupVersionKind, error) { + return ToPriorityRESTMapperWithContext(m).KindForWithContext(context.Background(), partiallySpecifiedResource) +} + +// PriorityRESTMapperWithContext.RESTMappingWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use PriorityRESTMapperWithContext.RESTMappingWithContext instead. +func (m PriorityRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (mapping *RESTMapping, err error) { + return ToPriorityRESTMapperWithContext(m).RESTMappingWithContext(context.Background(), gk, versions...) +} + +// PriorityRESTMapperWithContext.RESTMappingsWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use PriorityRESTMapperWithContext.RESTMappingsWithContext instead. +func (m PriorityRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*RESTMapping, error) { + return m.Delegate.RESTMappings(gk, versions...) +} + +// PriorityRESTMapperWithContext.ResourceSingularizerWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use PriorityRESTMapperWithContext.ResourceSingularizerWithContext instead. +func (m PriorityRESTMapper) ResourceSingularizer(resource string) (singular string, err error) { + return m.Delegate.ResourceSingularizer(resource) +} + +// PriorityRESTMapperWithContext.ResourcesForWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use PriorityRESTMapperWithContext.ResourcesForWithContext instead. +func (m PriorityRESTMapper) ResourcesFor(partiallySpecifiedResource schema.GroupVersionResource) ([]schema.GroupVersionResource, error) { + return m.Delegate.ResourcesFor(partiallySpecifiedResource) +} + +// PriorityRESTMapperWithContext.KindsForWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use PriorityRESTMapperWithContext.KindsForWithContext instead. +func (m PriorityRESTMapper) KindsFor(partiallySpecifiedResource schema.GroupVersionResource) (gvk []schema.GroupVersionKind, err error) { + return m.Delegate.KindsFor(partiallySpecifiedResource) +} + +// PriorityRESTMapperWithContext.ResetWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use PriorityRESTMapperWithContext.ResetWithContext instead. +func (m PriorityRESTMapper) Reset() { + MaybeResetRESTMapper(m.Delegate) +} + +// ResourceFor finds all resources, then passes them through the ResourcePriority patterns to find a single matching hit. +func (m PriorityRESTMapperWithContext) ResourceForWithContext(ctx context.Context, partiallySpecifiedResource schema.GroupVersionResource) (schema.GroupVersionResource, error) { + originalGVRs, originalErr := m.Delegate.ResourcesForWithContext(ctx, partiallySpecifiedResource) if originalErr != nil && len(originalGVRs) == 0 { return schema.GroupVersionResource{}, originalErr } @@ -93,8 +191,8 @@ func (m PriorityRESTMapper) ResourceFor(partiallySpecifiedResource schema.GroupV } // KindFor finds all kinds, then passes them through the KindPriority patterns to find a single matching hit. -func (m PriorityRESTMapper) KindFor(partiallySpecifiedResource schema.GroupVersionResource) (schema.GroupVersionKind, error) { - originalGVKs, originalErr := m.Delegate.KindsFor(partiallySpecifiedResource) +func (m PriorityRESTMapperWithContext) KindForWithContext(ctx context.Context, partiallySpecifiedResource schema.GroupVersionResource) (schema.GroupVersionKind, error) { + originalGVKs, originalErr := m.Delegate.KindsForWithContext(ctx, partiallySpecifiedResource) if originalErr != nil && len(originalGVKs) == 0 { return schema.GroupVersionKind{}, originalErr } @@ -156,8 +254,8 @@ func kindMatches(pattern schema.GroupVersionKind, kind schema.GroupVersionKind) return true } -func (m PriorityRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (mapping *RESTMapping, err error) { - mappings, originalErr := m.Delegate.RESTMappings(gk, versions...) +func (m PriorityRESTMapperWithContext) RESTMappingWithContext(ctx context.Context, gk schema.GroupKind, versions ...string) (mapping *RESTMapping, err error) { + mappings, originalErr := m.Delegate.RESTMappingsWithContext(ctx, gk, versions...) if originalErr != nil && len(mappings) == 0 { return nil, originalErr } @@ -209,22 +307,22 @@ func (m PriorityRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) return nil, &AmbiguousKindError{PartialKind: gk.WithVersion(""), MatchingKinds: kinds} } -func (m PriorityRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*RESTMapping, error) { - return m.Delegate.RESTMappings(gk, versions...) +func (m PriorityRESTMapperWithContext) RESTMappingsWithContext(ctx context.Context, gk schema.GroupKind, versions ...string) ([]*RESTMapping, error) { + return m.Delegate.RESTMappingsWithContext(ctx, gk, versions...) } -func (m PriorityRESTMapper) ResourceSingularizer(resource string) (singular string, err error) { - return m.Delegate.ResourceSingularizer(resource) +func (m PriorityRESTMapperWithContext) ResourceSingularizerWithContext(ctx context.Context, resource string) (singular string, err error) { + return m.Delegate.ResourceSingularizerWithContext(ctx, resource) } -func (m PriorityRESTMapper) ResourcesFor(partiallySpecifiedResource schema.GroupVersionResource) ([]schema.GroupVersionResource, error) { - return m.Delegate.ResourcesFor(partiallySpecifiedResource) +func (m PriorityRESTMapperWithContext) ResourcesForWithContext(ctx context.Context, partiallySpecifiedResource schema.GroupVersionResource) ([]schema.GroupVersionResource, error) { + return m.Delegate.ResourcesForWithContext(ctx, partiallySpecifiedResource) } -func (m PriorityRESTMapper) KindsFor(partiallySpecifiedResource schema.GroupVersionResource) (gvk []schema.GroupVersionKind, err error) { - return m.Delegate.KindsFor(partiallySpecifiedResource) +func (m PriorityRESTMapperWithContext) KindsForWithContext(ctx context.Context, partiallySpecifiedResource schema.GroupVersionResource) (gvk []schema.GroupVersionKind, err error) { + return m.Delegate.KindsForWithContext(ctx, partiallySpecifiedResource) } -func (m PriorityRESTMapper) Reset() { - MaybeResetRESTMapper(m.Delegate) +func (m PriorityRESTMapperWithContext) ResetWithContext(ctx context.Context) { + MaybeResetRESTMapperWithContext(ctx, m.Delegate) } diff --git a/vendor/k8s.io/apimachinery/pkg/api/meta/restmapper.go b/vendor/k8s.io/apimachinery/pkg/api/meta/restmapper.go index 91cb98cae4..d64db33d41 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/meta/restmapper.go +++ b/vendor/k8s.io/apimachinery/pkg/api/meta/restmapper.go @@ -18,6 +18,7 @@ limitations under the License. package meta import ( + "context" "fmt" "sort" "strings" @@ -72,6 +73,8 @@ func (m *DefaultRESTMapper) String() string { } var _ RESTMapper = &DefaultRESTMapper{} +var _ RESTMapperWithContext = &DefaultRESTMapper{} +var _ fmt.Stringer = &DefaultRESTMapper{} // NewDefaultRESTMapper initializes a mapping between Kind and APIVersion // to a resource name and back based on the objects in a runtime.Scheme @@ -179,6 +182,10 @@ func (m *DefaultRESTMapper) ResourceSingularizer(resourceType string) (string, e return singular.Resource, nil } +func (m *DefaultRESTMapper) ResourceSingularizerWithContext(_ context.Context, resourceType string) (string, error) { + return m.ResourceSingularizer(resourceType) +} + // coerceResourceForMatching makes the resource lower case and converts internal versions to unspecified (legacy behavior) func coerceResourceForMatching(resource schema.GroupVersionResource) schema.GroupVersionResource { resource.Resource = strings.ToLower(resource.Resource) @@ -276,6 +283,10 @@ func (m *DefaultRESTMapper) ResourcesFor(input schema.GroupVersionResource) ([]s return ret, nil } +func (m *DefaultRESTMapper) ResourcesForWithContext(_ context.Context, input schema.GroupVersionResource) ([]schema.GroupVersionResource, error) { + return m.ResourcesFor(input) +} + func (m *DefaultRESTMapper) ResourceFor(resource schema.GroupVersionResource) (schema.GroupVersionResource, error) { resources, err := m.ResourcesFor(resource) if err != nil { @@ -288,6 +299,10 @@ func (m *DefaultRESTMapper) ResourceFor(resource schema.GroupVersionResource) (s return schema.GroupVersionResource{}, &AmbiguousResourceError{PartialResource: resource, MatchingResources: resources} } +func (m *DefaultRESTMapper) ResourceForWithContext(_ context.Context, resource schema.GroupVersionResource) (schema.GroupVersionResource, error) { + return m.ResourceFor(resource) +} + func (m *DefaultRESTMapper) KindsFor(input schema.GroupVersionResource) ([]schema.GroupVersionKind, error) { resource := coerceResourceForMatching(input) @@ -355,6 +370,10 @@ func (m *DefaultRESTMapper) KindsFor(input schema.GroupVersionResource) ([]schem return ret, nil } +func (m *DefaultRESTMapper) KindsForWithContext(_ context.Context, input schema.GroupVersionResource) ([]schema.GroupVersionKind, error) { + return m.KindsFor(input) +} + func (m *DefaultRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) { kinds, err := m.KindsFor(resource) if err != nil { @@ -367,6 +386,10 @@ func (m *DefaultRESTMapper) KindFor(resource schema.GroupVersionResource) (schem return schema.GroupVersionKind{}, &AmbiguousResourceError{PartialResource: resource, MatchingKinds: kinds} } +func (m *DefaultRESTMapper) KindForWithContext(_ context.Context, resource schema.GroupVersionResource) (schema.GroupVersionKind, error) { + return m.KindFor(resource) +} + type kindByPreferredGroupVersion struct { list []schema.GroupVersionKind sortOrder []schema.GroupVersion @@ -461,6 +484,10 @@ func (m *DefaultRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) return mappings[0], nil } +func (m *DefaultRESTMapper) RESTMappingWithContext(_ context.Context, gk schema.GroupKind, versions ...string) (*RESTMapping, error) { + return m.RESTMapping(gk, versions...) +} + // RESTMappings returns the RESTMappings for the provided group kind. If a version search order // is not provided, the search order provided to DefaultRESTMapper will be used. func (m *DefaultRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*RESTMapping, error) { @@ -520,10 +547,33 @@ func (m *DefaultRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string return mappings, nil } -// MaybeResetRESTMapper calls Reset() on the mapper if it is a ResettableRESTMapper. +func (m *DefaultRESTMapper) RESTMappingsWithContext(_ context.Context, gk schema.GroupKind, versions ...string) ([]*RESTMapping, error) { + return m.RESTMappings(gk, versions...) +} + +// MaybeResetRESTMapper calls Reset() on the mapper if it is a ResettableRESTMapper or +// ResetWithContext() if it is a ResettableRESTMapperWithContext. +// +// MaybeResetRESTMapperWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use MaybeResetRESTMapperWithContext instead. func MaybeResetRESTMapper(mapper RESTMapper) { - m, ok := mapper.(ResettableRESTMapper) - if ok { + maybeReset(context.Background(), mapper) +} + +// MaybeResetRESTMapperWithContext calls Reset() on the mapper if it is a ResettableRESTMapper or +// ResetWithContext() if it is a ResettableRESTMapperWithContext. +func MaybeResetRESTMapperWithContext(ctx context.Context, mapper RESTMapperWithContext) { + maybeReset(ctx, mapper) +} + +func maybeReset(ctx context.Context, mapper any) { + if m, ok := mapper.(ResettableRESTMapperWithContext); ok { + m.ResetWithContext(ctx) + return + } + if m, ok := mapper.(ResettableRESTMapper); ok { m.Reset() + return } } diff --git a/vendor/k8s.io/apimachinery/pkg/api/operation/operation.go b/vendor/k8s.io/apimachinery/pkg/api/operation/operation.go index 86b6ddf37c..cccc7e60c2 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/operation/operation.go +++ b/vendor/k8s.io/apimachinery/pkg/api/operation/operation.go @@ -17,7 +17,6 @@ limitations under the License. package operation import ( - "slices" "strings" ) @@ -31,28 +30,27 @@ type Operation struct { // those into a single "Update" category. Type Type - // Options declare the options enabled for validation. + // Options are the validation options in effect for this operation, mapping option + // name to whether it is enabled. Option names typically match feature gates, but an + // option may be enabled even when its feature gate is off — e.g. when the feature is + // already in use by the object being updated. Set by the resource strategy and + // read-only during validation. // - // Options should be set according to a resource validation strategy before validation - // is performed, and must be treated as read-only during validation. - // - // Options are identified by string names. Option string names may match the name of a feature - // gate, in which case the presence of the name in the set indicates that the feature is - // considered enabled for the resource being validated. Note that a resource may have a - // feature enabled even when the feature gate is disabled. This can happen when feature is - // already in-use by a resource, often because the feature gate was enabled when the - // resource first began using the feature. - // - // Unset options are disabled/false. - Options []string + // Every option a validation tag references must be defined here by the strategy; an + // option that is not defined is a programming error (see HasOption). + Options map[string]bool // Request provides information about the request being validated. Request Request } -// HasOption returns true if the given string is in the Options slice. -func (o Operation) HasOption(option string) bool { - return slices.Contains(o.Options, option) +// HasOption returns whether the named option is enabled and whether it was defined by +// the strategy. Every option a validation tag references must be defined; callers treat +// an undefined option as an internal error (see validate.IfOption) rather than silently +// as disabled. +func (o Operation) HasOption(option string) (enabled, defined bool) { + enabled, defined = o.Options[option] + return } // Request provides information about the request being validated. diff --git a/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go b/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go index f3cd600604..e6b1f1b535 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go +++ b/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go @@ -878,3 +878,14 @@ func (q *QuantityValue) Set(s string) error { func (q QuantityValue) Type() string { return "quantity" } + +// QuantityPtrEqual compares two Quantity pointers and returns true if they are both nil or point to equal quantities. +func QuantityPtrEqual(a, b *Quantity) bool { + if a == nil && b == nil { + return true + } + if a == nil || b == nil { + return false + } + return a.Equal(*b) +} diff --git a/vendor/k8s.io/apimachinery/pkg/api/validate/content/kube.go b/vendor/k8s.io/apimachinery/pkg/api/validate/content/kube.go index 44e82eefd3..608073f708 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/validate/content/kube.go +++ b/vendor/k8s.io/apimachinery/pkg/api/validate/content/kube.go @@ -99,3 +99,19 @@ func prefixEach(msgs []string, prefix string) []string { } return msgs } + +// IsPrefixedLabelKey tests whether the value passed is a valid label key with +// a domain prefix. This allows "example.com/key" but not "key". +// If the value is not valid, a list of error strings is returned. Otherwise, +// an empty list (or nil) is returned. +func IsPrefixedLabelKey(value string) []string { + if errs := IsLabelKey(value); len(errs) > 0 { + return errs + } + + segments := strings.Split(value, "/") + if len(segments) != 2 { + return []string{"must include a prefix (e.g. 'example.com/key')"} + } + return nil +} diff --git a/vendor/k8s.io/apimachinery/pkg/api/validate/dependentrequired.go b/vendor/k8s.io/apimachinery/pkg/api/validate/dependentrequired.go new file mode 100644 index 0000000000..69222c9752 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/api/validate/dependentrequired.go @@ -0,0 +1,83 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package validate + +import ( + "context" + "fmt" + + "k8s.io/apimachinery/pkg/api/operation" + "k8s.io/apimachinery/pkg/util/validation/field" +) + +// DependentRequired verifies that when triggerIsSet(obj) is true, dependentIsSet(obj) +// is also true; otherwise reports an error at fldPath.Child(dependentName). +// On Update, the check is skipped if neither side's set-ness changed from oldObj, +// so unrelated updates can proceed past a pre-existing violation. +func DependentRequired[T any](_ context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *T, + triggerName string, triggerIsSet ExtractorFn[*T, bool], + dependentName string, dependentIsSet ExtractorFn[*T, bool], +) field.ErrorList { + if obj == nil { + return nil + } + if op.Type == operation.Update && oldObj != nil { + if triggerIsSet(obj) == triggerIsSet(oldObj) && dependentIsSet(obj) == dependentIsSet(oldObj) { + return nil + } + } + if !triggerIsSet(obj) { + return nil + } + if dependentIsSet(obj) { + return nil + } + return field.ErrorList{ + field.Required(fldPath.Child(dependentName), + fmt.Sprintf("must be set when %s is set", triggerName)). + WithOrigin("dependentRequired"), + } +} + +// DependentForbidden verifies that when triggerIsSet(obj) is true, dependentIsSet(obj) +// is false; otherwise reports an error at fldPath.Child(dependentName). +// On Update, the check is skipped if neither side's set-ness changed from oldObj, +// so unrelated updates can proceed past a pre-existing violation. +func DependentForbidden[T any](_ context.Context, op operation.Operation, fldPath *field.Path, obj, oldObj *T, + triggerName string, triggerIsSet ExtractorFn[*T, bool], + dependentName string, dependentIsSet ExtractorFn[*T, bool], +) field.ErrorList { + if obj == nil { + return nil + } + if op.Type == operation.Update && oldObj != nil { + if triggerIsSet(obj) == triggerIsSet(oldObj) && dependentIsSet(obj) == dependentIsSet(oldObj) { + return nil + } + } + if !triggerIsSet(obj) { + return nil + } + if !dependentIsSet(obj) { + return nil + } + return field.ErrorList{ + field.Forbidden(fldPath.Child(dependentName), + fmt.Sprintf("may not be set when %s is set", triggerName)). + WithOrigin("dependentForbidden"), + } +} diff --git a/vendor/k8s.io/apimachinery/pkg/api/validate/discriminator.go b/vendor/k8s.io/apimachinery/pkg/api/validate/discriminator.go index 787ae6b0b7..6f4b3cddda 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/validate/discriminator.go +++ b/vendor/k8s.io/apimachinery/pkg/api/validate/discriminator.go @@ -35,6 +35,9 @@ type DiscriminatedRule[Tfield any, Tdisc comparable] struct { // // It performs ratcheting: if the operation is an Update, and neither the discriminator // nor the value (checked via equiv) have changed, validation is skipped. +// +// The equiv function can be called with nil arguments in the case of nilable +// fields. func Discriminated[Tfield any, Tdisc comparable, Tstruct any](ctx context.Context, op operation.Operation, structPath *field.Path, obj, oldObj *Tstruct, fieldName string, getMemberValue func(*Tstruct) Tfield, getDiscriminator func(*Tstruct) Tdisc, equiv MatchFunc[Tfield], defaultValidation ValidateFunc[Tfield], rules []DiscriminatedRule[Tfield, Tdisc], diff --git a/vendor/k8s.io/apimachinery/pkg/api/validate/each.go b/vendor/k8s.io/apimachinery/pkg/api/validate/each.go index c815d6d913..2930c21836 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/validate/each.go +++ b/vendor/k8s.io/apimachinery/pkg/api/validate/each.go @@ -18,6 +18,7 @@ package validate import ( "context" + "slices" "sort" "k8s.io/apimachinery/pkg/api/equality" @@ -29,22 +30,29 @@ import ( // according to some criteria, and returns true if they match. type MatchFunc[T any] func(T, T) bool -// EachSliceVal performs validation on each element of newSlice using the provided validation function. +// EachValSliceVal performs validation on each element of a slice of values +// using the provided validation function. // -// For update operations, the match function finds corresponding values in oldSlice for each -// value in newSlice. This comparison can be either full or partial (e.g., matching only -// specific struct fields that serve as a unique identifier). If match is nil, validation -// proceeds without considering old values, and the equiv function is not used. +// For update operations, the match function finds corresponding values in +// oldSlice for each value in newSlice. This comparison can be either full or +// partial (e.g., matching only specific struct fields that serve as a unique +// identifier). If match is nil, validation proceeds without considering old +// values, and the equiv function is not used. // -// For update operations, the equiv function checks if a new value is equivalent to its -// corresponding old value, enabling validation ratcheting. If equiv is nil but match is -// provided, the match function is assumed to perform full value comparison. +// For update operations, the equiv function checks if a new value is +// equivalent to its corresponding old value, enabling validation ratcheting. +// If equiv is nil but match is provided, the match function is assumed to +// perform full value comparison. +// +// The match and equiv functions will never be called with nil arguments. // // Note: The slice element type must be non-nilable. -func EachSliceVal[T any](ctx context.Context, op operation.Operation, fldPath *field.Path, newSlice, oldSlice []T, - match, equiv MatchFunc[T], validator ValidateFunc[*T]) field.ErrorList { +func EachValSliceVal[T any](ctx context.Context, op operation.Operation, fldPath *field.Path, newSlice, oldSlice []T, + match, equiv MatchFunc[*T], validator ValidateFunc[*T]) field.ErrorList { var errs field.ErrorList - for i, val := range newSlice { + for i := range newSlice { + val := &newSlice[i] + var old *T if match != nil && len(oldSlice) > 0 { old = lookup(oldSlice, val, match) @@ -55,33 +63,90 @@ func EachSliceVal[T any](ctx context.Context, op operation.Operation, fldPath *f // 2. The equiv function confirms the values are equivalent (either directly or semantically) // // The equiv function provides equality comparison when match uses partial comparison. - if op.Type == operation.Update && old != nil && (equiv == nil || equiv(val, *old)) { + if op.Type == operation.Update && old != nil && (equiv == nil || equiv(val, old)) { + continue + } + errs = append(errs, validator(ctx, op, fldPath.Index(i), val, old)...) + } + return errs +} + +// EachPtrSliceVal performs validation on each element of a slice of pointers +// using the provided validation function. +// +// For update operations, the match function finds corresponding values in +// oldSlice for each value in newSlice. This comparison can be either full or +// partial (e.g., matching only specific struct fields that serve as a unique +// identifier). If match is nil, validation proceeds without considering old +// values, and the equiv function is not used. +// +// For update operations, the equiv function checks if a new value is +// equivalent to its corresponding old value, enabling validation ratcheting. +// If equiv is nil but match is provided, the match function is assumed to +// perform full value comparison. +// +// The match and equiv functions will never be called with nil arguments. +func EachPtrSliceVal[T any](ctx context.Context, op operation.Operation, fldPath *field.Path, newSlice, oldSlice []*T, + match, equiv MatchFunc[*T], validator ValidateFunc[*T]) field.ErrorList { + var errs field.ErrorList + for i := range newSlice { + val := newSlice[i] + if val == nil { + // Ignore nil items; they are supposed to have been checked by PtrSliceNoNils. + continue + } + + var old *T + if match != nil && len(oldSlice) > 0 { + old = lookupPointer(oldSlice, val, match) + } + if op.Type == operation.Update && old != nil && (equiv == nil || equiv(val, old)) { continue } - errs = append(errs, validator(ctx, op, fldPath.Index(i), &val, old)...) + errs = append(errs, validator(ctx, op, fldPath.Index(i), val, old)...) } return errs } // lookup returns a pointer to the first element in the list that matches the // target, according to the provided comparison function, or else nil. -func lookup[T any](list []T, target T, match MatchFunc[T]) *T { +func lookup[T any](list []T, target *T, match MatchFunc[*T]) *T { for i := range list { - if match(list[i], target) { + if match(&list[i], target) { return &list[i] } } return nil } +// lookupPointer returns the first non-nil element in the list that matches the +// target, according to the provided comparison function, or else nil. +// Nil elements in the list are skipped. +func lookupPointer[T any](list []*T, target *T, match MatchFunc[*T]) *T { + for i := range list { + if list[i] == nil { + // We can't really do anything about nil entries in the old list, + // just skip them. + continue + } + if match(list[i], target) { + return list[i] + } + } + return nil +} + // EachMapVal validates each value in newMap using the specified validation // function, passing the corresponding old value from oldMap if the key exists in oldMap. // For update operations, it implements validation ratcheting by skipping validation // when the old value exists and the equiv function confirms the values are equivalent. // The value-type of the map is assumed to not be nilable. +// +// The equiv function will never be called with nil arguments. +// // If equiv is nil, value-based ratcheting is disabled and all values will be validated. func EachMapVal[K ~string, V any](ctx context.Context, op operation.Operation, fldPath *field.Path, newMap, oldMap map[K]V, - equiv MatchFunc[V], validator ValidateFunc[*V]) field.ErrorList { + equiv MatchFunc[*V], validator ValidateFunc[*V]) field.ErrorList { var errs field.ErrorList for key, val := range newMap { var old *V @@ -90,7 +155,7 @@ func EachMapVal[K ~string, V any](ctx context.Context, op operation.Operation, f } // If the operation is an update, for validation ratcheting, skip re-validating if the old // value is found and the equiv function confirms the values are equivalent. - if op.Type == operation.Update && old != nil && equiv != nil && equiv(val, *old) { + if op.Type == operation.Update && old != nil && equiv != nil && equiv(&val, old) { continue } errs = append(errs, validator(ctx, op, fldPath.Key(string(key)), &val, old)...) @@ -119,19 +184,20 @@ func EachMapKey[K ~string, T any](ctx context.Context, op operation.Operation, f return errs } -// Unique verifies that each element of newSlice is unique, according to the -// match function. It compares every element of the slice with every other -// element and returns errors for non-unique items. -func Unique[T any](_ context.Context, _ operation.Operation, fldPath *field.Path, newSlice, _ []T, match MatchFunc[T]) field.ErrorList { +// ValSliceUnique verifies that each element of a slice of values is unique, +// according to the match function. It compares every element of the slice with +// every other element and returns errors for non-unique items. +// +// The match function will never be called with nil arguments. +func ValSliceUnique[T any](_ context.Context, _ operation.Operation, fldPath *field.Path, newSlice, _ []T, match MatchFunc[*T]) field.ErrorList { var dups []int - for i, val := range newSlice { + for i := range newSlice { for j := i + 1; j < len(newSlice); j++ { - other := newSlice[j] - if match(val, other) { + if match(&newSlice[i], &newSlice[j]) { if dups == nil { dups = make([]int, 0, len(newSlice)) } - if lookup(dups, j, func(a, b int) bool { return a == b }) == nil { + if !slices.Contains(dups, j) { dups = append(dups, j) } } @@ -152,6 +218,42 @@ func Unique[T any](_ context.Context, _ operation.Operation, fldPath *field.Path return errs } +// PtrSliceUnique verifies that each element of a slice of pointers is unique, +// according to the match function. It compares every element of the slice with +// every other element and returns errors for non-unique items. +// +// The match function will never be called with nil arguments. +func PtrSliceUnique[T any](_ context.Context, _ operation.Operation, fldPath *field.Path, newSlice, _ []*T, match MatchFunc[*T]) field.ErrorList { + var errs field.ErrorList + var dups []int + for i := range newSlice { + if newSlice[i] == nil { + // Ignore nil items; they are supposed to have been checked by PtrSliceNoNils. + continue + } + for j := i + 1; j < len(newSlice); j++ { + if newSlice[j] == nil { + continue + } + if match(newSlice[i], newSlice[j]) { + if dups == nil { + dups = make([]int, 0, len(newSlice)) + } + if !slices.Contains(dups, j) { + dups = append(dups, j) + } + } + } + } + + sort.Ints(dups) + for _, i := range dups { + var val any = newSlice[i] + errs = append(errs, field.Duplicate(fldPath.Index(i), val)) + } + return errs +} + // SemanticDeepEqual is a MatchFunc that uses equality.Semantic.DeepEqual to // compare two values. // This wrapper is needed because MatchFunc requires a function that takes two @@ -163,19 +265,12 @@ func SemanticDeepEqual[T any](a, b T) bool { return equality.Semantic.DeepEqual(a, b) } -// DirectEqual is a MatchFunc that uses the == operator to compare two values. -// It can be used by any other function that needs to compare two values -// directly. -func DirectEqual[T comparable](a, b T) bool { - return a == b -} - -// DirectEqualPtr is a MatchFunc that dereferences two pointers and uses the == +// DirectEqual is a MatchFunc that dereferences two pointers and uses the == // operator to compare the values. If both pointers are nil, it returns true. // If one pointer is nil and the other is not, it returns false. // It can be used by any other function that needs to compare two pointees // directly. -func DirectEqualPtr[T comparable](a, b *T) bool { +func DirectEqual[T comparable](a, b *T) bool { if a == b { return true } @@ -184,3 +279,14 @@ func DirectEqualPtr[T comparable](a, b *T) bool { } return *a == *b } + +// PtrSliceNoNils returns a Required error for each nil element in a slice of +// pointers. +func PtrSliceNoNils[T any](_ context.Context, _ operation.Operation, fldPath *field.Path, newSlice, _ []*T) (errs field.ErrorList) { + for i := range newSlice { + if newSlice[i] == nil { + errs = append(errs, field.Required(fldPath.Index(i), "")) + } + } + return +} diff --git a/vendor/k8s.io/apimachinery/pkg/api/validate/enum.go b/vendor/k8s.io/apimachinery/pkg/api/validate/enum.go index 6e5bcf373b..4d8e2c0aa8 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/validate/enum.go +++ b/vendor/k8s.io/apimachinery/pkg/api/validate/enum.go @@ -18,6 +18,7 @@ package validate import ( "context" + "fmt" "slices" "k8s.io/apimachinery/pkg/api/operation" @@ -32,24 +33,36 @@ func Enum[T ~string](_ context.Context, op operation.Operation, fldPath *field.P if value == nil { return nil } - if !validValues.Has(*value) || isExcluded(op, exclusions, *value) { - return field.ErrorList{field.NotSupported[T](fldPath, *value, supportedValues(op, validValues, exclusions))} + excluded, err := isExcluded(op, exclusions, *value) + if err != nil { + return field.ErrorList{field.InternalError(fldPath, err)} + } + if !validValues.Has(*value) || excluded { + supported, err := supportedValues(op, validValues, exclusions) + if err != nil { + return field.ErrorList{field.InternalError(fldPath, err)} + } + return field.ErrorList{field.NotSupported[T](fldPath, *value, supported)} } return nil } // supportedValues returns a sorted list of supported values. // Excluded enum values are not included in the list. -func supportedValues[T ~string](op operation.Operation, values sets.Set[T], exclusions []EnumExclusion[T]) []T { +func supportedValues[T ~string](op operation.Operation, values sets.Set[T], exclusions []EnumExclusion[T]) ([]T, error) { res := make([]T, 0, len(values)) for key := range values { - if isExcluded(op, exclusions, key) { + excluded, err := isExcluded(op, exclusions, key) + if err != nil { + return nil, err + } + if excluded { continue } res = append(res, key) } slices.Sort(res) - return res + return res, nil } // EnumExclusion represents a single enum exclusion rule. @@ -64,11 +77,15 @@ type EnumExclusion[T ~string] struct { Option string } -func isExcluded[T ~string](op operation.Operation, exclusions []EnumExclusion[T], value T) bool { +func isExcluded[T ~string](op operation.Operation, exclusions []EnumExclusion[T], value T) (bool, error) { for _, rule := range exclusions { - if rule.Value == value && rule.ExcludeWhen == op.HasOption(rule.Option) { - return true + on, defined := op.HasOption(rule.Option) + if !defined { + return false, fmt.Errorf("undefined validation option %q", rule.Option) + } + if rule.Value == value && rule.ExcludeWhen == on { + return true, nil } } - return false + return false, nil } diff --git a/vendor/k8s.io/apimachinery/pkg/api/validate/errors.go b/vendor/k8s.io/apimachinery/pkg/api/validate/errors.go new file mode 100644 index 0000000000..a9dc4b01c0 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/api/validate/errors.go @@ -0,0 +1,96 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package validate + +import ( + "context" + "errors" + + "k8s.io/apimachinery/pkg/util/validation/field" +) + +type allDeclarativeEnforcedKeyType struct{} + +var allDeclarativeEnforcedKey = allDeclarativeEnforcedKeyType{} + +// WithAllDeclarativeEnforcedForTest returns a copy of parent context with allDeclarativeEnforcedKey set to true. +// This is used for testing to expose all declarative validation errors and filter all handwritten validation errors +// that are covered by declarative validation, regardless of the feature gate or maturity level. +// +// NOTE: This function is intended for testing purposes only and should not be used in production code. +func WithAllDeclarativeEnforcedForTest(ctx context.Context) context.Context { + return context.WithValue(ctx, allDeclarativeEnforcedKey, true) +} + +// AllDeclarativeEnforced returns true if the context contains allDeclarativeEnforcedKey set to true. +func AllDeclarativeEnforced(ctx context.Context) bool { + if ctx == nil { + return false + } + return ctx.Value(allDeclarativeEnforcedKey) == true +} + +// FilterCoveredHandwrittenErrors removes a CoveredByDeclarative handwritten error when a matching enforced +// beta declarative error exists (matched by type, field, and origin). In AllDeclarativeEnforced +// (testing-only) mode every covered handwritten error is removed. +func FilterCoveredHandwrittenErrors(ctx context.Context, imperativeErrs, enforcedDeclarativeErrs field.ErrorList, betaEnabled bool, rules ...field.NormalizationRule) field.ErrorList { + matcher := field.ErrorMatcher{}.ByType().ByOrigin().RequireOriginWhenInvalid().ByFieldNormalized(rules) + allDeclarativeEnforced := AllDeclarativeEnforced(ctx) + return imperativeErrs.Filter(func(e error) bool { + var fe *field.Error + if !errors.As(e, &fe) || !fe.CoveredByDeclarative { + return false + } + if allDeclarativeEnforced { + return true + } + for _, dErr := range enforcedDeclarativeErrs { + if dErr.IsBeta() && matcher.Matches(fe, dErr) { + return true + } + } + return false + }) +} + +// FilterEnforcedDeclarativeErrors collects the declarative errors that are enforced (i.e. surfaced to the user) in the +// current mode. A declarative error is enforced when any of the following holds: +// - AllDeclarativeEnforced is set (testing): every declarative error is enforced. +// - It is an internal error: always enforced, regardless of lifecycle. +// - It is a beta error and BetaEnabled is true. +// - It is a standard (unprefixed) error: always enforced. +// +// Alpha errors are never enforced; they remain shadowed by handwritten validation. +func FilterEnforcedDeclarativeErrors(ctx context.Context, declarativeErrs field.ErrorList, betaEnabled bool) field.ErrorList { + enforcedDeclarativeErrs := make(field.ErrorList, 0, len(declarativeErrs)) + allDeclarativeEnforced := AllDeclarativeEnforced(ctx) + for _, dvErr := range declarativeErrs { + switch { + case allDeclarativeEnforced: + enforcedDeclarativeErrs = append(enforcedDeclarativeErrs, dvErr) + case dvErr.Type == field.ErrorTypeInternal: + enforcedDeclarativeErrs = append(enforcedDeclarativeErrs, dvErr) + case dvErr.IsBeta(): + if betaEnabled { + enforcedDeclarativeErrs = append(enforcedDeclarativeErrs, dvErr) + } + case !dvErr.IsAlpha(): + enforcedDeclarativeErrs = append(enforcedDeclarativeErrs, dvErr) // Standard + } + } + return enforcedDeclarativeErrs +} diff --git a/vendor/k8s.io/apimachinery/pkg/api/validate/item.go b/vendor/k8s.io/apimachinery/pkg/api/validate/item.go index aba417fa1d..4ddb2860c5 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/validate/item.go +++ b/vendor/k8s.io/apimachinery/pkg/api/validate/item.go @@ -23,36 +23,39 @@ import ( "k8s.io/apimachinery/pkg/util/validation/field" ) -// MatchItemFn takes a pointer to an item and returns true if it matches the criteria. -type MatchItemFn[T any] func(*T) bool +// MatchItemFunc takes an item and returns true if it matches the criteria. +type MatchItemFunc[T any] func(T) bool -// SliceItem finds the first item in newList that satisfies the match function, -// and if found, also looks for a matching item in oldList. If the value of the -// item is the same as the previous value, as per the equiv function, then no -// validation is performed. Otherwise, it invokes 'itemValidator' on these items. +// ValSliceItem finds the first item in a list of values which satisfies the +// match function, and if found, also looks for a matching item in oldList. If +// the value of the item is the same as the previous value, as per the equiv +// function, then no validation is performed. Otherwise, it invokes +// 'itemValidator' on these items. // // This function processes only the *first* matching item found in newList. It // assumes that the match functions targets a unique identifier (primary key) // and will match at most one element per list. If this assumption is violated, // changes in list order can lead this function to have inconsistent behavior. // +// The match and equiv functions will never be called with nil arguments. +// // The fldPath passed to itemValidator is indexed to the matched item's // position in newList. // // This function does not validate items that were removed (present in oldList // but not in newList). -func SliceItem[TList ~[]TItem, TItem any]( +func ValSliceItem[TList ~[]TItem, TItem any]( ctx context.Context, op operation.Operation, fldPath *field.Path, newList, oldList TList, - matches MatchItemFn[TItem], - equiv MatchFunc[TItem], + match MatchItemFunc[*TItem], + equiv MatchFunc[*TItem], itemValidator func(ctx context.Context, op operation.Operation, fldPath *field.Path, newObj, oldObj *TItem) field.ErrorList, ) field.ErrorList { var matchedNew, matchedOld *TItem var newIndex int for i := range newList { - if matches(&newList[i]) { + if match(&newList[i]) { matchedNew = &newList[i] newIndex = i break @@ -63,13 +66,73 @@ func SliceItem[TList ~[]TItem, TItem any]( } for i := range oldList { - if matches(&oldList[i]) { + if match(&oldList[i]) { matchedOld = &oldList[i] break } } - if op.Type == operation.Update && matchedOld != nil && equiv(*matchedNew, *matchedOld) { + if op.Type == operation.Update && matchedOld != nil && equiv(matchedNew, matchedOld) { + return nil + } + + return itemValidator(ctx, op, fldPath.Index(newIndex), matchedNew, matchedOld) +} + +// PtrSliceItem finds the first item in a list of pointers which satisfies the +// match function, and if found, also looks for a matching item in oldList. If +// the value of the item is the same as the previous value, as per the equiv +// function, then no validation is performed. Otherwise, it invokes +// 'itemValidator' on these items. +// +// This function processes only the *first* matching item found in newList. It +// assumes that the match functions targets a unique identifier (primary key) +// and will match at most one element per list. If this assumption is violated, +// changes in list order can lead this function to have inconsistent behavior. +// +// The match and equiv functions will never be called with nil arguments. +// +// The fldPath passed to itemValidator is indexed to the matched item's +// position in newList. +// +// This function does not validate items that were removed (present in oldList +// but not in newList). +func PtrSliceItem[TList ~[]*TItem, TItem any]( + ctx context.Context, op operation.Operation, fldPath *field.Path, + newList, oldList TList, + match MatchItemFunc[*TItem], + equiv MatchFunc[*TItem], + itemValidator func(ctx context.Context, op operation.Operation, fldPath *field.Path, newObj, oldObj *TItem) field.ErrorList, +) field.ErrorList { + var matchedNew, matchedOld *TItem + var newIndex int + + for i := range newList { + if newList[i] == nil { + // Ignore nil items; they are supposed to have been checked by PtrSliceNoNils. + continue + } + if match(newList[i]) { + matchedNew = newList[i] + newIndex = i + break + } + } + if matchedNew == nil { + return nil + } + + for i := range oldList { + if oldList[i] == nil { + continue + } + if match(oldList[i]) { + matchedOld = oldList[i] + break + } + } + + if op.Type == operation.Update && matchedOld != nil && equiv(matchedNew, matchedOld) { return nil } diff --git a/vendor/k8s.io/apimachinery/pkg/api/validate/limits.go b/vendor/k8s.io/apimachinery/pkg/api/validate/limits.go index dcc7f518d8..768546f6bc 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/validate/limits.go +++ b/vendor/k8s.io/apimachinery/pkg/api/validate/limits.go @@ -78,6 +78,18 @@ func MaxItems[T any](_ context.Context, _ operation.Operation, fldPath *field.Pa return nil } +// MaxProperties verifies that the specified map has no more than max keys. +func MaxProperties[K comparable, V any](_ context.Context, _ operation.Operation, fldPath *field.Path, value, _ map[K]V, max int) field.ErrorList { + if value == nil { + return nil + } + + if len(value) > max { + return field.ErrorList{field.TooMany(fldPath, len(value), max).WithOrigin("maxProperties")} + } + return nil +} + // MinItems verifies that the specified slice is not shorter than min items. func MinItems[T any](_ context.Context, _ operation.Operation, fldPath *field.Path, value, _ []T, min int) field.ErrorList { if len(value) < min { @@ -86,6 +98,14 @@ func MinItems[T any](_ context.Context, _ operation.Operation, fldPath *field.Pa return nil } +// MinProperties verifies that the specified map is not shorter than min properties. +func MinProperties[K comparable, V any](_ context.Context, _ operation.Operation, fldPath *field.Path, value, _ map[K]V, min int) field.ErrorList { + if len(value) < min { + return field.ErrorList{field.TooFew(fldPath, len(value), min).WithOrigin("minProperties")} + } + return nil +} + // Minimum verifies that the specified value is greater than or equal to min. func Minimum[T constraints.Integer](_ context.Context, _ operation.Operation, fldPath *field.Path, value, _ *T, min T) field.ErrorList { if value == nil { diff --git a/vendor/k8s.io/apimachinery/pkg/api/validate/monotonic.go b/vendor/k8s.io/apimachinery/pkg/api/validate/monotonic.go new file mode 100644 index 0000000000..f0526c9ffe --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/api/validate/monotonic.go @@ -0,0 +1,43 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package validate + +import ( + "context" + "fmt" + + "k8s.io/apimachinery/pkg/api/operation" + "k8s.io/apimachinery/pkg/api/validate/constraints" + "k8s.io/apimachinery/pkg/util/validation/field" +) + +// Monotonic validates that an integer value has not decreased on update. +func Monotonic[T constraints.Integer](_ context.Context, op operation.Operation, fldPath *field.Path, value, oldValue *T) field.ErrorList { + if op.Type != operation.Update { + return nil + } + + if value == nil || oldValue == nil { + return nil + } + + if *value < *oldValue { + return field.ErrorList{field.Invalid(fldPath, *value, fmt.Sprintf("may not be decreased from %v", *oldValue)).WithOrigin("monotonic")} + } + + return nil +} diff --git a/vendor/k8s.io/apimachinery/pkg/api/validate/options.go b/vendor/k8s.io/apimachinery/pkg/api/validate/options.go index 44236550b7..143be3b64a 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/validate/options.go +++ b/vendor/k8s.io/apimachinery/pkg/api/validate/options.go @@ -18,6 +18,7 @@ package validate import ( "context" + "fmt" "k8s.io/apimachinery/pkg/api/operation" "k8s.io/apimachinery/pkg/util/validation/field" @@ -25,10 +26,14 @@ import ( // IfOption conditionally evaluates a validation function. If the option and enabled are both true the validator // is called. If the option and enabled are both false the validator is called. Otherwise, the validator is not called. -func IfOption[T any](ctx context.Context, op operation.Operation, fldPath *field.Path, value, oldValue *T, - optionName string, enabled bool, validator func(context.Context, operation.Operation, *field.Path, *T, *T) field.ErrorList, +func IfOption[T any](ctx context.Context, op operation.Operation, fldPath *field.Path, value, oldValue T, + optionName string, enabled bool, validator func(context.Context, operation.Operation, *field.Path, T, T) field.ErrorList, ) field.ErrorList { - if op.HasOption(optionName) == enabled { + on, defined := op.HasOption(optionName) + if !defined { + return field.ErrorList{field.InternalError(fldPath, fmt.Errorf("undefined validation option %q", optionName))} + } + if on == enabled { return validator(ctx, op, fldPath, value, oldValue) } return nil diff --git a/vendor/k8s.io/apimachinery/pkg/api/validate/strfmt.go b/vendor/k8s.io/apimachinery/pkg/api/validate/strfmt.go index 190fa8dbe9..893f55d777 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/validate/strfmt.go +++ b/vendor/k8s.io/apimachinery/pkg/api/validate/strfmt.go @@ -97,6 +97,28 @@ func LabelKey[T ~string](_ context.Context, op operation.Operation, fldPath *fie return allErrs } +// PrefixedLabelKey verifies that the specified value is a valid label key with +// a domain prefix. +// A prefixed label key is composed of a prefix and a name, separated by a '/'. +// The name part is required and must: +// - be 63 characters or less +// - begin and end with an alphanumeric character ([a-z0-9A-Z]) +// - contain only alphanumeric characters, dashes (-), underscores (_), or dots (.) +// +// The prefix must: +// - be a DNS subdomain +// - be no more than 253 characters +func PrefixedLabelKey[T ~string](_ context.Context, op operation.Operation, fldPath *field.Path, value, _ *T) field.ErrorList { + if value == nil { + return nil + } + var allErrs field.ErrorList + for _, msg := range content.IsPrefixedLabelKey((string)(*value)) { + allErrs = append(allErrs, field.Invalid(fldPath, *value, msg).WithOrigin("format=k8s-prefixed-label-key")) + } + return allErrs +} + // LongNameCaseless verifies that the specified value is a valid "long name" // (sometimes known as a "DNS subdomain"), but is case-insensitive. // - must not be empty diff --git a/vendor/k8s.io/apimachinery/pkg/api/validate/subfield.go b/vendor/k8s.io/apimachinery/pkg/api/validate/subfield.go index 896f3c3f36..7aa48d3304 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/validate/subfield.go +++ b/vendor/k8s.io/apimachinery/pkg/api/validate/subfield.go @@ -31,6 +31,9 @@ type GetFieldFunc[Tstruct any, Tfield any] func(*Tstruct) Tfield // the value of the subfield is the same as the previous value, as per the // equiv function, then no validation is performed. // +// The equiv function can be called with nil arguments in the case of nilable +// fields. +// // The fldPath passed to the validator includes the subfield name. func Subfield[Tstruct any, Tfield any]( ctx context.Context, op operation.Operation, fldPath *field.Path, diff --git a/vendor/k8s.io/apimachinery/pkg/api/validate/update.go b/vendor/k8s.io/apimachinery/pkg/api/validate/update.go index e67ee28ded..c258e6d112 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/validate/update.go +++ b/vendor/k8s.io/apimachinery/pkg/api/validate/update.go @@ -18,6 +18,8 @@ package validate import ( "context" + "fmt" + "slices" "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apimachinery/pkg/api/operation" @@ -34,11 +36,16 @@ const ( NoUnset // NoModify prevents value changes but allows set/unset transitions NoModify + // NoAddItem prevents adding items to a slice or map + NoAddItem + // NoRemoveItem prevents removing items from a slice or map + NoRemoveItem ) // UpdateValueByCompare verifies update constraints for comparable value types. func UpdateValueByCompare[T comparable](_ context.Context, op operation.Operation, fldPath *field.Path, value, oldValue *T, constraints ...UpdateConstraint) field.ErrorList { - if op.Type != operation.Update { + // nil oldValue means no prior value to compare against (eg: a new item at +k8s:eachVal scope) -> no transition to check. + if op.Type != operation.Update || oldValue == nil { return nil } @@ -101,7 +108,8 @@ func UpdatePointer[T any](_ context.Context, op operation.Operation, fldPath *fi // UpdateValueByReflect verifies update constraints for non-comparable value types using reflection. func UpdateValueByReflect[T any](_ context.Context, op operation.Operation, fldPath *field.Path, value, oldValue *T, constraints ...UpdateConstraint) field.ErrorList { - if op.Type != operation.Update { + // nil oldValue means no prior value to compare against (eg: a new item at +k8s:eachVal scope) -> no transition to check. + if op.Type != operation.Update || oldValue == nil { return nil } @@ -136,7 +144,8 @@ func UpdateValueByReflect[T any](_ context.Context, op operation.Operation, fldP // UpdateStruct verifies update constraints for non-pointer struct types. // Non-pointer structs are always considered "set" and never "unset". func UpdateStruct[T any](_ context.Context, op operation.Operation, fldPath *field.Path, value, oldValue *T, constraints ...UpdateConstraint) field.ErrorList { - if op.Type != operation.Update { + // nil oldValue means no prior value to compare against (eg: a new item at +k8s:eachVal scope) -> no transition to check. + if op.Type != operation.Update || oldValue == nil { return nil } @@ -158,3 +167,142 @@ func UpdateStruct[T any](_ context.Context, op operation.Operation, fldPath *fie return errs } + +// ValSliceUpdate verifies update constraints for slices of values. +// NoAddItem and NoRemoveItem use the match function to find corresponding +// elements between value and oldValue. NoSet and NoUnset treat len == 0 as +// "unset". +// +// The match function will never be called with nil arguments. +func ValSliceUpdate[T any](_ context.Context, op operation.Operation, fldPath *field.Path, value, oldValue []T, match MatchFunc[*T], constraints ...UpdateConstraint) field.ErrorList { + if op.Type != operation.Update { + return nil + } + + if match == nil && (slices.Contains(constraints, NoAddItem) || slices.Contains(constraints, NoRemoveItem)) { + return field.ErrorList{field.InternalError(fldPath, fmt.Errorf("ValSliceUpdate: NoAddItem/NoRemoveItem require a non-nil match function"))} + } + + var errs field.ErrorList + + for _, constraint := range constraints { + switch constraint { + case NoSet: + if len(oldValue) == 0 && len(value) > 0 { + errs = append(errs, field.Invalid(fldPath, nil, "field cannot be set once created").WithOrigin("update")) + } + case NoUnset: + if len(oldValue) > 0 && len(value) == 0 { + errs = append(errs, field.Invalid(fldPath, nil, "field cannot be cleared once set").WithOrigin("update")) + } + case NoAddItem: + for i := range value { + newItem := &value[i] + if lookup(oldValue, newItem, match) == nil { + errs = append(errs, field.Forbidden(fldPath.Index(i), "item may not be added").WithOrigin("update")) + } + } + case NoRemoveItem: + for i := range oldValue { + oldItem := &oldValue[i] + if lookup(value, oldItem, match) == nil { + errs = append(errs, field.Forbidden(fldPath, "item may not be removed").WithOrigin("update")) + } + } + } + } + + return errs +} + +// PtrSliceUpdate verifies update constraints for slices of pointers. +// NoAddItem and NoRemoveItem use the match function to find corresponding +// elements between value and oldValue. NoSet and NoUnset treat len == 0 as +// "unset". +// +// The match function will never be called with nil arguments. +func PtrSliceUpdate[T any](ctx context.Context, op operation.Operation, fldPath *field.Path, value, oldValue []*T, match MatchFunc[*T], constraints ...UpdateConstraint) field.ErrorList { + if op.Type != operation.Update { + return nil + } + + if match == nil && (slices.Contains(constraints, NoAddItem) || slices.Contains(constraints, NoRemoveItem)) { + return field.ErrorList{field.InternalError(fldPath, fmt.Errorf("PtrSliceUpdate: NoAddItem/NoRemoveItem require a non-nil match function"))} + } + + var errs field.ErrorList + + for _, constraint := range constraints { + switch constraint { + case NoSet: + if len(oldValue) == 0 && len(value) > 0 { + errs = append(errs, field.Invalid(fldPath, nil, "field cannot be set once created").WithOrigin("update")) + } + case NoUnset: + if len(oldValue) > 0 && len(value) == 0 { + errs = append(errs, field.Invalid(fldPath, nil, "field cannot be cleared once set").WithOrigin("update")) + } + case NoAddItem: + for i := range value { + newItem := value[i] + if newItem == nil { + // Ignore nil items; they are supposed to have been checked by PtrSliceNoNils. + continue + } + if lookupPointer(oldValue, newItem, match) == nil { + errs = append(errs, field.Forbidden(fldPath.Index(i), "item may not be added").WithOrigin("update")) + } + } + case NoRemoveItem: + for i := range oldValue { + oldItem := oldValue[i] + if oldItem == nil { + continue + } + if lookupPointer(value, oldItem, match) == nil { + errs = append(errs, field.Forbidden(fldPath, "item may not be removed").WithOrigin("update")) + } + } + } + } + + return errs +} + +// UpdateMap verifies update constraints for map types. +// NoAddItem and NoRemoveItem compare keys between value and oldValue. NoSet +// and NoUnset treat len == 0 as "unset". +func UpdateMap[K comparable, V any](_ context.Context, op operation.Operation, fldPath *field.Path, value, oldValue map[K]V, constraints ...UpdateConstraint) field.ErrorList { + if op.Type != operation.Update { + return nil + } + + var errs field.ErrorList + + for _, constraint := range constraints { + switch constraint { + case NoSet: + if len(oldValue) == 0 && len(value) > 0 { + errs = append(errs, field.Invalid(fldPath, nil, "field cannot be set once created").WithOrigin("update")) + } + case NoUnset: + if len(oldValue) > 0 && len(value) == 0 { + errs = append(errs, field.Invalid(fldPath, nil, "field cannot be cleared once set").WithOrigin("update")) + } + case NoAddItem: + for k := range value { + if _, ok := oldValue[k]; !ok { + errs = append(errs, field.Forbidden(fldPath.Key(fmt.Sprintf("%v", k)), "item may not be added").WithOrigin("update")) + } + } + case NoRemoveItem: + for k := range oldValue { + if _, ok := value[k]; !ok { + errs = append(errs, field.Forbidden(fldPath.Key(fmt.Sprintf("%v", k)), "item may not be removed").WithOrigin("update")) + } + } + } + } + + return errs +} diff --git a/vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go b/vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go index 9a4f378483..ff86973fbd 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go +++ b/vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go @@ -17,11 +17,14 @@ limitations under the License. package validation import ( + "context" "fmt" "strings" apiequality "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apimachinery/pkg/api/meta" + "k8s.io/apimachinery/pkg/api/operation" + "k8s.io/apimachinery/pkg/api/validate" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" "k8s.io/apimachinery/pkg/runtime/schema" @@ -68,20 +71,23 @@ func ValidateAnnotationsSize(annotations map[string]string) error { func validateOwnerReference(ownerReference metav1.OwnerReference, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} - gvk := schema.FromAPIVersionAndKind(ownerReference.APIVersion, ownerReference.Kind) + gv, err := schema.ParseGroupVersion(ownerReference.APIVersion) // gvk.Group is empty for the legacy group. - if len(gvk.Version) == 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("apiVersion"), ownerReference.APIVersion, "version must not be empty")) + if len(ownerReference.APIVersion) == 0 { + allErrs = append(allErrs, field.Required(fldPath.Child("apiVersion"), "must not be empty").MarkCoveredByDeclarative()) + } else if err != nil || len(gv.Version) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("apiVersion"), ownerReference.APIVersion, "must be / or ")) } - if len(gvk.Kind) == 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("kind"), ownerReference.Kind, "must not be empty")) + if len(ownerReference.Kind) == 0 { + allErrs = append(allErrs, field.Required(fldPath.Child("kind"), "must not be empty").MarkCoveredByDeclarative()) } if len(ownerReference.Name) == 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), ownerReference.Name, "must not be empty")) + allErrs = append(allErrs, field.Required(fldPath.Child("name"), "must not be empty").MarkCoveredByDeclarative()) } if len(ownerReference.UID) == 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("uid"), ownerReference.UID, "must not be empty")) + allErrs = append(allErrs, field.Required(fldPath.Child("uid"), "must not be empty").MarkCoveredByDeclarative()) } + gvk := gv.WithKind(ownerReference.Kind) if _, ok := BannedOwners[gvk]; ok { allErrs = append(allErrs, field.Invalid(fldPath, ownerReference, fmt.Sprintf("%s is disallowed from being an owner", gvk))) } @@ -92,8 +98,8 @@ func validateOwnerReference(ownerReference metav1.OwnerReference, fldPath *field func ValidateOwnerReferences(ownerReferences []metav1.OwnerReference, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} firstControllerName := "" - for _, ref := range ownerReferences { - allErrs = append(allErrs, validateOwnerReference(ref, fldPath)...) + for idx, ref := range ownerReferences { + allErrs = append(allErrs, validateOwnerReference(ref, fldPath.Index(idx))...) if ref.Controller != nil && *ref.Controller { curControllerName := ref.Kind + "/" + ref.Name if firstControllerName != "" { @@ -136,6 +142,25 @@ func ValidateImmutableField(newVal, oldVal interface{}, fldPath *field.Path) fie return allErrs } +// ValidateObjectMetaDeclaratively validates an ObjectMeta instance declaratively and deduplicates handwritten errors. +// betaEnabled controls whether declarative validation rules at the Beta stability level are enforced. +// NOTE: This method should be used in the types for which declarative validation is not enabled yet or cannot be enabled. The types +// for which declarative validation is enabled and valdiation code is generated must use ValidateObjectMeta and ValidateObjectMetaUpdate. +func ValidateObjectMetaDeclaratively(ctx context.Context, op operation.Type, obj, oldObj *metav1.ObjectMeta, requiresNamespace bool, nameFn ValidateNameFunc, fldPath *field.Path, betaEnabled bool) field.ErrorList { + var errs field.ErrorList + switch op { + case operation.Create: + errs = ValidateObjectMeta(obj, requiresNamespace, nameFn, fldPath) + case operation.Update: + errs = ValidateObjectMetaUpdate(obj, oldObj, fldPath) + } + dvErrs := v1validation.Validate_ObjectMeta(ctx, operation.Operation{Type: op}, fldPath, obj, oldObj) + enforcedDVErrs := validate.FilterEnforcedDeclarativeErrors(ctx, dvErrs, betaEnabled) + errs = errs.MarkFromImperative() + errs = validate.FilterCoveredHandwrittenErrors(ctx, errs, enforcedDVErrs, betaEnabled) + return append(errs, enforcedDVErrs...) +} + // ValidateObjectMeta validates an object's metadata on creation. It expects that name generation has already // been performed. func ValidateObjectMeta(objMeta *metav1.ObjectMeta, requiresNamespace bool, nameFn ValidateNameFunc, fldPath *field.Path) field.ErrorList { @@ -262,12 +287,12 @@ func validateObjectMetaAccessorWithOptsCommon(meta metav1.Object, isNamespaced b } } - allErrs = append(allErrs, ValidateNonnegativeField(meta.GetGeneration(), fldPath.Child("generation"))...) + allErrs = append(allErrs, ValidateNonnegativeField(meta.GetGeneration(), fldPath.Child("generation")).MarkCoveredByDeclarative()...) allErrs = append(allErrs, v1validation.ValidateLabels(meta.GetLabels(), fldPath.Child("labels"))...) allErrs = append(allErrs, ValidateAnnotations(meta.GetAnnotations(), fldPath.Child("annotations"))...) allErrs = append(allErrs, ValidateOwnerReferences(meta.GetOwnerReferences(), fldPath.Child("ownerReferences"))...) allErrs = append(allErrs, ValidateFinalizers(meta.GetFinalizers(), fldPath.Child("finalizers"))...) - allErrs = append(allErrs, v1validation.ValidateManagedFields(meta.GetManagedFields(), fldPath.Child("managedFields"))...) + allErrs = append(allErrs, v1validation.ValidateManagedFields(meta.GetManagedFields(), fldPath.Child("managedFields"), v1validation.CoveredByDeclarative)...) return allErrs } @@ -323,21 +348,22 @@ func ValidateObjectMetaAccessorUpdate(newMeta, oldMeta metav1.Object, fldPath *f } // Generation shouldn't be decremented + allErrs = append(allErrs, ValidateNonnegativeField(newMeta.GetGeneration(), fldPath.Child("generation")).MarkCoveredByDeclarative()...) if newMeta.GetGeneration() < oldMeta.GetGeneration() { allErrs = append(allErrs, field.Invalid(fldPath.Child("generation"), newMeta.GetGeneration(), "must not be decremented")) } allErrs = append(allErrs, ValidateImmutableField(newMeta.GetName(), oldMeta.GetName(), fldPath.Child("name"))...) allErrs = append(allErrs, ValidateImmutableField(newMeta.GetNamespace(), oldMeta.GetNamespace(), fldPath.Child("namespace"))...) - allErrs = append(allErrs, ValidateImmutableField(newMeta.GetUID(), oldMeta.GetUID(), fldPath.Child("uid"))...) - allErrs = append(allErrs, ValidateImmutableField(newMeta.GetCreationTimestamp(), oldMeta.GetCreationTimestamp(), fldPath.Child("creationTimestamp"))...) - allErrs = append(allErrs, ValidateImmutableField(newMeta.GetDeletionTimestamp(), oldMeta.GetDeletionTimestamp(), fldPath.Child("deletionTimestamp"))...) - allErrs = append(allErrs, ValidateImmutableField(newMeta.GetDeletionGracePeriodSeconds(), oldMeta.GetDeletionGracePeriodSeconds(), fldPath.Child("deletionGracePeriodSeconds"))...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetUID(), oldMeta.GetUID(), fldPath.Child("uid")).WithOrigin("immutable").MarkCoveredByDeclarative()...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetCreationTimestamp(), oldMeta.GetCreationTimestamp(), fldPath.Child("creationTimestamp")).WithOrigin("immutable").MarkCoveredByDeclarative()...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetDeletionTimestamp(), oldMeta.GetDeletionTimestamp(), fldPath.Child("deletionTimestamp")).WithOrigin("immutable").MarkCoveredByDeclarative()...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetDeletionGracePeriodSeconds(), oldMeta.GetDeletionGracePeriodSeconds(), fldPath.Child("deletionGracePeriodSeconds")).WithOrigin("immutable").MarkCoveredByDeclarative()...) allErrs = append(allErrs, v1validation.ValidateLabels(newMeta.GetLabels(), fldPath.Child("labels"))...) allErrs = append(allErrs, ValidateAnnotations(newMeta.GetAnnotations(), fldPath.Child("annotations"))...) allErrs = append(allErrs, ValidateOwnerReferences(newMeta.GetOwnerReferences(), fldPath.Child("ownerReferences"))...) - allErrs = append(allErrs, v1validation.ValidateManagedFields(newMeta.GetManagedFields(), fldPath.Child("managedFields"))...) + allErrs = append(allErrs, v1validation.ValidateManagedFields(newMeta.GetManagedFields(), fldPath.Child("managedFields"), v1validation.CoveredByDeclarative)...) return allErrs } diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto index d03a733141..afc9b250fa 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto @@ -179,6 +179,9 @@ message ApplyOptions { // // +patchStrategy=merge // // +listType=map // // +listMapKey=type +// // +k8s:alpha(since: "1.37")=+k8s:optional +// // +k8s:alpha(since: "1.37")=+k8s:listType=map +// // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type // Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` // // // other fields @@ -193,12 +196,14 @@ message Condition { // +kubebuilder:validation:Required // +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$` // +kubebuilder:validation:MaxLength=316 + // +k8s:alpha(since: "1.37")=+k8s:required optional string type = 1; // status of the condition, one of True, False, Unknown. // +required // +kubebuilder:validation:Required // +kubebuilder:validation:Enum=True;False;Unknown + // +k8s:alpha(since: "1.37")=+k8s:required optional string status = 2; // observedGeneration represents the .metadata.generation that the condition was set based upon. @@ -206,6 +211,8 @@ message Condition { // with respect to the current state of the instance. // +optional // +kubebuilder:validation:Minimum=0 + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:minimum=0 optional int64 observedGeneration = 3; // lastTransitionTime is the last time the condition transitioned from one status to another. @@ -214,6 +221,7 @@ message Condition { // +kubebuilder:validation:Required // +kubebuilder:validation:Type=string // +kubebuilder:validation:Format=date-time + // +k8s:alpha(since: "1.37")=+k8s:customValidation optional Time lastTransitionTime = 4; // reason contains a programmatic identifier indicating the reason for the condition's last transition. @@ -226,6 +234,8 @@ message Condition { // +kubebuilder:validation:MaxLength=1024 // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:Pattern=`^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$` + // +k8s:alpha(since: "1.37")=+k8s:required + // +k8s:alpha(since: "1.37")=+k8s:maxBytes=1024 optional string reason = 5; // message is a human readable message indicating details about the transition. @@ -700,6 +710,7 @@ message ManagedFieldsEntry { // Operation is the type of operation which lead to this ManagedFieldsEntry being created. // The only valid values for this field are 'Apply' and 'Update'. + // +k8s:alpha(since: "1.37")=+k8s:required optional string operation = 2; // APIVersion defines the version of this resource that this field set @@ -802,6 +813,8 @@ message ObjectMeta { // Read-only. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:immutable optional string uid = 5; // An opaque value that represents the internal version of this object that can @@ -820,6 +833,8 @@ message ObjectMeta { // A sequence number representing a specific generation of the desired state. // Populated by the system. Read-only. // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:minimum=0 optional int64 generation = 7; // CreationTimestamp is a timestamp representing the server time when this object was @@ -831,6 +846,7 @@ message ObjectMeta { // Null for lists. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable optional Time creationTimestamp = 8; // DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This @@ -852,6 +868,8 @@ message ObjectMeta { // Read-only. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:immutable optional Time deletionTimestamp = 9; // Number of seconds allowed for this object to gracefully terminate before @@ -859,6 +877,8 @@ message ObjectMeta { // May only be shortened. // Read-only. // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:immutable optional int64 deletionGracePeriodSeconds = 10; // Map of string keys and values that can be used to organize and categorize @@ -884,6 +904,7 @@ message ObjectMeta { // +patchStrategy=merge // +listType=map // +listMapKey=uid + // +k8s:alpha(since:"1.37")=+k8s:optional repeated OwnerReference ownerReferences = 13; // Must be empty before the object is deleted from the registry. Each entry @@ -914,6 +935,7 @@ message ObjectMeta { // // +optional // +listType=atomic + // +k8s:alpha(since: "1.37")=+k8s:optional repeated ManagedFieldsEntry managedFields = 17; } @@ -923,18 +945,22 @@ message ObjectMeta { // +structType=atomic message OwnerReference { // API version of the referent. + // +k8s:alpha(since:"1.37")=+k8s:required optional string apiVersion = 5; // Kind of the referent. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + // +k8s:alpha(since:"1.37")=+k8s:required optional string kind = 1; // Name of the referent. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names + // +k8s:alpha(since:"1.37")=+k8s:required optional string name = 3; // UID of the referent. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids + // +k8s:alpha(since:"1.37")=+k8s:required optional string uid = 4; // If true, this reference points to the managing controller. @@ -960,6 +986,7 @@ message PartialObjectMetadata { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType optional ObjectMeta metadata = 1; } diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go index c8b87f20c8..f88212e15e 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go @@ -176,6 +176,8 @@ type ObjectMeta struct { // Read-only. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:immutable UID types.UID `json:"uid,omitempty" protobuf:"bytes,5,opt,name=uid,casttype=k8s.io/kubernetes/pkg/types.UID"` // An opaque value that represents the internal version of this object that can @@ -194,6 +196,8 @@ type ObjectMeta struct { // A sequence number representing a specific generation of the desired state. // Populated by the system. Read-only. // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:minimum=0 Generation int64 `json:"generation,omitempty" protobuf:"varint,7,opt,name=generation"` // CreationTimestamp is a timestamp representing the server time when this object was @@ -205,6 +209,7 @@ type ObjectMeta struct { // Null for lists. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:alpha(since: "1.37")=+k8s:immutable CreationTimestamp Time `json:"creationTimestamp,omitempty,omitzero" protobuf:"bytes,8,opt,name=creationTimestamp"` // DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This @@ -226,6 +231,8 @@ type ObjectMeta struct { // Read-only. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:immutable DeletionTimestamp *Time `json:"deletionTimestamp,omitempty" protobuf:"bytes,9,opt,name=deletionTimestamp"` // Number of seconds allowed for this object to gracefully terminate before @@ -233,6 +240,8 @@ type ObjectMeta struct { // May only be shortened. // Read-only. // +optional + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:immutable DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty" protobuf:"varint,10,opt,name=deletionGracePeriodSeconds"` // Map of string keys and values that can be used to organize and categorize @@ -258,6 +267,7 @@ type ObjectMeta struct { // +patchStrategy=merge // +listType=map // +listMapKey=uid + // +k8s:alpha(since:"1.37")=+k8s:optional OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" patchStrategy:"merge" patchMergeKey:"uid" protobuf:"bytes,13,rep,name=ownerReferences"` // Must be empty before the object is deleted from the registry. Each entry @@ -292,6 +302,7 @@ type ObjectMeta struct { // // +optional // +listType=atomic + // +k8s:alpha(since: "1.37")=+k8s:optional ManagedFields []ManagedFieldsEntry `json:"managedFields,omitempty" protobuf:"bytes,17,rep,name=managedFields"` } @@ -314,15 +325,19 @@ const ( // +structType=atomic type OwnerReference struct { // API version of the referent. + // +k8s:alpha(since:"1.37")=+k8s:required APIVersion string `json:"apiVersion" protobuf:"bytes,5,opt,name=apiVersion"` // Kind of the referent. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + // +k8s:alpha(since:"1.37")=+k8s:required Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` // Name of the referent. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names + // +k8s:alpha(since:"1.37")=+k8s:required Name string `json:"name" protobuf:"bytes,3,opt,name=name"` // UID of the referent. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids + // +k8s:alpha(since:"1.37")=+k8s:required UID types.UID `json:"uid" protobuf:"bytes,4,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` // If true, this reference points to the managing controller. // +optional @@ -344,7 +359,7 @@ type OwnerReference struct { // ListOptions is the query options to a standard REST list call. type ListOptions struct { - TypeMeta `json:",inline"` + TypeMeta `json:""` // A selector to restrict the list of returned objects by their labels. // Defaults to everything. @@ -517,7 +532,7 @@ const ( // GetOptions is the standard query options to the standard REST get call. type GetOptions struct { - TypeMeta `json:",inline"` + TypeMeta `json:""` // resourceVersion sets a constraint on what resource versions a request may be served from. // See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for // details. @@ -557,7 +572,7 @@ const ( // DeleteOptions may be provided when deleting an API object. type DeleteOptions struct { - TypeMeta `json:",inline"` + TypeMeta `json:""` // The duration in seconds before the object should be deleted. Value must be non-negative integer. // The value zero indicates delete immediately. If this value is nil, the default grace period for the @@ -629,7 +644,7 @@ const ( // CreateOptions may be provided when creating an API object. type CreateOptions struct { - TypeMeta `json:",inline"` + TypeMeta `json:""` // When present, indicates that modifications should not be // persisted. An invalid or unrecognized dryRun directive will @@ -674,7 +689,7 @@ type CreateOptions struct { // PatchOptions may be provided when patching an API object. // PatchOptions is meant to be a superset of UpdateOptions. type PatchOptions struct { - TypeMeta `json:",inline"` + TypeMeta `json:""` // When present, indicates that modifications should not be // persisted. An invalid or unrecognized dryRun directive will @@ -726,7 +741,7 @@ type PatchOptions struct { // ApplyOptions is equivalent to PatchOptions. It is provided as a convenience with documentation // that speaks specifically to how the options fields relate to apply. type ApplyOptions struct { - TypeMeta `json:",inline"` + TypeMeta `json:""` // When present, indicates that modifications should not be // persisted. An invalid or unrecognized dryRun directive will @@ -759,7 +774,7 @@ func (o ApplyOptions) ToPatchOptions() PatchOptions { // UpdateOptions may be provided when updating an API object. // All fields in UpdateOptions should also be present in PatchOptions. type UpdateOptions struct { - TypeMeta `json:",inline"` + TypeMeta `json:""` // When present, indicates that modifications should not be // persisted. An invalid or unrecognized dryRun directive will @@ -811,7 +826,7 @@ type Preconditions struct { // Status is a return value for calls that don't return other objects. type Status struct { - TypeMeta `json:",inline"` + TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -1131,7 +1146,7 @@ const ( // List holds a list of objects, which may not be known by the server. type List struct { - TypeMeta `json:",inline"` + TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -1147,7 +1162,7 @@ type List struct { // +protobuf.options.(gogoproto.goproto_stringer)=false // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type APIVersions struct { - TypeMeta `json:",inline"` + TypeMeta `json:""` // versions are the api versions that are available. // +listType=atomic Versions []string `json:"versions" protobuf:"bytes,1,rep,name=versions"` @@ -1167,7 +1182,7 @@ type APIVersions struct { // APIGroupList is a list of APIGroup, to allow clients to discover the API at // /apis. type APIGroupList struct { - TypeMeta `json:",inline"` + TypeMeta `json:""` // groups is a list of APIGroup. // +listType=atomic Groups []APIGroup `json:"groups" protobuf:"bytes,1,rep,name=groups"` @@ -1178,7 +1193,7 @@ type APIGroupList struct { // APIGroup contains the name, the supported versions, and the preferred version // of a group. type APIGroup struct { - TypeMeta `json:",inline"` + TypeMeta `json:""` // name is the name of the group. Name string `json:"name" protobuf:"bytes,1,opt,name=name"` // versions are the versions supported in this group. @@ -1273,7 +1288,7 @@ func (vs Verbs) String() string { // resources supported in a specific group and version, and if the resource // is namespaced. type APIResourceList struct { - TypeMeta `json:",inline"` + TypeMeta `json:""` // groupVersion is the group and version this APIResourceList is for. GroupVersion string `json:"groupVersion" protobuf:"bytes,1,opt,name=groupVersion"` // resources contains the name of the resources and if they are namespaced. @@ -1394,6 +1409,7 @@ type ManagedFieldsEntry struct { Manager string `json:"manager,omitempty" protobuf:"bytes,1,opt,name=manager"` // Operation is the type of operation which lead to this ManagedFieldsEntry being created. // The only valid values for this field are 'Apply' and 'Update'. + // +k8s:alpha(since: "1.37")=+k8s:required Operation ManagedFieldsOperationType `json:"operation,omitempty" protobuf:"bytes,2,opt,name=operation,casttype=ManagedFieldsOperationType"` // APIVersion defines the version of this resource that this field set // applies to. The format is "group/version" just like the top-level @@ -1429,6 +1445,7 @@ type ManagedFieldsEntry struct { } // ManagedFieldsOperationType is the type of operation which lead to a ManagedFieldsEntry being created. +// +k8s:alpha(since: "1.37")=+k8s:enum type ManagedFieldsOperationType string const ( @@ -1446,7 +1463,7 @@ const ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +protobuf=false type Table struct { - TypeMeta `json:",inline"` + TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -1537,6 +1554,7 @@ const ( RowCompleted RowConditionType = "Completed" ) +// +k8s:alpha(since: "1.37")=+k8s:enum type ConditionStatus string // These are valid condition statuses. "ConditionTrue" means a resource is in the condition. @@ -1565,7 +1583,7 @@ const ( // +k8s:conversion-gen:explicit-from=net/url.Values // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type TableOptions struct { - TypeMeta `json:",inline"` + TypeMeta `json:""` // NoHeaders is only exposed for internal callers. It is not included in our OpenAPI definitions // and may be removed as a field in a future release. @@ -1582,17 +1600,18 @@ type TableOptions struct { // to get access to a particular ObjectMeta schema without knowing the details of the version. // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type PartialObjectMetadata struct { - TypeMeta `json:",inline"` + TypeMeta `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional + // +k8s:opaqueType ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` } // PartialObjectMetadataList contains a list of objects containing only their metadata // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type PartialObjectMetadataList struct { - TypeMeta `json:",inline"` + TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional @@ -1613,6 +1632,9 @@ type PartialObjectMetadataList struct { // // +patchStrategy=merge // // +listType=map // // +listMapKey=type +// // +k8s:alpha(since: "1.37")=+k8s:optional +// // +k8s:alpha(since: "1.37")=+k8s:listType=map +// // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type // Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` // // // other fields @@ -1627,17 +1649,21 @@ type Condition struct { // +kubebuilder:validation:Required // +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$` // +kubebuilder:validation:MaxLength=316 + // +k8s:alpha(since: "1.37")=+k8s:required Type string `json:"type" protobuf:"bytes,1,opt,name=type"` // status of the condition, one of True, False, Unknown. // +required // +kubebuilder:validation:Required // +kubebuilder:validation:Enum=True;False;Unknown + // +k8s:alpha(since: "1.37")=+k8s:required Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status"` // observedGeneration represents the .metadata.generation that the condition was set based upon. // For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date // with respect to the current state of the instance. // +optional // +kubebuilder:validation:Minimum=0 + // +k8s:alpha(since: "1.37")=+k8s:optional + // +k8s:alpha(since: "1.37")=+k8s:minimum=0 ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"` // lastTransitionTime is the last time the condition transitioned from one status to another. // This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. @@ -1645,6 +1671,7 @@ type Condition struct { // +kubebuilder:validation:Required // +kubebuilder:validation:Type=string // +kubebuilder:validation:Format=date-time + // +k8s:alpha(since: "1.37")=+k8s:customValidation LastTransitionTime Time `json:"lastTransitionTime" protobuf:"bytes,4,opt,name=lastTransitionTime"` // reason contains a programmatic identifier indicating the reason for the condition's last transition. // Producers of specific condition types may define expected values and meanings for this field, @@ -1656,6 +1683,8 @@ type Condition struct { // +kubebuilder:validation:MaxLength=1024 // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:Pattern=`^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$` + // +k8s:alpha(since: "1.37")=+k8s:required + // +k8s:alpha(since: "1.37")=+k8s:maxBytes=1024 Reason string `json:"reason" protobuf:"bytes,5,opt,name=reason"` // message is a human readable message indicating details about the transition. // This may be an empty string. diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/helpers.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/helpers.go index 59f43b7bff..592445d9c8 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/helpers.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/helpers.go @@ -523,6 +523,7 @@ func NewJSONFallbackEncoder(encoder runtime.Encoder) runtime.Encoder { } identifier, err := gojson.Marshal(result) if err != nil { + //nolint:logcheck // Should not be reached. klog.Fatalf("Failed marshaling identifier for jsonFallbackEncoder: %v", err) } return &jsonFallbackEncoder{ diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/doc.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/doc.go new file mode 100644 index 0000000000..3b9cb30f2a --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/doc.go @@ -0,0 +1,21 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:validation-gen=TypesWithField=TypeMeta +// +k8s:validation-gen-input=k8s.io/apimachinery/pkg/apis/meta/v1 + +// Package validation holds generated validations for meta/v1 types. +package validation diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go index d0ca20013a..b9ec344270 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go @@ -17,10 +17,12 @@ limitations under the License. package validation import ( + "context" "fmt" "regexp" "unicode" + "k8s.io/apimachinery/pkg/api/operation" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" @@ -266,14 +268,39 @@ func ValidateTableOptions(opts *metav1.TableOptions) field.ErrorList { const MaxSubresourceNameLength = 256 -func ValidateManagedFields(fieldsList []metav1.ManagedFieldsEntry, fldPath *field.Path) field.ErrorList { +// ManagedFieldsValidationOption specifies options for validating managed fields. +type ManagedFieldsValidationOption int + +const ( + // CoveredByDeclarative indicates whether errors should be marked as covered by declarative validation. + CoveredByDeclarative ManagedFieldsValidationOption = iota + 1 +) + +// ValidateManagedFields validates a list of managed fields. +func ValidateManagedFields(fieldsList []metav1.ManagedFieldsEntry, fldPath *field.Path, opts ...ManagedFieldsValidationOption) field.ErrorList { + coveredByDeclarative := false + for _, opt := range opts { + if opt == CoveredByDeclarative { + coveredByDeclarative = true + } + } var allErrs field.ErrorList for i, fields := range fieldsList { fldPath := fldPath.Index(i) switch fields.Operation { + case "": + err := field.Required(fldPath.Child("operation"), "must not be empty") + if coveredByDeclarative { + err = err.MarkCoveredByDeclarative() + } + allErrs = append(allErrs, err) case metav1.ManagedFieldsOperationApply, metav1.ManagedFieldsOperationUpdate: default: - allErrs = append(allErrs, field.Invalid(fldPath.Child("operation"), fields.Operation, "must be `Apply` or `Update`")) + err := field.NotSupported(fldPath.Child("operation"), fields.Operation, []metav1.ManagedFieldsOperationType{metav1.ManagedFieldsOperationApply, metav1.ManagedFieldsOperationUpdate}) + if coveredByDeclarative { + err = err.MarkCoveredByDeclarative() + } + allErrs = append(allErrs, err) } if len(fields.FieldsType) > 0 && fields.FieldsType != "FieldsV1" { allErrs = append(allErrs, field.Invalid(fldPath.Child("fieldsType"), fields.FieldsType, "must be `FieldsV1`")) @@ -293,7 +320,7 @@ func ValidateConditions(conditions []metav1.Condition, fldPath *field.Path) fiel conditionTypeToFirstIndex := map[string]int{} for i, condition := range conditions { if _, ok := conditionTypeToFirstIndex[condition.Type]; ok { - allErrs = append(allErrs, field.Duplicate(fldPath.Index(i).Child("type"), condition.Type)) + allErrs = append(allErrs, field.Duplicate(fldPath.Index(i), condition.Type).MarkCoveredByDeclarative()) } else { conditionTypeToFirstIndex[condition.Type] = i } @@ -316,29 +343,35 @@ func ValidateCondition(condition metav1.Condition, fldPath *field.Path) field.Er var allErrs field.ErrorList // type is set and is a valid format - allErrs = append(allErrs, ValidateLabelName(condition.Type, fldPath.Child("type"))...) + if len(condition.Type) == 0 { + allErrs = append(allErrs, field.Required(fldPath.Child("type"), "is required").MarkCoveredByDeclarative()) + } else { + allErrs = append(allErrs, ValidateLabelName(condition.Type, fldPath.Child("type"))...) + } // status is set and is an accepted value - if !validConditionStatuses.Has(string(condition.Status)) { - allErrs = append(allErrs, field.NotSupported(fldPath.Child("status"), condition.Status, validConditionStatuses.List())) + if len(condition.Status) == 0 { + allErrs = append(allErrs, field.Required(fldPath.Child("status"), "").MarkCoveredByDeclarative()) + } else if !validConditionStatuses.Has(string(condition.Status)) { + allErrs = append(allErrs, field.NotSupported(fldPath.Child("status"), condition.Status, validConditionStatuses.List()).MarkCoveredByDeclarative()) } if condition.ObservedGeneration < 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("observedGeneration"), condition.ObservedGeneration, "must be greater than or equal to zero")) + allErrs = append(allErrs, field.Invalid(fldPath.Child("observedGeneration"), condition.ObservedGeneration, "must be greater than or equal to zero").WithOrigin("minimum").MarkCoveredByDeclarative()) } if condition.LastTransitionTime.IsZero() { - allErrs = append(allErrs, field.Required(fldPath.Child("lastTransitionTime"), "")) + allErrs = append(allErrs, field.Required(fldPath.Child("lastTransitionTime"), "").MarkCoveredByDeclarative()) } if len(condition.Reason) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("reason"), "")) + allErrs = append(allErrs, field.Required(fldPath.Child("reason"), "").MarkCoveredByDeclarative()) } else { - for _, currErr := range isValidConditionReason(condition.Reason) { + for _, currErr := range IsValidConditionReason(condition.Reason) { allErrs = append(allErrs, field.Invalid(fldPath.Child("reason"), condition.Reason, currErr)) } if len(condition.Reason) > maxReasonLen { - allErrs = append(allErrs, field.TooLong(fldPath.Child("reason"), "" /*unused*/, maxReasonLen)) + allErrs = append(allErrs, field.TooLong(fldPath.Child("reason"), "" /*unused*/, maxReasonLen).WithOrigin("maxBytes").MarkCoveredByDeclarative()) } } @@ -354,8 +387,9 @@ const conditionReasonErrMsg string = "a condition reason must start with alphabe var conditionReasonRegexp = regexp.MustCompile("^" + conditionReasonFmt + "$") -// isValidConditionReason tests for a string that conforms to rules for condition reasons. This checks the format, but not the length. -func isValidConditionReason(value string) []string { +// IsValidConditionReason tests for a string that conforms to rules for condition +// reasons. This checks the format, but not the length. +func IsValidConditionReason(value string) []string { if !conditionReasonRegexp.MatchString(value) { return []string{validation.RegexError(conditionReasonErrMsg, conditionReasonFmt, "my_name", "MY_NAME", "MyName", "ReasonA,ReasonB", "ReasonA:ReasonB")} } @@ -370,9 +404,6 @@ func ValidateIgnoreStoreReadError(fldPath *field.Path, options *metav1.DeleteOpt return allErrs } - if len(options.DryRun) > 0 { - allErrs = append(allErrs, field.Invalid(fldPath, true, "cannot be set together with .dryRun")) - } if options.PropagationPolicy != nil { allErrs = append(allErrs, field.Invalid(fldPath, true, "cannot be set together with .propagationPolicy")) } @@ -389,3 +420,14 @@ func ValidateIgnoreStoreReadError(fldPath *field.Path, options *metav1.DeleteOpt return allErrs } + +// ValidateCustom_Condition_LastTransitionTime is wired into the generated +// declarative validation by +k8s:customValidation on Condition.LastTransitionTime. +// It enforces that the field is set, mirroring the handwritten check in +// ValidateCondition. +func ValidateCustom_Condition_LastTransitionTime(ctx context.Context, op operation.Operation, fldPath *field.Path, value, oldValue *metav1.Time) field.ErrorList { + if value.IsZero() { + return field.ErrorList{field.Required(fldPath, "")} + } + return nil +} diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/zz_generated.validations.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/zz_generated.validations.go new file mode 100644 index 0000000000..f79373a26d --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/zz_generated.validations.go @@ -0,0 +1,638 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by validation-gen. DO NOT EDIT. + +package validation + +import ( + context "context" + + equality "k8s.io/apimachinery/pkg/api/equality" + operation "k8s.io/apimachinery/pkg/api/operation" + safe "k8s.io/apimachinery/pkg/api/safe" + validate "k8s.io/apimachinery/pkg/api/validate" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + sets "k8s.io/apimachinery/pkg/util/sets" + field "k8s.io/apimachinery/pkg/util/validation/field" +) + +// Validate_Condition validates an instance of Condition according +// to declarative validation rules in the API schema. +func Validate_Condition( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *v1.Condition) (errs field.ErrorList) { + + { // field v1.Condition.Type + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.Condition) *string { + return &oldObj.Type + }) + errs = append(errs, fn(fldPath.Child("type"), &obj.Type, oldVal, oldObj != nil)...) + } + + { // field v1.Condition.Status + fn := func( + fldPath *field.Path, + obj, oldObj *v1.ConditionStatus, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_ConditionStatus(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.Condition) *v1.ConditionStatus { + return &oldObj.Status + }) + errs = append(errs, fn(fldPath.Child("status"), &obj.Status, oldVal, oldObj != nil)...) + } + + { // field v1.Condition.ObservedGeneration + fn := func( + fldPath *field.Path, + obj, oldObj *int64, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.Minimum(ctx, op, fldPath, obj, oldObj, 0).MarkAlpha(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.Condition) *int64 { + return &oldObj.ObservedGeneration + }) + errs = append(errs, fn(fldPath.Child("observedGeneration"), &obj.ObservedGeneration, oldVal, oldObj != nil)...) + } + + { // field v1.Condition.LastTransitionTime + fn := func( + fldPath *field.Path, + obj, oldObj *v1.Time, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + // custom validation + if e := ValidateCustom_Condition_LastTransitionTime(ctx, op, fldPath, obj, oldObj).MarkAlpha(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.Condition) *v1.Time { + return &oldObj.LastTransitionTime + }) + errs = append(errs, fn(fldPath.Child("lastTransitionTime"), &obj.LastTransitionTime, oldVal, oldObj != nil)...) + } + + { // field v1.Condition.Reason + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.MaxBytes(ctx, op, fldPath, obj, oldObj, 1024).MarkAlpha(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.Condition) *string { + return &oldObj.Reason + }) + errs = append(errs, fn(fldPath.Child("reason"), &obj.Reason, oldVal, oldObj != nil)...) + } + + // field v1.Condition.Message has no validation + return errs +} + +var symbolsForConditionStatus = sets.New(v1.ConditionFalse, v1.ConditionTrue, v1.ConditionUnknown) + +// Validate_ConditionStatus validates an instance of ConditionStatus according +// to declarative validation rules in the API schema. +func Validate_ConditionStatus( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *v1.ConditionStatus) (errs field.ErrorList) { + + if e := validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForConditionStatus, nil).MarkAlpha(); len(e) != 0 { + errs = append(errs, e...) + } + + return errs +} + +// Validate_ManagedFieldsEntry validates an instance of ManagedFieldsEntry according +// to declarative validation rules in the API schema. +func Validate_ManagedFieldsEntry( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *v1.ManagedFieldsEntry) (errs field.ErrorList) { + + // field v1.ManagedFieldsEntry.Manager has no validation + + { // field v1.ManagedFieldsEntry.Operation + fn := func( + fldPath *field.Path, + obj, oldObj *v1.ManagedFieldsOperationType, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // call the type's validation function + errs = append(errs, Validate_ManagedFieldsOperationType(ctx, op, fldPath, obj, oldObj)...) + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.ManagedFieldsEntry) *v1.ManagedFieldsOperationType { + return &oldObj.Operation + }) + errs = append(errs, fn(fldPath.Child("operation"), &obj.Operation, oldVal, oldObj != nil)...) + } + + // field v1.ManagedFieldsEntry.APIVersion has no validation + // field v1.ManagedFieldsEntry.Time has no validation + // field v1.ManagedFieldsEntry.FieldsType has no validation + // field v1.ManagedFieldsEntry.FieldsV1 has no validation + // field v1.ManagedFieldsEntry.Subresource has no validation + return errs +} + +var symbolsForManagedFieldsOperationType = sets.New(v1.ManagedFieldsOperationApply, v1.ManagedFieldsOperationUpdate) + +// Validate_ManagedFieldsOperationType validates an instance of ManagedFieldsOperationType according +// to declarative validation rules in the API schema. +func Validate_ManagedFieldsOperationType( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *v1.ManagedFieldsOperationType) (errs field.ErrorList) { + + if e := validate.Enum(ctx, op, fldPath, obj, oldObj, symbolsForManagedFieldsOperationType, nil).MarkAlpha(); len(e) != 0 { + errs = append(errs, e...) + } + + return errs +} + +// Validate_ObjectMeta validates an instance of ObjectMeta according +// to declarative validation rules in the API schema. +func Validate_ObjectMeta( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *v1.ObjectMeta) (errs field.ErrorList) { + + // field v1.ObjectMeta.Name has no validation + // field v1.ObjectMeta.GenerateName has no validation + // field v1.ObjectMeta.Namespace has no validation + // field v1.ObjectMeta.SelfLink has no validation + + { // field v1.ObjectMeta.UID + fn := func( + fldPath *field.Path, + obj, oldObj *types.UID, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.ObjectMeta) *types.UID { + return &oldObj.UID + }) + errs = append(errs, fn(fldPath.Child("uid"), &obj.UID, oldVal, oldObj != nil)...) + } + + // field v1.ObjectMeta.ResourceVersion has no validation + + { // field v1.ObjectMeta.Generation + fn := func( + fldPath *field.Path, + obj, oldObj *int64, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalValue(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + if e := validate.Minimum(ctx, op, fldPath, obj, oldObj, 0).MarkAlpha(); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.ObjectMeta) *int64 { + return &oldObj.Generation + }) + errs = append(errs, fn(fldPath.Child("generation"), &obj.Generation, oldVal, oldObj != nil)...) + } + + { // field v1.ObjectMeta.CreationTimestamp + fn := func( + fldPath *field.Path, + obj, oldObj *v1.Time, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.ObjectMeta) *v1.Time { + return &oldObj.CreationTimestamp + }) + errs = append(errs, fn(fldPath.Child("creationTimestamp"), &obj.CreationTimestamp, oldVal, oldObj != nil)...) + } + + { // field v1.ObjectMeta.DeletionTimestamp + fn := func( + fldPath *field.Path, + obj, oldObj *v1.Time, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.ObjectMeta) *v1.Time { + return oldObj.DeletionTimestamp + }) + errs = append(errs, fn(fldPath.Child("deletionTimestamp"), obj.DeletionTimestamp, oldVal, oldObj != nil)...) + } + + { // field v1.ObjectMeta.DeletionGracePeriodSeconds + fn := func( + fldPath *field.Path, + obj, oldObj *int64, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalPointer(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if e := validate.Immutable(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.ObjectMeta) *int64 { + return oldObj.DeletionGracePeriodSeconds + }) + errs = append(errs, fn(fldPath.Child("deletionGracePeriodSeconds"), obj.DeletionGracePeriodSeconds, oldVal, oldObj != nil)...) + } + + // field v1.ObjectMeta.Labels has no validation + // field v1.ObjectMeta.Annotations has no validation + + { // field v1.ObjectMeta.OwnerReferences + fn := func( + fldPath *field.Path, + obj, oldObj []v1.OwnerReference, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_OwnerReference); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.ObjectMeta) []v1.OwnerReference { + return oldObj.OwnerReferences + }) + errs = append(errs, fn(fldPath.Child("ownerReferences"), obj.OwnerReferences, oldVal, oldObj != nil)...) + } + + // field v1.ObjectMeta.Finalizers has no validation + + { // field v1.ObjectMeta.ManagedFields + fn := func( + fldPath *field.Path, + obj, oldObj []v1.ManagedFieldsEntry, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if equality.Semantic.DeepEqual(obj, oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.OptionalSlice(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + // iterate the list and call the type's validation function + if e := validate.EachValSliceVal(ctx, op, fldPath, obj, oldObj, nil, nil, Validate_ManagedFieldsEntry); len(e) != 0 { + errs = append(errs, e...) + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.ObjectMeta) []v1.ManagedFieldsEntry { + return oldObj.ManagedFields + }) + errs = append(errs, fn(fldPath.Child("managedFields"), obj.ManagedFields, oldVal, oldObj != nil)...) + } + + return errs +} + +// Validate_OwnerReference validates an instance of OwnerReference according +// to declarative validation rules in the API schema. +func Validate_OwnerReference( + ctx context.Context, op operation.Operation, fldPath *field.Path, + obj, oldObj *v1.OwnerReference) (errs field.ErrorList) { + + { // field v1.OwnerReference.APIVersion + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.OwnerReference) *string { + return &oldObj.APIVersion + }) + errs = append(errs, fn(fldPath.Child("apiVersion"), &obj.APIVersion, oldVal, oldObj != nil)...) + } + + { // field v1.OwnerReference.Kind + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.OwnerReference) *string { + return &oldObj.Kind + }) + errs = append(errs, fn(fldPath.Child("kind"), &obj.Kind, oldVal, oldObj != nil)...) + } + + { // field v1.OwnerReference.Name + fn := func( + fldPath *field.Path, + obj, oldObj *string, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.OwnerReference) *string { + return &oldObj.Name + }) + errs = append(errs, fn(fldPath.Child("name"), &obj.Name, oldVal, oldObj != nil)...) + } + + { // field v1.OwnerReference.UID + fn := func( + fldPath *field.Path, + obj, oldObj *types.UID, + oldValueCorrelated bool) (errs field.ErrorList) { + // don't revalidate unchanged data + if oldValueCorrelated && op.Type == operation.Update { + if obj == oldObj || (obj != nil && oldObj != nil && *obj == *oldObj) { + return nil + } + } + // call field-attached validations + earlyReturn := false + if e := validate.RequiredValue(ctx, op, fldPath, obj, oldObj).MarkAlpha().MarkShortCircuit(); len(e) != 0 { + errs = append(errs, e...) + earlyReturn = true + } + if earlyReturn { + return // do not proceed + } + return + } + oldVal := safe.Field(oldObj, + func(oldObj *v1.OwnerReference) *types.UID { + return &oldObj.UID + }) + errs = append(errs, fn(fldPath.Child("uid"), &obj.UID, oldVal, oldObj != nil)...) + } + + // field v1.OwnerReference.Controller has no validation + // field v1.OwnerReference.BlockOwnerDeletion has no validation + return errs +} diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/types.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/types.go index 68f261cc14..1cda0840ac 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/types.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/types.go @@ -62,7 +62,7 @@ type PartialObjectMetadata = v1.PartialObjectMetadata // PartialObjectMetadataList contains a list of objects containing only their metadata. // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type PartialObjectMetadataList struct { - v1.TypeMeta `json:",inline"` + v1.TypeMeta `json:""` // Standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // +optional diff --git a/vendor/k8s.io/apimachinery/pkg/conversion/queryparams/convert.go b/vendor/k8s.io/apimachinery/pkg/conversion/queryparams/convert.go index b0a9246d97..5eb25e2e80 100644 --- a/vendor/k8s.io/apimachinery/pkg/conversion/queryparams/convert.go +++ b/vendor/k8s.io/apimachinery/pkg/conversion/queryparams/convert.go @@ -34,8 +34,8 @@ type Unmarshaler interface { } func jsonTag(field reflect.StructField) (string, bool) { - structTag := field.Tag.Get("json") - if len(structTag) == 0 { + structTag, exists := field.Tag.Lookup("json") + if !exists || len(structTag) == 0 { return "", false } parts := strings.Split(structTag, ",") diff --git a/vendor/k8s.io/apimachinery/pkg/labels/selector.go b/vendor/k8s.io/apimachinery/pkg/labels/selector.go index 031dcd21be..f31a890f2b 100644 --- a/vendor/k8s.io/apimachinery/pkg/labels/selector.go +++ b/vendor/k8s.io/apimachinery/pkg/labels/selector.go @@ -269,13 +269,15 @@ func (r *Requirement) Matches(ls Labels) bool { } lsValue, err := strconv.ParseInt(val, 10, 64) if err != nil { - klog.V(10).Infof("ParseInt failed for value %+v in label %+v, %+v", val, ls, err) + //nolint:logcheck // Extending the API is not worth it for contextual, structured logging of this. + klog.V(10).InfoS("ParseInt failed", "value", val, "label", ls, "err", err) return false } // There should be only one strValue in r.strValues, and can be converted to an integer. if len(r.strValues) != 1 { - klog.V(10).Infof("Invalid values count %+v of requirement %#v, for 'Gt', 'Lt' operators, exactly one value is required", len(r.strValues), r) + //nolint:logcheck // Extending the API is not worth it for contextual, structured logging of this. + klog.V(10).InfoS("Invalid values count: for 'Gt', 'Lt' operators, exactly one value is required", "count", len(r.strValues), "requirement", r) return false } @@ -283,7 +285,8 @@ func (r *Requirement) Matches(ls Labels) bool { for i := range r.strValues { rValue, err = strconv.ParseInt(r.strValues[i], 10, 64) if err != nil { - klog.V(10).Infof("ParseInt failed for value %+v in requirement %#v, for 'Gt', 'Lt' operators, the value must be an integer", r.strValues[i], r) + //nolint:logcheck // Extending the API is not worth it for contextual, structured logging of this. + klog.V(10).InfoS("ParseInt failed: for 'Gt', 'Lt' operators, the value must be an integer", "value", r.strValues[i], "requirement", r, "err", err) return false } } diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/codec.go b/vendor/k8s.io/apimachinery/pkg/runtime/codec.go index 73f85286c2..654835b3ed 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/codec.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/codec.go @@ -226,6 +226,7 @@ func identifier(e Encoder) Identifier { } identifier, err := json.Marshal(result) if err != nil { + //nolint:logcheck // Should not be reached. klog.Fatalf("Failed marshaling identifier for base64Serializer: %v", err) } return Identifier(identifier) @@ -390,6 +391,7 @@ func (v multiGroupVersioner) Identifier() string { } identifier, err := json.Marshal(result) if err != nil { + //nolint:logcheck // Should not be reached. klog.Fatalf("Failed marshaling Identifier for %#v: %v", v, err) } return string(identifier) diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/conversion.go b/vendor/k8s.io/apimachinery/pkg/runtime/conversion.go index d04d701f37..7cef382de2 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/conversion.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/conversion.go @@ -20,7 +20,6 @@ package runtime import ( "fmt" - "reflect" "strconv" "strings" @@ -41,18 +40,6 @@ func DefaultMetaV1FieldSelectorConversion(label, value string) (string, string, } } -// JSONKeyMapper uses the struct tags on a conversion to determine the key value for -// the other side. Use when mapping from a map[string]* to a struct or vice versa. -func JSONKeyMapper(key string, sourceTag, destTag reflect.StructTag) (string, string) { - if s := destTag.Get("json"); len(s) > 0 { - return strings.SplitN(s, ",", 2)[0], key - } - if s := sourceTag.Get("json"); len(s) > 0 { - return key, strings.SplitN(s, ",", 2)[0] - } - return key, key -} - func Convert_Slice_string_To_string(in *[]string, out *string, s conversion.Scope) error { if len(*in) == 0 { *out = "" diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/converter.go b/vendor/k8s.io/apimachinery/pkg/runtime/converter.go index b1a300959b..5aa118f58f 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/converter.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/converter.go @@ -251,9 +251,11 @@ func (c *unstructuredConverter) FromUnstructuredWithValidation(u map[string]inte newObj := reflect.New(t.Elem()).Interface() newErr := fromUnstructuredViaJSON(u, newObj) if (err != nil) != (newErr != nil) { + //nolint:logcheck // Should not be reached. klog.Fatalf("FromUnstructured unexpected error for %v: error: %v", u, err) } if err == nil && !c.comparison.DeepEqual(obj, newObj) { + //nolint:logcheck // Should not be reached. klog.Fatalf("FromUnstructured mismatch\nobj1: %#v\nobj2: %#v", obj, newObj) } } @@ -376,8 +378,8 @@ func fieldInfoFromField(structType reflect.Type, field int) *fieldInfo { // Cache miss - we need to compute the field name. info := &fieldInfo{} typeField := structType.Field(field) - jsonTag := typeField.Tag.Get("json") - if len(jsonTag) == 0 { + jsonTag, exists := typeField.Tag.Lookup("json") + if !exists || len(jsonTag) == 0 { if !typeField.Anonymous { // match stdlib behavior for naming fields that don't specify a json tag name info.name = typeField.Name @@ -385,7 +387,10 @@ func fieldInfoFromField(structType reflect.Type, field int) *fieldInfo { } else { items := strings.Split(jsonTag, ",") info.name = items[0] - if len(info.name) == 0 && !typeField.Anonymous { + if isInlinedFromTag(typeField, items[0], items[1:]) { + // match stdlib behavior when controlled by tag + info.name = "" + } else if len(info.name) == 0 && !typeField.Anonymous { // match stdlib behavior for naming fields that don't specify a json tag name info.name = typeField.Name } @@ -596,9 +601,11 @@ func (c *unstructuredConverter) ToUnstructured(obj interface{}) (map[string]inte newUnstr := map[string]interface{}{} newErr := toUnstructuredViaJSON(obj, &newUnstr) if (err != nil) != (newErr != nil) { + //nolint:logcheck // Should not be reached. klog.Fatalf("ToUnstructured unexpected error for %v: error: %v; newErr: %v", obj, err, newErr) } if err == nil && !c.comparison.DeepEqual(u, newUnstr) { + //nolint:logcheck // Should not be reached. klog.Fatalf("ToUnstructured mismatch\nobj1: %#v\nobj2: %#v", u, newUnstr) } } @@ -680,11 +687,11 @@ func toUnstructured(sv, dv reflect.Value) error { dv.Set(reflect.ValueOf(sv.Int())) return nil case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - uVal := sv.Uint() - if uVal > math.MaxInt64 { - return fmt.Errorf("unsigned value %d does not fit into int64 (overflow)", uVal) + val, err := uintToUnstructuredHelper(sv.Uint()) + if err != nil { + return err } - dv.Set(reflect.ValueOf(int64(uVal))) + dv.Set(reflect.ValueOf(val)) return nil case reflect.Float32, reflect.Float64: dv.Set(reflect.ValueOf(sv.Float())) @@ -846,7 +853,11 @@ func structToUnstructured(sv, dv reflect.Value) error { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: realMap[fieldInfo.name] = fv.Int() case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - realMap[fieldInfo.name] = fv.Uint() + val, err := uintToUnstructuredHelper(fv.Uint()) + if err != nil { + return err + } + realMap[fieldInfo.name] = val case reflect.Float32, reflect.Float64: realMap[fieldInfo.name] = fv.Float() default: @@ -867,3 +878,10 @@ func interfaceToUnstructured(sv, dv reflect.Value) error { } return toUnstructured(sv.Elem(), dv) } + +func uintToUnstructuredHelper(uVal uint64) (int64, error) { + if uVal > math.MaxInt64 { + return 0, fmt.Errorf("unsigned value %d does not fit into int64 (overflow)", uVal) + } + return int64(uVal), nil +} diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/fieldinfo_126.go b/vendor/k8s.io/apimachinery/pkg/runtime/fieldinfo_126.go new file mode 100644 index 0000000000..686ff6abb3 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/runtime/fieldinfo_126.go @@ -0,0 +1,26 @@ +//go:build !go1.27 + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package runtime + +import "reflect" + +func isInlinedFromTag(fieldType reflect.StructField, tagName string, tagDirectives []string) bool { + // go <1.27 doesn't honor ",inline" + return false +} diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/fieldinfo_127.go b/vendor/k8s.io/apimachinery/pkg/runtime/fieldinfo_127.go new file mode 100644 index 0000000000..abaa79a2db --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/runtime/fieldinfo_127.go @@ -0,0 +1,33 @@ +//go:build go1.27 + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package runtime + +import ( + "reflect" +) + +func isInlinedFromTag(field reflect.StructField, tagName string, tagDirectives []string) bool { + fieldType := field.Type + if fieldType.Kind() == reflect.Pointer && fieldType.Name() == "" { + // optionally unwrap a single level + fieldType = fieldType.Elem() + } + // TODO: when switching to direct use of json/v2, error on non-struct embedding and use of embed with other directives + return fieldType.Kind() == reflect.Struct && tagName == "" && len(tagDirectives) == 1 && tagDirectives[0] == "embed" +} diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/generated.proto b/vendor/k8s.io/apimachinery/pkg/runtime/generated.proto index 5f06cc5743..93d187d94a 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/generated.proto +++ b/vendor/k8s.io/apimachinery/pkg/runtime/generated.proto @@ -33,7 +33,7 @@ option go_package = "k8s.io/apimachinery/pkg/runtime"; // // Internal package: // // type MyAPIObject struct { -// runtime.TypeMeta `json:",inline"` +// runtime.TypeMeta `json:""` // MyPlugin runtime.Object `json:"myPlugin"` // } // @@ -44,7 +44,7 @@ option go_package = "k8s.io/apimachinery/pkg/runtime"; // // External package: // // type MyAPIObject struct { -// runtime.TypeMeta `json:",inline"` +// runtime.TypeMeta `json:""` // MyPlugin runtime.RawExtension `json:"myPlugin"` // } // @@ -85,7 +85,7 @@ message RawExtension { // like this: // // type MyAwesomeAPIObject struct { -// runtime.TypeMeta `json:",inline"` +// runtime.TypeMeta `json:""` // ... // other fields // } // diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/helper.go b/vendor/k8s.io/apimachinery/pkg/runtime/helper.go index 395dfdbd02..242a349865 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/helper.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/helper.go @@ -285,20 +285,26 @@ func (e *encoderWithAllocator) Identifier() Identifier { return e.encoder.Identifier() } +// The legacy discovery endpoint requires that its response Encoder implement Serializer. +// https://github.com/kubernetes/kubernetes/blob/4a1340bfd58fdb3846d4342c101e0bcb574fbfb1/staging/src/k8s.io/apiserver/pkg/endpoints/discovery/util.go#L101-L107 +var _ Serializer = nondeterministicEncoderToEncoderAdapter{} + type nondeterministicEncoderToEncoderAdapter struct { NondeterministicEncoder + + Decoder } func (e nondeterministicEncoderToEncoderAdapter) Encode(obj Object, w io.Writer) error { return e.EncodeNondeterministic(obj, w) } -// UseNondeterministicEncoding returns an Encoder that encodes objects using the provided Encoder's -// EncodeNondeterministic method if it implements NondeterministicEncoder, otherwise it returns the -// provided Encoder as-is. -func UseNondeterministicEncoding(encoder Encoder) Encoder { - if nondeterministic, ok := encoder.(NondeterministicEncoder); ok { - return nondeterministicEncoderToEncoderAdapter{nondeterministic} +// UseNondeterministicEncoding returns an Encoder that encodes objects using the provided +// Serializer's EncodeNondeterministic method if it implements NondeterministicEncoder, otherwise it +// returns the provided Serializer as-is. +func UseNondeterministicEncoding(serializer Serializer) Encoder { + if nondeterministic, ok := serializer.(NondeterministicEncoder); ok { + return nondeterministicEncoderToEncoderAdapter{NondeterministicEncoder: nondeterministic, Decoder: serializer} } - return encoder + return serializer } diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go b/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go index e2fbeabdd0..80662e55c4 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go @@ -370,7 +370,7 @@ func (s *Scheme) AddValidationFunc(srcType Object, fn func(ctx context.Context, // Validate validates the provided Object according to the generated declarative validation code. // WARNING: This does not validate all objects! The handwritten validation code in validation.go // is not run when this is called. Only the generated zz_generated.validations.go validation code is run. -func (s *Scheme) Validate(ctx context.Context, options []string, object Object, subresources ...string) field.ErrorList { +func (s *Scheme) Validate(ctx context.Context, options map[string]bool, object Object, subresources ...string) field.ErrorList { if fn, ok := s.validationFuncs[reflect.TypeOf(object)]; ok { return fn(ctx, operation.Operation{Type: operation.Create, Request: operation.Request{Subresources: subresources}, Options: options}, object, nil) } @@ -380,13 +380,21 @@ func (s *Scheme) Validate(ctx context.Context, options []string, object Object, // ValidateUpdate validates the provided object and oldObject according to the generated declarative validation code. // WARNING: This does not validate all objects! The handwritten validation code in validation.go // is not run when this is called. Only the generated zz_generated.validations.go validation code is run. -func (s *Scheme) ValidateUpdate(ctx context.Context, options []string, object, oldObject Object, subresources ...string) field.ErrorList { +func (s *Scheme) ValidateUpdate(ctx context.Context, options map[string]bool, object, oldObject Object, subresources ...string) field.ErrorList { if fn, ok := s.validationFuncs[reflect.TypeOf(object)]; ok { return fn(ctx, operation.Operation{Type: operation.Update, Request: operation.Request{Subresources: subresources}, Options: options}, object, oldObject) } return nil } +// HasValidationFunc reports whether a validation function is registered for the +// object's type. Unlike Validate, it distinguishes "no function registered" from +// "function ran and found no errors", which both yield a nil error list. +func (s *Scheme) HasValidationFunc(obj Object) bool { + _, ok := s.validationFuncs[reflect.TypeOf(obj)] + return ok +} + // Convert will attempt to convert in into out. Both must be pointers. For easy // testing of conversion functions. Returns an error if the conversion isn't // possible. You can call this with types that haven't been registered (for example, diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/cbor.go b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/cbor.go index 118579ec35..e5730e3c50 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/cbor.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/cbor.go @@ -68,8 +68,9 @@ type Serializer interface { var _ Serializer = &serializer{} type options struct { - strict bool - transcode bool + strict bool + transcode bool + streamingCollectionsEncoding bool } type Option func(*options) @@ -92,6 +93,13 @@ func Transcode(s bool) Option { } } +// StreamingCollectionsEncoding is used for testing purposes only. +func StreamingCollectionsEncoding(s bool) Option { + return func(opts *options) { + opts.streamingCollectionsEncoding = s + } +} + type serializer struct { metaFactory metaFactory creater runtime.ObjectCreater @@ -114,6 +122,7 @@ func newSerializer(metaFactory metaFactory, creater runtime.ObjectCreater, typer typer: typer, } s.options.transcode = true + s.options.streamingCollectionsEncoding = true for _, o := range options { o(&s.options) } @@ -147,15 +156,25 @@ func (s *serializer) EncodeNondeterministic(obj runtime.Object, w io.Writer) err } func (s *serializer) encode(mode modes.EncMode, obj runtime.Object, w io.Writer) error { + if _, err := w.Write(selfDescribedCBOR); err != nil { + return err + } + + if s.options.streamingCollectionsEncoding { + ok, err := streamEncodeCollections(obj, w, mode) + if err != nil { + return err + } + if ok { + return nil + } + } + var v interface{} = obj if u, ok := obj.(runtime.Unstructured); ok { v = u.UnstructuredContent() } - if _, err := w.Write(selfDescribedCBOR); err != nil { - return err - } - return mode.MarshalTo(v, w) } diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/collections.go b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/collections.go new file mode 100644 index 0000000000..5aa0fb7ca4 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/collections.go @@ -0,0 +1,328 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cbor + +import ( + "encoding/json" + "fmt" + "io" + "maps" + "math/rand" + "reflect" + "slices" + "sort" + + "k8s.io/apimachinery/pkg/conversion" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes" + + "github.com/fxamacker/cbor/v2" +) + +func streamEncodeCollections(obj runtime.Object, w io.Writer, mode modes.EncMode) (bool, error) { + list, ok := obj.(*unstructured.UnstructuredList) + if ok { + return true, streamingEncodeUnstructuredList(w, list, mode) + } + if _, ok := obj.(cbor.Marshaler); ok { + return false, nil + } + if _, ok := obj.(json.Marshaler); ok { + return false, nil + } + typeMeta, listMeta, items, err := getListMeta(obj) + if err == nil { + return true, streamingEncodeList(w, typeMeta, listMeta, items, mode) + } + return false, nil +} + +// getListMeta implements list extraction logic for cbor stream serialization. +func getListMeta(list runtime.Object) (metav1.TypeMeta, metav1.ListMeta, []interface{}, error) { + listValue, err := conversion.EnforcePtr(list) + if err != nil { + return metav1.TypeMeta{}, metav1.ListMeta{}, nil, err + } + listType := listValue.Type() + if listType.NumField() != 3 { + return metav1.TypeMeta{}, metav1.ListMeta{}, nil, fmt.Errorf("expected ListType to have 3 fields") + } + // The streaming encoder reproduces the field names and layout implied by the + // json struct tags (kind, apiVersion, metadata, items). The CBOR encoder, + // however, gives a "cbor" struct tag precedence over "json", so a cbor tag on + // any of these fields could rename a key, change its options (e.g. keyasint), + // or un-inline the embedded TypeMeta -- diverging from the streamed output. + // Refuse to stream such a type and fall back to the general encoder, which + // honors the cbor tag correctly. + for i := 0; i < listType.NumField(); i++ { + if _, ok := listType.Field(i).Tag.Lookup("cbor"); ok { + return metav1.TypeMeta{}, metav1.ListMeta{}, nil, fmt.Errorf("expected list field %d to have no cbor tag", i) + } + } + // TypeMeta + typeMeta, ok := listValue.Field(0).Interface().(metav1.TypeMeta) + if !ok { + return metav1.TypeMeta{}, metav1.ListMeta{}, nil, fmt.Errorf("expected TypeMeta field to have TypeMeta type") + } + if !listType.Field(0).Anonymous { + return metav1.TypeMeta{}, metav1.ListMeta{}, nil, fmt.Errorf(`expected TypeMeta json field tag to be embedded`) + } + if jsonTag, jsonTagExists := listType.Field(0).Tag.Lookup("json"); !jsonTagExists { + return metav1.TypeMeta{}, metav1.ListMeta{}, nil, fmt.Errorf(`expected TypeMeta json field tag`) + } else if jsonTag != "" && jsonTag != ",inline" { + return metav1.TypeMeta{}, metav1.ListMeta{}, nil, fmt.Errorf(`expected TypeMeta json field tag to be "" or ",inline"`) + } + // ListMeta + listMeta, ok := listValue.Field(1).Interface().(metav1.ListMeta) + if !ok { + return metav1.TypeMeta{}, metav1.ListMeta{}, nil, fmt.Errorf("expected ListMeta field to have ListMeta type") + } + if listType.Field(1).Tag.Get("json") != "metadata,omitempty" { + return metav1.TypeMeta{}, metav1.ListMeta{}, nil, fmt.Errorf(`expected ListMeta json field tag to be "metadata,omitempty"`) + } + // Items + if listType.Field(2).Tag.Get("json") != "items" { + return metav1.TypeMeta{}, metav1.ListMeta{}, nil, fmt.Errorf(`expected Items json field tag to be "items"`) + } + items, err := getListItems(listValue.Field(2)) + if err != nil { + return metav1.TypeMeta{}, metav1.ListMeta{}, nil, err + } + return typeMeta, listMeta, items, nil +} + +// getListItems returns the elements of a list's Items field as addressable +// values. Marshaling each element directly (rather than routing through +// meta.ExtractList) preserves the element's own type and custom marshaler, so +// that e.g. a metav1.List whose Items are runtime.RawExtension holding CBOR +// bytes are encoded verbatim by runtime.RawExtension.MarshalCBOR instead of +// being flattened into a runtime.Unknown (which has no MarshalCBOR and would be +// misencoded as a struct or fail JSON transcoding). +// +// A nil Items slice returns a nil result, distinct from an empty non-nil slice, +// so the encoder can emit CBOR null rather than an empty array. +func getListItems(itemsValue reflect.Value) ([]interface{}, error) { + if itemsValue.Kind() != reflect.Slice { + return nil, fmt.Errorf("expected Items field to be a slice, got %s", itemsValue.Kind()) + } + if itemsValue.IsNil() { + return nil, nil + } + items := make([]interface{}, itemsValue.Len()) + for i := range items { + items[i] = itemsValue.Index(i).Addr().Interface() + } + return items, nil +} + +type cborMapEntry struct { + key string + write func() error +} + +func streamingEncodeList(w io.Writer, typeMeta metav1.TypeMeta, listMeta metav1.ListMeta, items []interface{}, mode modes.EncMode) error { + var entries []cborMapEntry + + if typeMeta.Kind != "" { + entries = append(entries, cborMapEntry{ + key: "kind", + write: func() error { + return encodeKeyValuePair(w, "kind", typeMeta.Kind, mode) + }, + }) + } + entries = append(entries, cborMapEntry{ + key: "items", + write: func() error { + if err := mode.MarshalTo("items", w); err != nil { + return err + } + if items == nil { + _, err := w.Write([]byte{0xf6}) // CBOR null + return err + } + if err := writeArrayHead(w, len(items)); err != nil { + return err + } + for _, item := range items { + if err := mode.MarshalTo(item, w); err != nil { + return err + } + } + return nil + }, + }) + entries = append(entries, cborMapEntry{ + key: "metadata", + write: func() error { + return encodeKeyValuePair(w, "metadata", listMeta, mode) + }, + }) + if typeMeta.APIVersion != "" { + entries = append(entries, cborMapEntry{ + key: "apiVersion", + write: func() error { + return encodeKeyValuePair(w, "apiVersion", typeMeta.APIVersion, mode) + }, + }) + } + + // entries is built in a fixed order (kind, items, metadata, apiVersion). + // Unlike streamingEncodeUnstructuredList, whose keys come in Go's randomized + // map-iteration order, there is no inherent randomness here, so for + // nondeterministic modes (SortFastShuffle) we rotate the encoding for-loop + // by a random initial offset. + start := 0 + if !mode.IsDeterministic() && len(entries) > 0 { + start = rand.Intn(len(entries)) + } + + if err := writeMapHead(w, len(entries)); err != nil { + return err + } + + for i := 0; i < len(entries); i++ { + entry := entries[(start+i)%len(entries)] + if err := entry.write(); err != nil { + return err + } + } + return nil +} + +func streamingEncodeUnstructuredList(w io.Writer, list *unstructured.UnstructuredList, mode modes.EncMode) error { + keys := slices.Collect(maps.Keys(list.Object)) + if _, exists := list.Object["items"]; !exists { + keys = append(keys, "items") + } + // keys starts in Go's randomized map-iteration order. For deterministic + // modes (SortBytewiseLexical) we sort it: shorter lengths come first, then + // lexicographic by content. For nondeterministic modes (SortFastShuffle) we + // leave the map-iteration order as-is, which already varies from call to + // call (analogous to what SortFastShuffle does for structs), so no explicit + // shuffling is needed. + if mode.IsDeterministic() { + sort.Slice(keys, func(i, j int) bool { + if len(keys[i]) != len(keys[j]) { + return len(keys[i]) < len(keys[j]) + } + return keys[i] < keys[j] + }) + } + + if err := writeMapHead(w, len(keys)); err != nil { + return err + } + + for _, key := range keys { + if err := mode.MarshalTo(key, w); err != nil { + return err + } + if key == "items" { + if err := writeArrayHead(w, len(list.Items)); err != nil { + return err + } + for _, item := range list.Items { + if err := mode.MarshalTo(item.Object, w); err != nil { + return err + } + } + } else { + if err := mode.MarshalTo(list.Object[key], w); err != nil { + return err + } + } + } + return nil +} + +func encodeKeyValuePair(w io.Writer, key string, value interface{}, mode modes.EncMode) error { + if err := mode.MarshalTo(key, w); err != nil { + return err + } + if err := mode.MarshalTo(value, w); err != nil { + return err + } + return nil +} + +// CBOR major type prefix bytes (the type in the high 3 bits, additional info +// zeroed), following RFC 8949 Section 3.1. +const ( + cborTypeArray byte = 0x80 // major type 4 + cborTypeMap byte = 0xa0 // major type 5 +) + +// writeMapHead writes a CBOR map header for a map with n entries. +func writeMapHead(w io.Writer, n int) error { + return writeCollectionHead(w, cborTypeMap, int64(n)) +} + +// writeArrayHead writes a CBOR array header for an array with n elements. +func writeArrayHead(w io.Writer, n int) error { + return writeCollectionHead(w, cborTypeArray, int64(n)) +} + +// writeCollectionHead writes a CBOR collection (array or map) header encoding +// the number of elements n, following RFC 8949 Section 3 additional info rules: +// +// - base: the prefix byte for the collection type. +// For maps: cborTypeMap (0xa0), for arrays: cborTypeArray (0x80). +// +// The extended form prefixes are derived from base using bitwise OR: +// - base|24: 1-byte length follows (additional info 24) +// - base|25: 2-byte length follows (additional info 25) +// - base|26: 4-byte length follows (additional info 26) +// - base|27: 8-byte length follows (additional info 27) +// +// Encoding table (map example, base=0xa0): +// +// n <= 23: 1 byte — 0xa0|n +// n <= 0xFF: 2 bytes — 0xb8 (0xa0|24), n +// n <= 0xFFFF: 3 bytes — 0xb9 (0xa0|25), n>>8, n +// n <= 0xFFFFFFFF: 5 bytes — 0xba (0xa0|26), n>>24..n +// n > 0xFFFFFFFF: 9 bytes — 0xbb (0xa0|27), n>>56..n +func writeCollectionHead(w io.Writer, base byte, n int64) error { + switch { + case n <= 23: + // Additional info 0–23: length is encoded directly in the low 5 bits. + _, err := w.Write([]byte{base + byte(n)}) + return err + case n <= 0xFF: + // Additional info 24: one additional byte carries the length. + _, err := w.Write([]byte{base | 24, byte(n)}) + return err + case n <= 0xFFFF: + // Additional info 25: two additional bytes carry the length (big-endian). + _, err := w.Write([]byte{base | 25, byte(n >> 8), byte(n)}) + return err + case n <= 0xFFFFFFFF: + // Additional info 26: four additional bytes carry the length (big-endian). + _, err := w.Write([]byte{base | 26, byte(n >> 24), byte(n >> 16), byte(n >> 8), byte(n)}) + return err + default: + // Additional info 27: eight additional bytes carry the length (big-endian). + _, err := w.Write([]byte{ + base | 27, byte(n >> 56), byte(n >> 48), byte(n >> 40), byte(n >> 32), byte(n >> 24), byte(n >> 16), + byte(n >> 8), byte(n), + }) + return err + } +} diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/encode.go b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/encode.go index 815dbe6660..3287dfd31c 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/encode.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/encode.go @@ -107,6 +107,7 @@ var encode = EncMode{ } return encode }(), + deterministic: true, } var Encode = EncMode{ @@ -122,6 +123,7 @@ var Encode = EncMode{ } return em }(), + deterministic: true, } var EncodeNondeterministic = EncMode{ @@ -134,16 +136,22 @@ var EncodeNondeterministic = EncMode{ } return em }(), + deterministic: false, } type EncMode struct { - delegate cbor.UserBufferEncMode + delegate cbor.UserBufferEncMode + deterministic bool } func (em EncMode) options() cbor.EncOptions { return em.delegate.EncOptions() } +func (em EncMode) IsDeterministic() bool { + return em.deterministic +} + func (em EncMode) MarshalTo(v interface{}, w io.Writer) error { if buf, ok := w.(*buffer); ok { return em.delegate.MarshalToBuffer(v, &buf.Buffer) diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/collections.go b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/collections.go index 075163ddd8..3fa6012dde 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/collections.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/collections.go @@ -17,11 +17,10 @@ limitations under the License. package json import ( + "bytes" "encoding/json" "fmt" "io" - "maps" - "slices" "sort" "k8s.io/apimachinery/pkg/api/meta" @@ -35,14 +34,14 @@ import ( func streamEncodeCollections(obj runtime.Object, w io.Writer) (bool, error) { list, ok := obj.(*unstructured.UnstructuredList) if ok { - return true, streamingEncodeUnstructuredList(w, list) + return true, newStreamEncoder(w).encodeUnstructuredList(list) } if _, ok := obj.(json.Marshaler); ok { return false, nil } typeMeta, listMeta, items, err := getListMeta(obj) if err == nil { - return true, streamingEncodeList(w, typeMeta, listMeta, items) + return true, newStreamEncoder(w).encodeList(typeMeta, listMeta, items) } return false, nil } @@ -67,8 +66,13 @@ func getListMeta(list runtime.Object) (metav1.TypeMeta, metav1.ListMeta, []runti if !ok { return metav1.TypeMeta{}, metav1.ListMeta{}, nil, fmt.Errorf("expected TypeMeta field to have TypeMeta type") } - if listType.Field(0).Tag.Get("json") != ",inline" { - return metav1.TypeMeta{}, metav1.ListMeta{}, nil, fmt.Errorf(`expected TypeMeta json field tag to be ",inline"`) + if !listType.Field(0).Anonymous { + return metav1.TypeMeta{}, metav1.ListMeta{}, nil, fmt.Errorf(`expected TypeMeta json field tag to be embedded`) + } + if jsonTag, jsonTagExists := listType.Field(0).Tag.Lookup("json"); !jsonTagExists { + return metav1.TypeMeta{}, metav1.ListMeta{}, nil, fmt.Errorf(`expected TypeMeta json field tag`) + } else if jsonTag != "" && jsonTag != ",inline" { + return metav1.TypeMeta{}, metav1.ListMeta{}, nil, fmt.Errorf(`expected TypeMeta json field tag to be "" or ",inline"`) } // ListMeta listMeta, ok := listValue.Field(1).Interface().(metav1.ListMeta) @@ -89,45 +93,59 @@ func getListMeta(list runtime.Object) (metav1.TypeMeta, metav1.ListMeta, []runti return typeMeta, listMeta, items, nil } -func streamingEncodeList(w io.Writer, typeMeta metav1.TypeMeta, listMeta metav1.ListMeta, items []runtime.Object) error { +// streamEncoder encodes JSON values to w, reusing an internal buffer across +// values to avoid the fresh output allocation json.Marshal makes per call. +type streamEncoder struct { + w io.Writer + buf bytes.Buffer + json *json.Encoder +} + +func newStreamEncoder(w io.Writer) *streamEncoder { + e := &streamEncoder{w: w} + e.json = json.NewEncoder(&e.buf) + return e +} + +func (e *streamEncoder) encodeList(typeMeta metav1.TypeMeta, listMeta metav1.ListMeta, items []runtime.Object) error { // Start - if _, err := w.Write([]byte(`{`)); err != nil { + if _, err := e.w.Write([]byte(`{`)); err != nil { return err } // TypeMeta if typeMeta.Kind != "" { - if err := encodeKeyValuePair(w, "kind", typeMeta.Kind, []byte(",")); err != nil { + if err := e.encodeKeyValuePair("kind", typeMeta.Kind, []byte(",")); err != nil { return err } } if typeMeta.APIVersion != "" { - if err := encodeKeyValuePair(w, "apiVersion", typeMeta.APIVersion, []byte(",")); err != nil { + if err := e.encodeKeyValuePair("apiVersion", typeMeta.APIVersion, []byte(",")); err != nil { return err } } // ListMeta - if err := encodeKeyValuePair(w, "metadata", listMeta, []byte(",")); err != nil { + if err := e.encodeKeyValuePair("metadata", listMeta, []byte(",")); err != nil { return err } // Items - if err := encodeItemsObjectSlice(w, items); err != nil { + if err := e.encodeItemsObjectSlice(items); err != nil { return err } // End - _, err := w.Write([]byte("}\n")) + _, err := e.w.Write([]byte("}\n")) return err } -func encodeItemsObjectSlice(w io.Writer, items []runtime.Object) (err error) { +func (e *streamEncoder) encodeItemsObjectSlice(items []runtime.Object) (err error) { if items == nil { - err := encodeKeyValuePair(w, "items", nil, nil) + err := e.encodeKeyValuePair("items", nil, nil) return err } - _, err = w.Write([]byte(`"items":[`)) + _, err = e.w.Write([]byte(`"items":[`)) if err != nil { return err } @@ -136,24 +154,27 @@ func encodeItemsObjectSlice(w io.Writer, items []runtime.Object) (err error) { if i == len(items)-1 { suffix = nil } - err := encodeValue(w, item, suffix) + err := e.encodeValue(item, suffix) if err != nil { return err } } - _, err = w.Write([]byte("]")) + _, err = e.w.Write([]byte("]")) if err != nil { return err } return err } -func streamingEncodeUnstructuredList(w io.Writer, list *unstructured.UnstructuredList) error { - _, err := w.Write([]byte(`{`)) +func (e *streamEncoder) encodeUnstructuredList(list *unstructured.UnstructuredList) error { + _, err := e.w.Write([]byte(`{`)) if err != nil { return err } - keys := slices.Collect(maps.Keys(list.Object)) + keys := make([]string, 0, len(list.Object)+1) + for key := range list.Object { + keys = append(keys, key) + } if _, exists := list.Object["items"]; !exists { keys = append(keys, "items") } @@ -165,20 +186,20 @@ func streamingEncodeUnstructuredList(w io.Writer, list *unstructured.Unstructure suffix = nil } if key == "items" { - err = encodeItemsUnstructuredSlice(w, list.Items, suffix) + err = e.encodeItemsUnstructuredSlice(list.Items, suffix) } else { - err = encodeKeyValuePair(w, key, list.Object[key], suffix) + err = e.encodeKeyValuePair(key, list.Object[key], suffix) } if err != nil { return err } } - _, err = w.Write([]byte("}\n")) + _, err = e.w.Write([]byte("}\n")) return err } -func encodeItemsUnstructuredSlice(w io.Writer, items []unstructured.Unstructured, suffix []byte) (err error) { - _, err = w.Write([]byte(`"items":[`)) +func (e *streamEncoder) encodeItemsUnstructuredSlice(items []unstructured.Unstructured, suffix []byte) (err error) { + _, err = e.w.Write([]byte(`"items":[`)) if err != nil { return err } @@ -187,44 +208,42 @@ func encodeItemsUnstructuredSlice(w io.Writer, items []unstructured.Unstructured if i == len(items)-1 { comma = nil } - err := encodeValue(w, item.Object, comma) + err := e.encodeValue(item.Object, comma) if err != nil { return err } } - _, err = w.Write([]byte("]")) + _, err = e.w.Write([]byte("]")) if err != nil { return err } if len(suffix) > 0 { - _, err = w.Write(suffix) + _, err = e.w.Write(suffix) } return err } -func encodeKeyValuePair(w io.Writer, key string, value any, suffix []byte) (err error) { - err = encodeValue(w, key, []byte(":")) +func (e *streamEncoder) encodeKeyValuePair(key string, value any, suffix []byte) (err error) { + err = e.encodeValue(key, []byte(":")) if err != nil { return err } - err = encodeValue(w, value, suffix) + err = e.encodeValue(value, suffix) if err != nil { return err } return err } -func encodeValue(w io.Writer, value any, suffix []byte) error { - data, err := json.Marshal(value) - if err != nil { - return err - } - _, err = w.Write(data) - if err != nil { +func (e *streamEncoder) encodeValue(value any, suffix []byte) error { + e.buf.Reset() + if err := e.json.Encode(value); err != nil { return err } - if len(suffix) > 0 { - _, err = w.Write(suffix) - } + // Encode appends a newline after the value; replace it with the suffix to + // keep the output identical to json.Marshal's. + e.buf.Truncate(e.buf.Len() - 1) + e.buf.Write(suffix) + _, err := e.w.Write(e.buf.Bytes()) return err } diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go index 24f66a1017..52c814172f 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go @@ -70,6 +70,7 @@ func identifier(options SerializerOptions) runtime.Identifier { } identifier, err := json.Marshal(result) if err != nil { + //nolint:logcheck // Should not be reached. klog.Fatalf("Failed marshaling identifier for json Serializer: %v", err) } return runtime.Identifier(identifier) diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/protobuf/collections.go b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/protobuf/collections.go index afac03e9da..8db8932fbb 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/protobuf/collections.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/protobuf/collections.go @@ -17,6 +17,7 @@ limitations under the License. package protobuf import ( + "encoding/binary" "errors" "io" "math/bits" @@ -134,15 +135,17 @@ func streamingEncodeUnknownList(w io.Writer, unk runtime.Unknown, listData strea } func streamingEncodeList(w io.Writer, listData streamingListData, memAlloc runtime.MemoryAllocator) (size int, err error) { + // headerScratch escapes via w.Write, so allocate it once per call instead of once per item. + headerScratch := make([]byte, 1+binary.MaxVarintLen64) // ListMeta; 0xa = (1 << 3) | 2; field number: 1, type: 2 (LEN). https://protobuf.dev/programming-guides/encoding/#structure - n, err := doEncodeWithHeader(&listData.listMeta, w, 0xa, listData.listMetaSize, memAlloc) + n, err := doEncodeWithHeader(&listData.listMeta, w, 0xa, listData.listMetaSize, headerScratch, memAlloc) size += n if err != nil { return size, err } // Items; 0x12 = (2 << 3) | 2; field number: 2, type: 2 (LEN). https://protobuf.dev/programming-guides/encoding/#structure for i, item := range listData.items { - n, err := doEncodeWithHeader(item, w, 0x12, listData.itemsSizes[i], memAlloc) + n, err := doEncodeWithHeader(item, w, 0x12, listData.itemsSizes[i], headerScratch, memAlloc) size += n if err != nil { return size, err @@ -151,12 +154,6 @@ func streamingEncodeList(w io.Writer, listData streamingListData, memAlloc runti return size, nil } -func writeVarintGenerated(w io.Writer, v int) (int, error) { - buf := make([]byte, sovGenerated(uint64(v))) - encodeVarintGenerated(buf, len(buf), uint64(v)) - return w.Write(buf) -} - // sovGenerated is copied from `generated.pb.go` returns size of varint. func sovGenerated(v uint64) int { return (bits.Len64(v|1) + 6) / 7 diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/protobuf/protobuf.go b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/protobuf/protobuf.go index 67a2d12474..93ad95cef3 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/protobuf/protobuf.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/protobuf/protobuf.go @@ -199,6 +199,7 @@ func (s *Serializer) encode(obj runtime.Object, w io.Writer, memAlloc runtime.Me func (s *Serializer) doEncode(obj runtime.Object, w io.Writer, memAlloc runtime.MemoryAllocator) error { if memAlloc == nil { + //nolint:logcheck // Should not be reached in normal operations. klog.Error("a mandatory memory allocator wasn't provided, this might have a negative impact on performance, check invocations of EncodeWithAllocator method, falling back on runtime.SimpleAllocator") memAlloc = &runtime.SimpleAllocator{} } @@ -470,15 +471,12 @@ func (s *RawSerializer) doEncode(obj runtime.Object, w io.Writer, memAlloc runti return err } -func doEncodeWithHeader(obj any, w io.Writer, field byte, precomputedSize int, memAlloc runtime.MemoryAllocator) (size int, err error) { - // Field identifier - n, err := w.Write([]byte{field}) - size += n - if err != nil { - return size, err - } - // Size - n, err = writeVarintGenerated(w, precomputedSize) +func doEncodeWithHeader(obj any, w io.Writer, field byte, precomputedSize int, headerScratch []byte, memAlloc runtime.MemoryAllocator) (size int, err error) { + // Field identifier and size + header := headerScratch[:1+sovGenerated(uint64(precomputedSize))] + header[0] = field + encodeVarintGenerated(header, len(header), uint64(precomputedSize)) + n, err := w.Write(header) size += n if err != nil { return size, err @@ -500,6 +498,7 @@ func doEncodeWithHeader(obj any, w io.Writer, field byte, precomputedSize int, m // precomputedObjSize should not include header bytes (field identifier, size). func doEncode(obj any, w io.Writer, precomputedObjSize *int, memAlloc runtime.MemoryAllocator) (int, error) { if memAlloc == nil { + //nolint:logcheck // Should not be reached in normal operations. klog.Error("a mandatory memory allocator wasn't provided, this might have a negative impact on performance, check invocations of EncodeWithAllocator method, falling back on runtime.SimpleAllocator") memAlloc = &runtime.SimpleAllocator{} } diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning.go b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning.go index 25f955ed75..6c86d5e15c 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning.go @@ -116,6 +116,7 @@ func identifier(encodeGV runtime.GroupVersioner, encoder runtime.Encoder) runtim } identifier, err := json.Marshal(result) if err != nil { + //nolint:logcheck // Should not be reached. klog.Fatalf("Failed marshaling identifier for codec: %v", err) } identifiersMap.Store(result, runtime.Identifier(identifier)) @@ -222,6 +223,7 @@ func (c *codec) doEncode(obj runtime.Object, w io.Writer, memAlloc runtime.Memor return encoder.EncodeWithAllocator(obj, w, memAlloc) } } else { + //nolint:logcheck // Extending the API is not worth it for contextual, structured logging of this. klog.V(6).Infof("a memory allocator was provided but the encoder %s doesn't implement the runtime.EncoderWithAllocator, using regular encoder.Encode method", c.encoder.Identifier()) } } diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/swagger_doc_generator.go b/vendor/k8s.io/apimachinery/pkg/runtime/swagger_doc_generator.go index 5bc642bc8e..0d5a3e709d 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/swagger_doc_generator.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/swagger_doc_generator.go @@ -25,7 +25,10 @@ import ( "go/token" "io" "reflect" + "strconv" "strings" + + "k8s.io/apimachinery/pkg/util/errors" ) // Pair of strings. We keed the name of fields and the doc @@ -94,23 +97,29 @@ func fmtRawDoc(rawDoc string) string { // fieldName returns the name of the field as it should appear in JSON format // "-" indicates that this field is not part of the JSON representation -func fieldName(field *ast.Field) string { +func fieldName(field *ast.Field) (string, error) { jsonTag := "" if field.Tag != nil { - jsonTag = reflect.StructTag(field.Tag.Value[1 : len(field.Tag.Value)-1]).Get("json") // Delete first and last quotation - if strings.Contains(jsonTag, "inline") { - return "-" + var jsonTagExists bool + tagValue, err := strconv.Unquote(field.Tag.Value) + if err != nil { + return "", err + } + jsonTag, jsonTagExists = reflect.StructTag(tagValue).Lookup("json") // Delete first and last quotation + // field is embedded, json tag is declared and has an empty name + if field.Names == nil && jsonTagExists && (jsonTag == "" || strings.HasPrefix(jsonTag, ",")) { + return "-", nil } } jsonTag = strings.Split(jsonTag, ",")[0] // This can return "-" if jsonTag == "" { if field.Names != nil { - return field.Names[0].Name + return field.Names[0].Name, nil } - return field.Type.(*ast.Ident).Name + return field.Type.(*ast.Ident).Name, nil } - return jsonTag + return jsonTag, nil } // A buffer of lines that will be written. @@ -171,8 +180,9 @@ func writeMapBody(b *buffer, kubeType []Pair, indent int) { // array. Each type is again represented as an array (we have to use arrays as we // need to be sure for the order of the fields). This function returns fields and // struct definitions that have no documentation as {name, ""}. -func ParseDocumentationFrom(src string) []KubeTypes { +func ParseDocumentationFrom(src string) ([]KubeTypes, error) { var docForTypes []KubeTypes + var errs []error pkg := astFrom(src) @@ -182,7 +192,9 @@ func ParseDocumentationFrom(src string) []KubeTypes { ks = append(ks, Pair{kubType.Name, fmtRawDoc(kubType.Doc)}) for _, field := range structType.Fields.List { - if n := fieldName(field); n != "-" { + if n, err := fieldName(field); err != nil { + errs = append(errs, err) + } else if n != "-" { fieldDoc := fmtRawDoc(field.Doc.Text()) ks = append(ks, Pair{n, fieldDoc}) } @@ -191,7 +203,7 @@ func ParseDocumentationFrom(src string) []KubeTypes { } } - return docForTypes + return docForTypes, errors.NewAggregate(errs) } // WriteSwaggerDocFunc writes a declaration of a function as a string. This function is used in diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/types.go b/vendor/k8s.io/apimachinery/pkg/runtime/types.go index ca7b7cc2d4..6cded88997 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/types.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/types.go @@ -23,7 +23,7 @@ package runtime // like this: // // type MyAwesomeAPIObject struct { -// runtime.TypeMeta `json:",inline"` +// runtime.TypeMeta `json:""` // ... // other fields // } // @@ -59,7 +59,7 @@ const ( // // Internal package: // // type MyAPIObject struct { -// runtime.TypeMeta `json:",inline"` +// runtime.TypeMeta `json:""` // MyPlugin runtime.Object `json:"myPlugin"` // } // @@ -70,7 +70,7 @@ const ( // // External package: // // type MyAPIObject struct { -// runtime.TypeMeta `json:",inline"` +// runtime.TypeMeta `json:""` // MyPlugin runtime.RawExtension `json:"myPlugin"` // } // @@ -121,7 +121,7 @@ type RawExtension struct { // +protobuf=true // +k8s:openapi-gen=true type Unknown struct { - TypeMeta `json:",inline" protobuf:"bytes,1,opt,name=typeMeta"` + TypeMeta `json:"" protobuf:"bytes,1,opt,name=typeMeta"` // Raw will hold the complete serialized object which couldn't be matched // with a registered type. Most likely, nothing should be done with this // except for passing it through the system. diff --git a/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go b/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go index f372ae589c..b0ca3803e4 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go +++ b/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go @@ -59,6 +59,7 @@ const ( // Deprecated: use FromInt32 instead. func FromInt(val int) IntOrString { if val > math.MaxInt32 || val < math.MinInt32 { + //nolint:logcheck // Should not be reached. klog.Errorf("value: %d overflows int32\n%s\n", val, debug.Stack()) } return IntOrString{Type: Int, IntVal: int32(val)} diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/fieldmanager.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/fieldmanager.go index ac8d4279d6..2e2db65561 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/fieldmanager.go +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/fieldmanager.go @@ -140,24 +140,28 @@ func (f *FieldManager) Update(liveObj, newObj runtime.Object, manager string) (o } // UpdateNoErrors is the same as Update, but it will not return -// errors. If an error happens, the object is returned with -// managedFields cleared. +// errors. If an error happens, we preserve the managedFields from +// liveObj. func (f *FieldManager) UpdateNoErrors(liveObj, newObj runtime.Object, manager string) runtime.Object { obj, err := f.Update(liveObj, newObj, manager) if err != nil { - atMostEverySecond.Do(func() { - ns, name := "unknown", "unknown" - if accessor, err := meta.Accessor(newObj); err == nil { - ns = accessor.GetNamespace() - name = accessor.GetName() + // Preserve the managedFields from the live object rather than + // stripping them entirely, to avoid silent data loss when the + // managedFields update fails (e.g. due to an unavailable + // conversion webhook). + // Note: meta.Accessor for liveObj and newObj below never return an error in this code branch, + // because if they would f.Update above would return "newObj, nil". Accordingly, the case + // where one of the accessors returns an error is not handled here. + if liveAccessor, aErr := meta.Accessor(liveObj); aErr == nil { + if newAccessor, aErr := meta.Accessor(newObj); aErr == nil { + atMostEverySecond.Do(func() { + //nolint:logcheck // Should not be reached. + klog.ErrorS(err, "[SHOULD NOT HAPPEN] failed to update managedFields (restored previous managedFields from live object)", "versionKind", + newObj.GetObjectKind().GroupVersionKind(), "namespace", newAccessor.GetNamespace(), "name", newAccessor.GetName()) + }) + newAccessor.SetManagedFields(liveAccessor.GetManagedFields()) } - - klog.ErrorS(err, "[SHOULD NOT HAPPEN] failed to update managedFields", "versionKind", - newObj.GetObjectKind().GroupVersionKind(), "namespace", ns, "name", name) - }) - // Explicitly remove managedFields on failure, so that - // we can't have garbage in it. - RemoveObjectManagedFields(newObj) + } return newObj } return obj diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/typeconverter.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/typeconverter.go index cbefc2eba0..40cc90da78 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/typeconverter.go +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/typeconverter.go @@ -109,6 +109,24 @@ func valueToObject(val value.Value) (runtime.Object, error) { } } +// GroupVersionOfTypedValue returns the extracted GroupVersion from the TypeMeta +// fields of a TypedValue, or return false if no TypeMeta fields are found. +func GroupVersionOfTypedValue(object *typed.TypedValue) (schema.GroupVersion, bool) { + val := object.AsValue() + if val == nil || !val.IsMap() { + return schema.GroupVersion{}, false + } + apiVersion, ok := val.AsMap().Get("apiVersion") + if !ok || !apiVersion.IsString() { + return schema.GroupVersion{}, false + } + groupVersion, err := schema.ParseGroupVersion(apiVersion.AsString()) + if err != nil { + return schema.GroupVersion{}, false + } + return groupVersion, true +} + func indexModels( typeParser *typed.Parser, openAPISchemas map[string]*spec.Schema, diff --git a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/versionconverter.go b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/versionconverter.go index 86695e0c0b..917bdcd75f 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/versionconverter.go +++ b/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/versionconverter.go @@ -63,24 +63,23 @@ func newCRDVersionConverter(t TypeConverter, o runtime.ObjectConvertor, h schema // Convert implements sigs.k8s.io/structured-merge-diff/merge.Converter func (v *versionConverter) Convert(object *typed.TypedValue, version fieldpath.APIVersion) (*typed.TypedValue, error) { - // Convert the smd typed value to a kubernetes object. - objectToConvert, err := v.typeConverter.TypedToObject(object) - if err != nil { - return object, err - } - - // Parse the target groupVersion. groupVersion, err := schema.ParseGroupVersion(string(version)) if err != nil { return object, err } // If attempting to convert to the same version as we already have, just return it. - fromVersion := objectToConvert.GetObjectKind().GroupVersionKind().GroupVersion() - if fromVersion == groupVersion { + if typedVersion, ok := GroupVersionOfTypedValue(object); ok && typedVersion == groupVersion { return object, nil } + // Convert the smd typed value to a kubernetes object. + objectToConvert, err := v.typeConverter.TypedToObject(object) + if err != nil { + return object, err + } + fromVersion := objectToConvert.GetObjectKind().GroupVersionKind().GroupVersion() + // Convert to internal internalObject, err := v.objectConvertor.ConvertToVersion(objectToConvert, v.hubGetter(fromVersion)) if err != nil { diff --git a/vendor/k8s.io/apimachinery/pkg/util/validation/field/error_matcher.go b/vendor/k8s.io/apimachinery/pkg/util/validation/field/error_matcher.go index 1eeb71ff53..1a18b27666 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/validation/field/error_matcher.go +++ b/vendor/k8s.io/apimachinery/pkg/util/validation/field/error_matcher.go @@ -46,35 +46,57 @@ type ErrorMatcher struct { requireOriginWhenInvalid bool matchValidationStabilityLevel bool matchSource bool + matchAncestorShortCircuit bool + matchShortCircuit bool // normalizationRules holds the pre-compiled regex patterns for path normalization. normalizationRules []NormalizationRule } +// isChildPath returns true if child is a descendant path of parent. +// It avoids false positives like "spec.containers" being a child of "spec.container" +// by explicitly checking for '.' or '[' path separators. +func isChildPath(parent, child string) bool { + // "" as parent path not supported. It can un-intentionally match with any path. + // theoretically system errors can be matched with any path errors. + if len(parent) == 0 { + return false + } + if len(child) <= len(parent) { + return false + } + if child[:len(parent)] != parent { + return false + } + sep := child[len(parent)] + return sep == '.' || sep == '[' +} + // Matches returns true if the two Error objects match according to the // configured criteria. When field normalization is configured, only the // "got" error's field path is normalized (to bring older API versions up // to the internal/latest format), while "want" is assumed to already be // in the canonical internal API format. func (m ErrorMatcher) Matches(want, got *Error) bool { - if m.matchType && want.Type != got.Type { - return false + gotField := got.Field + if want.Field != gotField { + gotField = m.normalizePath(gotField) } - if m.matchField { - // Try direct match first (common case) - if want.Field != got.Field { - // Fields don't match, try normalization if rules are configured. - // Only normalize "got" - it may be from an older API version that - // needs to be brought up to the internal/latest format that "want" - // is already in. - if want.Field != m.normalizePath(got.Field) { - return false - } + if m.matchAncestorShortCircuit { + if got.ShortCircuit && (isChildPath(gotField, want.Field) || isChildPath(got.Field, want.Field)) { + return true } } + if m.matchType && want.Type != got.Type { + return false + } + if m.matchField && want.Field != gotField { + return false + } if m.matchValue && !reflect.DeepEqual(want.BadValue, got.BadValue) { return false } + if m.matchOrigin { if want.Origin != got.Origin { return false @@ -91,10 +113,12 @@ func (m ErrorMatcher) Matches(want, got *Error) bool { if m.matchValidationStabilityLevel && want.ValidationStabilityLevel != got.ValidationStabilityLevel { return false } - if m.matchSource && want.FromImperative != got.FromImperative { return false } + if m.matchShortCircuit && want.ShortCircuit != got.ShortCircuit { + return false + } return true } @@ -124,47 +148,51 @@ func (m ErrorMatcher) Render(e *Error) string { if m.matchType { comma() - buf.WriteString(fmt.Sprintf("Type=%q", e.Type)) + fmt.Fprintf(&buf, "Type=%q", e.Type) } if m.matchField { comma() if normalized := m.normalizePath(e.Field); normalized != e.Field { - buf.WriteString(fmt.Sprintf("Field=%q (aka %q)", normalized, e.Field)) + fmt.Fprintf(&buf, "Field=%q (aka %q)", normalized, e.Field) } else { - buf.WriteString(fmt.Sprintf("Field=%q", e.Field)) + fmt.Fprintf(&buf, "Field=%q", e.Field) } } if m.matchValue { comma() if s, ok := e.BadValue.(string); ok { - buf.WriteString(fmt.Sprintf("Value=%q", s)) + fmt.Fprintf(&buf, "Value=%q", s) } else { rv := reflect.ValueOf(e.BadValue) if rv.Kind() == reflect.Pointer && !rv.IsNil() { rv = rv.Elem() } if rv.IsValid() && rv.CanInterface() { - buf.WriteString(fmt.Sprintf("Value=%v", rv.Interface())) + fmt.Fprintf(&buf, "Value=%v", rv.Interface()) } else { - buf.WriteString(fmt.Sprintf("Value=%v", e.BadValue)) + fmt.Fprintf(&buf, "Value=%v", e.BadValue) } } } if m.matchOrigin || m.requireOriginWhenInvalid && e.Type == ErrorTypeInvalid { comma() - buf.WriteString(fmt.Sprintf("Origin=%q", e.Origin)) + fmt.Fprintf(&buf, "Origin=%q", e.Origin) } if m.matchDetail != nil { comma() - buf.WriteString(fmt.Sprintf("Detail=%q", e.Detail)) + fmt.Fprintf(&buf, "Detail=%q", e.Detail) } if m.matchValidationStabilityLevel { comma() - buf.WriteString(fmt.Sprintf("ValidationStabilityLevel=%s", e.ValidationStabilityLevel)) + fmt.Fprintf(&buf, "ValidationStabilityLevel=%s", e.ValidationStabilityLevel) } if m.matchSource { comma() - buf.WriteString(fmt.Sprintf("FromImperative=%t", e.FromImperative)) + fmt.Fprintf(&buf, "FromImperative=%t", e.FromImperative) + } + if m.matchShortCircuit { + comma() + fmt.Fprintf(&buf, "ShortCircuit=%t", e.ShortCircuit) } return "{" + buf.String() + "}" } @@ -249,6 +277,18 @@ func (m ErrorMatcher) BySource() ErrorMatcher { return m } +// MatchAncestorShortCircuit returns a derived ErrorMatcher which also matches when the "got" error short-circuited at an ancestor of the "want" error's field path. +func (m ErrorMatcher) MatchAncestorShortCircuit() ErrorMatcher { + m.matchAncestorShortCircuit = true + return m +} + +// MatchShortCircuit returns a derived ErrorMatcher which also matches by the ShortCircuit value. +func (m ErrorMatcher) MatchShortCircuit() ErrorMatcher { + m.matchShortCircuit = true + return m +} + // ByValidationStabilityLevel returns a derived ErrorMatcher which also matches by the validation stability level // value of field errors. func (m ErrorMatcher) ByValidationStabilityLevel() ErrorMatcher { @@ -300,9 +340,13 @@ type TestIntf interface { // "want" error can match multiple "got" errors, and they will all be consumed. // The only exception to this is if the matcher got multiple identical (in every way, // even those not being matched on) errors, which is likely to indicate a bug. +// This doesn't support matchAncestorShortCircuit as it it not needed to be used in the tests. func (m ErrorMatcher) Test(tb TestIntf, want, got ErrorList) { tb.Helper() + if m.matchAncestorShortCircuit { + tb.Errorf("matchAncestorShortCircuit is not supported for test") + } exactly := m.Exactly() // makes a copy // If we ever find an EXACT duplicate error, it's almost certainly a bug diff --git a/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go b/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go index 9357fb306c..0d00acb42d 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go +++ b/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go @@ -59,6 +59,12 @@ type Error struct { // FromImperative denotes these errors are originating from the hand written validations. FromImperative bool + // ShortCircuit denotes that this error prevents further validation of the current field's children. + ShortCircuit bool + + // ShortCircuitedInDeclarative denotes this error is covered by declarative validation. But not returned by declarative validation due to a short circuiting behavior for the current input. + ShortCircuitedInDeclarative bool + // ValidationStabilityLevel denotes the validation stability level of the declarative validation from this error is returned. This should be used in the declarative validations only. ValidationStabilityLevel ValidationStabilityLevel } @@ -545,6 +551,12 @@ func (e *Error) MarkAlpha() *Error { return e } +// MarkShortCircuitedInDV marks that this error is not returned by declarative validations, because DV returns before running the current validation. Handwritten validations still return it. +func (e *Error) MarkShortCircuitedInDV() *Error { + e.ShortCircuitedInDeclarative = true + return e +} + // MarkAlpha marks the errors as alpha validation errors. func (list ErrorList) MarkAlpha() ErrorList { for _, err := range list { @@ -579,6 +591,14 @@ func (list ErrorList) MarkFromImperative() ErrorList { return list } +// MarkShortCircuit marks the errors as short-circuit errors. +func (list ErrorList) MarkShortCircuit() ErrorList { + for _, err := range list { + err.ShortCircuit = true + } + return list +} + // RemoveCoveredByDeclarative returns a new ErrorList containing only the errors that should not be covered by declarative validation. func (list ErrorList) RemoveCoveredByDeclarative() ErrorList { newList := ErrorList{} diff --git a/vendor/k8s.io/apimachinery/pkg/util/validation/ip.go b/vendor/k8s.io/apimachinery/pkg/util/validation/ip.go index 869fb0aad0..95f4e6218f 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/validation/ip.go +++ b/vendor/k8s.io/apimachinery/pkg/util/validation/ip.go @@ -105,6 +105,7 @@ func IsValidIP(fldPath *field.Path, value string) field.ErrorList { func GetWarningsForIP(fldPath *field.Path, value string) []string { ip := netutils.ParseIPSloppy(value) if ip == nil { + //nolint:logcheck // Should not be reached. klog.ErrorS(nil, "GetWarningsForIP called on value that was not validated with IsValidIPForLegacyField", "field", fldPath, "value", value) return nil } @@ -211,6 +212,7 @@ func IsValidCIDR(fldPath *field.Path, value string) field.ErrorList { func GetWarningsForCIDR(fldPath *field.Path, value string) []string { ip, ipnet, err := netutils.ParseCIDRSloppy(value) if err != nil { + //nolint:logcheck // Should not be reached. klog.ErrorS(err, "GetWarningsForCIDR called on value that was not validated with IsValidCIDRForLegacyField", "field", fldPath, "value", value) return nil } diff --git a/vendor/k8s.io/client-go/applyconfigurations/OWNERS b/vendor/k8s.io/client-go/applyconfigurations/OWNERS index de4067fd35..8bea129e9a 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/OWNERS +++ b/vendor/k8s.io/client-go/applyconfigurations/OWNERS @@ -1,6 +1,7 @@ # See the OWNERS docs at https://go.k8s.io/owners approvers: - - apelisse - jpbetz - api-approvers +emeritus_approvers: + - apelisse diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/mutatingadmissionpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/mutatingadmissionpolicy.go index f99f055b3c..ae3d2f1fc2 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/mutatingadmissionpolicy.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/mutatingadmissionpolicy.go @@ -32,7 +32,7 @@ import ( // // MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain. type MutatingAdmissionPolicyApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec defines the desired behavior of the MutatingAdmissionPolicy. diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/mutatingadmissionpolicybinding.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/mutatingadmissionpolicybinding.go index 4bb30baa6f..bea8a4a0f6 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/mutatingadmissionpolicybinding.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/mutatingadmissionpolicybinding.go @@ -42,7 +42,7 @@ import ( // Adding/removing policies, bindings, or params can not affect whether a // given (policy, binding, param) combination is within its own CEL budget. type MutatingAdmissionPolicyBindingApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec defines the desired behavior of the MutatingAdmissionPolicyBinding. diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/mutatingwebhookconfiguration.go index dcb0b81cca..926f15936f 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/mutatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/mutatingwebhookconfiguration.go @@ -32,7 +32,7 @@ import ( // // MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object. type MutatingWebhookConfigurationApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // webhooks is a list of webhooks and the affected resources and operations. diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/namedrulewithoperations.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/namedrulewithoperations.go index 326337c8cc..aaffe6cc1d 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/namedrulewithoperations.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/namedrulewithoperations.go @@ -30,7 +30,7 @@ type NamedRuleWithOperationsApplyConfiguration struct { // resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. ResourceNames []string `json:"resourceNames,omitempty"` // RuleWithOperations is a tuple of Operations and Resources. - RuleWithOperationsApplyConfiguration `json:",inline"` + RuleWithOperationsApplyConfiguration `json:""` } // NamedRuleWithOperationsApplyConfiguration constructs a declarative configuration of the NamedRuleWithOperations type for use with diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/rulewithoperations.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/rulewithoperations.go index 575e1ab35c..6692ef9393 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/rulewithoperations.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/rulewithoperations.go @@ -35,7 +35,7 @@ type RuleWithOperationsApplyConfiguration struct { Operations []admissionregistrationv1.OperationType `json:"operations,omitempty"` // Rule is embedded, it describes other criteria of the rule, like // APIGroups, APIVersions, Resources, etc. - RuleApplyConfiguration `json:",inline"` + RuleApplyConfiguration `json:""` } // RuleWithOperationsApplyConfiguration constructs a declarative configuration of the RuleWithOperations type for use with diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go index 6e06ed3e5f..a007d50570 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go @@ -32,7 +32,7 @@ import ( // // ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it. type ValidatingAdmissionPolicyApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec defines the desired behavior of the ValidatingAdmissionPolicy. diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go index 590aabda81..8fcc72c6db 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go @@ -42,7 +42,7 @@ import ( // Adding/removing policies, bindings, or params can not affect whether a // given (policy, binding, param) combination is within its own CEL budget. type ValidatingAdmissionPolicyBindingApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec defines the desired behavior of the ValidatingAdmissionPolicyBinding. diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingwebhookconfiguration.go index c3ac1fafdd..d668f26def 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1/validatingwebhookconfiguration.go @@ -32,7 +32,7 @@ import ( // // ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it. type ValidatingWebhookConfigurationApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // webhooks is a list of webhooks and the affected resources and operations. diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/mutatingadmissionpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/mutatingadmissionpolicy.go index 678e4d612a..4c0ceff12f 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/mutatingadmissionpolicy.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/mutatingadmissionpolicy.go @@ -32,7 +32,7 @@ import ( // // MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain. type MutatingAdmissionPolicyApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec defines the desired behavior of the MutatingAdmissionPolicy. diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/mutatingadmissionpolicybinding.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/mutatingadmissionpolicybinding.go index 5286ce24c5..1242180907 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/mutatingadmissionpolicybinding.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/mutatingadmissionpolicybinding.go @@ -42,7 +42,7 @@ import ( // Adding/removing policies, bindings, or params can not affect whether a // given (policy, binding, param) combination is within its own CEL budget. type MutatingAdmissionPolicyBindingApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec defines the desired behavior of the MutatingAdmissionPolicyBinding. diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/namedrulewithoperations.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/namedrulewithoperations.go index 45c12f191d..5caf9c5717 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/namedrulewithoperations.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/namedrulewithoperations.go @@ -31,7 +31,7 @@ type NamedRuleWithOperationsApplyConfiguration struct { // resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. ResourceNames []string `json:"resourceNames,omitempty"` // RuleWithOperations is a tuple of Operations and Resources. - v1.RuleWithOperationsApplyConfiguration `json:",inline"` + v1.RuleWithOperationsApplyConfiguration `json:""` } // NamedRuleWithOperationsApplyConfiguration constructs a declarative configuration of the NamedRuleWithOperations type for use with diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicy.go index 9191eaab20..6a591f4d5d 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicy.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicy.go @@ -32,7 +32,7 @@ import ( // // ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it. type ValidatingAdmissionPolicyApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec defines the desired behavior of the ValidatingAdmissionPolicy. diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go index ad61dad084..0db11e2b07 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go @@ -42,7 +42,7 @@ import ( // Adding/removing policies, bindings, or params can not affect whether a // given (policy, binding, param) combination is within its own CEL budget. type ValidatingAdmissionPolicyBindingApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec defines the desired behavior of the ValidatingAdmissionPolicyBinding. diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingadmissionpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingadmissionpolicy.go index 9dbdd7dbd9..64ac2a936c 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingadmissionpolicy.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingadmissionpolicy.go @@ -32,7 +32,7 @@ import ( // // MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain. type MutatingAdmissionPolicyApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec defines the desired behavior of the MutatingAdmissionPolicy. diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingadmissionpolicybinding.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingadmissionpolicybinding.go index 560d1b1469..7aeacf4f42 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingadmissionpolicybinding.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingadmissionpolicybinding.go @@ -42,7 +42,7 @@ import ( // Adding/removing policies, bindings, or params can not affect whether a // given (policy, binding, param) combination is within its own CEL budget. type MutatingAdmissionPolicyBindingApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec defines the desired behavior of the MutatingAdmissionPolicyBinding. diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index 63bce15404..5668e07c89 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -33,7 +33,7 @@ import ( // MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object. // Deprecated in v1.16, planned for removal in v1.19. Use admissionregistration.k8s.io/v1 MutatingWebhookConfiguration instead. type MutatingWebhookConfigurationApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // webhooks is a list of webhooks and the affected resources and operations. diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/namedrulewithoperations.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/namedrulewithoperations.go index 0da66790cc..20a327cccd 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/namedrulewithoperations.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/namedrulewithoperations.go @@ -31,7 +31,7 @@ type NamedRuleWithOperationsApplyConfiguration struct { // resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. ResourceNames []string `json:"resourceNames,omitempty"` // RuleWithOperations is a tuple of Operations and Resources. - v1.RuleWithOperationsApplyConfiguration `json:",inline"` + v1.RuleWithOperationsApplyConfiguration `json:""` } // NamedRuleWithOperationsApplyConfiguration constructs a declarative configuration of the NamedRuleWithOperations type for use with diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicy.go index bc1ad6473a..e727943350 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicy.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicy.go @@ -32,7 +32,7 @@ import ( // // ValidatingAdmissionPolicy describes the definition of an admission validation policy that accepts or rejects an object without changing it. type ValidatingAdmissionPolicyApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec defines the desired behavior of the ValidatingAdmissionPolicy. diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybinding.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybinding.go index fd658f9a45..d202ccb73c 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybinding.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybinding.go @@ -42,7 +42,7 @@ import ( // Adding/removing policies, bindings, or params can not affect whether a // given (policy, binding, param) combination is within its own CEL budget. type ValidatingAdmissionPolicyBindingApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec defines the desired behavior of the ValidatingAdmissionPolicyBinding. diff --git a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingwebhookconfiguration.go index dd53f3b334..cf4440d8ca 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -33,7 +33,7 @@ import ( // ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it. // Deprecated in v1.16, planned for removal in v1.19. Use admissionregistration.k8s.io/v1 ValidatingWebhookConfiguration instead. type ValidatingWebhookConfigurationApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // webhooks is a list of webhooks and the affected resources and operations. diff --git a/vendor/k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1/storageversion.go b/vendor/k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1/storageversion.go index 46b2349b1d..236f0d6652 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1/storageversion.go +++ b/vendor/k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1/storageversion.go @@ -32,7 +32,7 @@ import ( // // Storage version of a specific resource. type StorageVersionApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // metadata is the standard object metadata. // The name is .. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/apps/v1/controllerrevision.go b/vendor/k8s.io/client-go/applyconfigurations/apps/v1/controllerrevision.go index 8a01c0d754..1e4b09060e 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/apps/v1/controllerrevision.go +++ b/vendor/k8s.io/client-go/applyconfigurations/apps/v1/controllerrevision.go @@ -41,7 +41,7 @@ import ( // it may be subject to name and representation changes in future releases, and clients should not // depend on its stability. It is primarily for internal use by controllers. type ControllerRevisionApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/apps/v1/daemonset.go b/vendor/k8s.io/client-go/applyconfigurations/apps/v1/daemonset.go index cc8f33f290..c2c0ded3e4 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/apps/v1/daemonset.go +++ b/vendor/k8s.io/client-go/applyconfigurations/apps/v1/daemonset.go @@ -32,7 +32,7 @@ import ( // // DaemonSet represents the configuration of a daemon set. type DaemonSetApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/apps/v1/deployment.go b/vendor/k8s.io/client-go/applyconfigurations/apps/v1/deployment.go index 771ca0a75b..0fa84e16ef 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/apps/v1/deployment.go +++ b/vendor/k8s.io/client-go/applyconfigurations/apps/v1/deployment.go @@ -32,7 +32,7 @@ import ( // // Deployment enables declarative updates for Pods and ReplicaSets. type DeploymentApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/apps/v1/replicaset.go b/vendor/k8s.io/client-go/applyconfigurations/apps/v1/replicaset.go index 63f11a2183..689ee1e39c 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/apps/v1/replicaset.go +++ b/vendor/k8s.io/client-go/applyconfigurations/apps/v1/replicaset.go @@ -32,7 +32,7 @@ import ( // // ReplicaSet ensures that a specified number of pod replicas are running at any given time. type ReplicaSetApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // If the Labels of a ReplicaSet are empty, they are defaulted to // be the same as the Pod(s) that the ReplicaSet manages. // Standard object's metadata. diff --git a/vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulset.go b/vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulset.go index e3dc204637..b07c565144 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulset.go +++ b/vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulset.go @@ -38,7 +38,7 @@ import ( // The StatefulSet guarantees that a given network identity will always // map to the same storage identity. type StatefulSetApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/controllerrevision.go b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/controllerrevision.go index 6d2fdbefc8..4b3eb6d25a 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/controllerrevision.go +++ b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/controllerrevision.go @@ -43,7 +43,7 @@ import ( // it may be subject to name and representation changes in future releases, and clients should not // depend on its stability. It is primarily for internal use by controllers. type ControllerRevisionApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/deployment.go b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/deployment.go index e8195218ce..66cfa1fe4c 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/deployment.go @@ -34,7 +34,7 @@ import ( // more information. // Deployment enables declarative updates for Pods and ReplicaSets. type DeploymentApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Specification of the desired behavior of the Deployment. diff --git a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulset.go b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulset.go index 361ed68a90..392336c037 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulset.go +++ b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulset.go @@ -40,7 +40,7 @@ import ( // The StatefulSet guarantees that a given network identity will always // map to the same storage identity. type StatefulSetApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Spec defines the desired identities of pods in this set. Spec *StatefulSetSpecApplyConfiguration `json:"spec,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulsetspec.go b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulsetspec.go index 3047440cac..250d4ab5d0 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulsetspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulsetspec.go @@ -36,7 +36,7 @@ type StatefulSetSpecApplyConfiguration struct { // TODO: Consider a rename of this field. Replicas *int32 `json:"replicas,omitempty"` // selector is a label query over pods that should match the replica count. - // If empty, defaulted to labels on the pod template. + // It must match the pod template's labels. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` // template is the object that describes the pod that will be created if diff --git a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/controllerrevision.go b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/controllerrevision.go index 8ffacf61c2..120ebff872 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/controllerrevision.go +++ b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/controllerrevision.go @@ -43,7 +43,7 @@ import ( // it may be subject to name and representation changes in future releases, and clients should not // depend on its stability. It is primarily for internal use by controllers. type ControllerRevisionApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/daemonset.go b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/daemonset.go index 12b6150a3a..f7cdd6e743 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/daemonset.go +++ b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/daemonset.go @@ -34,7 +34,7 @@ import ( // more information. // DaemonSet represents the configuration of a daemon set. type DaemonSetApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/deployment.go b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/deployment.go index 4add5ae257..6d714e1942 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/deployment.go +++ b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/deployment.go @@ -34,7 +34,7 @@ import ( // more information. // Deployment enables declarative updates for Pods and ReplicaSets. type DeploymentApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Specification of the desired behavior of the Deployment. diff --git a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/replicaset.go b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/replicaset.go index ea35da04ce..d34d5db25b 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/replicaset.go +++ b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/replicaset.go @@ -34,7 +34,7 @@ import ( // more information. // ReplicaSet ensures that a specified number of pod replicas are running at any given time. type ReplicaSetApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // If the Labels of a ReplicaSet are empty, they are defaulted to // be the same as the Pod(s) that the ReplicaSet manages. // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata diff --git a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/scale.go b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/scale.go index ca62809fcd..42f5cc553e 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/scale.go +++ b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/scale.go @@ -30,7 +30,7 @@ import ( // // Scale represents a scaling request for a resource. type ScaleApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. diff --git a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulset.go b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulset.go index 5649c11849..fc52c9ccf0 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulset.go +++ b/vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulset.go @@ -40,7 +40,7 @@ import ( // The StatefulSet guarantees that a given network identity will always // map to the same storage identity. type StatefulSetApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Spec defines the desired identities of pods in this set. Spec *StatefulSetSpecApplyConfiguration `json:"spec,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go index f3bd143807..ad35e28842 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go @@ -32,8 +32,8 @@ import ( // // configuration of a horizontal pod autoscaler. type HorizontalPodAutoscalerApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec defines the behaviour of autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. Spec *HorizontalPodAutoscalerSpecApplyConfiguration `json:"spec,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/horizontalpodautoscalerspec.go b/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/horizontalpodautoscalerspec.go index bf58371a9f..e4f0c72e17 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/horizontalpodautoscalerspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/horizontalpodautoscalerspec.go @@ -23,7 +23,7 @@ package v1 // // specification of a horizontal pod autoscaler. type HorizontalPodAutoscalerSpecApplyConfiguration struct { - // reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption + // scaleTargetRef is the reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption // and will set the desired number of pods by using its Scale subresource. ScaleTargetRef *CrossVersionObjectReferenceApplyConfiguration `json:"scaleTargetRef,omitempty"` // minReplicas is the lower limit for the number of replicas to which the autoscaler diff --git a/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/scale.go b/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/scale.go index a491c5ac84..ea605a98b5 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/scale.go +++ b/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v1/scale.go @@ -29,8 +29,8 @@ import ( // // Scale represents a scaling request for a resource. type ScaleApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. Spec *ScaleSpecApplyConfiguration `json:"spec,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/horizontalpodautoscaler.go index e001653fc2..13de61084a 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/horizontalpodautoscaler.go @@ -34,7 +34,7 @@ import ( // autoscaler, which automatically manages the replica count of any resource // implementing the scale subresource based on the metrics specified. type HorizontalPodAutoscalerApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/horizontalpodautoscalercondition.go b/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/horizontalpodautoscalercondition.go index 75bb498524..9d43ddc1bd 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/horizontalpodautoscalercondition.go +++ b/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/horizontalpodautoscalercondition.go @@ -42,6 +42,10 @@ type HorizontalPodAutoscalerConditionApplyConfiguration struct { // message is a human-readable explanation containing details about // the transition Message *string `json:"message,omitempty"` + // observedGeneration represents the .metadata.generation that the condition was set based upon. + // For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + // with respect to the current state of the instance. + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` } // HorizontalPodAutoscalerConditionApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerCondition type for use with @@ -89,3 +93,11 @@ func (b *HorizontalPodAutoscalerConditionApplyConfiguration) WithMessage(value s b.Message = &value return b } + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *HorizontalPodAutoscalerConditionApplyConfiguration) WithObservedGeneration(value int64) *HorizontalPodAutoscalerConditionApplyConfiguration { + b.ObservedGeneration = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/hpascalingrules.go b/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/hpascalingrules.go index cebb11aa6a..ad0556b0a6 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/hpascalingrules.go +++ b/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/hpascalingrules.go @@ -36,8 +36,7 @@ import ( // window is chosen. // // The tolerance is applied to the metric values and prevents scaling too -// eagerly for small metric variations. (Note that setting a tolerance requires -// the beta HPAConfigurableTolerance feature gate to be enabled.) +// eagerly for small metric variations. type HPAScalingRulesApplyConfiguration struct { // stabilizationWindowSeconds is the number of seconds for which past recommendations should be // considered while scaling up or scaling down. @@ -62,9 +61,6 @@ type HPAScalingRulesApplyConfiguration struct { // For example, if autoscaling is configured with a memory consumption target of 100Mi, // and scale-down and scale-up tolerances of 5% and 1% respectively, scaling will be // triggered when the actual consumption falls below 95Mi or exceeds 101Mi. - // - // This is an beta field and requires the HPAConfigurableTolerance feature - // gate to be enabled. Tolerance *resource.Quantity `json:"tolerance,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/metricstatus.go b/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/metricstatus.go index 7c1a2cb0d6..0092a3135f 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/metricstatus.go +++ b/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/metricstatus.go @@ -43,7 +43,7 @@ type MetricStatusApplyConfiguration struct { // Kubernetes, and have special scaling options on top of those available // to normal per-pod metrics using the "pods" source. Resource *ResourceMetricStatusApplyConfiguration `json:"resource,omitempty"` - // container resource refers to a resource metric (such as those specified in + // containerResource refers to a resource metric (such as those specified in // requests and limits) known to Kubernetes describing a single container in each pod in the // current scale target (e.g. CPU or memory). Such metrics are built in to // Kubernetes, and have special scaling options on top of those available diff --git a/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/metricvaluestatus.go b/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/metricvaluestatus.go index 9cd743d3e8..609c6e0248 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/metricvaluestatus.go +++ b/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/metricvaluestatus.go @@ -32,7 +32,7 @@ type MetricValueStatusApplyConfiguration struct { // averageValue is the current value of the average of the // metric across all relevant pods (as a quantity) AverageValue *resource.Quantity `json:"averageValue,omitempty"` - // currentAverageUtilization is the current value of the average of the + // averageUtilization is the current value of the average of the // resource metric across all relevant pods, represented as a percentage of // the requested value of the resource for the pods. AverageUtilization *int32 `json:"averageUtilization,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/objectmetricstatus.go b/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/objectmetricstatus.go index ec5da782a4..dc43e05d9d 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/objectmetricstatus.go +++ b/vendor/k8s.io/client-go/applyconfigurations/autoscaling/v2/objectmetricstatus.go @@ -28,7 +28,7 @@ type ObjectMetricStatusApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` // current contains the current value for the given metric Current *MetricValueStatusApplyConfiguration `json:"current,omitempty"` - // DescribedObject specifies the descriptions of a object,such as kind,name apiVersion + // describedObject specifies the descriptions of a object,such as kind,name apiVersion DescribedObject *CrossVersionObjectReferenceApplyConfiguration `json:"describedObject,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/batch/v1/cronjob.go b/vendor/k8s.io/client-go/applyconfigurations/batch/v1/cronjob.go index 2fbd489633..d6d8f0a8b6 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/batch/v1/cronjob.go +++ b/vendor/k8s.io/client-go/applyconfigurations/batch/v1/cronjob.go @@ -32,7 +32,7 @@ import ( // // CronJob represents the configuration of a single cron job. type CronJobApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/batch/v1/job.go b/vendor/k8s.io/client-go/applyconfigurations/batch/v1/job.go index 02d59f0ec4..42da14b3eb 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/batch/v1/job.go +++ b/vendor/k8s.io/client-go/applyconfigurations/batch/v1/job.go @@ -32,7 +32,7 @@ import ( // // Job represents the configuration of a single job. type JobApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/batch/v1/jobschedulingconfiguration.go b/vendor/k8s.io/client-go/applyconfigurations/batch/v1/jobschedulingconfiguration.go new file mode 100644 index 0000000000..21845d8012 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/batch/v1/jobschedulingconfiguration.go @@ -0,0 +1,98 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1alpha3 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha3" +) + +// JobSchedulingConfigurationApplyConfiguration represents a declarative configuration of the JobSchedulingConfiguration type for use +// with apply. +// +// JobSchedulingConfiguration composes the reusable workload-aware +// scheduling building blocks. +type JobSchedulingConfigurationApplyConfiguration struct { + // SchedulingPolicy defines the scheduling policy for this Job. + // Exactly one of Basic or Gang must be set. + // This field is immutable after creation: the policy may not be added or + // removed. The policy variant (basic/gang) is frozen by hand-written + // validation; only schedulingPolicy.gang.minCount may be changed. + SchedulingPolicy *v1alpha3.WorkloadPodGroupSchedulingPolicyApplyConfiguration `json:"schedulingPolicy,omitempty"` + // SchedulingConstraints defines scheduling constraints (e.g. topology) + // for the Job's pods. + // This field is immutable after creation. + SchedulingConstraints *v1alpha3.WorkloadPodGroupSchedulingConstraintsApplyConfiguration `json:"schedulingConstraints,omitempty"` + // DisruptionMode defines the mode in which the Job's pods can be disrupted. + // One of Single, All. + // This field is immutable after creation: it may not be added or removed, + // and the selected mode may not be changed. + DisruptionMode *v1alpha3.WorkloadPodGroupDisruptionModeApplyConfiguration `json:"disruptionMode,omitempty"` + // ResourceClaims defines which ResourceClaims may be shared among Pods in + // the Job. Pods consume the devices allocated to a PodGroup's claim by + // defining a claim in its own Spec.ResourceClaims that matches the + // PodGroup's claim exactly. The claim must have the same name and refer to + // the same ResourceClaim or ResourceClaimTemplate. + // At most 4 claims may be set, matching the limit on the resulting PodGroup. + // This list is immutable after creation: entries may neither be added, + // removed, nor modified. + ResourceClaims []v1alpha3.WorkloadPodGroupResourceClaimApplyConfiguration `json:"resourceClaims,omitempty"` +} + +// JobSchedulingConfigurationApplyConfiguration constructs a declarative configuration of the JobSchedulingConfiguration type for use with +// apply. +func JobSchedulingConfiguration() *JobSchedulingConfigurationApplyConfiguration { + return &JobSchedulingConfigurationApplyConfiguration{} +} + +// WithSchedulingPolicy sets the SchedulingPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SchedulingPolicy field is set to the value of the last call. +func (b *JobSchedulingConfigurationApplyConfiguration) WithSchedulingPolicy(value *v1alpha3.WorkloadPodGroupSchedulingPolicyApplyConfiguration) *JobSchedulingConfigurationApplyConfiguration { + b.SchedulingPolicy = value + return b +} + +// WithSchedulingConstraints sets the SchedulingConstraints field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SchedulingConstraints field is set to the value of the last call. +func (b *JobSchedulingConfigurationApplyConfiguration) WithSchedulingConstraints(value *v1alpha3.WorkloadPodGroupSchedulingConstraintsApplyConfiguration) *JobSchedulingConfigurationApplyConfiguration { + b.SchedulingConstraints = value + return b +} + +// WithDisruptionMode sets the DisruptionMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DisruptionMode field is set to the value of the last call. +func (b *JobSchedulingConfigurationApplyConfiguration) WithDisruptionMode(value *v1alpha3.WorkloadPodGroupDisruptionModeApplyConfiguration) *JobSchedulingConfigurationApplyConfiguration { + b.DisruptionMode = value + return b +} + +// WithResourceClaims adds the given value to the ResourceClaims field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ResourceClaims field. +func (b *JobSchedulingConfigurationApplyConfiguration) WithResourceClaims(values ...*v1alpha3.WorkloadPodGroupResourceClaimApplyConfiguration) *JobSchedulingConfigurationApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResourceClaims") + } + b.ResourceClaims = append(b.ResourceClaims, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/batch/v1/jobspec.go b/vendor/k8s.io/client-go/applyconfigurations/batch/v1/jobspec.go index 81064df751..ea3d54b062 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/batch/v1/jobspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/batch/v1/jobspec.go @@ -160,6 +160,15 @@ type JobSpecApplyConfiguration struct { // characters as defined by RFC 3986. The value cannot exceed 63 characters. // This field is immutable. ManagedBy *string `json:"managedBy,omitempty"` + // scheduling defines the Workload-aware Scheduling configuration for this Job. + // When set, it specifies the scheduling policy (basic or gang), topology + // constraints, disruption mode, and shared resource claims. + // When omitted, the Job defaults to the basic scheduling policy, which behaves + // as standard pod-by-pod scheduling. + // This field is alpha-level and requires the WorkloadWithJob feature gate. + // This field is immutable, including whether it is set at all, only + // policy.gang.minCount may be changed after creation. + Scheduling *JobSchedulingConfigurationApplyConfiguration `json:"scheduling,omitempty"` } // JobSpecApplyConfiguration constructs a declarative configuration of the JobSpec type for use with @@ -295,3 +304,11 @@ func (b *JobSpecApplyConfiguration) WithManagedBy(value string) *JobSpecApplyCon b.ManagedBy = &value return b } + +// WithScheduling sets the Scheduling field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Scheduling field is set to the value of the last call. +func (b *JobSpecApplyConfiguration) WithScheduling(value *JobSchedulingConfigurationApplyConfiguration) *JobSpecApplyConfiguration { + b.Scheduling = value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/batch/v1/jobstatus.go b/vendor/k8s.io/client-go/applyconfigurations/batch/v1/jobstatus.go index 0e11fd9beb..8260f4b6dd 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/batch/v1/jobstatus.go +++ b/vendor/k8s.io/client-go/applyconfigurations/batch/v1/jobstatus.go @@ -69,9 +69,6 @@ type JobStatusApplyConfiguration struct { Failed *int32 `json:"failed,omitempty"` // The number of pods which are terminating (in phase Pending or Running // and have a deletionTimestamp). - // - // This field is beta-level. The job controller populates the field when - // the feature gate JobPodReplacementPolicy is enabled (enabled by default). Terminating *int32 `json:"terminating,omitempty"` // completedIndexes holds the completed indexes when .spec.completionMode = // "Indexed" in a text format. The indexes are represented as decimal integers diff --git a/vendor/k8s.io/client-go/applyconfigurations/batch/v1beta1/cronjob.go b/vendor/k8s.io/client-go/applyconfigurations/batch/v1beta1/cronjob.go index f0ab32de4d..6b3a33f374 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/batch/v1beta1/cronjob.go +++ b/vendor/k8s.io/client-go/applyconfigurations/batch/v1beta1/cronjob.go @@ -32,7 +32,7 @@ import ( // // CronJob represents the configuration of a single cron job. type CronJobApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/certificatesigningrequest.go b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/certificatesigningrequest.go index 0769c9f2c7..58bfd595c1 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/certificatesigningrequest.go +++ b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/certificatesigningrequest.go @@ -41,7 +41,7 @@ import ( // (with the "kubernetes.io/kube-apiserver-client" signerName), // or to obtain certificates from custom non-Kubernetes signers. type CertificateSigningRequestApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec contains the certificate request, and is immutable after creation. // Only the request, signerName, expirationSeconds, and usages fields can be set on creation. diff --git a/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/clustertrustbundle.go b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/clustertrustbundle.go new file mode 100644 index 0000000000..3879548644 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/clustertrustbundle.go @@ -0,0 +1,288 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + certificatesv1 "k8s.io/api/certificates/v1" + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ClusterTrustBundleApplyConfiguration represents a declarative configuration of the ClusterTrustBundle type for use +// with apply. +// +// ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors +// (root certificates). +// +// ClusterTrustBundle objects are considered to be readable by any authenticated +// user in the cluster, because they can be mounted by pods using the +// `clusterTrustBundle` projection. All service accounts have read access to +// ClusterTrustBundles by default. Users who only have namespace-level access +// to a cluster can read ClusterTrustBundles by impersonating a serviceaccount +// that they have access to. +// +// It can be optionally associated with a particular signer, in which case it +// contains one valid set of trust anchors for that signer. Signers may have +// multiple associated ClusterTrustBundles; each is an independent set of trust +// anchors for that signer. Admission control is used to enforce that only users +// with permissions on the signer can create or modify the corresponding bundle. +type ClusterTrustBundleApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:""` + // metadata contains the object metadata. + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec contains the signer (if any) and trust anchors. + Spec *ClusterTrustBundleSpecApplyConfiguration `json:"spec,omitempty"` +} + +// ClusterTrustBundle constructs a declarative configuration of the ClusterTrustBundle type for use with +// apply. +func ClusterTrustBundle(name string) *ClusterTrustBundleApplyConfiguration { + b := &ClusterTrustBundleApplyConfiguration{} + b.WithName(name) + b.WithKind("ClusterTrustBundle") + b.WithAPIVersion("certificates.k8s.io/v1") + return b +} + +// ExtractClusterTrustBundleFrom extracts the applied configuration owned by fieldManager from +// clusterTrustBundle for the specified subresource. Pass an empty string for subresource to extract +// the main resource. Common subresources include "status", "scale", etc. +// clusterTrustBundle must be a unmodified ClusterTrustBundle API object that was retrieved from the Kubernetes API. +// ExtractClusterTrustBundleFrom provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractClusterTrustBundleFrom(clusterTrustBundle *certificatesv1.ClusterTrustBundle, fieldManager string, subresource string) (*ClusterTrustBundleApplyConfiguration, error) { + b := &ClusterTrustBundleApplyConfiguration{} + err := managedfields.ExtractInto(clusterTrustBundle, internal.Parser().Type("io.k8s.api.certificates.v1.ClusterTrustBundle"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(clusterTrustBundle.Name) + + b.WithKind("ClusterTrustBundle") + b.WithAPIVersion("certificates.k8s.io/v1") + return b, nil +} + +// ExtractClusterTrustBundle extracts the applied configuration owned by fieldManager from +// clusterTrustBundle. If no managedFields are found in clusterTrustBundle for fieldManager, a +// ClusterTrustBundleApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// clusterTrustBundle must be a unmodified ClusterTrustBundle API object that was retrieved from the Kubernetes API. +// ExtractClusterTrustBundle provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractClusterTrustBundle(clusterTrustBundle *certificatesv1.ClusterTrustBundle, fieldManager string) (*ClusterTrustBundleApplyConfiguration, error) { + return ExtractClusterTrustBundleFrom(clusterTrustBundle, fieldManager, "") +} + +func (b ClusterTrustBundleApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithKind(value string) *ClusterTrustBundleApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithAPIVersion(value string) *ClusterTrustBundleApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithName(value string) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithGenerateName(value string) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithNamespace(value string) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithUID(value types.UID) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithResourceVersion(value string) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithGeneration(value int64) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ClusterTrustBundleApplyConfiguration) WithLabels(entries map[string]string) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ClusterTrustBundleApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ClusterTrustBundleApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ClusterTrustBundleApplyConfiguration) WithFinalizers(values ...string) *ClusterTrustBundleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ClusterTrustBundleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ClusterTrustBundleApplyConfiguration) WithSpec(value *ClusterTrustBundleSpecApplyConfiguration) *ClusterTrustBundleApplyConfiguration { + b.Spec = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ClusterTrustBundleApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ClusterTrustBundleApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ClusterTrustBundleApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ClusterTrustBundleApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/clustertrustbundlespec.go b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/clustertrustbundlespec.go new file mode 100644 index 0000000000..5b7bb10384 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/clustertrustbundlespec.go @@ -0,0 +1,79 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ClusterTrustBundleSpecApplyConfiguration represents a declarative configuration of the ClusterTrustBundleSpec type for use +// with apply. +// +// ClusterTrustBundleSpec contains the signer and trust anchors. +type ClusterTrustBundleSpecApplyConfiguration struct { + // signerName indicates the associated signer, if any. + // + // In order to create or update a ClusterTrustBundle that sets signerName, + // you must have the following cluster-scoped permission: + // group=certificates.k8s.io resource=signers resourceName= + // verb=attest. + // + // If signerName is not empty, then the ClusterTrustBundle object must be + // named with the signer name as a prefix (translating slashes to colons). + // For example, for the signer name `example.com/foo`, valid + // ClusterTrustBundle object names include `example.com:foo:abc` and + // `example.com:foo:v1`. + // + // If signerName is empty, then the ClusterTrustBundle object's name must + // not have such a prefix. + // + // List/watch requests for ClusterTrustBundles can filter on this field + // using a `spec.signerName=NAME` field selector. + SignerName *string `json:"signerName,omitempty"` + // trustBundle contains the individual X.509 trust anchors for this + // bundle, as PEM bundle of PEM-wrapped, DER-formatted X.509 certificates. + // + // The data must consist only of PEM certificate blocks that parse as valid + // X.509 certificates. Each certificate must include a basic constraints + // extension with the CA bit set. The API server will reject objects that + // contain duplicate certificates, or that use PEM block headers. + // + // Users of ClusterTrustBundles, including Kubelet, are free to reorder and + // deduplicate certificate blocks in this file according to their own logic, + // as well as to drop PEM block headers and inter-block data. + TrustBundle *string `json:"trustBundle,omitempty"` +} + +// ClusterTrustBundleSpecApplyConfiguration constructs a declarative configuration of the ClusterTrustBundleSpec type for use with +// apply. +func ClusterTrustBundleSpec() *ClusterTrustBundleSpecApplyConfiguration { + return &ClusterTrustBundleSpecApplyConfiguration{} +} + +// WithSignerName sets the SignerName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SignerName field is set to the value of the last call. +func (b *ClusterTrustBundleSpecApplyConfiguration) WithSignerName(value string) *ClusterTrustBundleSpecApplyConfiguration { + b.SignerName = &value + return b +} + +// WithTrustBundle sets the TrustBundle field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TrustBundle field is set to the value of the last call. +func (b *ClusterTrustBundleSpecApplyConfiguration) WithTrustBundle(value string) *ClusterTrustBundleSpecApplyConfiguration { + b.TrustBundle = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/podcertificaterequest.go b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/podcertificaterequest.go new file mode 100644 index 0000000000..41ecc78d80 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/podcertificaterequest.go @@ -0,0 +1,295 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + certificatesv1 "k8s.io/api/certificates/v1" + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// PodCertificateRequestApplyConfiguration represents a declarative configuration of the PodCertificateRequest type for use +// with apply. +// +// PodCertificateRequest encodes a pod requesting a certificate from a given +// signer. +// +// Kubelets use this API to implement podCertificate projected volumes +type PodCertificateRequestApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:""` + // metadata contains the object metadata. + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec contains the details about the certificate being requested. + Spec *PodCertificateRequestSpecApplyConfiguration `json:"spec,omitempty"` + // status contains the issued certificate, and a standard set of conditions. + Status *PodCertificateRequestStatusApplyConfiguration `json:"status,omitempty"` +} + +// PodCertificateRequest constructs a declarative configuration of the PodCertificateRequest type for use with +// apply. +func PodCertificateRequest(name, namespace string) *PodCertificateRequestApplyConfiguration { + b := &PodCertificateRequestApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("PodCertificateRequest") + b.WithAPIVersion("certificates.k8s.io/v1") + return b +} + +// ExtractPodCertificateRequestFrom extracts the applied configuration owned by fieldManager from +// podCertificateRequest for the specified subresource. Pass an empty string for subresource to extract +// the main resource. Common subresources include "status", "scale", etc. +// podCertificateRequest must be a unmodified PodCertificateRequest API object that was retrieved from the Kubernetes API. +// ExtractPodCertificateRequestFrom provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractPodCertificateRequestFrom(podCertificateRequest *certificatesv1.PodCertificateRequest, fieldManager string, subresource string) (*PodCertificateRequestApplyConfiguration, error) { + b := &PodCertificateRequestApplyConfiguration{} + err := managedfields.ExtractInto(podCertificateRequest, internal.Parser().Type("io.k8s.api.certificates.v1.PodCertificateRequest"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(podCertificateRequest.Name) + b.WithNamespace(podCertificateRequest.Namespace) + + b.WithKind("PodCertificateRequest") + b.WithAPIVersion("certificates.k8s.io/v1") + return b, nil +} + +// ExtractPodCertificateRequest extracts the applied configuration owned by fieldManager from +// podCertificateRequest. If no managedFields are found in podCertificateRequest for fieldManager, a +// PodCertificateRequestApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// podCertificateRequest must be a unmodified PodCertificateRequest API object that was retrieved from the Kubernetes API. +// ExtractPodCertificateRequest provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractPodCertificateRequest(podCertificateRequest *certificatesv1.PodCertificateRequest, fieldManager string) (*PodCertificateRequestApplyConfiguration, error) { + return ExtractPodCertificateRequestFrom(podCertificateRequest, fieldManager, "") +} + +// ExtractPodCertificateRequestStatus extracts the applied configuration owned by fieldManager from +// podCertificateRequest for the status subresource. +func ExtractPodCertificateRequestStatus(podCertificateRequest *certificatesv1.PodCertificateRequest, fieldManager string) (*PodCertificateRequestApplyConfiguration, error) { + return ExtractPodCertificateRequestFrom(podCertificateRequest, fieldManager, "status") +} + +func (b PodCertificateRequestApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *PodCertificateRequestApplyConfiguration) WithKind(value string) *PodCertificateRequestApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *PodCertificateRequestApplyConfiguration) WithAPIVersion(value string) *PodCertificateRequestApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PodCertificateRequestApplyConfiguration) WithName(value string) *PodCertificateRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *PodCertificateRequestApplyConfiguration) WithGenerateName(value string) *PodCertificateRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *PodCertificateRequestApplyConfiguration) WithNamespace(value string) *PodCertificateRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *PodCertificateRequestApplyConfiguration) WithUID(value types.UID) *PodCertificateRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *PodCertificateRequestApplyConfiguration) WithResourceVersion(value string) *PodCertificateRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *PodCertificateRequestApplyConfiguration) WithGeneration(value int64) *PodCertificateRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *PodCertificateRequestApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *PodCertificateRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *PodCertificateRequestApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *PodCertificateRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *PodCertificateRequestApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PodCertificateRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *PodCertificateRequestApplyConfiguration) WithLabels(entries map[string]string) *PodCertificateRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *PodCertificateRequestApplyConfiguration) WithAnnotations(entries map[string]string) *PodCertificateRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *PodCertificateRequestApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *PodCertificateRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *PodCertificateRequestApplyConfiguration) WithFinalizers(values ...string) *PodCertificateRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *PodCertificateRequestApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *PodCertificateRequestApplyConfiguration) WithSpec(value *PodCertificateRequestSpecApplyConfiguration) *PodCertificateRequestApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *PodCertificateRequestApplyConfiguration) WithStatus(value *PodCertificateRequestStatusApplyConfiguration) *PodCertificateRequestApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *PodCertificateRequestApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *PodCertificateRequestApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PodCertificateRequestApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *PodCertificateRequestApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/podcertificaterequestspec.go b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/podcertificaterequestspec.go new file mode 100644 index 0000000000..a952f16523 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/podcertificaterequestspec.go @@ -0,0 +1,189 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + types "k8s.io/apimachinery/pkg/types" +) + +// PodCertificateRequestSpecApplyConfiguration represents a declarative configuration of the PodCertificateRequestSpec type for use +// with apply. +// +// PodCertificateRequestSpec describes the certificate request. All fields are +// immutable after creation. +type PodCertificateRequestSpecApplyConfiguration struct { + // signerName indicates the requested signer. + // + // All signer names beginning with `kubernetes.io` are reserved for use by + // the Kubernetes project. There is currently one well-known signer + // documented by the Kubernetes project, + // `kubernetes.io/kube-apiserver-client-pod`, which will issue client + // certificates understood by kube-apiserver. It is currently + // unimplemented. + SignerName *string `json:"signerName,omitempty"` + // podName is the name of the pod into which the certificate will be mounted. + PodName *string `json:"podName,omitempty"` + // podUID is the UID of the pod into which the certificate will be mounted. + PodUID *types.UID `json:"podUID,omitempty"` + // serviceAccountName is the name of the service account the pod is running as. + ServiceAccountName *string `json:"serviceAccountName,omitempty"` + // serviceAccountUID is the UID of the service account the pod is running as. + ServiceAccountUID *types.UID `json:"serviceAccountUID,omitempty"` + // nodeName is the name of the node the pod is assigned to. + NodeName *types.NodeName `json:"nodeName,omitempty"` + // nodeUID is the UID of the node the pod is assigned to. + NodeUID *types.UID `json:"nodeUID,omitempty"` + // maxExpirationSeconds is the maximum lifetime permitted for the + // certificate. + // + // If omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver + // will reject values shorter than 3600 (1 hour). The maximum allowable + // value is 7862400 (91 days). + // + // The signer implementation is then free to issue a certificate with any + // lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600 + // seconds (1 hour). This constraint is enforced by kube-apiserver. + // `kubernetes.io` signers will never issue certificates with a lifetime + // longer than 24 hours. + MaxExpirationSeconds *int32 `json:"maxExpirationSeconds,omitempty"` + // A PKCS#10 certificate signing request (DER-serialized) generated by + // Kubelet using the subject private key. + // + // Most signer implementations will ignore the contents of the CSR except to + // extract the subject public key. The API server automatically verifies the + // CSR signature during admission, so the signer does not need to repeat the + // verification. CSRs generated by kubelet are completely empty. + // + // The subject public key must be one of RSA3072, RSA4096, ECDSAP256, + // ECDSAP384, ECDSAP521, or ED25519. Note that this list may be expanded in + // the future. + // + // Signer implementations do not need to support all key types supported by + // kube-apiserver and kubelet. If a signer does not support the key type + // used for a given PodCertificateRequest, it must deny the request by + // setting a status.conditions entry with a type of "Denied" and a reason of + // "UnsupportedKeyType". It may also suggest a key type that it does support + // in the message field. + StubPKCS10Request []byte `json:"stubPKCS10Request,omitempty"` + // unverifiedUserAnnotations allow pod authors to pass additional information to + // the signer implementation. Kubernetes does not restrict or validate this + // metadata in any way. + // + // Entries are subject to the same validation as object metadata annotations, + // with the addition that all keys must be domain-prefixed. No restrictions + // are placed on values, except an overall size limitation on the entire field. + // + // Signers should document the keys and values they support. Signers should + // deny requests that contain keys they do not recognize. + UnverifiedUserAnnotations map[string]string `json:"unverifiedUserAnnotations,omitempty"` +} + +// PodCertificateRequestSpecApplyConfiguration constructs a declarative configuration of the PodCertificateRequestSpec type for use with +// apply. +func PodCertificateRequestSpec() *PodCertificateRequestSpecApplyConfiguration { + return &PodCertificateRequestSpecApplyConfiguration{} +} + +// WithSignerName sets the SignerName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SignerName field is set to the value of the last call. +func (b *PodCertificateRequestSpecApplyConfiguration) WithSignerName(value string) *PodCertificateRequestSpecApplyConfiguration { + b.SignerName = &value + return b +} + +// WithPodName sets the PodName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodName field is set to the value of the last call. +func (b *PodCertificateRequestSpecApplyConfiguration) WithPodName(value string) *PodCertificateRequestSpecApplyConfiguration { + b.PodName = &value + return b +} + +// WithPodUID sets the PodUID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodUID field is set to the value of the last call. +func (b *PodCertificateRequestSpecApplyConfiguration) WithPodUID(value types.UID) *PodCertificateRequestSpecApplyConfiguration { + b.PodUID = &value + return b +} + +// WithServiceAccountName sets the ServiceAccountName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServiceAccountName field is set to the value of the last call. +func (b *PodCertificateRequestSpecApplyConfiguration) WithServiceAccountName(value string) *PodCertificateRequestSpecApplyConfiguration { + b.ServiceAccountName = &value + return b +} + +// WithServiceAccountUID sets the ServiceAccountUID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServiceAccountUID field is set to the value of the last call. +func (b *PodCertificateRequestSpecApplyConfiguration) WithServiceAccountUID(value types.UID) *PodCertificateRequestSpecApplyConfiguration { + b.ServiceAccountUID = &value + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *PodCertificateRequestSpecApplyConfiguration) WithNodeName(value types.NodeName) *PodCertificateRequestSpecApplyConfiguration { + b.NodeName = &value + return b +} + +// WithNodeUID sets the NodeUID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeUID field is set to the value of the last call. +func (b *PodCertificateRequestSpecApplyConfiguration) WithNodeUID(value types.UID) *PodCertificateRequestSpecApplyConfiguration { + b.NodeUID = &value + return b +} + +// WithMaxExpirationSeconds sets the MaxExpirationSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxExpirationSeconds field is set to the value of the last call. +func (b *PodCertificateRequestSpecApplyConfiguration) WithMaxExpirationSeconds(value int32) *PodCertificateRequestSpecApplyConfiguration { + b.MaxExpirationSeconds = &value + return b +} + +// WithStubPKCS10Request adds the given value to the StubPKCS10Request field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the StubPKCS10Request field. +func (b *PodCertificateRequestSpecApplyConfiguration) WithStubPKCS10Request(values ...byte) *PodCertificateRequestSpecApplyConfiguration { + for i := range values { + b.StubPKCS10Request = append(b.StubPKCS10Request, values[i]) + } + return b +} + +// WithUnverifiedUserAnnotations puts the entries into the UnverifiedUserAnnotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the UnverifiedUserAnnotations field, +// overwriting an existing map entries in UnverifiedUserAnnotations field with the same key. +func (b *PodCertificateRequestSpecApplyConfiguration) WithUnverifiedUserAnnotations(entries map[string]string) *PodCertificateRequestSpecApplyConfiguration { + if b.UnverifiedUserAnnotations == nil && len(entries) > 0 { + b.UnverifiedUserAnnotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.UnverifiedUserAnnotations[k] = v + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/podcertificaterequeststatus.go b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/podcertificaterequeststatus.go new file mode 100644 index 0000000000..e10dd930a0 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1/podcertificaterequeststatus.go @@ -0,0 +1,133 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// PodCertificateRequestStatusApplyConfiguration represents a declarative configuration of the PodCertificateRequestStatus type for use +// with apply. +// +// PodCertificateRequestStatus describes the status of the request, and holds +// the certificate data if the request is issued. +type PodCertificateRequestStatusApplyConfiguration struct { + // conditions applied to the request. + // + // The types "Issued", "Denied", and "Failed" have special handling. At + // most one of these conditions may be present, and they must have status + // "True". + // + // If the request is denied with `Reason=UnsupportedKeyType`, the signer may + // suggest a key type that will work in the message field. + Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` + // certificateChain is populated with an issued certificate by the signer. + // This field is set via the /status subresource. Once populated, this field + // is immutable. + // + // If the certificate signing request is denied, a condition of type + // "Denied" is added and this field remains empty. If the signer cannot + // issue the certificate, a condition of type "Failed" is added and this + // field remains empty. + // + // Validation requirements: + // 1. certificateChain must consist of one or more PEM-formatted certificates. + // 2. Each entry must be a valid PEM-wrapped, DER-encoded ASN.1 Certificate as + // described in section 4 of RFC5280. + // + // If more than one block is present, and the definition of the requested + // spec.signerName does not indicate otherwise, the first block is the + // issued certificate, and subsequent blocks should be treated as + // intermediate certificates and presented in TLS handshakes. When + // projecting the chain into a pod volume, kubelet will drop any data + // in-between the PEM blocks, as well as any PEM block headers. + CertificateChain *string `json:"certificateChain,omitempty"` + // notBefore is the time at which the certificate becomes valid. The value + // must be the same as the notBefore value in the leaf certificate in + // certificateChain. This field is set via the /status subresource. Once + // populated, it is immutable. The signer must set this field at the same + // time it sets certificateChain. + NotBefore *apismetav1.Time `json:"notBefore,omitempty"` + // beginRefreshAt is the time at which the kubelet should begin trying to + // refresh the certificate. This field is set via the /status subresource, + // and must be set at the same time as certificateChain. Once populated, + // this field is immutable. + // + // This field is only a hint. Kubelet may start refreshing before or after + // this time if necessary. + BeginRefreshAt *apismetav1.Time `json:"beginRefreshAt,omitempty"` + // notAfter is the time at which the certificate expires. The value must be + // the same as the notAfter value in the leaf certificate in + // certificateChain. This field is set via the /status subresource. Once + // populated, it is immutable. The signer must set this field at the same + // time it sets certificateChain. + NotAfter *apismetav1.Time `json:"notAfter,omitempty"` +} + +// PodCertificateRequestStatusApplyConfiguration constructs a declarative configuration of the PodCertificateRequestStatus type for use with +// apply. +func PodCertificateRequestStatus() *PodCertificateRequestStatusApplyConfiguration { + return &PodCertificateRequestStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *PodCertificateRequestStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *PodCertificateRequestStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithCertificateChain sets the CertificateChain field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CertificateChain field is set to the value of the last call. +func (b *PodCertificateRequestStatusApplyConfiguration) WithCertificateChain(value string) *PodCertificateRequestStatusApplyConfiguration { + b.CertificateChain = &value + return b +} + +// WithNotBefore sets the NotBefore field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NotBefore field is set to the value of the last call. +func (b *PodCertificateRequestStatusApplyConfiguration) WithNotBefore(value apismetav1.Time) *PodCertificateRequestStatusApplyConfiguration { + b.NotBefore = &value + return b +} + +// WithBeginRefreshAt sets the BeginRefreshAt field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BeginRefreshAt field is set to the value of the last call. +func (b *PodCertificateRequestStatusApplyConfiguration) WithBeginRefreshAt(value apismetav1.Time) *PodCertificateRequestStatusApplyConfiguration { + b.BeginRefreshAt = &value + return b +} + +// WithNotAfter sets the NotAfter field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NotAfter field is set to the value of the last call. +func (b *PodCertificateRequestStatusApplyConfiguration) WithNotAfter(value apismetav1.Time) *PodCertificateRequestStatusApplyConfiguration { + b.NotAfter = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/certificates/v1alpha1/clustertrustbundle.go b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1alpha1/clustertrustbundle.go index 9c26cdb915..7fdaae5b01 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/certificates/v1alpha1/clustertrustbundle.go +++ b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1alpha1/clustertrustbundle.go @@ -40,13 +40,13 @@ import ( // to a cluster can read ClusterTrustBundles by impersonating a serviceaccount // that they have access to. // -// It can be optionally associated with a particular assigner, in which case it +// It can be optionally associated with a particular signer, in which case it // contains one valid set of trust anchors for that signer. Signers may have // multiple associated ClusterTrustBundles; each is an independent set of trust // anchors for that signer. Admission control is used to enforce that only users // with permissions on the signer can create or modify the corresponding bundle. type ClusterTrustBundleApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // metadata contains the object metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec contains the signer (if any) and trust anchors. diff --git a/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/certificatesigningrequest.go b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/certificatesigningrequest.go index 05e16d2054..256e0f5045 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/certificatesigningrequest.go +++ b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/certificatesigningrequest.go @@ -32,7 +32,7 @@ import ( // // Describes a certificate signing request type CertificateSigningRequestApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec contains the certificate request, and is immutable after creation. // Only the request, signerName, expirationSeconds, and usages fields can be set on creation. diff --git a/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/clustertrustbundle.go b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/clustertrustbundle.go index 7f8be00ce4..5c70207c6a 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/clustertrustbundle.go +++ b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/clustertrustbundle.go @@ -40,13 +40,13 @@ import ( // to a cluster can read ClusterTrustBundles by impersonating a serviceaccount // that they have access to. // -// It can be optionally associated with a particular assigner, in which case it +// It can be optionally associated with a particular signer, in which case it // contains one valid set of trust anchors for that signer. Signers may have // multiple associated ClusterTrustBundles; each is an independent set of trust // anchors for that signer. Admission control is used to enforce that only users // with permissions on the signer can create or modify the corresponding bundle. type ClusterTrustBundleApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // metadata contains the object metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec contains the signer (if any) and trust anchors. diff --git a/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/podcertificaterequest.go b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/podcertificaterequest.go index 447172552c..bf12e23c0f 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/podcertificaterequest.go +++ b/vendor/k8s.io/client-go/applyconfigurations/certificates/v1beta1/podcertificaterequest.go @@ -35,7 +35,7 @@ import ( // // Kubelets use this API to implement podCertificate projected volumes type PodCertificateRequestApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // metadata contains the object metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec contains the details about the certificate being requested. diff --git a/vendor/k8s.io/client-go/applyconfigurations/coordination/v1/lease.go b/vendor/k8s.io/client-go/applyconfigurations/coordination/v1/lease.go index de18339754..4dce4ca8a7 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/coordination/v1/lease.go +++ b/vendor/k8s.io/client-go/applyconfigurations/coordination/v1/lease.go @@ -32,7 +32,8 @@ import ( // // Lease defines a lease concept. type LeaseApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec contains the specification of the Lease. diff --git a/vendor/k8s.io/client-go/applyconfigurations/coordination/v1/leasespec.go b/vendor/k8s.io/client-go/applyconfigurations/coordination/v1/leasespec.go index 4dca58e2e5..05470ca61a 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/coordination/v1/leasespec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/coordination/v1/leasespec.go @@ -44,11 +44,11 @@ type LeaseSpecApplyConfiguration struct { // leaseTransitions is the number of transitions of a lease between // holders. LeaseTransitions *int32 `json:"leaseTransitions,omitempty"` - // Strategy indicates the strategy for picking the leader for coordinated leader election. + // strategy indicates the strategy for picking the leader for coordinated leader election. // If the field is not specified, there is no active coordination for this lease. // (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled. Strategy *coordinationv1.CoordinatedLeaseStrategy `json:"strategy,omitempty"` - // PreferredHolder signals to a lease holder that the lease has a + // preferredHolder signals to a lease holder that the lease has a // more optimal holder and should be given up. // This field can only be set if Strategy is also set. PreferredHolder *string `json:"preferredHolder,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/coordination/v1alpha2/leasecandidate.go b/vendor/k8s.io/client-go/applyconfigurations/coordination/v1alpha2/leasecandidate.go index 73150cb43a..25a2a000d4 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/coordination/v1alpha2/leasecandidate.go +++ b/vendor/k8s.io/client-go/applyconfigurations/coordination/v1alpha2/leasecandidate.go @@ -33,7 +33,8 @@ import ( // LeaseCandidate defines a candidate for a Lease object. // Candidates are created such that coordinated leader election will pick the best leader from the list of candidates. type LeaseCandidateApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec contains the specification of the Lease. diff --git a/vendor/k8s.io/client-go/applyconfigurations/coordination/v1alpha2/leasecandidatespec.go b/vendor/k8s.io/client-go/applyconfigurations/coordination/v1alpha2/leasecandidatespec.go index 44a2db06ff..e6ab4897dd 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/coordination/v1alpha2/leasecandidatespec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/coordination/v1alpha2/leasecandidatespec.go @@ -28,15 +28,15 @@ import ( // // LeaseCandidateSpec is a specification of a Lease. type LeaseCandidateSpecApplyConfiguration struct { - // LeaseName is the name of the lease for which this candidate is contending. + // leaseName is the name of the lease for which this candidate is contending. // This field is immutable. LeaseName *string `json:"leaseName,omitempty"` - // PingTime is the last time that the server has requested the LeaseCandidate + // pingTime is the last time that the server has requested the LeaseCandidate // to renew. It is only done during leader election to check if any // LeaseCandidates have become ineligible. When PingTime is updated, the // LeaseCandidate will respond by updating RenewTime. PingTime *v1.MicroTime `json:"pingTime,omitempty"` - // RenewTime is the time that the LeaseCandidate was last updated. + // renewTime is the time that the LeaseCandidate was last updated. // Any time a Lease needs to do leader election, the PingTime field // is updated to signal to the LeaseCandidate that they should update // the RenewTime. @@ -44,14 +44,14 @@ type LeaseCandidateSpecApplyConfiguration struct { // since the last renew. The PingTime field is updated regularly to prevent // garbage collection for still active LeaseCandidates. RenewTime *v1.MicroTime `json:"renewTime,omitempty"` - // BinaryVersion is the binary version. It must be in a semver format without leading `v`. + // binaryVersion is the binary version. It must be in a semver format without leading `v`. // This field is required. BinaryVersion *string `json:"binaryVersion,omitempty"` - // EmulationVersion is the emulation version. It must be in a semver format without leading `v`. + // emulationVersion is the emulation version. It must be in a semver format without leading `v`. // EmulationVersion must be less than or equal to BinaryVersion. // This field is required when strategy is "OldestEmulationVersion" EmulationVersion *string `json:"emulationVersion,omitempty"` - // Strategy is the strategy that coordinated leader election will use for picking the leader. + // strategy is the strategy that coordinated leader election will use for picking the leader. // If multiple candidates for the same Lease return different strategies, the strategy provided // by the candidate with the latest BinaryVersion will be used. If there is still conflict, // this is a user error and coordinated leader election will not operate the Lease until resolved. diff --git a/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/lease.go b/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/lease.go index 38263059a8..dccfdca8a4 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/lease.go +++ b/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/lease.go @@ -32,7 +32,8 @@ import ( // // Lease defines a lease concept. type LeaseApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec contains the specification of the Lease. diff --git a/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasecandidate.go b/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasecandidate.go index 4670d9d2b9..bfd45d103f 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasecandidate.go +++ b/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasecandidate.go @@ -33,7 +33,8 @@ import ( // LeaseCandidate defines a candidate for a Lease object. // Candidates are created such that coordinated leader election will pick the best leader from the list of candidates. type LeaseCandidateApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec contains the specification of the Lease. diff --git a/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasecandidatespec.go b/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasecandidatespec.go index 6b146dc494..3aed4ccc21 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasecandidatespec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasecandidatespec.go @@ -28,17 +28,17 @@ import ( // // LeaseCandidateSpec is a specification of a Lease. type LeaseCandidateSpecApplyConfiguration struct { - // LeaseName is the name of the lease for which this candidate is contending. + // leaseName is the name of the lease for which this candidate is contending. // The limits on this field are the same as on Lease.name. Multiple lease candidates // may reference the same Lease.name. // This field is immutable. LeaseName *string `json:"leaseName,omitempty"` - // PingTime is the last time that the server has requested the LeaseCandidate + // pingTime is the last time that the server has requested the LeaseCandidate // to renew. It is only done during leader election to check if any // LeaseCandidates have become ineligible. When PingTime is updated, the // LeaseCandidate will respond by updating RenewTime. PingTime *v1.MicroTime `json:"pingTime,omitempty"` - // RenewTime is the time that the LeaseCandidate was last updated. + // renewTime is the time that the LeaseCandidate was last updated. // Any time a Lease needs to do leader election, the PingTime field // is updated to signal to the LeaseCandidate that they should update // the RenewTime. @@ -46,14 +46,14 @@ type LeaseCandidateSpecApplyConfiguration struct { // since the last renew. The PingTime field is updated regularly to prevent // garbage collection for still active LeaseCandidates. RenewTime *v1.MicroTime `json:"renewTime,omitempty"` - // BinaryVersion is the binary version. It must be in a semver format without leading `v`. + // binaryVersion is the binary version. It must be in a semver format without leading `v`. // This field is required. BinaryVersion *string `json:"binaryVersion,omitempty"` - // EmulationVersion is the emulation version. It must be in a semver format without leading `v`. + // emulationVersion is the emulation version. It must be in a semver format without leading `v`. // EmulationVersion must be less than or equal to BinaryVersion. // This field is required when strategy is "OldestEmulationVersion" EmulationVersion *string `json:"emulationVersion,omitempty"` - // Strategy is the strategy that coordinated leader election will use for picking the leader. + // strategy is the strategy that coordinated leader election will use for picking the leader. // If multiple candidates for the same Lease return different strategies, the strategy provided // by the candidate with the latest BinaryVersion will be used. If there is still conflict, // this is a user error and coordinated leader election will not operate the Lease until resolved. diff --git a/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasespec.go b/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasespec.go index db40b83592..ec4ee1190f 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasespec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/coordination/v1beta1/leasespec.go @@ -44,10 +44,10 @@ type LeaseSpecApplyConfiguration struct { // leaseTransitions is the number of transitions of a lease between // holders. LeaseTransitions *int32 `json:"leaseTransitions,omitempty"` - // Strategy indicates the strategy for picking the leader for coordinated leader election + // strategy indicates the strategy for picking the leader for coordinated leader election. // (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled. Strategy *coordinationv1.CoordinatedLeaseStrategy `json:"strategy,omitempty"` - // PreferredHolder signals to a lease holder that the lease has a + // preferredHolder signals to a lease holder that the lease has a // more optimal holder and should be given up. PreferredHolder *string `json:"preferredHolder,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/clustertrustbundleprojection.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/clustertrustbundleprojection.go index 00eec6b377..8964d84f26 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/clustertrustbundleprojection.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/clustertrustbundleprojection.go @@ -49,6 +49,10 @@ type ClusterTrustBundleProjectionApplyConfiguration struct { Optional *bool `json:"optional,omitempty"` // Relative path from the volume root to write the bundle. Path *string `json:"path,omitempty"` + // user is Optional: The owner UID of the created file. + // If specified, the item-level user field takes precedence over defaultUser. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + User *int64 `json:"user,omitempty"` } // ClusterTrustBundleProjectionApplyConfiguration constructs a declarative configuration of the ClusterTrustBundleProjection type for use with @@ -96,3 +100,11 @@ func (b *ClusterTrustBundleProjectionApplyConfiguration) WithPath(value string) b.Path = &value return b } + +// WithUser sets the User field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the User field is set to the value of the last call. +func (b *ClusterTrustBundleProjectionApplyConfiguration) WithUser(value int64) *ClusterTrustBundleProjectionApplyConfiguration { + b.User = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/componentstatus.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/componentstatus.go index 5b9b7f32ce..b356d1ee37 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/componentstatus.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/componentstatus.go @@ -33,7 +33,7 @@ import ( // ComponentStatus (and ComponentStatusList) holds the cluster validation info. // Deprecated: This API is deprecated in v1.19+ type ComponentStatusApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmap.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmap.go index d638482048..6a181e3256 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmap.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmap.go @@ -32,7 +32,7 @@ import ( // // ConfigMap holds configuration data for pods to consume. type ConfigMapApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` @@ -54,6 +54,8 @@ type ConfigMapApplyConfiguration struct { // the Data field, this is enforced during validation process. // Using this field will require 1.10+ apiserver and // kubelet. + // Note: BinaryData keys are not currently propagated to container env vars + // via ConfigMapKeyRef or ConfigMapRef env sources; only Data keys are used. BinaryData map[string][]byte `json:"binaryData,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmapenvsource.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmapenvsource.go index c2c067b2c4..b50b3f11de 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmapenvsource.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmapenvsource.go @@ -26,9 +26,10 @@ package v1 // // The contents of the target ConfigMap's Data field will represent the // key-value pairs as environment variables. +// Keys in the BinaryData field are not currently propagated to container env vars. type ConfigMapEnvSourceApplyConfiguration struct { // The ConfigMap to select from. - LocalObjectReferenceApplyConfiguration `json:",inline"` + LocalObjectReferenceApplyConfiguration `json:""` // Specify whether the ConfigMap must be defined Optional *bool `json:"optional,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmapkeyselector.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmapkeyselector.go index 415edded52..384db766aa 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmapkeyselector.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmapkeyselector.go @@ -24,8 +24,9 @@ package v1 // Selects a key from a ConfigMap. type ConfigMapKeySelectorApplyConfiguration struct { // The ConfigMap to select from. - LocalObjectReferenceApplyConfiguration `json:",inline"` - // The key to select. + LocalObjectReferenceApplyConfiguration `json:""` + // The key to select from the ConfigMap's Data field. + // Keys in the BinaryData field are not currently propagated to container env vars. Key *string `json:"key,omitempty"` // Specify whether the ConfigMap or its key must be defined Optional *bool `json:"optional,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmapprojection.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmapprojection.go index 0357ca9983..9af0ca301f 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmapprojection.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmapprojection.go @@ -29,7 +29,7 @@ package v1 // Note that this is identical to a configmap volume source without the default // mode. type ConfigMapProjectionApplyConfiguration struct { - LocalObjectReferenceApplyConfiguration `json:",inline"` + LocalObjectReferenceApplyConfiguration `json:""` // items if unspecified, each key-value pair in the Data field of the referenced // ConfigMap will be projected into the volume as a file whose name is the // key and content is the value. If specified, the listed keys will be diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmapvolumesource.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmapvolumesource.go index b8a6a333f6..158857b8b2 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmapvolumesource.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/configmapvolumesource.go @@ -28,7 +28,7 @@ package v1 // the items element is populated with specific mappings of keys to paths. // ConfigMap volumes support ownership management and SELinux relabeling. type ConfigMapVolumeSourceApplyConfiguration struct { - LocalObjectReferenceApplyConfiguration `json:",inline"` + LocalObjectReferenceApplyConfiguration `json:""` // items if unspecified, each key-value pair in the Data field of the referenced // ConfigMap will be projected into the volume as a file whose name is the // key and content is the value. If specified, the listed keys will be @@ -47,6 +47,10 @@ type ConfigMapVolumeSourceApplyConfiguration struct { DefaultMode *int32 `json:"defaultMode,omitempty"` // optional specify whether the ConfigMap or its keys must be defined Optional *bool `json:"optional,omitempty"` + // defaultUser is Optional: The owner UID of the created files by default. + // The defaultUser field is only used as a fallback when the item-level user field is unset. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + DefaultUser *int64 `json:"defaultUser,omitempty"` } // ConfigMapVolumeSourceApplyConfiguration constructs a declarative configuration of the ConfigMapVolumeSource type for use with @@ -91,3 +95,11 @@ func (b *ConfigMapVolumeSourceApplyConfiguration) WithOptional(value bool) *Conf b.Optional = &value return b } + +// WithDefaultUser sets the DefaultUser field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DefaultUser field is set to the value of the last call. +func (b *ConfigMapVolumeSourceApplyConfiguration) WithDefaultUser(value int64) *ConfigMapVolumeSourceApplyConfiguration { + b.DefaultUser = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/downwardapivolumefile.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/downwardapivolumefile.go index 9028f3133c..99eb736fa1 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/downwardapivolumefile.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/downwardapivolumefile.go @@ -37,6 +37,10 @@ type DownwardAPIVolumeFileApplyConfiguration struct { // This might be in conflict with other options that affect the file // mode, like fsGroup, and the result can be other mode bits set. Mode *int32 `json:"mode,omitempty"` + // user is Optional: The owner UID of the created file. + // If specified, the item-level user field takes precedence over defaultUser. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + User *int64 `json:"user,omitempty"` } // DownwardAPIVolumeFileApplyConfiguration constructs a declarative configuration of the DownwardAPIVolumeFile type for use with @@ -76,3 +80,11 @@ func (b *DownwardAPIVolumeFileApplyConfiguration) WithMode(value int32) *Downwar b.Mode = &value return b } + +// WithUser sets the User field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the User field is set to the value of the last call. +func (b *DownwardAPIVolumeFileApplyConfiguration) WithUser(value int64) *DownwardAPIVolumeFileApplyConfiguration { + b.User = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/downwardapivolumesource.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/downwardapivolumesource.go index 42e726689d..308b05780b 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/downwardapivolumesource.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/downwardapivolumesource.go @@ -35,6 +35,10 @@ type DownwardAPIVolumeSourceApplyConfiguration struct { // This might be in conflict with other options that affect the file // mode, like fsGroup, and the result can be other mode bits set. DefaultMode *int32 `json:"defaultMode,omitempty"` + // defaultUser is Optional: The owner UID of the created files by default. + // The defaultUser field is only used as a fallback when the item-level user field is unset. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + DefaultUser *int64 `json:"defaultUser,omitempty"` } // DownwardAPIVolumeSourceApplyConfiguration constructs a declarative configuration of the DownwardAPIVolumeSource type for use with @@ -63,3 +67,11 @@ func (b *DownwardAPIVolumeSourceApplyConfiguration) WithDefaultMode(value int32) b.DefaultMode = &value return b } + +// WithDefaultUser sets the DefaultUser field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DefaultUser field is set to the value of the last call. +func (b *DownwardAPIVolumeSourceApplyConfiguration) WithDefaultUser(value int64) *DownwardAPIVolumeSourceApplyConfiguration { + b.DefaultUser = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/emptydirvolumesource.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/emptydirvolumesource.go index 97f71e8d21..b79a874d65 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/emptydirvolumesource.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/emptydirvolumesource.go @@ -41,6 +41,15 @@ type EmptyDirVolumeSourceApplyConfiguration struct { // The default is nil which means that the limit is undefined. // More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir SizeLimit *resource.Quantity `json:"sizeLimit,omitempty"` + // mode specifies the permission bits for the emptyDir directory, in numeric + // notation (e.g., 0755, 01777). Must be a value between 0000 and 01777. + // If not specified, defaults to 0777. + // This might be in conflict with other options that affect the file + // mode, like fsGroup. If fsGroup is specified, the fsGroup permissions + // will override the mode specified here. + // This field has no effect on Windows. + // This field is alpha and requires EmptyDirVolumeMode featuregate to be enabled. + Mode *int32 `json:"mode,omitempty"` } // EmptyDirVolumeSourceApplyConfiguration constructs a declarative configuration of the EmptyDirVolumeSource type for use with @@ -64,3 +73,11 @@ func (b *EmptyDirVolumeSourceApplyConfiguration) WithSizeLimit(value resource.Qu b.SizeLimit = &value return b } + +// WithMode sets the Mode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Mode field is set to the value of the last call. +func (b *EmptyDirVolumeSourceApplyConfiguration) WithMode(value int32) *EmptyDirVolumeSourceApplyConfiguration { + b.Mode = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/endpoints.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/endpoints.go index a13cd30e89..45861f369e 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/endpoints.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/endpoints.go @@ -49,7 +49,7 @@ import ( // // Deprecated: This API is deprecated in v1.33+. Use discoveryv1.EndpointSlice. type EndpointsApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/ephemeralcontainer.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/ephemeralcontainer.go index 43d97a6eff..3b3d1698c4 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/ephemeralcontainer.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/ephemeralcontainer.go @@ -38,7 +38,7 @@ type EphemeralContainerApplyConfiguration struct { // specific to ephemeral containers. Fields in common with Container are in the // following inlined struct so than an EphemeralContainer may easily be converted // to a Container. - EphemeralContainerCommonApplyConfiguration `json:",inline"` + EphemeralContainerCommonApplyConfiguration `json:""` // If set, the name of the container from PodSpec that this ephemeral container targets. // The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. // If not set then the ephemeral container uses the namespaces configured in the Pod spec. diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/event.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/event.go index 676a719b2f..80f48d4eef 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/event.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/event.go @@ -37,7 +37,7 @@ import ( // continued existence of events with that Reason. Events should be // treated as informative, best-effort, supplemental data. type EventApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/evictionresponder.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/evictionresponder.go new file mode 100644 index 0000000000..9decf94dd1 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/evictionresponder.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// EvictionResponderApplyConfiguration represents a declarative configuration of the EvictionResponder type for use +// with apply. +// +// EvictionResponder allows you to specify the responder reacting to an Eviction. +// Responders should observe and communicate through the Eviction Resource API to help with +// the graceful eviction of a target (e.g. termination of a pod). +type EvictionResponderApplyConfiguration struct { + // name allows you to identify the responder responding to the Eviction. + // + // It must be a valid domain-prefixed key (such as "acme.io/foo"). + // Domain names *.k8s.io and *.kubernetes.io are reserved. + // This field must be unique for each responder. + // This field is required. + Name *string `json:"name,omitempty"` + // priority for this responder. Higher priorities are selected first by the evictionrequest-controller. + // If there are responders with the same priority, the responder whose domain name comes first in the + // alphabetical higher domain order, will be picked. This means that the top domain labels are compared + // alphabetically first, followed by the lower domain labels. The key is compared last. + // + // The responder that is the managing controller of the pod should set the value of + // this field to 10000 to allow both for preemption or fallback registration by other + // responders. + // + // The minimum value is 0 and the maximum value is 100000. + // The interval 0-999 is reserved for responders with *.k8s.io suffix. + // This field is required. + Priority *int32 `json:"priority,omitempty"` +} + +// EvictionResponderApplyConfiguration constructs a declarative configuration of the EvictionResponder type for use with +// apply. +func EvictionResponder() *EvictionResponderApplyConfiguration { + return &EvictionResponderApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *EvictionResponderApplyConfiguration) WithName(value string) *EvictionResponderApplyConfiguration { + b.Name = &value + return b +} + +// WithPriority sets the Priority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Priority field is set to the value of the last call. +func (b *EvictionResponderApplyConfiguration) WithPriority(value int32) *EvictionResponderApplyConfiguration { + b.Priority = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/grpcaction.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/grpcaction.go index 40f5f9ecfd..05534f6bc8 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/grpcaction.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/grpcaction.go @@ -18,6 +18,10 @@ limitations under the License. package v1 +import ( + corev1 "k8s.io/api/core/v1" +) + // GRPCActionApplyConfiguration represents a declarative configuration of the GRPCAction type for use // with apply. // @@ -30,6 +34,11 @@ type GRPCActionApplyConfiguration struct { // // If this is not specified, the default behavior is defined by gRPC. Service *string `json:"service,omitempty"` + // mode specifies the connection mode for the gRPC health probe. + // Set to "TLS" to use TLS without certificate verification. + // Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + // If not specified, the probe uses a plaintext (insecure) connection. + Mode *corev1.GRPCProbeMode `json:"mode,omitempty"` } // GRPCActionApplyConfiguration constructs a declarative configuration of the GRPCAction type for use with @@ -53,3 +62,11 @@ func (b *GRPCActionApplyConfiguration) WithService(value string) *GRPCActionAppl b.Service = &value return b } + +// WithMode sets the Mode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Mode field is set to the value of the last call. +func (b *GRPCActionApplyConfiguration) WithMode(value corev1.GRPCProbeMode) *GRPCActionApplyConfiguration { + b.Mode = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/httpgetaction.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/httpgetaction.go index 3f892c752d..ec4ac6ee61 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/httpgetaction.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/httpgetaction.go @@ -42,6 +42,9 @@ type HTTPGetActionApplyConfiguration struct { Scheme *corev1.URIScheme `json:"scheme,omitempty"` // Custom headers to set in the request. HTTP allows repeated headers. HTTPHeaders []HTTPHeaderApplyConfiguration `json:"httpHeaders,omitempty"` + // Protocol selects the wire protocol for the probe connection. + // Nil defaults to HTTP/1.1. + Protocol *corev1.HTTPProtocol `json:"protocol,omitempty"` } // HTTPGetActionApplyConfiguration constructs a declarative configuration of the HTTPGetAction type for use with @@ -94,3 +97,11 @@ func (b *HTTPGetActionApplyConfiguration) WithHTTPHeaders(values ...*HTTPHeaderA } return b } + +// WithProtocol sets the Protocol field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Protocol field is set to the value of the last call. +func (b *HTTPGetActionApplyConfiguration) WithProtocol(value corev1.HTTPProtocol) *HTTPGetActionApplyConfiguration { + b.Protocol = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/keytopath.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/keytopath.go index 75ce1130a6..317554c74e 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/keytopath.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/keytopath.go @@ -37,6 +37,10 @@ type KeyToPathApplyConfiguration struct { // This might be in conflict with other options that affect the file // mode, like fsGroup, and the result can be other mode bits set. Mode *int32 `json:"mode,omitempty"` + // user is Optional: The owner UID of the created file. + // If specified, the item-level user field takes precedence over defaultUser. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + User *int64 `json:"user,omitempty"` } // KeyToPathApplyConfiguration constructs a declarative configuration of the KeyToPath type for use with @@ -68,3 +72,11 @@ func (b *KeyToPathApplyConfiguration) WithMode(value int32) *KeyToPathApplyConfi b.Mode = &value return b } + +// WithUser sets the User field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the User field is set to the value of the last call. +func (b *KeyToPathApplyConfiguration) WithUser(value int64) *KeyToPathApplyConfiguration { + b.User = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/limitrange.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/limitrange.go index 84a9fca312..e4da20c659 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/limitrange.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/limitrange.go @@ -32,7 +32,7 @@ import ( // // LimitRange sets resource usage limits for each kind of resource in a Namespace. type LimitRangeApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/namespace.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/namespace.go index a5bf0f9468..ab5c1b00d1 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/namespace.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/namespace.go @@ -33,7 +33,7 @@ import ( // Namespace provides a scope for Names. // Use of multiple namespaces is optional. type NamespaceApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/node.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/node.go index ff45b89945..511f02053d 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/node.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/node.go @@ -33,7 +33,7 @@ import ( // Node is a worker node in Kubernetes. // Each node will have a unique identifier in the cache (i.e. in etcd). type NodeApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodeallocatablemappedresources.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodeallocatablemappedresources.go new file mode 100644 index 0000000000..aab1093bdb --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodeallocatablemappedresources.go @@ -0,0 +1,59 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// NodeAllocatableMappedResourcesApplyConfiguration represents a declarative configuration of the NodeAllocatableMappedResources type for use +// with apply. +// +// NodeAllocatableMappedResources describes mapped node allocatable resource allocations. +type NodeAllocatableMappedResourcesApplyConfiguration struct { + // Name is the name of the resource (e.g., cpu, memory). + Name *corev1.ResourceName `json:"name,omitempty"` + // Quantity is the total node allocatable resource capacity allocated for the claim. + // This claim's allocated devices is shared by all the containers referencing the claim. + // Kubelet adds this value to both requests and limits at the pod-level cgroup, and to limits at the container-level cgroup for each container referencing the claim. + Quantity *resource.Quantity `json:"quantity,omitempty"` +} + +// NodeAllocatableMappedResourcesApplyConfiguration constructs a declarative configuration of the NodeAllocatableMappedResources type for use with +// apply. +func NodeAllocatableMappedResources() *NodeAllocatableMappedResourcesApplyConfiguration { + return &NodeAllocatableMappedResourcesApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *NodeAllocatableMappedResourcesApplyConfiguration) WithName(value corev1.ResourceName) *NodeAllocatableMappedResourcesApplyConfiguration { + b.Name = &value + return b +} + +// WithQuantity sets the Quantity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Quantity field is set to the value of the last call. +func (b *NodeAllocatableMappedResourcesApplyConfiguration) WithQuantity(value resource.Quantity) *NodeAllocatableMappedResourcesApplyConfiguration { + b.Quantity = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodeallocatableoverheadresources.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodeallocatableoverheadresources.go new file mode 100644 index 0000000000..fa7ca9442a --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodeallocatableoverheadresources.go @@ -0,0 +1,77 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// NodeAllocatableOverheadResourcesApplyConfiguration represents a declarative configuration of the NodeAllocatableOverheadResources type for use +// with apply. +// +// NodeAllocatableOverheadResources describes auxiliary overhead resource allocations. +type NodeAllocatableOverheadResourcesApplyConfiguration struct { + // Name is the name of the resource (e.g., cpu, memory). + Name *corev1.ResourceName `json:"name,omitempty"` + // PerPod is the flat overhead quantity allocated per pod. + // Adding to each container limit allows individual containers to utilize the overhead, while the parent pod-level cgroup limit caps the total usage at the pod boundary where the overhead is accounted for exactly once. + // At least one of PerPod or PerContainer must be specified. Specifying neither is an invalid configuration. + PerPod *resource.Quantity `json:"perPod,omitempty"` + // PerContainer is the variable overhead quantity applied for each container referencing the claim. + // The container references are recorded in `nodeAllocatableResourceClaimStatuses.containers`. + // The total overhead quantity allocated for the claim is computed as: + // Quantity = PerPod + (PerContainer * NumReferences) + // Kubelet accounts for this overhead in cgroups: + // - Pod-level cgroup (requests and limits): Kubelet adds PerPod + (PerContainer * NumReferences). + // - Container-level cgroup (limits only): Kubelet adds PerPod + PerContainer for each referencing container. + // This allows any single container to access the pod-level overhead, while the parent cgroup caps the total usage to account for PerPod exactly once. + // At least one of PerPod or PerContainer must be specified. Specifying neither is an invalid configuration. + PerContainer *resource.Quantity `json:"perContainer,omitempty"` +} + +// NodeAllocatableOverheadResourcesApplyConfiguration constructs a declarative configuration of the NodeAllocatableOverheadResources type for use with +// apply. +func NodeAllocatableOverheadResources() *NodeAllocatableOverheadResourcesApplyConfiguration { + return &NodeAllocatableOverheadResourcesApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *NodeAllocatableOverheadResourcesApplyConfiguration) WithName(value corev1.ResourceName) *NodeAllocatableOverheadResourcesApplyConfiguration { + b.Name = &value + return b +} + +// WithPerPod sets the PerPod field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PerPod field is set to the value of the last call. +func (b *NodeAllocatableOverheadResourcesApplyConfiguration) WithPerPod(value resource.Quantity) *NodeAllocatableOverheadResourcesApplyConfiguration { + b.PerPod = &value + return b +} + +// WithPerContainer sets the PerContainer field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PerContainer field is set to the value of the last call. +func (b *NodeAllocatableOverheadResourcesApplyConfiguration) WithPerContainer(value resource.Quantity) *NodeAllocatableOverheadResourcesApplyConfiguration { + b.PerContainer = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodeallocatableresourceclaimstatus.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodeallocatableresourceclaimstatus.go index 6e384b0028..9c67c7f9b4 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodeallocatableresourceclaimstatus.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodeallocatableresourceclaimstatus.go @@ -18,11 +18,6 @@ limitations under the License. package v1 -import ( - corev1 "k8s.io/api/core/v1" - resource "k8s.io/apimachinery/pkg/api/resource" -) - // NodeAllocatableResourceClaimStatusApplyConfiguration represents a declarative configuration of the NodeAllocatableResourceClaimStatus type for use // with apply. // @@ -32,8 +27,12 @@ type NodeAllocatableResourceClaimStatusApplyConfiguration struct { ResourceClaimName *string `json:"resourceClaimName,omitempty"` // Containers lists the names of all containers in this pod that reference the claim. Containers []string `json:"containers,omitempty"` - // Resources is a map of the node-allocatable resource name to the aggregate quantity allocated to the claim. - Resources map[corev1.ResourceName]resource.Quantity `json:"resources,omitempty"` + // Mapping contains allocations through devices mapped in the device spec's `nodeAllocatableResources[...].mapping` field. + // This is used by kubelet for pod level and container-level cgroup enforcement. + Mapping []NodeAllocatableMappedResourcesApplyConfiguration `json:"mapping,omitempty"` + // Overhead contains allocations through devices mapped in the device spec's `nodeAllocatableResources[...].overhead` field. + // This is used by kubelet for pod level and container-level cgroup enforcement. + Overhead []NodeAllocatableOverheadResourcesApplyConfiguration `json:"overhead,omitempty"` } // NodeAllocatableResourceClaimStatusApplyConfiguration constructs a declarative configuration of the NodeAllocatableResourceClaimStatus type for use with @@ -60,16 +59,28 @@ func (b *NodeAllocatableResourceClaimStatusApplyConfiguration) WithContainers(va return b } -// WithResources puts the entries into the Resources field in the declarative configuration +// WithMapping adds the given value to the Mapping field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Resources field, -// overwriting an existing map entries in Resources field with the same key. -func (b *NodeAllocatableResourceClaimStatusApplyConfiguration) WithResources(entries map[corev1.ResourceName]resource.Quantity) *NodeAllocatableResourceClaimStatusApplyConfiguration { - if b.Resources == nil && len(entries) > 0 { - b.Resources = make(map[corev1.ResourceName]resource.Quantity, len(entries)) +// If called multiple times, values provided by each call will be appended to the Mapping field. +func (b *NodeAllocatableResourceClaimStatusApplyConfiguration) WithMapping(values ...*NodeAllocatableMappedResourcesApplyConfiguration) *NodeAllocatableResourceClaimStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMapping") + } + b.Mapping = append(b.Mapping, *values[i]) } - for k, v := range entries { - b.Resources[k] = v + return b +} + +// WithOverhead adds the given value to the Overhead field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Overhead field. +func (b *NodeAllocatableResourceClaimStatusApplyConfiguration) WithOverhead(values ...*NodeAllocatableOverheadResourcesApplyConfiguration) *NodeAllocatableResourceClaimStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOverhead") + } + b.Overhead = append(b.Overhead, *values[i]) } return b } diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodepodpreemptionpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodepodpreemptionpolicy.go new file mode 100644 index 0000000000..62c0a00aec --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodepodpreemptionpolicy.go @@ -0,0 +1,47 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// NodePodPreemptionPolicyApplyConfiguration represents a declarative configuration of the NodePodPreemptionPolicy type for use +// with apply. +// +// NodePodPreemptionPolicy defines the node-level policies governing preemption for pods on this node. +type NodePodPreemptionPolicyApplyConfiguration struct { + // DisableResizePreemption lists the owners (e.g., autoscalers, operators, administrators) + // that have requested to disable scheduler and Kubelet preemption for in-place pod resize on this node. + // If this list is non-empty, resize-induced preemption is disabled on this node. + // This is an alpha field and requires enabling the InPlacePodVerticalScalingSchedulerPreemption feature gate. + DisableResizePreemption []string `json:"disableResizePreemption,omitempty"` +} + +// NodePodPreemptionPolicyApplyConfiguration constructs a declarative configuration of the NodePodPreemptionPolicy type for use with +// apply. +func NodePodPreemptionPolicy() *NodePodPreemptionPolicyApplyConfiguration { + return &NodePodPreemptionPolicyApplyConfiguration{} +} + +// WithDisableResizePreemption adds the given value to the DisableResizePreemption field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the DisableResizePreemption field. +func (b *NodePodPreemptionPolicyApplyConfiguration) WithDisableResizePreemption(values ...string) *NodePodPreemptionPolicyApplyConfiguration { + for i := range values { + b.DisableResizePreemption = append(b.DisableResizePreemption, values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodespec.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodespec.go index b53ed21d79..2839ed7679 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodespec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodespec.go @@ -41,6 +41,9 @@ type NodeSpecApplyConfiguration struct { // Deprecated. Not all kubelets will set this field. Remove field after 1.13. // see: https://issues.k8s.io/61966 DoNotUseExternalID *string `json:"externalID,omitempty"` + // PodPreemptionPolicy controls the node-level preemption behaviors for pods on this node. + // This is an alpha field and requires enabling the InPlacePodVerticalScalingSchedulerPreemption feature gate. + PodPreemptionPolicy *NodePodPreemptionPolicyApplyConfiguration `json:"podPreemptionPolicy,omitempty"` } // NodeSpecApplyConfiguration constructs a declarative configuration of the NodeSpec type for use with @@ -111,3 +114,11 @@ func (b *NodeSpecApplyConfiguration) WithDoNotUseExternalID(value string) *NodeS b.DoNotUseExternalID = &value return b } + +// WithPodPreemptionPolicy sets the PodPreemptionPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodPreemptionPolicy field is set to the value of the last call. +func (b *NodeSpecApplyConfiguration) WithPodPreemptionPolicy(value *NodePodPreemptionPolicyApplyConfiguration) *NodeSpecApplyConfiguration { + b.PodPreemptionPolicy = value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodesysteminfo.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodesysteminfo.go index 70b8a7819d..14a4680b2a 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodesysteminfo.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/nodesysteminfo.go @@ -49,6 +49,8 @@ type NodeSystemInfoApplyConfiguration struct { Architecture *string `json:"architecture,omitempty"` // Swap Info reported by the node. Swap *NodeSwapStatusApplyConfiguration `json:"swap,omitempty"` + // Whether the node is running in a user namespace. + RunningInUserNamespace *bool `json:"runningInUserNamespace,omitempty"` } // NodeSystemInfoApplyConfiguration constructs a declarative configuration of the NodeSystemInfo type for use with @@ -144,3 +146,11 @@ func (b *NodeSystemInfoApplyConfiguration) WithSwap(value *NodeSwapStatusApplyCo b.Swap = value return b } + +// WithRunningInUserNamespace sets the RunningInUserNamespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RunningInUserNamespace field is set to the value of the last call. +func (b *NodeSystemInfoApplyConfiguration) WithRunningInUserNamespace(value bool) *NodeSystemInfoApplyConfiguration { + b.RunningInUserNamespace = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolume.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolume.go index 4ef8ed4b5f..34da80ab9f 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolume.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolume.go @@ -34,7 +34,7 @@ import ( // It is analogous to a node. // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes type PersistentVolumeApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaim.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaim.go index d77417f359..1f86f61f7b 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaim.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaim.go @@ -32,7 +32,7 @@ import ( // // PersistentVolumeClaim is a user's request for and claim to a persistent volume type PersistentVolumeClaimApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaimspec.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaimspec.go index 8710769b77..1761f7bf30 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaimspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaimspec.go @@ -53,8 +53,8 @@ type PersistentVolumeClaimSpecApplyConfiguration struct { // * An existing PVC (PersistentVolumeClaim) // If the provisioner or an external controller can support the specified data source, // it will create a new volume based on the contents of the specified data source. - // When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, - // and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + // dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be + // copied to dataSource when dataSourceRef.namespace is not specified. // If the namespace is specified, then dataSourceRef will not be copied to dataSource. DataSource *TypedLocalObjectReferenceApplyConfiguration `json:"dataSource,omitempty"` // dataSourceRef specifies the object from which to populate the volume with data, if a non-empty @@ -78,7 +78,6 @@ type PersistentVolumeClaimSpecApplyConfiguration struct { // specified. // * While dataSource only allows local objects, dataSourceRef allows objects // in any namespaces. - // (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. // (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. DataSourceRef *TypedObjectReferenceApplyConfiguration `json:"dataSourceRef,omitempty"` // volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaimstatus.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaimstatus.go index ee2d5adbd3..c910005eb4 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaimstatus.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumeclaimstatus.go @@ -98,6 +98,9 @@ type PersistentVolumeClaimStatusApplyConfiguration struct { // ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. // When this is unset, there is no ModifyVolume operation being attempted. ModifyVolumeStatus *ModifyVolumeStatusApplyConfiguration `json:"modifyVolumeStatus,omitempty"` + // healthStatus contains the latest controller-reported health information + // for the volume bound to this claim. + HealthStatus *VolumeHealthStatusApplyConfiguration `json:"healthStatus,omitempty"` } // PersistentVolumeClaimStatusApplyConfiguration constructs a declarative configuration of the PersistentVolumeClaimStatus type for use with @@ -182,3 +185,11 @@ func (b *PersistentVolumeClaimStatusApplyConfiguration) WithModifyVolumeStatus(v b.ModifyVolumeStatus = value return b } + +// WithHealthStatus sets the HealthStatus field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HealthStatus field is set to the value of the last call. +func (b *PersistentVolumeClaimStatusApplyConfiguration) WithHealthStatus(value *VolumeHealthStatusApplyConfiguration) *PersistentVolumeClaimStatusApplyConfiguration { + b.HealthStatus = value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumespec.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumespec.go index 8c16610222..72fb8f540c 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumespec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/persistentvolumespec.go @@ -31,7 +31,7 @@ type PersistentVolumeSpecApplyConfiguration struct { // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity Capacity *corev1.ResourceList `json:"capacity,omitempty"` // persistentVolumeSource is the actual volume backing the persistent volume. - PersistentVolumeSourceApplyConfiguration `json:",inline"` + PersistentVolumeSourceApplyConfiguration `json:""` // accessModes contains all ways the volume can be mounted. // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes AccessModes []corev1.PersistentVolumeAccessMode `json:"accessModes,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/pod.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/pod.go index d10d38de19..815c0b4b63 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/pod.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/pod.go @@ -33,7 +33,7 @@ import ( // Pod is a collection of containers that can run on a host. This resource is created // by clients and scheduled onto hosts. type PodApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/podcertificateprojection.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/podcertificateprojection.go index 0d951a8948..3c10f37e0d 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/podcertificateprojection.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/podcertificateprojection.go @@ -89,6 +89,10 @@ type PodCertificateProjectionApplyConfiguration struct { // Signers should document the keys and values they support. Signers should // deny requests that contain keys they do not recognize. UserAnnotations map[string]string `json:"userAnnotations,omitempty"` + // user is Optional: The owner UID of the created file. + // If specified, the item-level user field takes precedence over defaultUser. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + User *int64 `json:"user,omitempty"` } // PodCertificateProjectionApplyConfiguration constructs a declarative configuration of the PodCertificateProjection type for use with @@ -158,3 +162,11 @@ func (b *PodCertificateProjectionApplyConfiguration) WithUserAnnotations(entries } return b } + +// WithUser sets the User field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the User field is set to the value of the last call. +func (b *PodCertificateProjectionApplyConfiguration) WithUser(value int64) *PodCertificateProjectionApplyConfiguration { + b.User = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/podsecuritycontext.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/podsecuritycontext.go index a6f1629ed7..951ced04b4 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/podsecuritycontext.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/podsecuritycontext.go @@ -121,11 +121,8 @@ type PodSecurityContextApplyConfiguration struct { // Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes // whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their // CSIDriver instance. Other volumes are always re-labelled recursively. - // "MountOption" value is allowed only when SELinuxMount feature gate is enabled. // - // If not specified and SELinuxMount feature gate is enabled, "MountOption" is used. - // If not specified and SELinuxMount feature gate is disabled, "MountOption" is used for ReadWriteOncePod volumes - // and "Recursive" for all other volumes. + // If not specified, "MountOption" is used. // // This field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers. // diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/podspec.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/podspec.go index e67c18c41b..f46481dabc 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/podspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/podspec.go @@ -172,6 +172,8 @@ type PodSpecApplyConfiguration struct { EnableServiceLinks *bool `json:"enableServiceLinks,omitempty"` // PreemptionPolicy is the Policy for preempting pods with lower priority. // One of Never, PreemptLowerPriority. + // When Priority Admission Controller is enabled, it prevents users from setting + // this field. The admission controller populates this field from PriorityClassName. // Defaults to PreemptLowerPriority if unset. PreemptionPolicy *corev1.PreemptionPolicy `json:"preemptionPolicy,omitempty"` // Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. @@ -270,7 +272,6 @@ type PodSpecApplyConfiguration struct { // - `hostNetwork` must be set to false. // // This field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters. - // Requires the HostnameOverride feature gate to be enabled. HostnameOverride *string `json:"hostnameOverride,omitempty"` // SchedulingGroup provides a reference to the immediate scheduling runtime // grouping object that this Pod belongs to. @@ -285,6 +286,22 @@ type PodSpecApplyConfiguration struct { // recreated with different policies. Doing this during pod scheduling // may result in the placement not conforming to the expected policies. SchedulingGroup *PodSchedulingGroupApplyConfiguration `json:"schedulingGroup,omitempty"` + // evictionResponders reference responders that react to Evictions based on EvictionRequests. + // Responders should observe and communicate through the Eviction Resource API to help with + // the graceful termination of a pod. The responders are selected sequentially, according to + // their specified priority. + // + // Responders should periodically report on an eviction progress by updating the + // .status.responders[].heartbeatTime field of the Eviction object. If this field is not updated + // within the heartbeat deadline defined by the Eviction API (currently 20 minutes), the eviction + // is passed over to the next responder with a lower priority. If there is no other responder, + // the last default imperative-eviction.k8s.io/evictor responder with a priority of 100 will + // evict the pod using the imperative Eviction API (pods//eviction subresource). + // + // The maximum length of the responders list is 10. + // Responders are not supported when the pod is part of a PodGroup (.spec.schedulingGroup is set). + // This field can only be set on creation and is immutable afterwards. + EvictionResponders []EvictionResponderApplyConfiguration `json:"evictionResponders,omitempty"` } // PodSpecApplyConfiguration constructs a declarative configuration of the PodSpec type for use with @@ -689,3 +706,16 @@ func (b *PodSpecApplyConfiguration) WithSchedulingGroup(value *PodSchedulingGrou b.SchedulingGroup = value return b } + +// WithEvictionResponders adds the given value to the EvictionResponders field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the EvictionResponders field. +func (b *PodSpecApplyConfiguration) WithEvictionResponders(values ...*EvictionResponderApplyConfiguration) *PodSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithEvictionResponders") + } + b.EvictionResponders = append(b.EvictionResponders, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/podstatus.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/podstatus.go index 8328d9cdb1..1bc37b5071 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/podstatus.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/podstatus.go @@ -145,6 +145,9 @@ type PodStatusApplyConfiguration struct { // (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). // Examples include "cpu", "memory", "ephemeral-storage", and hugepages. NodeAllocatableResourceClaimStatuses []NodeAllocatableResourceClaimStatusApplyConfiguration `json:"nodeAllocatableResourceClaimStatuses,omitempty"` + // volumeHealth contains node-reported health for each volume the pod is using. + // Populated by the kubelet on the pod's node. + VolumeHealth []PodVolumeHealthApplyConfiguration `json:"volumeHealth,omitempty"` } // PodStatusApplyConfiguration constructs a declarative configuration of the PodStatus type for use with @@ -360,3 +363,16 @@ func (b *PodStatusApplyConfiguration) WithNodeAllocatableResourceClaimStatuses(v } return b } + +// WithVolumeHealth adds the given value to the VolumeHealth field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the VolumeHealth field. +func (b *PodStatusApplyConfiguration) WithVolumeHealth(values ...*PodVolumeHealthApplyConfiguration) *PodStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVolumeHealth") + } + b.VolumeHealth = append(b.VolumeHealth, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/podtemplate.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/podtemplate.go index a4a2e300e4..a78cd0430b 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/podtemplate.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/podtemplate.go @@ -32,7 +32,7 @@ import ( // // PodTemplate describes a template for creating copies of a predefined pod. type PodTemplateApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/podvolumehealth.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/podvolumehealth.go new file mode 100644 index 0000000000..f17399dff7 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/podvolumehealth.go @@ -0,0 +1,74 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// PodVolumeHealthApplyConfiguration represents a declarative configuration of the PodVolumeHealth type for use +// with apply. +// +// PodVolumeHealth contains health information for a volume used by a pod, +// reported by the CSI node plugin via the kubelet. +type PodVolumeHealthApplyConfiguration struct { + // name matches an entry in pod.spec.volumes. + Name *string `json:"name,omitempty"` + // conditions is the set of adverse conditions reported by + // the CSI node plugin for this volume on this node. + // At most 16 conditions may be reported. + HealthConditions []VolumeHealthConditionApplyConfiguration `json:"healthConditions,omitempty"` + // lastTransitionTime is when the current set of conditions first appeared. + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` +} + +// PodVolumeHealthApplyConfiguration constructs a declarative configuration of the PodVolumeHealth type for use with +// apply. +func PodVolumeHealth() *PodVolumeHealthApplyConfiguration { + return &PodVolumeHealthApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PodVolumeHealthApplyConfiguration) WithName(value string) *PodVolumeHealthApplyConfiguration { + b.Name = &value + return b +} + +// WithHealthConditions adds the given value to the HealthConditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the HealthConditions field. +func (b *PodVolumeHealthApplyConfiguration) WithHealthConditions(values ...*VolumeHealthConditionApplyConfiguration) *PodVolumeHealthApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithHealthConditions") + } + b.HealthConditions = append(b.HealthConditions, *values[i]) + } + return b +} + +// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTransitionTime field is set to the value of the last call. +func (b *PodVolumeHealthApplyConfiguration) WithLastTransitionTime(value metav1.Time) *PodVolumeHealthApplyConfiguration { + b.LastTransitionTime = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/probe.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/probe.go index e6b3ddd7c5..5ea41ea5cf 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/probe.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/probe.go @@ -25,7 +25,7 @@ package v1 // alive or ready to receive traffic. type ProbeApplyConfiguration struct { // The action taken to determine the health of a container - ProbeHandlerApplyConfiguration `json:",inline"` + ProbeHandlerApplyConfiguration `json:""` // Number of seconds after the container has started before liveness probes are initiated. // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/projectedvolumesource.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/projectedvolumesource.go index a17e4d1dfc..c00e9ca6c4 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/projectedvolumesource.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/projectedvolumesource.go @@ -33,6 +33,10 @@ type ProjectedVolumeSourceApplyConfiguration struct { // This might be in conflict with other options that affect the file // mode, like fsGroup, and the result can be other mode bits set. DefaultMode *int32 `json:"defaultMode,omitempty"` + // defaultUser is Optional: The owner UID of the created files by default. + // The defaultUser field is only used as a fallback when the item-level user field is unset. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + DefaultUser *int64 `json:"defaultUser,omitempty"` } // ProjectedVolumeSourceApplyConfiguration constructs a declarative configuration of the ProjectedVolumeSource type for use with @@ -61,3 +65,11 @@ func (b *ProjectedVolumeSourceApplyConfiguration) WithDefaultMode(value int32) * b.DefaultMode = &value return b } + +// WithDefaultUser sets the DefaultUser field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DefaultUser field is set to the value of the last call. +func (b *ProjectedVolumeSourceApplyConfiguration) WithDefaultUser(value int64) *ProjectedVolumeSourceApplyConfiguration { + b.DefaultUser = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/replicationcontroller.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/replicationcontroller.go index a6416c4b77..8d8c43547a 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/replicationcontroller.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/replicationcontroller.go @@ -32,7 +32,7 @@ import ( // // ReplicationController represents the configuration of a replication controller. type ReplicationControllerApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // If the Labels of a ReplicationController are empty, they are defaulted to // be the same as the Pod(s) that the replication controller manages. // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/resourcequota.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/resourcequota.go index 6489d2928d..475135b071 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/resourcequota.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/resourcequota.go @@ -32,7 +32,7 @@ import ( // // ResourceQuota sets aggregate quota restrictions enforced per namespace type ResourceQuotaApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/resourcestatus.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/resourcestatus.go index 511164e7cf..b418ff4cb4 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/resourcestatus.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/resourcestatus.go @@ -28,8 +28,13 @@ import ( // ResourceStatus represents the status of a single resource allocated to a Pod. type ResourceStatusApplyConfiguration struct { // Name of the resource. Must be unique within the pod and in case of non-DRA resource, match one of the resources from the pod spec. - // For DRA resources, the value must be "claim:/". - // When this status is reported about a container, the "claim_name" and "request" must match one of the claims of this container. + // For DRA resources, the value must be "claim:/" when + // container.resources.claims[*].request is set or "claim:" when + // container.resources.claims[*].request is empty. + // For DRA-backed extended resources, "claim:/" is used + // when the claim name and request name are recorded in pod.status.extendedResourceClaimStatus. + // When this status is reported about a container, the "claim_name" and "request" + // must match one of the claims of this container. Name *corev1.ResourceName `json:"name,omitempty"` // List of unique resources health. Each element in the list contains an unique resource ID and its health. // At a minimum, for the lifetime of a Pod, resource ID must uniquely identify the resource allocated to the Pod on the Node. diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/secret.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/secret.go index 42be779311..e4b12ad2bf 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/secret.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/secret.go @@ -33,7 +33,7 @@ import ( // Secret holds secret data of a certain type. The total bytes of the values in // the Data field must be less than MaxSecretSize bytes. type SecretApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/secretenvsource.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/secretenvsource.go index 21a6b75248..bb2f7243e7 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/secretenvsource.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/secretenvsource.go @@ -28,7 +28,7 @@ package v1 // key-value pairs as environment variables. type SecretEnvSourceApplyConfiguration struct { // The Secret to select from. - LocalObjectReferenceApplyConfiguration `json:",inline"` + LocalObjectReferenceApplyConfiguration `json:""` // Specify whether the Secret must be defined Optional *bool `json:"optional,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/secretkeyselector.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/secretkeyselector.go index 8e83bc813c..71d48813c5 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/secretkeyselector.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/secretkeyselector.go @@ -24,7 +24,7 @@ package v1 // SecretKeySelector selects a key of a Secret. type SecretKeySelectorApplyConfiguration struct { // The name of the secret in the pod's namespace to select from. - LocalObjectReferenceApplyConfiguration `json:",inline"` + LocalObjectReferenceApplyConfiguration `json:""` // The key of the secret to select from. Must be a valid secret key. Key *string `json:"key,omitempty"` // Specify whether the Secret or its key must be defined diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/secretprojection.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/secretprojection.go index 87016d9fa3..879ed4bf4e 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/secretprojection.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/secretprojection.go @@ -28,7 +28,7 @@ package v1 // Note that this is identical to a secret volume source without the default // mode. type SecretProjectionApplyConfiguration struct { - LocalObjectReferenceApplyConfiguration `json:",inline"` + LocalObjectReferenceApplyConfiguration `json:""` // items if unspecified, each key-value pair in the Data field of the referenced // Secret will be projected into the volume as a file whose name is the // key and content is the value. If specified, the listed keys will be diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/secretvolumesource.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/secretvolumesource.go index bdc098535e..a4c37ae01e 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/secretvolumesource.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/secretvolumesource.go @@ -48,6 +48,10 @@ type SecretVolumeSourceApplyConfiguration struct { DefaultMode *int32 `json:"defaultMode,omitempty"` // optional field specify whether the Secret or its keys must be defined Optional *bool `json:"optional,omitempty"` + // defaultUser is Optional: The owner UID of the created files by default. + // The defaultUser field is only used as a fallback when the item-level user field is unset. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + DefaultUser *int64 `json:"defaultUser,omitempty"` } // SecretVolumeSourceApplyConfiguration constructs a declarative configuration of the SecretVolumeSource type for use with @@ -92,3 +96,11 @@ func (b *SecretVolumeSourceApplyConfiguration) WithOptional(value bool) *SecretV b.Optional = &value return b } + +// WithDefaultUser sets the DefaultUser field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DefaultUser field is set to the value of the last call. +func (b *SecretVolumeSourceApplyConfiguration) WithDefaultUser(value int64) *SecretVolumeSourceApplyConfiguration { + b.DefaultUser = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/service.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/service.go index b0e667824b..432aa14eed 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/service.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/service.go @@ -34,7 +34,7 @@ import ( // (for example 3306) that the proxy listens on, and the selector that determines which pods // will answer requests sent through the proxy. type ServiceApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/serviceaccount.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/serviceaccount.go index d439347778..2104cb4e43 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/serviceaccount.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/serviceaccount.go @@ -35,7 +35,7 @@ import ( // * a principal that can be authenticated and authorized // * a set of secrets type ServiceAccountApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/serviceaccounttokenprojection.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/serviceaccounttokenprojection.go index e2bf69bc44..93b13a2897 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/serviceaccounttokenprojection.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/serviceaccounttokenprojection.go @@ -41,6 +41,10 @@ type ServiceAccountTokenProjectionApplyConfiguration struct { // path is the path relative to the mount point of the file to project the // token into. Path *string `json:"path,omitempty"` + // user is Optional: The owner UID of the created file. + // If specified, the item-level user field takes precedence over defaultUser. + // (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + User *int64 `json:"user,omitempty"` } // ServiceAccountTokenProjectionApplyConfiguration constructs a declarative configuration of the ServiceAccountTokenProjection type for use with @@ -72,3 +76,11 @@ func (b *ServiceAccountTokenProjectionApplyConfiguration) WithPath(value string) b.Path = &value return b } + +// WithUser sets the User field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the User field is set to the value of the last call. +func (b *ServiceAccountTokenProjectionApplyConfiguration) WithUser(value int64) *ServiceAccountTokenProjectionApplyConfiguration { + b.User = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/volume.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/volume.go index 2e4c0e6ad6..a2e0b3fc9d 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/volume.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/volume.go @@ -30,7 +30,7 @@ type VolumeApplyConfiguration struct { // volumeSource represents the location and type of the mounted volume. // If not specified, the Volume is implied to be an EmptyDir. // This implied behavior is deprecated and will be removed in a future version. - VolumeSourceApplyConfiguration `json:",inline"` + VolumeSourceApplyConfiguration `json:""` } // VolumeApplyConfiguration constructs a declarative configuration of the Volume type for use with diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumehealthcondition.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumehealthcondition.go new file mode 100644 index 0000000000..26fa8d1401 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumehealthcondition.go @@ -0,0 +1,73 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// VolumeHealthConditionApplyConfiguration represents a declarative configuration of the VolumeHealthCondition type for use +// with apply. +// +// VolumeHealthCondition represents an adverse health condition reported for a volume. +type VolumeHealthConditionApplyConfiguration struct { + // status is the machine-parseable health category. + // Possible values: + // - "Inaccessible": the volume cannot be accessed. + // - "DataLoss": data loss has been detected on the volume. + // - "Degraded": the volume is functioning with reduced capability. + Status *corev1.VolumeHealthStatusType `json:"status,omitempty"` + // reason is a brief CamelCase machine-parseable reason. + // Together with status it forms the unique identity of a condition entry. + // Maximum permitted length of a reason is 256 bytes. + Reason *string `json:"reason,omitempty"` + // message is a human-readable description. + // Maximum permitted length of a message is 1024 bytes. + Message *string `json:"message,omitempty"` +} + +// VolumeHealthConditionApplyConfiguration constructs a declarative configuration of the VolumeHealthCondition type for use with +// apply. +func VolumeHealthCondition() *VolumeHealthConditionApplyConfiguration { + return &VolumeHealthConditionApplyConfiguration{} +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *VolumeHealthConditionApplyConfiguration) WithStatus(value corev1.VolumeHealthStatusType) *VolumeHealthConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *VolumeHealthConditionApplyConfiguration) WithReason(value string) *VolumeHealthConditionApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *VolumeHealthConditionApplyConfiguration) WithMessage(value string) *VolumeHealthConditionApplyConfiguration { + b.Message = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumehealthstatus.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumehealthstatus.go new file mode 100644 index 0000000000..23d3b22c8d --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumehealthstatus.go @@ -0,0 +1,64 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// VolumeHealthStatusApplyConfiguration represents a declarative configuration of the VolumeHealthStatus type for use +// with apply. +// +// VolumeHealthStatus contains health information for a volume reported +// by the CSI controller plugin. +type VolumeHealthStatusApplyConfiguration struct { + // conditions is the set of adverse conditions reported by + // the CSI controller plugin. An empty list means no adverse condition. + // At most 16 conditions may be reported. + HealthConditions []VolumeHealthConditionApplyConfiguration `json:"healthConditions,omitempty"` + // lastTransitionTime is when the current set of conditions first appeared. + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` +} + +// VolumeHealthStatusApplyConfiguration constructs a declarative configuration of the VolumeHealthStatus type for use with +// apply. +func VolumeHealthStatus() *VolumeHealthStatusApplyConfiguration { + return &VolumeHealthStatusApplyConfiguration{} +} + +// WithHealthConditions adds the given value to the HealthConditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the HealthConditions field. +func (b *VolumeHealthStatusApplyConfiguration) WithHealthConditions(values ...*VolumeHealthConditionApplyConfiguration) *VolumeHealthStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithHealthConditions") + } + b.HealthConditions = append(b.HealthConditions, *values[i]) + } + return b +} + +// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTransitionTime field is set to the value of the last call. +func (b *VolumeHealthStatusApplyConfiguration) WithLastTransitionTime(value metav1.Time) *VolumeHealthStatusApplyConfiguration { + b.LastTransitionTime = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumemount.go b/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumemount.go index 83b71eb659..35e77e3dac 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumemount.go +++ b/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumemount.go @@ -49,8 +49,7 @@ type VolumeMountApplyConfiguration struct { // // If this field is not specified, it is treated as an equivalent of Disabled. RecursiveReadOnly *corev1.RecursiveReadOnlyMode `json:"recursiveReadOnly,omitempty"` - // Path within the container at which the volume should be mounted. Must - // not contain ':'. + // Path within the container at which the volume should be mounted. MountPath *string `json:"mountPath,omitempty"` // Path within the volume from which the container's volume should be mounted. // Defaults to "" (volume's root). @@ -67,6 +66,13 @@ type VolumeMountApplyConfiguration struct { // Defaults to "" (volume's root). // SubPathExpr and SubPath are mutually exclusive. SubPathExpr *string `json:"subPathExpr,omitempty"` + // bindMountOptions is the list of additional bind mount options to apply when + // mounting this volume into the container. Allowed values are noexec, + // nodev, and nosuid. These are Linux mount options and have no effect on + // Windows nodes. + // This field is not supported with image volumes. + // This is an alpha field and requires enabling the VolumeBindMountOptions feature gate. + BindMountOptions []string `json:"bindMountOptions,omitempty"` } // VolumeMountApplyConfiguration constructs a declarative configuration of the VolumeMount type for use with @@ -130,3 +136,13 @@ func (b *VolumeMountApplyConfiguration) WithSubPathExpr(value string) *VolumeMou b.SubPathExpr = &value return b } + +// WithBindMountOptions adds the given value to the BindMountOptions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the BindMountOptions field. +func (b *VolumeMountApplyConfiguration) WithBindMountOptions(values ...string) *VolumeMountApplyConfiguration { + for i := range values { + b.BindMountOptions = append(b.BindMountOptions, values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpointslice.go b/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpointslice.go index cba77dd571..705dd0be44 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpointslice.go +++ b/vendor/k8s.io/client-go/applyconfigurations/discovery/v1/endpointslice.go @@ -37,7 +37,7 @@ import ( // by listing EndpointSlices in the service's namespace whose `kubernetes.io/service-name` // label contains the service's name. type EndpointSliceApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // addressType specifies the type of address carried by this EndpointSlice. diff --git a/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpointslice.go b/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpointslice.go index 4d40de54a6..2a1ac2ca95 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpointslice.go +++ b/vendor/k8s.io/client-go/applyconfigurations/discovery/v1beta1/endpointslice.go @@ -34,7 +34,7 @@ import ( // For a given service there may be multiple EndpointSlice objects, selected by // labels, which must be joined to produce the full set of endpoints. type EndpointSliceApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // addressType specifies the type of address carried by this EndpointSlice. diff --git a/vendor/k8s.io/client-go/applyconfigurations/events/v1/event.go b/vendor/k8s.io/client-go/applyconfigurations/events/v1/event.go index 122cccad7e..e5c5721733 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/events/v1/event.go +++ b/vendor/k8s.io/client-go/applyconfigurations/events/v1/event.go @@ -38,8 +38,8 @@ import ( // continued existence of events with that Reason. Events should be // treated as informative, best-effort, supplemental data. type EventApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // eventTime is the time when this Event was first observed. It is required. diff --git a/vendor/k8s.io/client-go/applyconfigurations/events/v1beta1/event.go b/vendor/k8s.io/client-go/applyconfigurations/events/v1beta1/event.go index cf6068f470..a4a6abe6d1 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/events/v1beta1/event.go +++ b/vendor/k8s.io/client-go/applyconfigurations/events/v1beta1/event.go @@ -38,8 +38,8 @@ import ( // continued existence of events with that Reason. Events should be // treated as informative, best-effort, supplemental data. type EventApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // eventTime is the time when this Event was first observed. It is required. diff --git a/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/daemonset.go b/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/daemonset.go index 452f9b1c2d..c6968fec94 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/daemonset.go +++ b/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/daemonset.go @@ -34,7 +34,7 @@ import ( // more information. // DaemonSet represents the configuration of a daemon set. type DaemonSetApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/deployment.go b/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/deployment.go index 6d0e5f89cf..27a554b12c 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/deployment.go @@ -34,7 +34,7 @@ import ( // more information. // Deployment enables declarative updates for Pods and ReplicaSets. type DeploymentApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Specification of the desired behavior of the Deployment. diff --git a/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/ingress.go b/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/ingress.go index ba82ba9be4..8b6ed56e05 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/ingress.go +++ b/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/ingress.go @@ -36,7 +36,7 @@ import ( // based virtual hosting etc. // DEPRECATED - This group version of Ingress is deprecated by networking.k8s.io/v1beta1 Ingress. See the release notes for more information. type IngressApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/ingressrule.go b/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/ingressrule.go index 91ebcf89f0..323574f095 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/ingressrule.go +++ b/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/ingressrule.go @@ -53,7 +53,7 @@ type IngressRuleApplyConfiguration struct { // just traffic matching the host to the default backend or all traffic to the // default backend, is left to the controller fulfilling the Ingress. Http is // currently the only supported IngressRuleValue. - IngressRuleValueApplyConfiguration `json:",inline"` + IngressRuleValueApplyConfiguration `json:""` } // IngressRuleApplyConfiguration constructs a declarative configuration of the IngressRule type for use with diff --git a/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/networkpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/networkpolicy.go index 64d95e4925..860d8ec7e4 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/networkpolicy.go +++ b/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/networkpolicy.go @@ -33,7 +33,7 @@ import ( // DEPRECATED 1.9 - This group version of NetworkPolicy is deprecated by networking/v1/NetworkPolicy. // NetworkPolicy describes what network traffic is allowed for a set of Pods type NetworkPolicyApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/replicaset.go b/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/replicaset.go index 02d6cbffe4..2dfa8fdcb2 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/replicaset.go +++ b/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/replicaset.go @@ -34,7 +34,7 @@ import ( // more information. // ReplicaSet ensures that a specified number of pod replicas are running at any given time. type ReplicaSetApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // If the Labels of a ReplicaSet are empty, they are defaulted to // be the same as the Pod(s) that the ReplicaSet manages. // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata diff --git a/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/scale.go b/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/scale.go index 9637d58c84..8542fa6667 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/scale.go +++ b/vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/scale.go @@ -30,7 +30,7 @@ import ( // // represents a scaling request for a resource. type ScaleApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. diff --git a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschema.go b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschema.go index 1bfc945a3f..085dd1bf92 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschema.go +++ b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschema.go @@ -33,7 +33,7 @@ import ( // FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with // similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". type FlowSchemaApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemacondition.go b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemacondition.go index a9023615de..fa6c672058 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemacondition.go +++ b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemacondition.go @@ -32,8 +32,7 @@ type FlowSchemaConditionApplyConfiguration struct { // Required. Type *flowcontrolv1.FlowSchemaConditionType `json:"type,omitempty"` // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. Status *flowcontrolv1.ConditionStatus `json:"status,omitempty"` // `lastTransitionTime` is the last time the condition transitioned from one status to another. LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go index d64c3acb62..ae87170fd7 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go +++ b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go @@ -32,7 +32,7 @@ import ( // // PriorityLevelConfiguration represents the configuration of a priority level. type PriorityLevelConfigurationApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationcondition.go b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationcondition.go index 82b9547d57..ea7be15dca 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationcondition.go +++ b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationcondition.go @@ -32,8 +32,7 @@ type PriorityLevelConfigurationConditionApplyConfiguration struct { // Required. Type *flowcontrolv1.PriorityLevelConfigurationConditionType `json:"type,omitempty"` // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. Status *flowcontrolv1.ConditionStatus `json:"status,omitempty"` // `lastTransitionTime` is the last time the condition transitioned from one status to another. LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/flowschema.go b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/flowschema.go index 80a1f720fa..dbd3a5f291 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/flowschema.go +++ b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/flowschema.go @@ -33,7 +33,7 @@ import ( // FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with // similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". type FlowSchemaApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/flowschemacondition.go b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/flowschemacondition.go index 9462bbd02e..aa926a1be5 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/flowschemacondition.go +++ b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/flowschemacondition.go @@ -32,8 +32,7 @@ type FlowSchemaConditionApplyConfiguration struct { // Required. Type *flowcontrolv1beta1.FlowSchemaConditionType `json:"type,omitempty"` // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. Status *flowcontrolv1beta1.ConditionStatus `json:"status,omitempty"` // `lastTransitionTime` is the last time the condition transitioned from one status to another. LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfiguration.go b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfiguration.go index 8fecf8688c..1f34672a1b 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfiguration.go +++ b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfiguration.go @@ -32,7 +32,7 @@ import ( // // PriorityLevelConfiguration represents the configuration of a priority level. type PriorityLevelConfigurationApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationcondition.go b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationcondition.go index a2ebf71fc5..af4dc6a3a4 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationcondition.go +++ b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationcondition.go @@ -32,8 +32,7 @@ type PriorityLevelConfigurationConditionApplyConfiguration struct { // Required. Type *flowcontrolv1beta1.PriorityLevelConfigurationConditionType `json:"type,omitempty"` // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. Status *flowcontrolv1beta1.ConditionStatus `json:"status,omitempty"` // `lastTransitionTime` is the last time the condition transitioned from one status to another. LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/flowschema.go b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/flowschema.go index 394f24b993..a083ea91e9 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/flowschema.go +++ b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/flowschema.go @@ -33,7 +33,7 @@ import ( // FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with // similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". type FlowSchemaApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/flowschemacondition.go b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/flowschemacondition.go index 6bebc912c6..2706b563cb 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/flowschemacondition.go +++ b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/flowschemacondition.go @@ -32,8 +32,7 @@ type FlowSchemaConditionApplyConfiguration struct { // Required. Type *flowcontrolv1beta2.FlowSchemaConditionType `json:"type,omitempty"` // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. Status *flowcontrolv1beta2.ConditionStatus `json:"status,omitempty"` // `lastTransitionTime` is the last time the condition transitioned from one status to another. LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfiguration.go b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfiguration.go index a60827b636..56cb3557a3 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfiguration.go +++ b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfiguration.go @@ -32,7 +32,7 @@ import ( // // PriorityLevelConfiguration represents the configuration of a priority level. type PriorityLevelConfigurationApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationcondition.go b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationcondition.go index 26a8b66243..a6c7898868 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationcondition.go +++ b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationcondition.go @@ -32,8 +32,7 @@ type PriorityLevelConfigurationConditionApplyConfiguration struct { // Required. Type *flowcontrolv1beta2.PriorityLevelConfigurationConditionType `json:"type,omitempty"` // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. Status *flowcontrolv1beta2.ConditionStatus `json:"status,omitempty"` // `lastTransitionTime` is the last time the condition transitioned from one status to another. LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/flowschema.go b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/flowschema.go index 0079748b66..19e43e5cbe 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/flowschema.go +++ b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/flowschema.go @@ -33,7 +33,7 @@ import ( // FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with // similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". type FlowSchemaApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/flowschemacondition.go b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/flowschemacondition.go index de2aff5682..74189b100a 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/flowschemacondition.go +++ b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/flowschemacondition.go @@ -32,8 +32,7 @@ type FlowSchemaConditionApplyConfiguration struct { // Required. Type *flowcontrolv1beta3.FlowSchemaConditionType `json:"type,omitempty"` // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. Status *flowcontrolv1beta3.ConditionStatus `json:"status,omitempty"` // `lastTransitionTime` is the last time the condition transitioned from one status to another. LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfiguration.go b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfiguration.go index 910cb4c25c..5b16a044aa 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfiguration.go +++ b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfiguration.go @@ -32,7 +32,7 @@ import ( // // PriorityLevelConfiguration represents the configuration of a priority level. type PriorityLevelConfigurationApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // `metadata` is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationcondition.go b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationcondition.go index bd14650a93..87013c67b1 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationcondition.go +++ b/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationcondition.go @@ -32,8 +32,7 @@ type PriorityLevelConfigurationConditionApplyConfiguration struct { // Required. Type *flowcontrolv1beta3.PriorityLevelConfigurationConditionType `json:"type,omitempty"` // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. + // Should be specified and set to one of True, False, Unknown. Status *flowcontrolv1beta3.ConditionStatus `json:"status,omitempty"` // `lastTransitionTime` is the last time the condition transitioned from one status to another. LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereview.go b/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereview.go index f63c86ceb2..c2aad9565b 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereview.go +++ b/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereview.go @@ -32,13 +32,13 @@ import ( // // ImageReview checks if the set of images in a pod are allowed. type ImageReviewApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Spec holds information about the pod being evaluated + // spec holds information about the pod being evaluated Spec *ImageReviewSpecApplyConfiguration `json:"spec,omitempty"` - // Status is filled in by the backend and indicates whether the pod should be allowed. + // status is filled in by the backend and indicates whether the pod should be allowed. Status *ImageReviewStatusApplyConfiguration `json:"status,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewcontainerspec.go b/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewcontainerspec.go index 1f0193f031..0a24f4332d 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewcontainerspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewcontainerspec.go @@ -23,7 +23,7 @@ package v1alpha1 // // ImageReviewContainerSpec is a description of a container within the pod creation request. type ImageReviewContainerSpecApplyConfiguration struct { - // This can be in the form image:tag or image@SHA:012345679abcdef. + // image can be in the form image:tag or image@SHA:012345679abcdef. Image *string `json:"image,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewspec.go b/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewspec.go index 14c6603f5e..9abdc95017 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewspec.go @@ -23,13 +23,13 @@ package v1alpha1 // // ImageReviewSpec is a description of the pod creation request. type ImageReviewSpecApplyConfiguration struct { - // Containers is a list of a subset of the information in each container of the Pod being created. + // containers is a list of a subset of the information in each container of the Pod being created. Containers []ImageReviewContainerSpecApplyConfiguration `json:"containers,omitempty"` - // Annotations is a list of key-value pairs extracted from the Pod's annotations. + // annotations is a list of key-value pairs extracted from the Pod's annotations. // It only includes keys which match the pattern `*.image-policy.k8s.io/*`. // It is up to each webhook backend to determine how to interpret these annotations, if at all. Annotations map[string]string `json:"annotations,omitempty"` - // Namespace is the namespace the pod is being created in. + // namespace is the namespace the pod is being created in. Namespace *string `json:"namespace,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewstatus.go b/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewstatus.go index 52828a29c1..53d32ee915 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewstatus.go +++ b/vendor/k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1/imagereviewstatus.go @@ -23,13 +23,13 @@ package v1alpha1 // // ImageReviewStatus is the result of the review for the pod creation request. type ImageReviewStatusApplyConfiguration struct { - // Allowed indicates that all images were allowed to be run. + // allowed indicates that all images were allowed to be run. Allowed *bool `json:"allowed,omitempty"` - // Reason should be empty unless Allowed is false in which case it + // reason should be empty unless Allowed is false in which case it // may contain a short description of what is wrong. Kubernetes // may truncate excessively long errors when displaying to the user. Reason *string `json:"reason,omitempty"` - // AuditAnnotations will be added to the attributes object of the + // auditAnnotations will be added to the attributes object of the // admission controller request using 'AddAnnotation'. The keys should // be prefix-less (i.e., the admission controller will add an // appropriate prefix). diff --git a/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go b/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go index c0b255cc73..a8007a3d1b 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go +++ b/vendor/k8s.io/client-go/applyconfigurations/internal/internal.go @@ -3188,6 +3188,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: message type: scalar: string + - name: observedGeneration + type: + scalar: numeric - name: reason type: scalar: string @@ -3517,6 +3520,26 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" +- name: io.k8s.api.batch.v1.JobSchedulingConfiguration + map: + fields: + - name: disruptionMode + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupDisruptionMode + - name: resourceClaims + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupResourceClaim + elementRelationship: associative + keys: + - name + - name: schedulingConstraints + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupSchedulingConstraints + - name: schedulingPolicy + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupSchedulingPolicy - name: io.k8s.api.batch.v1.JobSpec map: fields: @@ -3553,6 +3576,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: podReplacementPolicy type: scalar: string + - name: scheduling + type: + namedType: io.k8s.api.batch.v1.JobSchedulingConfiguration - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector @@ -3877,6 +3903,120 @@ var schemaYAML = typed.YAMLObject(`types: elementRelationship: associative keys: - type +- name: io.k8s.api.certificates.v1.ClusterTrustBundle + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.certificates.v1.ClusterTrustBundleSpec + default: {} +- name: io.k8s.api.certificates.v1.ClusterTrustBundleSpec + map: + fields: + - name: signerName + type: + scalar: string + - name: trustBundle + type: + scalar: string + default: "" +- name: io.k8s.api.certificates.v1.PodCertificateRequest + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.certificates.v1.PodCertificateRequestSpec + default: {} + - name: status + type: + namedType: io.k8s.api.certificates.v1.PodCertificateRequestStatus + default: {} +- name: io.k8s.api.certificates.v1.PodCertificateRequestSpec + map: + fields: + - name: maxExpirationSeconds + type: + scalar: numeric + default: 86400 + - name: nodeName + type: + scalar: string + default: "" + - name: nodeUID + type: + scalar: string + default: "" + - name: podName + type: + scalar: string + default: "" + - name: podUID + type: + scalar: string + default: "" + - name: serviceAccountName + type: + scalar: string + default: "" + - name: serviceAccountUID + type: + scalar: string + default: "" + - name: signerName + type: + scalar: string + default: "" + - name: stubPKCS10Request + type: + scalar: string + - name: unverifiedUserAnnotations + type: + map: + elementType: + scalar: string +- name: io.k8s.api.certificates.v1.PodCertificateRequestStatus + map: + fields: + - name: beginRefreshAt + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: certificateChain + type: + scalar: string + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: notAfter + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: notBefore + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: io.k8s.api.certificates.v1alpha1.ClusterTrustBundle map: fields: @@ -4572,6 +4712,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: signerName type: scalar: string + - name: user + type: + scalar: numeric - name: io.k8s.api.core.v1.ComponentCondition map: fields: @@ -4704,6 +4847,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: defaultMode type: scalar: numeric + - name: defaultUser + type: + scalar: numeric - name: items type: list: @@ -5069,12 +5215,18 @@ var schemaYAML = typed.YAMLObject(`types: - name: resourceFieldRef type: namedType: io.k8s.api.core.v1.ResourceFieldSelector + - name: user + type: + scalar: numeric - name: io.k8s.api.core.v1.DownwardAPIVolumeSource map: fields: - name: defaultMode type: scalar: numeric + - name: defaultUser + type: + scalar: numeric - name: items type: list: @@ -5087,6 +5239,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: medium type: scalar: string + - name: mode + type: + scalar: numeric - name: sizeLimit type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity @@ -5409,6 +5564,17 @@ var schemaYAML = typed.YAMLObject(`types: - name: host type: scalar: string +- name: io.k8s.api.core.v1.EvictionResponder + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: priority + type: + scalar: numeric + elementRelationship: atomic - name: io.k8s.api.core.v1.ExecAction map: fields: @@ -5532,6 +5698,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.core.v1.GRPCAction map: fields: + - name: mode + type: + scalar: string - name: port type: scalar: numeric @@ -5602,6 +5771,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: port type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + - name: protocol + type: + scalar: string - name: scheme type: scalar: string @@ -5761,6 +5933,9 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" + - name: user + type: + scalar: numeric - name: io.k8s.api.core.v1.Lifecycle map: fields: @@ -6040,6 +6215,29 @@ var schemaYAML = typed.YAMLObject(`types: - name: requiredDuringSchedulingIgnoredDuringExecution type: namedType: io.k8s.api.core.v1.NodeSelector +- name: io.k8s.api.core.v1.NodeAllocatableMappedResources + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: quantity + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.core.v1.NodeAllocatableOverheadResources + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: perContainer + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: perPod + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.core.v1.NodeAllocatableResourceClaimStatus map: fields: @@ -6049,15 +6247,26 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: associative + - name: mapping + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NodeAllocatableMappedResources + elementRelationship: associative + keys: + - name + - name: overhead + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NodeAllocatableOverheadResources + elementRelationship: associative + keys: + - name - name: resourceClaimName type: scalar: string default: "" - - name: resources - type: - map: - elementType: - namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.core.v1.NodeCondition map: fields: @@ -6115,6 +6324,15 @@ var schemaYAML = typed.YAMLObject(`types: - name: supplementalGroupsPolicy type: scalar: boolean +- name: io.k8s.api.core.v1.NodePodPreemptionPolicy + map: + fields: + - name: disableResizePreemption + type: + list: + elementType: + scalar: string + elementRelationship: associative - name: io.k8s.api.core.v1.NodeRuntimeHandler map: fields: @@ -6195,6 +6413,9 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: associative + - name: podPreemptionPolicy + type: + namedType: io.k8s.api.core.v1.NodePodPreemptionPolicy - name: providerID type: scalar: string @@ -6328,6 +6549,9 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" + - name: runningInUserNamespace + type: + scalar: boolean - name: swap type: namedType: io.k8s.api.core.v1.NodeSwapStatus @@ -6506,6 +6730,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: currentVolumeAttributesClassName type: scalar: string + - name: healthStatus + type: + namedType: io.k8s.api.core.v1.VolumeHealthStatus - name: modifyVolumeStatus type: namedType: io.k8s.api.core.v1.ModifyVolumeStatus @@ -6766,6 +6993,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: signerName type: scalar: string + - name: user + type: + scalar: numeric - name: userAnnotations type: map: @@ -6986,6 +7216,14 @@ var schemaYAML = typed.YAMLObject(`types: elementRelationship: associative keys: - name + - name: evictionResponders + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EvictionResponder + elementRelationship: associative + keys: + - name - name: hostAliases type: list: @@ -7189,7 +7427,9 @@ var schemaYAML = typed.YAMLObject(`types: list: elementType: namedType: io.k8s.api.core.v1.NodeAllocatableResourceClaimStatus - elementRelationship: atomic + elementRelationship: associative + keys: + - resourceClaimName - name: nominatedNodeName type: scalar: string @@ -7233,6 +7473,14 @@ var schemaYAML = typed.YAMLObject(`types: - name: startTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: volumeHealth + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PodVolumeHealth + elementRelationship: associative + keys: + - name - name: io.k8s.api.core.v1.PodTemplate map: fields: @@ -7261,6 +7509,25 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.api.core.v1.PodSpec default: {} +- name: io.k8s.api.core.v1.PodVolumeHealth + map: + fields: + - name: healthConditions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.VolumeHealthCondition + elementRelationship: associative + keys: + - status + - reason + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: name + type: + scalar: string + default: "" - name: io.k8s.api.core.v1.PortStatus map: fields: @@ -7338,6 +7605,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: defaultMode type: scalar: numeric + - name: defaultUser + type: + scalar: numeric - name: sources type: list: @@ -7864,6 +8134,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: defaultMode type: scalar: numeric + - name: defaultUser + type: + scalar: numeric - name: items type: list: @@ -7979,6 +8252,9 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" + - name: user + type: + scalar: numeric - name: io.k8s.api.core.v1.ServicePort map: fields: @@ -8401,21 +8677,56 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" -- name: io.k8s.api.core.v1.VolumeMount +- name: io.k8s.api.core.v1.VolumeHealthCondition map: fields: - - name: mountPath + - name: message type: scalar: string - default: "" - - name: mountPropagation + - name: reason type: scalar: string - - name: name + default: "" + - name: status type: scalar: string default: "" - - name: readOnly +- name: io.k8s.api.core.v1.VolumeHealthStatus + map: + fields: + - name: healthConditions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.VolumeHealthCondition + elementRelationship: associative + keys: + - status + - reason + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time +- name: io.k8s.api.core.v1.VolumeMount + map: + fields: + - name: bindMountOptions + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: mountPath + type: + scalar: string + default: "" + - name: mountPropagation + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: readOnly type: scalar: boolean - name: recursiveReadOnly @@ -10862,6 +11173,214 @@ var schemaYAML = typed.YAMLObject(`types: - name: reason type: scalar: string +- name: io.k8s.api.lifecycle.v1alpha1.Eviction + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.lifecycle.v1alpha1.EvictionSpec + default: {} + - name: status + type: + namedType: io.k8s.api.lifecycle.v1alpha1.EvictionStatus + default: {} +- name: io.k8s.api.lifecycle.v1alpha1.EvictionPodReference + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: uid + type: + scalar: string + default: "" +- name: io.k8s.api.lifecycle.v1alpha1.EvictionRequest + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.lifecycle.v1alpha1.EvictionRequestSpec + default: {} + - name: status + type: + namedType: io.k8s.api.lifecycle.v1alpha1.EvictionRequestStatus + default: {} +- name: io.k8s.api.lifecycle.v1alpha1.EvictionRequestPodReference + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: uid + type: + scalar: string + default: "" +- name: io.k8s.api.lifecycle.v1alpha1.EvictionRequestSpec + map: + fields: + - name: intent + type: + scalar: string + default: "" + - name: requester + type: + scalar: string + default: "" + - name: target + type: + namedType: io.k8s.api.lifecycle.v1alpha1.EvictionRequestTarget + default: {} +- name: io.k8s.api.lifecycle.v1alpha1.EvictionRequestStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: observedGeneration + type: + scalar: numeric +- name: io.k8s.api.lifecycle.v1alpha1.EvictionRequestTarget + map: + fields: + - name: pod + type: + namedType: io.k8s.api.lifecycle.v1alpha1.EvictionRequestPodReference + unions: + - fields: + - fieldName: pod + discriminatorValue: Pod +- name: io.k8s.api.lifecycle.v1alpha1.EvictionSpec + map: + fields: + - name: target + type: + namedType: io.k8s.api.lifecycle.v1alpha1.EvictionTarget + default: {} +- name: io.k8s.api.lifecycle.v1alpha1.EvictionStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: observedGeneration + type: + scalar: numeric + - name: requesters + type: + list: + elementType: + namedType: io.k8s.api.lifecycle.v1alpha1.Requester + elementRelationship: associative + keys: + - name + - name: responders + type: + list: + elementType: + namedType: io.k8s.api.lifecycle.v1alpha1.ResponderStatus + elementRelationship: associative + keys: + - name + - name: targetResponders + type: + list: + elementType: + namedType: io.k8s.api.lifecycle.v1alpha1.TargetResponder + elementRelationship: associative + keys: + - name +- name: io.k8s.api.lifecycle.v1alpha1.EvictionTarget + map: + fields: + - name: pod + type: + namedType: io.k8s.api.lifecycle.v1alpha1.EvictionPodReference + unions: + - fields: + - fieldName: pod + discriminatorValue: Pod +- name: io.k8s.api.lifecycle.v1alpha1.Requester + map: + fields: + - name: intent + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + elementRelationship: atomic +- name: io.k8s.api.lifecycle.v1alpha1.ResponderStatus + map: + fields: + - name: completionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: expectedCompletionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: heartbeatTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: startTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + elementRelationship: separable +- name: io.k8s.api.lifecycle.v1alpha1.TargetResponder + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: priority + type: + scalar: numeric + - name: state + type: + scalar: string + default: "" + elementRelationship: atomic - name: io.k8s.api.networking.v1.HTTPIngressPath map: fields: @@ -12476,11 +12995,11 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" - - name: nodeAllocatableResourceMappings + - name: nodeAllocatableResources type: map: elementType: - namedType: io.k8s.api.resource.v1.NodeAllocatableResourceMapping + namedType: io.k8s.api.resource.v1.NodeAllocatableResource - name: nodeName type: scalar: string @@ -12664,6 +13183,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.resource.v1.DeviceCounterConsumption map: fields: + - name: compatibilityGroups + type: + list: + elementType: + scalar: string + elementRelationship: atomic - name: counterSet type: scalar: string @@ -12673,6 +13198,17 @@ var schemaYAML = typed.YAMLObject(`types: map: elementType: namedType: io.k8s.api.resource.v1.Counter +- name: io.k8s.api.resource.v1.DeviceDerivedAttribute + map: + fields: + - name: expression + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" - name: io.k8s.api.resource.v1.DeviceRequest map: fields: @@ -12731,6 +13267,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: shareID type: scalar: string + - name: skipNodeOperations + type: + list: + elementType: + scalar: string + elementRelationship: associative - name: tolerations type: list: @@ -12755,6 +13297,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: count type: scalar: numeric + - name: derivedAttributes + type: + list: + elementType: + namedType: io.k8s.api.resource.v1.DeviceDerivedAttribute + elementRelationship: atomic - name: deviceClassName type: scalar: string @@ -12792,40 +13340,100 @@ var schemaYAML = typed.YAMLObject(`types: - name: value type: scalar: string -- name: io.k8s.api.resource.v1.DeviceToleration +- name: io.k8s.api.resource.v1.DeviceTaintRule map: fields: - - name: effect + - name: apiVersion type: scalar: string - - name: key + - name: kind type: scalar: string - - name: operator + - name: metadata type: - scalar: string - default: Equal - - name: tolerationSeconds + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec type: - scalar: numeric - - name: value + namedType: io.k8s.api.resource.v1.DeviceTaintRuleSpec + default: {} + - name: status type: - scalar: string -- name: io.k8s.api.resource.v1.ExactDeviceRequest + namedType: io.k8s.api.resource.v1.DeviceTaintRuleStatus + default: {} +- name: io.k8s.api.resource.v1.DeviceTaintRuleSpec map: fields: - - name: adminAccess - type: - scalar: boolean - - name: allocationMode + - name: deviceSelector type: - scalar: string - - name: capacity + namedType: io.k8s.api.resource.v1.DeviceTaintSelector + - name: taint type: - namedType: io.k8s.api.resource.v1.CapacityRequirements - - name: count + namedType: io.k8s.api.resource.v1.DeviceTaint + default: {} +- name: io.k8s.api.resource.v1.DeviceTaintRuleStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type +- name: io.k8s.api.resource.v1.DeviceTaintSelector + map: + fields: + - name: device + type: + scalar: string + - name: driver + type: + scalar: string + - name: pool + type: + scalar: string +- name: io.k8s.api.resource.v1.DeviceToleration + map: + fields: + - name: effect + type: + scalar: string + - name: key + type: + scalar: string + - name: operator + type: + scalar: string + default: Equal + - name: tolerationSeconds type: scalar: numeric + - name: value + type: + scalar: string +- name: io.k8s.api.resource.v1.ExactDeviceRequest + map: + fields: + - name: adminAccess + type: + scalar: boolean + - name: allocationMode + type: + scalar: string + - name: capacity + type: + namedType: io.k8s.api.resource.v1.CapacityRequirements + - name: count + type: + scalar: numeric + - name: derivedAttributes + type: + list: + elementType: + namedType: io.k8s.api.resource.v1.DeviceDerivedAttribute + elementRelationship: atomic - name: deviceClassName type: scalar: string @@ -12857,15 +13465,36 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: atomic -- name: io.k8s.api.resource.v1.NodeAllocatableResourceMapping +- name: io.k8s.api.resource.v1.NodeAllocatableMapping map: fields: - - name: allocationMultiplier - type: - namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: capacityKey type: scalar: string + - name: capacityMultiplier + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: deviceMultiplier + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1.NodeAllocatableOverhead + map: + fields: + - name: perContainer + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: perPod + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1.NodeAllocatableResource + map: + fields: + - name: mapping + type: + namedType: io.k8s.api.resource.v1.NodeAllocatableMapping + - name: overhead + type: + namedType: io.k8s.api.resource.v1.NodeAllocatableOverhead - name: io.k8s.api.resource.v1.OpaqueDeviceConfiguration map: fields: @@ -13029,6 +13658,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: nodeSelector type: namedType: io.k8s.api.core.v1.NodeSelector + - name: partitionTypeAttribute + type: + scalar: string - name: perDeviceNodeSelection type: scalar: boolean @@ -13042,6 +13674,12 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.resource.v1.CounterSet elementRelationship: atomic + - name: skipNodeOperations + type: + list: + elementType: + scalar: string + elementRelationship: associative - name: io.k8s.api.resource.v1alpha3.DeviceTaint map: fields: @@ -13113,6 +13751,21 @@ var schemaYAML = typed.YAMLObject(`types: - name: pool type: scalar: string +- name: io.k8s.api.resource.v1alpha3.PartitionTypeStatus + map: + fields: + - name: allocatable + type: + scalar: numeric + - name: attribute + type: + scalar: string + - name: total + type: + scalar: numeric + - name: type + type: + scalar: string - name: io.k8s.api.resource.v1alpha3.PoolStatus map: fields: @@ -13132,12 +13785,21 @@ var schemaYAML = typed.YAMLObject(`types: - name: nodeName type: scalar: string + - name: partitionSummary + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.PartitionTypeStatus + elementRelationship: atomic - name: poolName type: scalar: string - name: resourceSliceCount type: scalar: numeric + - name: shareableSummary + type: + namedType: io.k8s.api.resource.v1alpha3.ShareableSummaryStatus - name: totalDevices type: scalar: numeric @@ -13170,6 +13832,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.resource.v1alpha3.ResourcePoolStatusRequestSpec map: fields: + - name: defaultPartitionTypeAttribute + type: + scalar: string - name: driver type: scalar: string @@ -13201,6 +13866,36 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.resource.v1alpha3.PoolStatus elementRelationship: atomic +- name: io.k8s.api.resource.v1alpha3.ShareableCapacityStatus + map: + fields: + - name: available + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: consumed + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: name + type: + scalar: string + - name: total + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1alpha3.ShareableSummaryStatus + map: + fields: + - name: capacity + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.ShareableCapacityStatus + elementRelationship: atomic + - name: fullyAvailableDevices + type: + scalar: numeric + - name: partiallyAvailableDevices + type: + scalar: numeric - name: io.k8s.api.resource.v1beta1.AllocatedDeviceStatus map: fields: @@ -13286,11 +13981,11 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.resource.v1beta1.DeviceCounterConsumption elementRelationship: atomic - - name: nodeAllocatableResourceMappings + - name: nodeAllocatableResources type: map: elementType: - namedType: io.k8s.api.resource.v1beta1.NodeAllocatableResourceMapping + namedType: io.k8s.api.resource.v1beta1.NodeAllocatableResource - name: nodeName type: scalar: string @@ -13544,6 +14239,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.resource.v1beta1.DeviceCounterConsumption map: fields: + - name: compatibilityGroups + type: + list: + elementType: + scalar: string + elementRelationship: atomic - name: counterSet type: scalar: string @@ -13553,6 +14254,17 @@ var schemaYAML = typed.YAMLObject(`types: map: elementType: namedType: io.k8s.api.resource.v1beta1.Counter +- name: io.k8s.api.resource.v1beta1.DeviceDerivedAttribute + map: + fields: + - name: expression + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" - name: io.k8s.api.resource.v1beta1.DeviceRequest map: fields: @@ -13568,6 +14280,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: count type: scalar: numeric + - name: derivedAttributes + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta1.DeviceDerivedAttribute + elementRelationship: atomic - name: deviceClassName type: scalar: string @@ -13636,6 +14354,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: shareID type: scalar: string + - name: skipNodeOperations + type: + list: + elementType: + scalar: string + elementRelationship: associative - name: tolerations type: list: @@ -13660,6 +14384,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: count type: scalar: numeric + - name: derivedAttributes + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta1.DeviceDerivedAttribute + elementRelationship: atomic - name: deviceClassName type: scalar: string @@ -13731,15 +14461,36 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: atomic -- name: io.k8s.api.resource.v1beta1.NodeAllocatableResourceMapping +- name: io.k8s.api.resource.v1beta1.NodeAllocatableMapping map: fields: - - name: allocationMultiplier - type: - namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: capacityKey type: scalar: string + - name: capacityMultiplier + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: deviceMultiplier + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1beta1.NodeAllocatableOverhead + map: + fields: + - name: perContainer + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: perPod + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1beta1.NodeAllocatableResource + map: + fields: + - name: mapping + type: + namedType: io.k8s.api.resource.v1beta1.NodeAllocatableMapping + - name: overhead + type: + namedType: io.k8s.api.resource.v1beta1.NodeAllocatableOverhead - name: io.k8s.api.resource.v1beta1.OpaqueDeviceConfiguration map: fields: @@ -13903,6 +14654,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: nodeSelector type: namedType: io.k8s.api.core.v1.NodeSelector + - name: partitionTypeAttribute + type: + scalar: string - name: perDeviceNodeSelection type: scalar: boolean @@ -13916,6 +14670,12 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.resource.v1beta1.CounterSet elementRelationship: atomic + - name: skipNodeOperations + type: + list: + elementType: + scalar: string + elementRelationship: associative - name: io.k8s.api.resource.v1beta2.AllocatedDeviceStatus map: fields: @@ -14065,11 +14825,11 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" - - name: nodeAllocatableResourceMappings + - name: nodeAllocatableResources type: map: elementType: - namedType: io.k8s.api.resource.v1beta2.NodeAllocatableResourceMapping + namedType: io.k8s.api.resource.v1beta2.NodeAllocatableResource - name: nodeName type: scalar: string @@ -14253,6 +15013,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.resource.v1beta2.DeviceCounterConsumption map: fields: + - name: compatibilityGroups + type: + list: + elementType: + scalar: string + elementRelationship: atomic - name: counterSet type: scalar: string @@ -14262,6 +15028,17 @@ var schemaYAML = typed.YAMLObject(`types: map: elementType: namedType: io.k8s.api.resource.v1beta2.Counter +- name: io.k8s.api.resource.v1beta2.DeviceDerivedAttribute + map: + fields: + - name: expression + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" - name: io.k8s.api.resource.v1beta2.DeviceRequest map: fields: @@ -14320,6 +15097,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: shareID type: scalar: string + - name: skipNodeOperations + type: + list: + elementType: + scalar: string + elementRelationship: associative - name: tolerations type: list: @@ -14344,6 +15127,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: count type: scalar: numeric + - name: derivedAttributes + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceDerivedAttribute + elementRelationship: atomic - name: deviceClassName type: scalar: string @@ -14469,6 +15258,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: count type: scalar: numeric + - name: derivedAttributes + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceDerivedAttribute + elementRelationship: atomic - name: deviceClassName type: scalar: string @@ -14500,15 +15295,36 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: atomic -- name: io.k8s.api.resource.v1beta2.NodeAllocatableResourceMapping +- name: io.k8s.api.resource.v1beta2.NodeAllocatableMapping map: fields: - - name: allocationMultiplier - type: - namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: capacityKey type: scalar: string + - name: capacityMultiplier + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: deviceMultiplier + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1beta2.NodeAllocatableOverhead + map: + fields: + - name: perContainer + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: perPod + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1beta2.NodeAllocatableResource + map: + fields: + - name: mapping + type: + namedType: io.k8s.api.resource.v1beta2.NodeAllocatableMapping + - name: overhead + type: + namedType: io.k8s.api.resource.v1beta2.NodeAllocatableOverhead - name: io.k8s.api.resource.v1beta2.OpaqueDeviceConfiguration map: fields: @@ -14672,6 +15488,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: nodeSelector type: namedType: io.k8s.api.core.v1.NodeSelector + - name: partitionTypeAttribute + type: + scalar: string - name: perDeviceNodeSelection type: scalar: boolean @@ -14685,6 +15504,12 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.resource.v1beta2.CounterSet elementRelationship: atomic + - name: skipNodeOperations + type: + list: + elementType: + scalar: string + elementRelationship: associative - name: io.k8s.api.scheduling.v1.PriorityClass map: fields: @@ -14711,7 +15536,7 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: numeric default: 0 -- name: io.k8s.api.scheduling.v1alpha2.BasicSchedulingPolicy +- name: io.k8s.api.scheduling.v1alpha3.AllCompositeDisruptionMode map: elementType: scalar: untyped @@ -14723,35 +15548,742 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: __untyped_deduced_ elementRelationship: separable -- name: io.k8s.api.scheduling.v1alpha2.GangSchedulingPolicy - map: - fields: - - name: minCount - type: - scalar: numeric - default: 0 -- name: io.k8s.api.scheduling.v1alpha2.PodGroup +- name: io.k8s.api.scheduling.v1alpha3.AllDisruptionMode map: - fields: - - name: apiVersion - type: - scalar: string - - name: kind - type: - scalar: string - - name: metadata - type: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta - default: {} - - name: spec - type: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSpec - default: {} - - name: status - type: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupStatus - default: {} -- name: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaim + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1alpha3.BasicSchedulingPolicy + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1alpha3.CompositeBasicSchedulingPolicy + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1alpha3.CompositeDisruptionMode + map: + fields: + - name: all + type: + namedType: io.k8s.api.scheduling.v1alpha3.AllCompositeDisruptionMode + - name: single + type: + namedType: io.k8s.api.scheduling.v1alpha3.SingleCompositeDisruptionMode + unions: + - fields: + - fieldName: all + discriminatorValue: All + - fieldName: single + discriminatorValue: Single +- name: io.k8s.api.scheduling.v1alpha3.CompositeGangSchedulingPolicy + map: + fields: + - name: minGroupCount + type: + scalar: numeric + default: 0 +- name: io.k8s.api.scheduling.v1alpha3.CompositePodGroup + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositePodGroupSpec + default: {} + - name: status + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositePodGroupStatus + default: {} +- name: io.k8s.api.scheduling.v1alpha3.CompositePodGroupSchedulingConstraints + map: + fields: + - name: topology + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.TopologyConstraint + elementRelationship: atomic +- name: io.k8s.api.scheduling.v1alpha3.CompositePodGroupSchedulingPolicy + map: + fields: + - name: basic + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositeBasicSchedulingPolicy + - name: gang + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositeGangSchedulingPolicy + unions: + - fields: + - fieldName: basic + discriminatorValue: Basic + - fieldName: gang + discriminatorValue: Gang +- name: io.k8s.api.scheduling.v1alpha3.CompositePodGroupSpec + map: + fields: + - name: disruptionMode + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositeDisruptionMode + default: + single: {} + - name: parentCompositePodGroupName + type: + scalar: string + - name: preemptionPolicy + type: + scalar: string + - name: priority + type: + scalar: numeric + - name: priorityClassName + type: + scalar: string + - name: schedulingConstraints + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositePodGroupSchedulingConstraints + - name: schedulingPolicy + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositePodGroupSchedulingPolicy + default: {} + - name: workloadRef + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadReference +- name: io.k8s.api.scheduling.v1alpha3.CompositePodGroupStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type +- name: io.k8s.api.scheduling.v1alpha3.CompositePodGroupTemplate + map: + fields: + - name: compositePodGroupTemplates + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.CompositePodGroupTemplate + elementRelationship: associative + keys: + - name + - name: disruptionMode + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositeDisruptionMode + - name: name + type: + scalar: string + default: "" + - name: podGroupTemplates + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupTemplate + elementRelationship: associative + keys: + - name + - name: preemptionPolicy + type: + scalar: string + - name: priority + type: + scalar: numeric + - name: priorityClassName + type: + scalar: string + - name: schedulingConstraints + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositePodGroupSchedulingConstraints + - name: schedulingPolicy + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositePodGroupSchedulingPolicy + default: {} +- name: io.k8s.api.scheduling.v1alpha3.DisruptionMode + map: + fields: + - name: all + type: + namedType: io.k8s.api.scheduling.v1alpha3.AllDisruptionMode + - name: single + type: + namedType: io.k8s.api.scheduling.v1alpha3.SingleDisruptionMode + unions: + - fields: + - fieldName: all + discriminatorValue: All + - fieldName: single + discriminatorValue: Single +- name: io.k8s.api.scheduling.v1alpha3.GangSchedulingPolicy + map: + fields: + - name: minCount + type: + scalar: numeric + default: 0 +- name: io.k8s.api.scheduling.v1alpha3.PodGroup + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupSpec + default: {} + - name: status + type: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupStatus + default: {} +- name: io.k8s.api.scheduling.v1alpha3.PodGroupResourceClaim + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: resourceClaimName + type: + scalar: string + - name: resourceClaimTemplateName + type: + scalar: string +- name: io.k8s.api.scheduling.v1alpha3.PodGroupResourceClaimStatus + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: resourceClaimName + type: + scalar: string +- name: io.k8s.api.scheduling.v1alpha3.PodGroupSchedulingConstraints + map: + fields: + - name: topology + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.TopologyConstraint + elementRelationship: atomic +- name: io.k8s.api.scheduling.v1alpha3.PodGroupSchedulingPolicy + map: + fields: + - name: basic + type: + namedType: io.k8s.api.scheduling.v1alpha3.BasicSchedulingPolicy + - name: gang + type: + namedType: io.k8s.api.scheduling.v1alpha3.GangSchedulingPolicy + unions: + - fields: + - fieldName: basic + discriminatorValue: Basic + - fieldName: gang + discriminatorValue: Gang +- name: io.k8s.api.scheduling.v1alpha3.PodGroupSpec + map: + fields: + - name: disruptionMode + type: + namedType: io.k8s.api.scheduling.v1alpha3.DisruptionMode + default: + single: {} + - name: parentCompositePodGroupName + type: + scalar: string + - name: preemptionPolicy + type: + scalar: string + - name: priority + type: + scalar: numeric + - name: priorityClassName + type: + scalar: string + - name: resourceClaims + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupResourceClaim + elementRelationship: associative + keys: + - name + - name: schedulingConstraints + type: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupSchedulingConstraints + - name: schedulingPolicy + type: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupSchedulingPolicy + default: {} + - name: workloadRef + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadReference +- name: io.k8s.api.scheduling.v1alpha3.PodGroupStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: resourceClaimStatuses + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupResourceClaimStatus + elementRelationship: associative + keys: + - name +- name: io.k8s.api.scheduling.v1alpha3.PodGroupTemplate + map: + fields: + - name: disruptionMode + type: + namedType: io.k8s.api.scheduling.v1alpha3.DisruptionMode + - name: name + type: + scalar: string + default: "" + - name: preemptionPolicy + type: + scalar: string + - name: priority + type: + scalar: numeric + - name: priorityClassName + type: + scalar: string + - name: resourceClaims + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupResourceClaim + elementRelationship: associative + keys: + - name + - name: schedulingConstraints + type: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupSchedulingConstraints + - name: schedulingPolicy + type: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupSchedulingPolicy + default: {} +- name: io.k8s.api.scheduling.v1alpha3.SingleCompositeDisruptionMode + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1alpha3.SingleDisruptionMode + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1alpha3.TopologyConstraint + map: + fields: + - name: key + type: + scalar: string + default: "" +- name: io.k8s.api.scheduling.v1alpha3.TypedLocalObjectReference + map: + fields: + - name: apiGroup + type: + scalar: string + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.scheduling.v1alpha3.Workload + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadSpec + default: {} +- name: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupAllDisruptionMode + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupBasicSchedulingPolicy + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupDisruptionMode + map: + fields: + - name: all + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupAllDisruptionMode + - name: single + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupSingleDisruptionMode + unions: + - fields: + - fieldName: all + discriminatorValue: All + - fieldName: single + discriminatorValue: Single +- name: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupGangSchedulingPolicy + map: + fields: + - name: minCount + type: + scalar: numeric +- name: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupResourceClaim + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: resourceClaimName + type: + scalar: string + - name: resourceClaimTemplateName + type: + scalar: string +- name: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupSchedulingConstraints + map: + fields: + - name: topology + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.TopologyConstraint + elementRelationship: atomic +- name: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupSchedulingPolicy + map: + fields: + - name: basic + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupBasicSchedulingPolicy + - name: gang + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupGangSchedulingPolicy + unions: + - fields: + - fieldName: basic + discriminatorValue: Basic + - fieldName: gang + discriminatorValue: Gang +- name: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupSingleDisruptionMode + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1alpha3.WorkloadReference + map: + fields: + - name: templateName + type: + scalar: string + default: "" + - name: workloadName + type: + scalar: string + default: "" +- name: io.k8s.api.scheduling.v1alpha3.WorkloadSpec + map: + fields: + - name: compositePodGroupTemplates + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.CompositePodGroupTemplate + elementRelationship: associative + keys: + - name + - name: controllerRef + type: + namedType: io.k8s.api.scheduling.v1alpha3.TypedLocalObjectReference + - name: podGroupTemplates + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupTemplate + elementRelationship: associative + keys: + - name +- name: io.k8s.api.scheduling.v1beta1.AllCompositeDisruptionMode + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1beta1.AllDisruptionMode + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1beta1.BasicSchedulingPolicy + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1beta1.CompositeBasicSchedulingPolicy + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1beta1.CompositeDisruptionMode + map: + fields: + - name: all + type: + namedType: io.k8s.api.scheduling.v1beta1.AllCompositeDisruptionMode + - name: single + type: + namedType: io.k8s.api.scheduling.v1beta1.SingleCompositeDisruptionMode + unions: + - fields: + - fieldName: all + discriminatorValue: All + - fieldName: single + discriminatorValue: Single +- name: io.k8s.api.scheduling.v1beta1.CompositeGangSchedulingPolicy + map: + fields: + - name: minGroupCount + type: + scalar: numeric + default: 0 +- name: io.k8s.api.scheduling.v1beta1.CompositePodGroupSchedulingConstraints + map: + fields: + - name: topology + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1beta1.TopologyConstraint + elementRelationship: atomic +- name: io.k8s.api.scheduling.v1beta1.CompositePodGroupSchedulingPolicy + map: + fields: + - name: basic + type: + namedType: io.k8s.api.scheduling.v1beta1.CompositeBasicSchedulingPolicy + - name: gang + type: + namedType: io.k8s.api.scheduling.v1beta1.CompositeGangSchedulingPolicy + unions: + - fields: + - fieldName: basic + discriminatorValue: Basic + - fieldName: gang + discriminatorValue: Gang +- name: io.k8s.api.scheduling.v1beta1.CompositePodGroupTemplate + map: + fields: + - name: compositePodGroupTemplates + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1beta1.CompositePodGroupTemplate + elementRelationship: associative + keys: + - name + - name: disruptionMode + type: + namedType: io.k8s.api.scheduling.v1beta1.CompositeDisruptionMode + - name: name + type: + scalar: string + default: "" + - name: podGroupTemplates + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1beta1.PodGroupTemplate + elementRelationship: associative + keys: + - name + - name: preemptionPolicy + type: + scalar: string + - name: priority + type: + scalar: numeric + - name: priorityClassName + type: + scalar: string + - name: schedulingConstraints + type: + namedType: io.k8s.api.scheduling.v1beta1.CompositePodGroupSchedulingConstraints + - name: schedulingPolicy + type: + namedType: io.k8s.api.scheduling.v1beta1.CompositePodGroupSchedulingPolicy + default: {} +- name: io.k8s.api.scheduling.v1beta1.DisruptionMode + map: + fields: + - name: all + type: + namedType: io.k8s.api.scheduling.v1beta1.AllDisruptionMode + - name: single + type: + namedType: io.k8s.api.scheduling.v1beta1.SingleDisruptionMode + unions: + - fields: + - fieldName: all + discriminatorValue: All + - fieldName: single + discriminatorValue: Single +- name: io.k8s.api.scheduling.v1beta1.GangSchedulingPolicy + map: + fields: + - name: minCount + type: + scalar: numeric + default: 0 +- name: io.k8s.api.scheduling.v1beta1.PodGroup + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.scheduling.v1beta1.PodGroupSpec + default: {} + - name: status + type: + namedType: io.k8s.api.scheduling.v1beta1.PodGroupStatus + default: {} +- name: io.k8s.api.scheduling.v1beta1.PodGroupResourceClaim map: fields: - name: name @@ -14764,7 +16296,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: resourceClaimTemplateName type: scalar: string -- name: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaimStatus +- name: io.k8s.api.scheduling.v1beta1.PodGroupResourceClaimStatus map: fields: - name: name @@ -14774,40 +16306,44 @@ var schemaYAML = typed.YAMLObject(`types: - name: resourceClaimName type: scalar: string -- name: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingConstraints +- name: io.k8s.api.scheduling.v1beta1.PodGroupSchedulingConstraints map: fields: - name: topology type: list: elementType: - namedType: io.k8s.api.scheduling.v1alpha2.TopologyConstraint + namedType: io.k8s.api.scheduling.v1beta1.TopologyConstraint elementRelationship: atomic -- name: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingPolicy +- name: io.k8s.api.scheduling.v1beta1.PodGroupSchedulingPolicy map: fields: - name: basic type: - namedType: io.k8s.api.scheduling.v1alpha2.BasicSchedulingPolicy + namedType: io.k8s.api.scheduling.v1beta1.BasicSchedulingPolicy - name: gang type: - namedType: io.k8s.api.scheduling.v1alpha2.GangSchedulingPolicy + namedType: io.k8s.api.scheduling.v1beta1.GangSchedulingPolicy unions: - fields: - fieldName: basic discriminatorValue: Basic - fieldName: gang discriminatorValue: Gang -- name: io.k8s.api.scheduling.v1alpha2.PodGroupSpec +- name: io.k8s.api.scheduling.v1beta1.PodGroupSpec map: fields: - name: disruptionMode + type: + namedType: io.k8s.api.scheduling.v1beta1.DisruptionMode + default: + single: {} + - name: parentCompositePodGroupName type: scalar: string - default: Pod - - name: podGroupTemplateRef + - name: preemptionPolicy type: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupTemplateReference + scalar: string - name: priority type: scalar: numeric @@ -14818,18 +16354,21 @@ var schemaYAML = typed.YAMLObject(`types: type: list: elementType: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaim + namedType: io.k8s.api.scheduling.v1beta1.PodGroupResourceClaim elementRelationship: associative keys: - name - name: schedulingConstraints type: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingConstraints + namedType: io.k8s.api.scheduling.v1beta1.PodGroupSchedulingConstraints - name: schedulingPolicy type: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingPolicy + namedType: io.k8s.api.scheduling.v1beta1.PodGroupSchedulingPolicy default: {} -- name: io.k8s.api.scheduling.v1alpha2.PodGroupStatus + - name: workloadRef + type: + namedType: io.k8s.api.scheduling.v1beta1.WorkloadReference +- name: io.k8s.api.scheduling.v1beta1.PodGroupStatus map: fields: - name: conditions @@ -14844,20 +16383,23 @@ var schemaYAML = typed.YAMLObject(`types: type: list: elementType: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaimStatus + namedType: io.k8s.api.scheduling.v1beta1.PodGroupResourceClaimStatus elementRelationship: associative keys: - name -- name: io.k8s.api.scheduling.v1alpha2.PodGroupTemplate +- name: io.k8s.api.scheduling.v1beta1.PodGroupTemplate map: fields: - name: disruptionMode type: - scalar: string + namedType: io.k8s.api.scheduling.v1beta1.DisruptionMode - name: name type: scalar: string default: "" + - name: preemptionPolicy + type: + scalar: string - name: priority type: scalar: numeric @@ -14868,35 +16410,75 @@ var schemaYAML = typed.YAMLObject(`types: type: list: elementType: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaim + namedType: io.k8s.api.scheduling.v1beta1.PodGroupResourceClaim elementRelationship: associative keys: - name - name: schedulingConstraints type: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingConstraints + namedType: io.k8s.api.scheduling.v1beta1.PodGroupSchedulingConstraints - name: schedulingPolicy type: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingPolicy + namedType: io.k8s.api.scheduling.v1beta1.PodGroupSchedulingPolicy default: {} -- name: io.k8s.api.scheduling.v1alpha2.PodGroupTemplateReference +- name: io.k8s.api.scheduling.v1beta1.PriorityClass map: fields: - - name: workload + - name: apiVersion type: - namedType: io.k8s.api.scheduling.v1alpha2.WorkloadPodGroupTemplateReference - unions: - - fields: - - fieldName: workload - discriminatorValue: Workload -- name: io.k8s.api.scheduling.v1alpha2.TopologyConstraint + scalar: string + - name: description + type: + scalar: string + - name: globalDefault + type: + scalar: boolean + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: preemptionPolicy + type: + scalar: string + - name: value + type: + scalar: numeric + default: 0 +- name: io.k8s.api.scheduling.v1beta1.SingleCompositeDisruptionMode + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1beta1.SingleDisruptionMode + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1beta1.TopologyConstraint map: fields: - name: key type: scalar: string default: "" -- name: io.k8s.api.scheduling.v1alpha2.TypedLocalObjectReference +- name: io.k8s.api.scheduling.v1beta1.TypedLocalObjectReference map: fields: - name: apiGroup @@ -14910,7 +16492,7 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" -- name: io.k8s.api.scheduling.v1alpha2.Workload +- name: io.k8s.api.scheduling.v1beta1.Workload map: fields: - name: apiVersion @@ -14925,12 +16507,12 @@ var schemaYAML = typed.YAMLObject(`types: default: {} - name: spec type: - namedType: io.k8s.api.scheduling.v1alpha2.WorkloadSpec + namedType: io.k8s.api.scheduling.v1beta1.WorkloadSpec default: {} -- name: io.k8s.api.scheduling.v1alpha2.WorkloadPodGroupTemplateReference +- name: io.k8s.api.scheduling.v1beta1.WorkloadReference map: fields: - - name: podGroupTemplateName + - name: templateName type: scalar: string default: "" @@ -14938,46 +16520,28 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" -- name: io.k8s.api.scheduling.v1alpha2.WorkloadSpec +- name: io.k8s.api.scheduling.v1beta1.WorkloadSpec map: fields: + - name: compositePodGroupTemplates + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1beta1.CompositePodGroupTemplate + elementRelationship: associative + keys: + - name - name: controllerRef type: - namedType: io.k8s.api.scheduling.v1alpha2.TypedLocalObjectReference + namedType: io.k8s.api.scheduling.v1beta1.TypedLocalObjectReference - name: podGroupTemplates type: list: elementType: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupTemplate + namedType: io.k8s.api.scheduling.v1beta1.PodGroupTemplate elementRelationship: associative keys: - name -- name: io.k8s.api.scheduling.v1beta1.PriorityClass - map: - fields: - - name: apiVersion - type: - scalar: string - - name: description - type: - scalar: string - - name: globalDefault - type: - scalar: boolean - - name: kind - type: - scalar: string - - name: metadata - type: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta - default: {} - - name: preemptionPolicy - type: - scalar: string - - name: value - type: - scalar: numeric - default: 0 - name: io.k8s.api.storage.v1.CSIDriver map: fields: @@ -15054,6 +16618,10 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.api.storage.v1.CSINodeSpec default: {} + - name: status + type: + namedType: io.k8s.api.storage.v1.CSINodeStatus + default: {} - name: io.k8s.api.storage.v1.CSINodeDriver map: fields: @@ -15085,6 +16653,17 @@ var schemaYAML = typed.YAMLObject(`types: elementRelationship: associative keys: - name +- name: io.k8s.api.storage.v1.CSINodeStatus + map: + fields: + - name: storageHealth + type: + list: + elementType: + namedType: io.k8s.api.storage.v1.StorageHealth + elementRelationship: associative + keys: + - name - name: io.k8s.api.storage.v1.CSIStorageCapacity map: fields: @@ -15154,6 +16733,42 @@ var schemaYAML = typed.YAMLObject(`types: - name: volumeBindingMode type: scalar: string +- name: io.k8s.api.storage.v1.StorageHealth + map: + fields: + - name: healthConditions + type: + list: + elementType: + namedType: io.k8s.api.storage.v1.StorageHealthCondition + elementRelationship: atomic + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.storage.v1.StorageHealthCondition + map: + fields: + - name: accessMode + type: + scalar: string + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + default: "" + - name: status + type: + scalar: string + default: "" + - name: volumeMode + type: + scalar: string - name: io.k8s.api.storage.v1.TokenRequest map: fields: @@ -15466,6 +17081,10 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.api.storage.v1beta1.CSINodeSpec default: {} + - name: status + type: + namedType: io.k8s.api.storage.v1beta1.CSINodeStatus + default: {} - name: io.k8s.api.storage.v1beta1.CSINodeDriver map: fields: @@ -15497,6 +17116,17 @@ var schemaYAML = typed.YAMLObject(`types: elementRelationship: associative keys: - name +- name: io.k8s.api.storage.v1beta1.CSINodeStatus + map: + fields: + - name: storageHealth + type: + list: + elementType: + namedType: io.k8s.api.storage.v1beta1.StorageHealth + elementRelationship: associative + keys: + - name - name: io.k8s.api.storage.v1beta1.CSIStorageCapacity map: fields: @@ -15566,6 +17196,42 @@ var schemaYAML = typed.YAMLObject(`types: - name: volumeBindingMode type: scalar: string +- name: io.k8s.api.storage.v1beta1.StorageHealth + map: + fields: + - name: healthConditions + type: + list: + elementType: + namedType: io.k8s.api.storage.v1beta1.StorageHealthCondition + elementRelationship: atomic + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.storage.v1beta1.StorageHealthCondition + map: + fields: + - name: accessMode + type: + scalar: string + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + default: "" + - name: status + type: + scalar: string + default: "" + - name: volumeMode + type: + scalar: string - name: io.k8s.api.storage.v1beta1.TokenRequest map: fields: @@ -15679,6 +17345,48 @@ var schemaYAML = typed.YAMLObject(`types: - name: count type: scalar: numeric +- name: io.k8s.api.storagemigration.v1.StorageVersionMigration + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.storagemigration.v1.StorageVersionMigrationSpec + default: {} + - name: status + type: + namedType: io.k8s.api.storagemigration.v1.StorageVersionMigrationStatus + default: {} +- name: io.k8s.api.storagemigration.v1.StorageVersionMigrationSpec + map: + fields: + - name: resource + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.GroupResource + default: {} +- name: io.k8s.api.storagemigration.v1.StorageVersionMigrationStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: resourceVersion + type: + scalar: string - name: io.k8s.api.storagemigration.v1beta1.StorageVersionMigration map: fields: diff --git a/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/eviction.go b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/eviction.go new file mode 100644 index 0000000000..afcf451205 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/eviction.go @@ -0,0 +1,327 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + lifecyclev1alpha1 "k8s.io/api/lifecycle/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// EvictionApplyConfiguration represents a declarative configuration of the Eviction type for use +// with apply. +// +// Eviction initiates an eviction process, which should ideally result in a graceful eviction of a +// .spec.target (e.g. termination of a pod). +// +// The evictionrequest-controller observes intents of all EvictionRequests and transforms them into +// Evictions. It manages the Eviction lifecycle. +// Requesters are preserved in .status.requesters even after they have withdrawn their request. +// If all requesters withdraw their eviction intent for a common target, the eviction will be +// canceled. Once all EvictionRequest corresponding to this Eviction .spec.target have been +// removed, this Eviction object will eventually be garbage collected. +// +// If the target is a pod, the .status.targetResponders is populated from Pod's +// .spec.evictionResponders. +// +// Responders should observe and communicate through the .status to help with the eviction +// of the target when they see their state == Active in .status.targetResponders. ResponderStatus +// struct should then be periodically updated to indicate the progress or completion of the eviction +// process by each responder in .status.responders. If .status.responders[].heartbeatTime is not +// updated within the heartbeat deadline defined by the Eviction API (currently 20 minutes), the +// eviction is passed over to the next responder with a lower priority. +// +// If there are no other responders and the target is a pod, the last default +// imperative-eviction.k8s.io/evictor responder with a priority of 100 will evict the pod using the +// imperative Eviction API (pods//eviction subresource). +type EvictionApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. + // .metadata.name set by the evictionrequest-controller is purely informative and subject to change. + // .spec.target field should be used to identify the target precisesly. + // + // The requester and responder names will be used as label keys and added to the labels of the + // eviction in one of the following formats: + // 1. acme.io/foo: "requester" + // 2. acme.io/foo: "responder" + // 3. acme.io/foo: "requester-responder" + // + // Please see EvictionParticipantRole for available role label values. + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec defines the eviction specification. + // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + Spec *EvictionSpecApplyConfiguration `json:"spec,omitempty"` + // status represents the most recently observed status of the eviction. + // Populated by responders and evictionrequest-controller. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + Status *EvictionStatusApplyConfiguration `json:"status,omitempty"` +} + +// Eviction constructs a declarative configuration of the Eviction type for use with +// apply. +func Eviction(name, namespace string) *EvictionApplyConfiguration { + b := &EvictionApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Eviction") + b.WithAPIVersion("lifecycle.k8s.io/v1alpha1") + return b +} + +// ExtractEvictionFrom extracts the applied configuration owned by fieldManager from +// eviction for the specified subresource. Pass an empty string for subresource to extract +// the main resource. Common subresources include "status", "scale", etc. +// eviction must be a unmodified Eviction API object that was retrieved from the Kubernetes API. +// ExtractEvictionFrom provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractEvictionFrom(eviction *lifecyclev1alpha1.Eviction, fieldManager string, subresource string) (*EvictionApplyConfiguration, error) { + b := &EvictionApplyConfiguration{} + err := managedfields.ExtractInto(eviction, internal.Parser().Type("io.k8s.api.lifecycle.v1alpha1.Eviction"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(eviction.Name) + b.WithNamespace(eviction.Namespace) + + b.WithKind("Eviction") + b.WithAPIVersion("lifecycle.k8s.io/v1alpha1") + return b, nil +} + +// ExtractEviction extracts the applied configuration owned by fieldManager from +// eviction. If no managedFields are found in eviction for fieldManager, a +// EvictionApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// eviction must be a unmodified Eviction API object that was retrieved from the Kubernetes API. +// ExtractEviction provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractEviction(eviction *lifecyclev1alpha1.Eviction, fieldManager string) (*EvictionApplyConfiguration, error) { + return ExtractEvictionFrom(eviction, fieldManager, "") +} + +// ExtractEvictionStatus extracts the applied configuration owned by fieldManager from +// eviction for the status subresource. +func ExtractEvictionStatus(eviction *lifecyclev1alpha1.Eviction, fieldManager string) (*EvictionApplyConfiguration, error) { + return ExtractEvictionFrom(eviction, fieldManager, "status") +} + +func (b EvictionApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithKind(value string) *EvictionApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithAPIVersion(value string) *EvictionApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithName(value string) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithGenerateName(value string) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithNamespace(value string) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithUID(value types.UID) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithResourceVersion(value string) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithGeneration(value int64) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithCreationTimestamp(value metav1.Time) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *EvictionApplyConfiguration) WithLabels(entries map[string]string) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *EvictionApplyConfiguration) WithAnnotations(entries map[string]string) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *EvictionApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *EvictionApplyConfiguration) WithFinalizers(values ...string) *EvictionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *EvictionApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithSpec(value *EvictionSpecApplyConfiguration) *EvictionApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *EvictionApplyConfiguration) WithStatus(value *EvictionStatusApplyConfiguration) *EvictionApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *EvictionApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *EvictionApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *EvictionApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *EvictionApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionpodreference.go b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionpodreference.go new file mode 100644 index 0000000000..bc5c6e0f20 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionpodreference.go @@ -0,0 +1,60 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + types "k8s.io/apimachinery/pkg/types" +) + +// EvictionPodReferenceApplyConfiguration represents a declarative configuration of the EvictionPodReference type for use +// with apply. +// +// EvictionPodReference contains enough information to locate the referenced pod inside the same +// namespace. +type EvictionPodReferenceApplyConfiguration struct { + // name of the target. + // This field is required. + Name *string `json:"name,omitempty"` + // uid of the target. + // It can be found in .metadata.uid of the target and is a lowercase UUID in 8-4-4-4-12 format. + // This field is required. + UID *types.UID `json:"uid,omitempty"` +} + +// EvictionPodReferenceApplyConfiguration constructs a declarative configuration of the EvictionPodReference type for use with +// apply. +func EvictionPodReference() *EvictionPodReferenceApplyConfiguration { + return &EvictionPodReferenceApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *EvictionPodReferenceApplyConfiguration) WithName(value string) *EvictionPodReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *EvictionPodReferenceApplyConfiguration) WithUID(value types.UID) *EvictionPodReferenceApplyConfiguration { + b.UID = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionrequest.go b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionrequest.go new file mode 100644 index 0000000000..66bfeb38fb --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionrequest.go @@ -0,0 +1,310 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + lifecyclev1alpha1 "k8s.io/api/lifecycle/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// EvictionRequestApplyConfiguration represents a declarative configuration of the EvictionRequest type for use +// with apply. +// +// EvictionRequest defines a request that should ideally result in a graceful eviction of a +// .spec.target (e.g. termination of a pod). +// +// The evictionrequest-controller observes intents of all EvictionRequests and transforms them into +// Evictions. +// - .spec.requester is set as a label on the Eviction for easier lookup. +// - Each target can have a set of responders assigned to it. Eviction objects are observed by +// these responders, who implement the eviction logic and update the Eviction's status with +// progress. +// +// There is many-to-many relationship between EvictionRequests and Evictions in general. +// And many-to-one if the target is a pod. +// +// If all requesters withdraw their eviction intent for a common target, the eviction will be +// canceled. Deleting an EvictionRequest also counts as a withdrawal. +// Once all EvictionRequest of a target are removed, the corresponding Evictions are eventually +// garbage collected. +type EvictionRequestApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata. + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec defines the eviction request specification. + // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + Spec *EvictionRequestSpecApplyConfiguration `json:"spec,omitempty"` + // status represents the most recently observed status of the eviction request. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + Status *EvictionRequestStatusApplyConfiguration `json:"status,omitempty"` +} + +// EvictionRequest constructs a declarative configuration of the EvictionRequest type for use with +// apply. +func EvictionRequest(name, namespace string) *EvictionRequestApplyConfiguration { + b := &EvictionRequestApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("EvictionRequest") + b.WithAPIVersion("lifecycle.k8s.io/v1alpha1") + return b +} + +// ExtractEvictionRequestFrom extracts the applied configuration owned by fieldManager from +// evictionRequest for the specified subresource. Pass an empty string for subresource to extract +// the main resource. Common subresources include "status", "scale", etc. +// evictionRequest must be a unmodified EvictionRequest API object that was retrieved from the Kubernetes API. +// ExtractEvictionRequestFrom provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractEvictionRequestFrom(evictionRequest *lifecyclev1alpha1.EvictionRequest, fieldManager string, subresource string) (*EvictionRequestApplyConfiguration, error) { + b := &EvictionRequestApplyConfiguration{} + err := managedfields.ExtractInto(evictionRequest, internal.Parser().Type("io.k8s.api.lifecycle.v1alpha1.EvictionRequest"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(evictionRequest.Name) + b.WithNamespace(evictionRequest.Namespace) + + b.WithKind("EvictionRequest") + b.WithAPIVersion("lifecycle.k8s.io/v1alpha1") + return b, nil +} + +// ExtractEvictionRequest extracts the applied configuration owned by fieldManager from +// evictionRequest. If no managedFields are found in evictionRequest for fieldManager, a +// EvictionRequestApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// evictionRequest must be a unmodified EvictionRequest API object that was retrieved from the Kubernetes API. +// ExtractEvictionRequest provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractEvictionRequest(evictionRequest *lifecyclev1alpha1.EvictionRequest, fieldManager string) (*EvictionRequestApplyConfiguration, error) { + return ExtractEvictionRequestFrom(evictionRequest, fieldManager, "") +} + +// ExtractEvictionRequestStatus extracts the applied configuration owned by fieldManager from +// evictionRequest for the status subresource. +func ExtractEvictionRequestStatus(evictionRequest *lifecyclev1alpha1.EvictionRequest, fieldManager string) (*EvictionRequestApplyConfiguration, error) { + return ExtractEvictionRequestFrom(evictionRequest, fieldManager, "status") +} + +func (b EvictionRequestApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *EvictionRequestApplyConfiguration) WithKind(value string) *EvictionRequestApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *EvictionRequestApplyConfiguration) WithAPIVersion(value string) *EvictionRequestApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *EvictionRequestApplyConfiguration) WithName(value string) *EvictionRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *EvictionRequestApplyConfiguration) WithGenerateName(value string) *EvictionRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *EvictionRequestApplyConfiguration) WithNamespace(value string) *EvictionRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *EvictionRequestApplyConfiguration) WithUID(value types.UID) *EvictionRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *EvictionRequestApplyConfiguration) WithResourceVersion(value string) *EvictionRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *EvictionRequestApplyConfiguration) WithGeneration(value int64) *EvictionRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *EvictionRequestApplyConfiguration) WithCreationTimestamp(value metav1.Time) *EvictionRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *EvictionRequestApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *EvictionRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *EvictionRequestApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *EvictionRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *EvictionRequestApplyConfiguration) WithLabels(entries map[string]string) *EvictionRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *EvictionRequestApplyConfiguration) WithAnnotations(entries map[string]string) *EvictionRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *EvictionRequestApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *EvictionRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *EvictionRequestApplyConfiguration) WithFinalizers(values ...string) *EvictionRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *EvictionRequestApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *EvictionRequestApplyConfiguration) WithSpec(value *EvictionRequestSpecApplyConfiguration) *EvictionRequestApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *EvictionRequestApplyConfiguration) WithStatus(value *EvictionRequestStatusApplyConfiguration) *EvictionRequestApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *EvictionRequestApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *EvictionRequestApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *EvictionRequestApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *EvictionRequestApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionrequestpodreference.go b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionrequestpodreference.go new file mode 100644 index 0000000000..4e64868656 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionrequestpodreference.go @@ -0,0 +1,60 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + types "k8s.io/apimachinery/pkg/types" +) + +// EvictionRequestPodReferenceApplyConfiguration represents a declarative configuration of the EvictionRequestPodReference type for use +// with apply. +// +// EvictionRequestPodReference contains enough information to locate the referenced pod inside the +// same namespace. +type EvictionRequestPodReferenceApplyConfiguration struct { + // name of the target. + // This field is required. + Name *string `json:"name,omitempty"` + // uid of the target. + // It can be found in .metadata.uid of the target and is a lowercase UUID in 8-4-4-4-12 format. + // This field is required. + UID *types.UID `json:"uid,omitempty"` +} + +// EvictionRequestPodReferenceApplyConfiguration constructs a declarative configuration of the EvictionRequestPodReference type for use with +// apply. +func EvictionRequestPodReference() *EvictionRequestPodReferenceApplyConfiguration { + return &EvictionRequestPodReferenceApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *EvictionRequestPodReferenceApplyConfiguration) WithName(value string) *EvictionRequestPodReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *EvictionRequestPodReferenceApplyConfiguration) WithUID(value types.UID) *EvictionRequestPodReferenceApplyConfiguration { + b.UID = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionrequestspec.go b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionrequestspec.go new file mode 100644 index 0000000000..6fc40b8c22 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionrequestspec.go @@ -0,0 +1,79 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + lifecyclev1alpha1 "k8s.io/api/lifecycle/v1alpha1" +) + +// EvictionRequestSpecApplyConfiguration represents a declarative configuration of the EvictionRequestSpec type for use +// with apply. +// +// EvictionRequestSpec is a specification of an EvictionRequest. +type EvictionRequestSpecApplyConfiguration struct { + // target contains a reference to an object (e.g. a pod) that should be evicted. + // This field is required and immutable. + Target *EvictionRequestTargetApplyConfiguration `json:"target,omitempty"` + // requester allows you to identify the entity, that requested the eviction of the target. + // + // It must be a valid domain-prefixed key (such as "acme.io/foo"). + // Domain names *.k8s.io and *.kubernetes.io are reserved. + // This field is required and immutable. + Requester *string `json:"requester,omitempty"` + // intent specifies the action that should be taken for the specified target. + // + // - Eviction means that the requester is interested in the eviction of the target. + // - Withdrawn means that the requester is no longer interested in the eviction of the target. + // If all requesters' intents are withdrawn for a common target, the eviction will be canceled. + // Cancellation consequences: + // - Inactive responders will never run. + // - Active responders are expected to cancel the eviction. + // - Completed or Interrupted responders should not take any action. + Intent *lifecyclev1alpha1.EvictionRequestIntent `json:"intent,omitempty"` +} + +// EvictionRequestSpecApplyConfiguration constructs a declarative configuration of the EvictionRequestSpec type for use with +// apply. +func EvictionRequestSpec() *EvictionRequestSpecApplyConfiguration { + return &EvictionRequestSpecApplyConfiguration{} +} + +// WithTarget sets the Target field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Target field is set to the value of the last call. +func (b *EvictionRequestSpecApplyConfiguration) WithTarget(value *EvictionRequestTargetApplyConfiguration) *EvictionRequestSpecApplyConfiguration { + b.Target = value + return b +} + +// WithRequester sets the Requester field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Requester field is set to the value of the last call. +func (b *EvictionRequestSpecApplyConfiguration) WithRequester(value string) *EvictionRequestSpecApplyConfiguration { + b.Requester = &value + return b +} + +// WithIntent sets the Intent field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Intent field is set to the value of the last call. +func (b *EvictionRequestSpecApplyConfiguration) WithIntent(value lifecyclev1alpha1.EvictionRequestIntent) *EvictionRequestSpecApplyConfiguration { + b.Intent = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionrequeststatus.go b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionrequeststatus.go new file mode 100644 index 0000000000..8367990f9c --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionrequeststatus.go @@ -0,0 +1,75 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// EvictionRequestStatusApplyConfiguration represents a declarative configuration of the EvictionRequestStatus type for use +// with apply. +// +// EvictionRequestStatus represents the last observed status of the eviction request. +type EvictionRequestStatusApplyConfiguration struct { + // conditions contain information about the eviction request. + // + // EvictionRequest specific conditions are: TargetEvicted or Failed (managed by evictionrequest-controller). + // - Failed means that the eviction request is no longer being processed + // by any eviction responder. This can happen if the request is canceled or if no responder + // managed to evict the target (e.g. terminate or delete a pod). + // - TargetEvicted means that the target has been evicted (e.g. a pod has been terminated or deleted). + // + // These conditions can be reset if the eviction was unsuccessful and a new Eviction intent has + // been submitted. + // + // The maximum length of the conditions list is 100. + Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` + // observedGeneration is EvictionRequest's .metadata.generation observed by the evictionrequest-controller. + // The observed generation value cannot be negative and can only be incremented. + // The minimum value is 1. + // This field is managed by evictionrequest-controller. + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` +} + +// EvictionRequestStatusApplyConfiguration constructs a declarative configuration of the EvictionRequestStatus type for use with +// apply. +func EvictionRequestStatus() *EvictionRequestStatusApplyConfiguration { + return &EvictionRequestStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *EvictionRequestStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *EvictionRequestStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *EvictionRequestStatusApplyConfiguration) WithObservedGeneration(value int64) *EvictionRequestStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionrequesttarget.go b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionrequesttarget.go new file mode 100644 index 0000000000..1000dc533a --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionrequesttarget.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// EvictionRequestTargetApplyConfiguration represents a declarative configuration of the EvictionRequestTarget type for use +// with apply. +// +// EvictionRequestTarget contains a reference to an object that should be evicted. +type EvictionRequestTargetApplyConfiguration struct { + // pod references a pod that is subject to eviction/termination. + // Pods that are part of a PodGroup (.spec.schedulingGroup is set) are not supported. + Pod *EvictionRequestPodReferenceApplyConfiguration `json:"pod,omitempty"` +} + +// EvictionRequestTargetApplyConfiguration constructs a declarative configuration of the EvictionRequestTarget type for use with +// apply. +func EvictionRequestTarget() *EvictionRequestTargetApplyConfiguration { + return &EvictionRequestTargetApplyConfiguration{} +} + +// WithPod sets the Pod field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pod field is set to the value of the last call. +func (b *EvictionRequestTargetApplyConfiguration) WithPod(value *EvictionRequestPodReferenceApplyConfiguration) *EvictionRequestTargetApplyConfiguration { + b.Pod = value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionspec.go b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionspec.go new file mode 100644 index 0000000000..4ed00a53bf --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionspec.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// EvictionSpecApplyConfiguration represents a declarative configuration of the EvictionSpec type for use +// with apply. +// +// EvictionSpec is a specification of an Eviction. +type EvictionSpecApplyConfiguration struct { + // target contains a reference to an object (e.g. a pod) that should be evicted. + // This field is required and immutable. + Target *EvictionTargetApplyConfiguration `json:"target,omitempty"` +} + +// EvictionSpecApplyConfiguration constructs a declarative configuration of the EvictionSpec type for use with +// apply. +func EvictionSpec() *EvictionSpecApplyConfiguration { + return &EvictionSpecApplyConfiguration{} +} + +// WithTarget sets the Target field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Target field is set to the value of the last call. +func (b *EvictionSpecApplyConfiguration) WithTarget(value *EvictionTargetApplyConfiguration) *EvictionSpecApplyConfiguration { + b.Target = value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionstatus.go b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionstatus.go new file mode 100644 index 0000000000..b6d3a96584 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictionstatus.go @@ -0,0 +1,147 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// EvictionStatusApplyConfiguration represents a declarative configuration of the EvictionStatus type for use +// with apply. +// +// EvictionStatus represents the last observed status of the eviction request. +type EvictionStatusApplyConfiguration struct { + // conditions contain information about the eviction request. + // + // Eviction specific conditions are: TargetEvicted or Failed (managed by evictionrequest-controller). + // - Failed means that the eviction request is no longer being processed + // by any eviction responder. This can happen if the request is canceled or if no responder + // managed to evict the target (e.g. terminate or delete a pod). + // - TargetEvicted means that the target has been evicted (e.g. a pod has been terminated or deleted). + // + // The maximum length of the conditions list is 100. + Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` + // observedGeneration is Eviction's .metadata.generation observed by the evictionrequest-controller. + // The observed generation value cannot be negative and can only be incremented. + // The minimum value is 1. + // This field is managed by evictionrequest-controller. + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + // requesters allow you to identify the entities, that requested the eviction of the target. + // If all the requesters withdraw their eviction intent, the eviction will be canceled. + // + // The maximum length of the requesters list is 100. + // If this limit is exceeded, requesters with Withdrawn intent should be dropped first. + Requesters []RequesterApplyConfiguration `json:"requesters,omitempty"` + // targetResponders reference responders that should eventually respond to this eviction + // to help with the graceful eviction of a target. These responders are selected sequentially, + // according to their specified priority by setting the Active state to the TargetResponder + // .state field. The maximum number of active responders allowed is 1. + // Eventually each responder can end up in an Interrupted, Canceled or, Completed state. + // Responders should observe these states in order to navigate their lifecycle. + // + // If the target is a pod, the field is populated from Pod's .spec.evictionResponders. Default + // responders may be added to the list according to the target. + // + // Default responders: + // - imperative-eviction.k8s.io/evictor responder with a priority of 100 is added to the list if the + // target is a pod. It will call the imperative Eviction API (pods//eviction subresource). + // This call may not succeed due to PodDisruptionBudgets, which may block the pod termination. + // It will update the responder message and try again with a backoff. + // + // The maximum length of the responders list is 11. + // The length and keys of the list cannot change once set. + // This field is managed by evictionrequest-controller. + TargetResponders []TargetResponderApplyConfiguration `json:"targetResponders,omitempty"` + // responders represents the eviction process status of each declared responder. + // + // The responder list should be the same length and have the same .name fields as + // .status.targetResponders. Only responders with .name that have Active state in + // .targetResponders[].state should be updated and can be mutated. First initialization + // of the list is allowed. + // + // Each ResponderStatus is initialized by evictionrequest-controller and then managed by + // the designated responder. + Responders []ResponderStatusApplyConfiguration `json:"responders,omitempty"` +} + +// EvictionStatusApplyConfiguration constructs a declarative configuration of the EvictionStatus type for use with +// apply. +func EvictionStatus() *EvictionStatusApplyConfiguration { + return &EvictionStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *EvictionStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *EvictionStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *EvictionStatusApplyConfiguration) WithObservedGeneration(value int64) *EvictionStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithRequesters adds the given value to the Requesters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Requesters field. +func (b *EvictionStatusApplyConfiguration) WithRequesters(values ...*RequesterApplyConfiguration) *EvictionStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRequesters") + } + b.Requesters = append(b.Requesters, *values[i]) + } + return b +} + +// WithTargetResponders adds the given value to the TargetResponders field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TargetResponders field. +func (b *EvictionStatusApplyConfiguration) WithTargetResponders(values ...*TargetResponderApplyConfiguration) *EvictionStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTargetResponders") + } + b.TargetResponders = append(b.TargetResponders, *values[i]) + } + return b +} + +// WithResponders adds the given value to the Responders field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Responders field. +func (b *EvictionStatusApplyConfiguration) WithResponders(values ...*ResponderStatusApplyConfiguration) *EvictionStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResponders") + } + b.Responders = append(b.Responders, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictiontarget.go b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictiontarget.go new file mode 100644 index 0000000000..ff353caebb --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/evictiontarget.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// EvictionTargetApplyConfiguration represents a declarative configuration of the EvictionTarget type for use +// with apply. +// +// EvictionTarget contains a reference to an object that should be evicted. +type EvictionTargetApplyConfiguration struct { + // pod references a pod that is subject to eviction/termination. + // Pods that are part of a PodGroup (.spec.schedulingGroup is set) are not supported. + Pod *EvictionPodReferenceApplyConfiguration `json:"pod,omitempty"` +} + +// EvictionTargetApplyConfiguration constructs a declarative configuration of the EvictionTarget type for use with +// apply. +func EvictionTarget() *EvictionTargetApplyConfiguration { + return &EvictionTargetApplyConfiguration{} +} + +// WithPod sets the Pod field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pod field is set to the value of the last call. +func (b *EvictionTargetApplyConfiguration) WithPod(value *EvictionPodReferenceApplyConfiguration) *EvictionTargetApplyConfiguration { + b.Pod = value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/requester.go b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/requester.go new file mode 100644 index 0000000000..3991be03ea --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/requester.go @@ -0,0 +1,68 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + lifecyclev1alpha1 "k8s.io/api/lifecycle/v1alpha1" +) + +// RequesterApplyConfiguration represents a declarative configuration of the Requester type for use +// with apply. +// +// Requester allows you to identify the entity, that requested the eviction of the target. +type RequesterApplyConfiguration struct { + // name allows you to identify the entity, that requested the eviction of the target. + // + // It must be a valid domain-prefixed key (such as "acme.io/foo"). + // This field must be unique for each requester. + // This field is required. + Name *string `json:"name,omitempty"` + // intent specifies the action that should be taken for the specified target. + // + // - Eviction means that the requester is interested in the eviction of the target. + // - Withdrawn means that the requester is no longer interested in the eviction of the target. + // If all requesters' intents are withdrawn, the eviction will be canceled. + // Cancellation consequences: + // - Inactive responders will never run. + // - Active responders are expected to cancel the eviction. + // - Completed or Interrupted responders should not take any action. + Intent *lifecyclev1alpha1.RequesterIntent `json:"intent,omitempty"` +} + +// RequesterApplyConfiguration constructs a declarative configuration of the Requester type for use with +// apply. +func Requester() *RequesterApplyConfiguration { + return &RequesterApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *RequesterApplyConfiguration) WithName(value string) *RequesterApplyConfiguration { + b.Name = &value + return b +} + +// WithIntent sets the Intent field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Intent field is set to the value of the last call. +func (b *RequesterApplyConfiguration) WithIntent(value lifecyclev1alpha1.RequesterIntent) *RequesterApplyConfiguration { + b.Intent = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/responderstatus.go b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/responderstatus.go new file mode 100644 index 0000000000..e7d41d6670 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/responderstatus.go @@ -0,0 +1,118 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ResponderStatusApplyConfiguration represents a declarative configuration of the ResponderStatus type for use +// with apply. +// +// ResponderStatus represents the last observed status of the eviction process of the responder. +// It should be only updated by the designated responder whose name is .name field. +type ResponderStatusApplyConfiguration struct { + // name allows you to identify the responder reacting to the Eviction. + // + // It must be a valid domain-prefixed key (such as "acme.io/foo"). + // This field is initialized by Kubernetes and must be unique for each responder. + // This field is required. + Name *string `json:"name,omitempty"` + // startTime tracks the time at which this responder was designated as active and should start + // processing the eviction request. + // It should reflect the present time when set. + // This field is initialized by Kubernetes when this responder becomes active. + // This field becomes immutable once set. + StartTime *v1.Time `json:"startTime,omitempty"` + // heartbeatTime is the last time at which the eviction process was reported to be in progress + // by the responder. + // It should reflect the present time when set. + // Responders should avoid heartbeats more frequent than 20 seconds to avoid overloading the + // control-plane. + HeartbeatTime *v1.Time `json:"heartbeatTime,omitempty"` + // expectedCompletionTime is the time at which the eviction process step is expected to end for the + // responder. + // The time cannot be set to the past. + // May be omitted if no estimate can be made. + ExpectedCompletionTime *v1.Time `json:"expectedCompletionTime,omitempty"` + // completionTime tracks the time at which the Responder stopped processing the eviction request. + // Completion means that the responders has either fully or partially completed the + // eviction process, which may have resulted in target eviction (e.g. pod termination). + // It should reflect the present time when set. + // This field becomes immutable once set. + CompletionTime *v1.Time `json:"completionTime,omitempty"` + // message provides human-readable details about the state of the responder and the eviction + // process. + // Maximum length is 4000 characters. + Message *string `json:"message,omitempty"` +} + +// ResponderStatusApplyConfiguration constructs a declarative configuration of the ResponderStatus type for use with +// apply. +func ResponderStatus() *ResponderStatusApplyConfiguration { + return &ResponderStatusApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ResponderStatusApplyConfiguration) WithName(value string) *ResponderStatusApplyConfiguration { + b.Name = &value + return b +} + +// WithStartTime sets the StartTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StartTime field is set to the value of the last call. +func (b *ResponderStatusApplyConfiguration) WithStartTime(value v1.Time) *ResponderStatusApplyConfiguration { + b.StartTime = &value + return b +} + +// WithHeartbeatTime sets the HeartbeatTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HeartbeatTime field is set to the value of the last call. +func (b *ResponderStatusApplyConfiguration) WithHeartbeatTime(value v1.Time) *ResponderStatusApplyConfiguration { + b.HeartbeatTime = &value + return b +} + +// WithExpectedCompletionTime sets the ExpectedCompletionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExpectedCompletionTime field is set to the value of the last call. +func (b *ResponderStatusApplyConfiguration) WithExpectedCompletionTime(value v1.Time) *ResponderStatusApplyConfiguration { + b.ExpectedCompletionTime = &value + return b +} + +// WithCompletionTime sets the CompletionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CompletionTime field is set to the value of the last call. +func (b *ResponderStatusApplyConfiguration) WithCompletionTime(value v1.Time) *ResponderStatusApplyConfiguration { + b.CompletionTime = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *ResponderStatusApplyConfiguration) WithMessage(value string) *ResponderStatusApplyConfiguration { + b.Message = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/targetresponder.go b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/targetresponder.go new file mode 100644 index 0000000000..a04690e787 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1/targetresponder.go @@ -0,0 +1,102 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + lifecyclev1alpha1 "k8s.io/api/lifecycle/v1alpha1" +) + +// TargetResponderApplyConfiguration represents a declarative configuration of the TargetResponder type for use +// with apply. +// +// TargetResponder allows you to specify the responder reacting to the Eviction. +// Responders should observe and communicate through the Eviction API (see .state) to help +// with the graceful eviction of a target (e.g. termination of a pod). +type TargetResponderApplyConfiguration struct { + // name allows you to identify the responder reacting to the Eviction. + // + // It must be a valid domain-prefixed key (such as "acme.io/foo"). + // This field must be unique for each responder. + // This field is required. + Name *string `json:"name,omitempty"` + // priority for this responder. Higher priorities are selected first by the evictionrequest-controller. + // If there are responders with the same priority, the responder whose domain name comes first in the + // alphabetical higher domain order, will be picked. This means that the top domain labels are compared + // alphabetically first, followed by the lower domain labels. The key is compared last. + // + // The responder that is the managing controller of the pod should set the value of + // this field to 10000 to allow both for preemption or fallback registration by other + // responders. + // + // The minimum value is 0 and the maximum value is 100000. + // The interval 0-999 is reserved for responders with *.k8s.io suffix. + // This field is required and immutable. + Priority *int32 `json:"priority,omitempty"` + // state specifies a state that is assigned by the evictionrequest-controller. Responders should observe + // this state in order to navigate their lifecycle. + // - Inactive means that the responder should not yet process this eviction request. + // - Active means that the responder is either running or expected to start soon. + // Also, startTime has been set in the ResponderStatus by the evictionrequest-controller. + // + // An active responder should currently interact with the eviction process by updating + // .status.responders, where .name is the active responder name. ResponderStatus fields + // should be periodically updated to indicate the progress or completion of the eviction process. + // If .status.responders[].heartbeatTime field is not updated within the heartbeat deadline defined + // by the Eviction API (currently 20 minutes), the eviction is passed over to the next responder + // with a lower priority. Only one responder can be active at a time. + // - Interrupted means that the responder has failed to start or failed to update + // heartbeatTime in ResponderStatus in a timely manner. + // - Canceled means that the responder has been canceled. In other words, there is no + // EvictionRequest with the same target and Eviction intent in .spec.intent. + // - Completed means that the responder has successfully completed and set completionTime + // in ResponderStatus. + // + // Please refer to the ResponderStatus in .status.responders for more details on each responder. + State *lifecyclev1alpha1.ResponderStateType `json:"state,omitempty"` +} + +// TargetResponderApplyConfiguration constructs a declarative configuration of the TargetResponder type for use with +// apply. +func TargetResponder() *TargetResponderApplyConfiguration { + return &TargetResponderApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *TargetResponderApplyConfiguration) WithName(value string) *TargetResponderApplyConfiguration { + b.Name = &value + return b +} + +// WithPriority sets the Priority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Priority field is set to the value of the last call. +func (b *TargetResponderApplyConfiguration) WithPriority(value int32) *TargetResponderApplyConfiguration { + b.Priority = &value + return b +} + +// WithState sets the State field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the State field is set to the value of the last call. +func (b *TargetResponderApplyConfiguration) WithState(value lifecyclev1alpha1.ResponderStateType) *TargetResponderApplyConfiguration { + b.State = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/meta/v1/condition.go b/vendor/k8s.io/client-go/applyconfigurations/meta/v1/condition.go index 6b0a44312b..11e0260ab8 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/meta/v1/condition.go +++ b/vendor/k8s.io/client-go/applyconfigurations/meta/v1/condition.go @@ -36,6 +36,9 @@ import ( // // +patchStrategy=merge // // +listType=map // // +listMapKey=type +// // +k8s:alpha(since: "1.37")=+k8s:optional +// // +k8s:alpha(since: "1.37")=+k8s:listType=map +// // +k8s:alpha(since: "1.37")=+k8s:listMapKey=type // Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` // // // other fields diff --git a/vendor/k8s.io/client-go/applyconfigurations/meta/v1/deleteoptions.go b/vendor/k8s.io/client-go/applyconfigurations/meta/v1/deleteoptions.go index ed4c4bfa50..0679f1c8f1 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/meta/v1/deleteoptions.go +++ b/vendor/k8s.io/client-go/applyconfigurations/meta/v1/deleteoptions.go @@ -27,7 +27,7 @@ import ( // // DeleteOptions may be provided when deleting an API object. type DeleteOptionsApplyConfiguration struct { - TypeMetaApplyConfiguration `json:",inline"` + TypeMetaApplyConfiguration `json:""` // The duration in seconds before the object should be deleted. Value must be non-negative integer. // The value zero indicates delete immediately. If this value is nil, the default grace period for the // specified type will be used. diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingress.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingress.go index e6bb92050b..dad98cc876 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingress.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingress.go @@ -35,8 +35,8 @@ import ( // externally-reachable urls, load balance traffic, terminate SSL, offer name // based virtual hosting etc. type IngressApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec is the desired state of the Ingress. diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressclass.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressclass.go index 387e45728b..69da66c6c9 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressclass.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressclass.go @@ -36,8 +36,8 @@ import ( // single IngressClass resource has this annotation set to true, new Ingress // resources without a class specified will be assigned this default class. type IngressClassApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec is the desired state of the IngressClass. diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressrule.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressrule.go index e77494d869..7a8ffbf8bd 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressrule.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressrule.go @@ -53,7 +53,7 @@ type IngressRuleApplyConfiguration struct { // just traffic matching the host to the default backend or all traffic to the // default backend, is left to the controller fulfilling the Ingress. Http is // currently the only supported IngressRuleValue. - IngressRuleValueApplyConfiguration `json:",inline"` + IngressRuleValueApplyConfiguration `json:""` } // IngressRuleApplyConfiguration constructs a declarative configuration of the IngressRule type for use with diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressrulevalue.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressrulevalue.go index c1ca4853e2..198899ee68 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressrulevalue.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressrulevalue.go @@ -26,6 +26,7 @@ package v1 // mixing different types of rules in a single Ingress is disallowed, so exactly // one of the following must be set. type IngressRuleValueApplyConfiguration struct { + // http is a HTTP IngressRuleValue, which contains a list of http selectors HTTP *HTTPIngressRuleValueApplyConfiguration `json:"http,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ipaddress.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ipaddress.go index c0e4298aa3..8f73ecac7a 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ipaddress.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ipaddress.go @@ -38,8 +38,8 @@ import ( // Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 // Invalid: 10.01.2.3 or 2001:db8:0:0:0::1 type IPAddressApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec is the desired state of the IPAddress. diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ipaddressspec.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ipaddressspec.go index e9dce93b64..30bb1dbea4 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ipaddressspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/ipaddressspec.go @@ -23,7 +23,7 @@ package v1 // // IPAddressSpec describe the attributes in an IP Address. type IPAddressSpecApplyConfiguration struct { - // ParentRef references the resource that an IPAddress is attached to. + // parentRef references the resource that an IPAddress is attached to. // An IPAddress must reference a parent object. ParentRef *ParentReferenceApplyConfiguration `json:"parentRef,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/networkpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/networkpolicy.go index f3e1e1e5ed..be8b78720d 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/networkpolicy.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/networkpolicy.go @@ -32,8 +32,8 @@ import ( // // NetworkPolicy describes what network traffic is allowed for a set of Pods type NetworkPolicyApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec represents the specification of the desired behavior for this NetworkPolicy. diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/parentreference.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/parentreference.go index c725e697b0..34756f07e2 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/parentreference.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/parentreference.go @@ -23,13 +23,13 @@ package v1 // // ParentReference describes a reference to a parent object. type ParentReferenceApplyConfiguration struct { - // Group is the group of the object being referenced. + // group is the group of the object being referenced. Group *string `json:"group,omitempty"` - // Resource is the resource of the object being referenced. + // resource is the resource of the object being referenced. Resource *string `json:"resource,omitempty"` - // Namespace is the namespace of the object being referenced. + // namespace is the namespace of the object being referenced. Namespace *string `json:"namespace,omitempty"` - // Name is the name of the object being referenced. + // name is the name of the object being referenced. Name *string `json:"name,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidr.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidr.go index 8eede13e36..158ca7f925 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidr.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidr.go @@ -33,8 +33,8 @@ import ( // ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). // This range is used to allocate ClusterIPs to Service objects. type ServiceCIDRApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec is the desired state of the ServiceCIDR. diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidrspec.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidrspec.go index 9372a162bd..0844008346 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidrspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1/servicecidrspec.go @@ -23,7 +23,7 @@ package v1 // // ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services. type ServiceCIDRSpecApplyConfiguration struct { - // CIDRs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64") + // cidrs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64") // from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. // This field is immutable. CIDRs []string `json:"cidrs,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingress.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingress.go index 061c29c992..d2144ed9bb 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingress.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingress.go @@ -35,8 +35,8 @@ import ( // externally-reachable urls, load balance traffic, terminate SSL, offer name // based virtual hosting etc. type IngressApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec is the desired state of the Ingress. diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressclass.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressclass.go index c4d6df50b4..30882d4ad5 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressclass.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressclass.go @@ -36,8 +36,8 @@ import ( // single IngressClass resource has this annotation set to true, new Ingress // resources without a class specified will be assigned this default class. type IngressClassApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec is the desired state of the IngressClass. diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressrule.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressrule.go index 6c8b973ed0..b84026d674 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressrule.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressrule.go @@ -53,7 +53,7 @@ type IngressRuleApplyConfiguration struct { // just traffic matching the host to the default backend or all traffic to the // default backend, is left to the controller fulfilling the Ingress. Http is // currently the only supported IngressRuleValue. - IngressRuleValueApplyConfiguration `json:",inline"` + IngressRuleValueApplyConfiguration `json:""` } // IngressRuleApplyConfiguration constructs a declarative configuration of the IngressRule type for use with diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressrulevalue.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressrulevalue.go index 502384fa3d..e215effaf0 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressrulevalue.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressrulevalue.go @@ -26,6 +26,7 @@ package v1beta1 // mixing different types of rules in a single Ingress is disallowed, so exactly // one of the following must be set. type IngressRuleValueApplyConfiguration struct { + // http is a HTTP IngressRuleValue, which contains a list of http selectors HTTP *HTTPIngressRuleValueApplyConfiguration `json:"http,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ipaddress.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ipaddress.go index 28167f1f4c..10919a97ae 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ipaddress.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ipaddress.go @@ -38,8 +38,8 @@ import ( // Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 // Invalid: 10.01.2.3 or 2001:db8:0:0:0::1 type IPAddressApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec is the desired state of the IPAddress. diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ipaddressspec.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ipaddressspec.go index c0c012aaa6..7218076ba3 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ipaddressspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ipaddressspec.go @@ -23,7 +23,7 @@ package v1beta1 // // IPAddressSpec describe the attributes in an IP Address. type IPAddressSpecApplyConfiguration struct { - // ParentRef references the resource that an IPAddress is attached to. + // parentRef references the resource that an IPAddress is attached to. // An IPAddress must reference a parent object. ParentRef *ParentReferenceApplyConfiguration `json:"parentRef,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/parentreference.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/parentreference.go index edcc3b95d3..9acf5f7478 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/parentreference.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/parentreference.go @@ -23,13 +23,13 @@ package v1beta1 // // ParentReference describes a reference to a parent object. type ParentReferenceApplyConfiguration struct { - // Group is the group of the object being referenced. + // group is the group of the object being referenced. Group *string `json:"group,omitempty"` - // Resource is the resource of the object being referenced. + // resource is the resource of the object being referenced. Resource *string `json:"resource,omitempty"` - // Namespace is the namespace of the object being referenced. + // namespace is the namespace of the object being referenced. Namespace *string `json:"namespace,omitempty"` - // Name is the name of the object being referenced. + // name is the name of the object being referenced. Name *string `json:"name,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/servicecidr.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/servicecidr.go index 07281de616..68704740c9 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/servicecidr.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/servicecidr.go @@ -33,8 +33,8 @@ import ( // ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). // This range is used to allocate ClusterIPs to Service objects. type ServiceCIDRApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec is the desired state of the ServiceCIDR. diff --git a/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/servicecidrspec.go b/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/servicecidrspec.go index 7652700e2a..890dd1410f 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/servicecidrspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/servicecidrspec.go @@ -23,7 +23,7 @@ package v1beta1 // // ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services. type ServiceCIDRSpecApplyConfiguration struct { - // CIDRs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64") + // cidrs defines the IP blocks in CIDR notation (e.g. "192.168.0.0/24" or "2001:db8::/64") // from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. // This field is immutable. CIDRs []string `json:"cidrs,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/node/v1/runtimeclass.go b/vendor/k8s.io/client-go/applyconfigurations/node/v1/runtimeclass.go index 6b33701cab..3a05a98942 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/node/v1/runtimeclass.go +++ b/vendor/k8s.io/client-go/applyconfigurations/node/v1/runtimeclass.go @@ -38,7 +38,8 @@ import ( // pod. For more details, see // https://kubernetes.io/docs/concepts/containers/runtime-class/ type RuntimeClassApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // handler specifies the underlying runtime and configuration that the CRI diff --git a/vendor/k8s.io/client-go/applyconfigurations/node/v1alpha1/runtimeclass.go b/vendor/k8s.io/client-go/applyconfigurations/node/v1alpha1/runtimeclass.go index 5fbf9a649a..da0736e769 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/node/v1alpha1/runtimeclass.go +++ b/vendor/k8s.io/client-go/applyconfigurations/node/v1alpha1/runtimeclass.go @@ -38,7 +38,8 @@ import ( // pod. For more details, see // https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class type RuntimeClassApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec represents specification of the RuntimeClass diff --git a/vendor/k8s.io/client-go/applyconfigurations/node/v1beta1/runtimeclass.go b/vendor/k8s.io/client-go/applyconfigurations/node/v1beta1/runtimeclass.go index fc75967fc0..a7d34d2c90 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/node/v1beta1/runtimeclass.go +++ b/vendor/k8s.io/client-go/applyconfigurations/node/v1beta1/runtimeclass.go @@ -38,7 +38,8 @@ import ( // pod. For more details, see // https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class type RuntimeClassApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // handler specifies the underlying runtime and configuration that the CRI diff --git a/vendor/k8s.io/client-go/applyconfigurations/policy/v1/eviction.go b/vendor/k8s.io/client-go/applyconfigurations/policy/v1/eviction.go index bd944a5e8b..a229524661 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/policy/v1/eviction.go +++ b/vendor/k8s.io/client-go/applyconfigurations/policy/v1/eviction.go @@ -34,10 +34,10 @@ import ( // This is a subresource of Pod. A request to cause such an eviction is // created by POSTing to .../pods//evictions. type EvictionApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // ObjectMeta describes the pod that is being evicted. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata describes the pod that is being evicted. *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // DeleteOptions may be provided + // deleteOptions may be provided DeleteOptions *metav1.DeleteOptionsApplyConfiguration `json:"deleteOptions,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudget.go b/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudget.go index c9d4fd1a60..84f01bb1c7 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudget.go +++ b/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudget.go @@ -32,13 +32,13 @@ import ( // // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods type PodDisruptionBudgetApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Specification of the desired behavior of the PodDisruptionBudget. + // spec is the specification of the desired behavior of the PodDisruptionBudget. Spec *PodDisruptionBudgetSpecApplyConfiguration `json:"spec,omitempty"` - // Most recently observed status of the PodDisruptionBudget. + // status is the most recently observed status of the PodDisruptionBudget. Status *PodDisruptionBudgetStatusApplyConfiguration `json:"status,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudgetspec.go b/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudgetspec.go index 0d2307332b..acc995b330 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudgetspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/policy/v1/poddisruptionbudgetspec.go @@ -29,22 +29,22 @@ import ( // // PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. type PodDisruptionBudgetSpecApplyConfiguration struct { - // An eviction is allowed if at least "minAvailable" pods selected by + // minAvailable indicates that an eviction is allowed if at least "minAvailable" pods selected by // "selector" will still be available after the eviction, i.e. even in the // absence of the evicted pod. So for example you can prevent all voluntary // evictions by specifying "100%". MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"` - // Label query over pods whose evictions are managed by the disruption + // selector is a label query over pods whose evictions are managed by the disruption // budget. // A null selector will match no pods, while an empty ({}) selector will select // all pods within the namespace. Selector *metav1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` - // An eviction is allowed if at most "maxUnavailable" pods selected by + // maxUnavailable indicates that an eviction is allowed if at most "maxUnavailable" pods selected by // "selector" are unavailable after the eviction, i.e. even in absence of // the evicted pod. For example, one can prevent all voluntary evictions // by specifying 0. This is a mutually exclusive setting with "minAvailable". MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` - // UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods + // unhealthyPodEvictionPolicy defines the criteria for when unhealthy pods // should be considered for eviction. Current implementation considers healthy pods, // as pods that have status.conditions item with type="Ready",status="True". // diff --git a/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/eviction.go b/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/eviction.go index eeadbbcb7d..333b0869fa 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/eviction.go +++ b/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/eviction.go @@ -34,10 +34,10 @@ import ( // This is a subresource of Pod. A request to cause such an eviction is // created by POSTing to .../pods//evictions. type EvictionApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // ObjectMeta describes the pod that is being evicted. + v1.TypeMetaApplyConfiguration `json:""` + // metadata describes the pod that is being evicted. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // DeleteOptions may be provided + // deleteOptions may be provided DeleteOptions *v1.DeleteOptionsApplyConfiguration `json:"deleteOptions,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/poddisruptionbudget.go b/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/poddisruptionbudget.go index ca2d839daa..54ee768948 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/poddisruptionbudget.go +++ b/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/poddisruptionbudget.go @@ -32,13 +32,13 @@ import ( // // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods type PodDisruptionBudgetApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Specification of the desired behavior of the PodDisruptionBudget. + // spec is the specification of the desired behavior of the PodDisruptionBudget. Spec *PodDisruptionBudgetSpecApplyConfiguration `json:"spec,omitempty"` - // Most recently observed status of the PodDisruptionBudget. + // status is the most recently observed status of the PodDisruptionBudget. Status *PodDisruptionBudgetStatusApplyConfiguration `json:"status,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/poddisruptionbudgetspec.go b/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/poddisruptionbudgetspec.go index 1fe247b489..28914430f3 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/poddisruptionbudgetspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/policy/v1beta1/poddisruptionbudgetspec.go @@ -29,23 +29,23 @@ import ( // // PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. type PodDisruptionBudgetSpecApplyConfiguration struct { - // An eviction is allowed if at least "minAvailable" pods selected by + // minAvailable indicates that an eviction is allowed if at least "minAvailable" pods selected by // "selector" will still be available after the eviction, i.e. even in the // absence of the evicted pod. So for example you can prevent all voluntary // evictions by specifying "100%". MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"` - // Label query over pods whose evictions are managed by the disruption + // selector is a label query over pods whose evictions are managed by the disruption // budget. // A null selector selects no pods. // An empty selector ({}) also selects no pods, which differs from standard behavior of selecting all pods. // In policy/v1, an empty selector will select all pods in the namespace. Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` - // An eviction is allowed if at most "maxUnavailable" pods selected by + // maxUnavailable indicates that an eviction is allowed if at most "maxUnavailable" pods selected by // "selector" are unavailable after the eviction, i.e. even in absence of // the evicted pod. For example, one can prevent all voluntary evictions // by specifying 0. This is a mutually exclusive setting with "minAvailable". MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` - // UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods + // unhealthyPodEvictionPolicy defines the criteria for when unhealthy pods // should be considered for eviction. Current implementation considers healthy pods, // as pods that have status.conditions item with type="Ready",status="True". // diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/aggregationrule.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/aggregationrule.go index 6f44e79795..572b477410 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/aggregationrule.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/aggregationrule.go @@ -27,7 +27,7 @@ import ( // // AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole type AggregationRuleApplyConfiguration struct { - // ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. + // clusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. // If any of the selectors match, then the ClusterRole's permissions will be added ClusterRoleSelectors []metav1.LabelSelectorApplyConfiguration `json:"clusterRoleSelectors,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/clusterrole.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/clusterrole.go index d65387e249..2f8395cf21 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/clusterrole.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/clusterrole.go @@ -32,12 +32,12 @@ import ( // // ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. type ClusterRoleApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object's metadata. *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Rules holds all the PolicyRules for this ClusterRole + // rules holds all the PolicyRules for this ClusterRole Rules []PolicyRuleApplyConfiguration `json:"rules,omitempty"` - // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. + // aggregationRule is an optional field that describes how to build the Rules for this ClusterRole. // If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be // stomped by the controller. AggregationRule *AggregationRuleApplyConfiguration `json:"aggregationRule,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/clusterrolebinding.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/clusterrolebinding.go index 13d3d0201f..f4327511cc 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/clusterrolebinding.go @@ -33,12 +33,12 @@ import ( // ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, // and adds who information via Subject. type ClusterRoleBindingApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object's metadata. *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Subjects holds references to the objects the role applies to. + // subjects holds references to the objects the role applies to. Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` - // RoleRef can only reference a ClusterRole in the global namespace. + // roleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // This field is immutable. RoleRef *RoleRefApplyConfiguration `json:"roleRef,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/policyrule.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/policyrule.go index 03556b01c4..9685f7b278 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/policyrule.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/policyrule.go @@ -28,16 +28,16 @@ package v1 // PolicyRule holds information that describes a policy rule, but does not contain information // about who the rule applies to or which namespace the rule applies to. type PolicyRuleApplyConfiguration struct { - // Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. + // verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. Verbs []string `json:"verbs,omitempty"` - // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of + // apiGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of // the enumerated resources in any API group will be allowed. "" represents the core API group and "*" represents all API groups. APIGroups []string `json:"apiGroups,omitempty"` - // Resources is a list of resources this rule applies to. '*' represents all resources. + // resources is a list of resources this rule applies to. '*' represents all resources. Resources []string `json:"resources,omitempty"` - // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. + // resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. ResourceNames []string `json:"resourceNames,omitempty"` - // NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path + // nonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path // Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. // Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. NonResourceURLs []string `json:"nonResourceURLs,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/role.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/role.go index 9e2895b1a8..fee603dff6 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/role.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/role.go @@ -32,10 +32,10 @@ import ( // // Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. type RoleApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object's metadata. *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Rules holds all the PolicyRules for this Role + // rules holds all the PolicyRules for this Role Rules []PolicyRuleApplyConfiguration `json:"rules,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/rolebinding.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/rolebinding.go index 776fb3ed30..994779c8c9 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/rolebinding.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/rolebinding.go @@ -34,12 +34,12 @@ import ( // It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given // namespace only have effect in that namespace. type RoleBindingApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object's metadata. *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Subjects holds references to the objects the role applies to. + // subjects holds references to the objects the role applies to. Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` - // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. + // roleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // This field is immutable. RoleRef *RoleRefApplyConfiguration `json:"roleRef,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/roleref.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/roleref.go index 231fe0dd49..1df91726d1 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/roleref.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/roleref.go @@ -23,11 +23,11 @@ package v1 // // RoleRef contains information that points to the role being used type RoleRefApplyConfiguration struct { - // APIGroup is the group for the resource being referenced + // apiGroup is the group for the resource being referenced APIGroup *string `json:"apiGroup,omitempty"` - // Kind is the type of resource being referenced + // kind is the type of resource being referenced Kind *string `json:"kind,omitempty"` - // Name is the name of resource being referenced + // name is the name of resource being referenced Name *string `json:"name,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/subject.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/subject.go index 1914086c0f..1432b410a5 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/subject.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1/subject.go @@ -24,16 +24,16 @@ package v1 // Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, // or a value for non-objects such as user and group names. type SubjectApplyConfiguration struct { - // Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". + // kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". // If the Authorizer does not recognized the kind value, the Authorizer should report an error. Kind *string `json:"kind,omitempty"` - // APIGroup holds the API group of the referenced subject. + // apiGroup holds the API group of the referenced subject. // Defaults to "" for ServiceAccount subjects. // Defaults to "rbac.authorization.k8s.io" for User and Group subjects. APIGroup *string `json:"apiGroup,omitempty"` - // Name of the object being referenced. + // name of the object being referenced. Name *string `json:"name,omitempty"` - // Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty + // namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty // the Authorizer should report an error. Namespace *string `json:"namespace,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/aggregationrule.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/aggregationrule.go index 397d14a1ac..169cf984d7 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/aggregationrule.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/aggregationrule.go @@ -27,7 +27,7 @@ import ( // // AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole type AggregationRuleApplyConfiguration struct { - // ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. + // clusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. // If any of the selectors match, then the ClusterRole's permissions will be added ClusterRoleSelectors []v1.LabelSelectorApplyConfiguration `json:"clusterRoleSelectors,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/clusterrole.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/clusterrole.go index 678761e6a0..5cc806dea1 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/clusterrole.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/clusterrole.go @@ -33,12 +33,12 @@ import ( // ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRole, and will no longer be served in v1.22. type ClusterRoleApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object's metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Rules holds all the PolicyRules for this ClusterRole + // rules holds all the PolicyRules for this ClusterRole Rules []PolicyRuleApplyConfiguration `json:"rules,omitempty"` - // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. + // aggregationRule is an optional field that describes how to build the Rules for this ClusterRole. // If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be // stomped by the controller. AggregationRule *AggregationRuleApplyConfiguration `json:"aggregationRule,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/clusterrolebinding.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/clusterrolebinding.go index f4ee74f18f..fcfe3709ed 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/clusterrolebinding.go @@ -34,12 +34,12 @@ import ( // and adds who information via Subject. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBinding, and will no longer be served in v1.22. type ClusterRoleBindingApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object's metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Subjects holds references to the objects the role applies to. + // subjects holds references to the objects the role applies to. Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` - // RoleRef can only reference a ClusterRole in the global namespace. + // roleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. RoleRef *RoleRefApplyConfiguration `json:"roleRef,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/policyrule.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/policyrule.go index f4a6d3fff7..7c4e9cca1b 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/policyrule.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/policyrule.go @@ -28,16 +28,16 @@ package v1alpha1 // PolicyRule holds information that describes a policy rule, but does not contain information // about who the rule applies to or which namespace the rule applies to. type PolicyRuleApplyConfiguration struct { - // Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. + // verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. Verbs []string `json:"verbs,omitempty"` - // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of + // apiGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of // the enumerated resources in any API group will be allowed. "" represents the core API group and "*" represents all API groups. APIGroups []string `json:"apiGroups,omitempty"` - // Resources is a list of resources this rule applies to. '*' represents all resources. + // resources is a list of resources this rule applies to. '*' represents all resources. Resources []string `json:"resources,omitempty"` - // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. + // resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. ResourceNames []string `json:"resourceNames,omitempty"` - // NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path + // nonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path // Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. // Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. NonResourceURLs []string `json:"nonResourceURLs,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/role.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/role.go index 19b123b2d2..b2f8ca8b2c 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/role.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/role.go @@ -33,10 +33,10 @@ import ( // Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 Role, and will no longer be served in v1.22. type RoleApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object's metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Rules holds all the PolicyRules for this Role + // rules holds all the PolicyRules for this Role Rules []PolicyRuleApplyConfiguration `json:"rules,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/rolebinding.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/rolebinding.go index 116f293765..b836c08a5e 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/rolebinding.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/rolebinding.go @@ -35,12 +35,12 @@ import ( // namespace only have effect in that namespace. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBinding, and will no longer be served in v1.22. type RoleBindingApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object's metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Subjects holds references to the objects the role applies to. + // subjects holds references to the objects the role applies to. Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` - // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. + // roleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. RoleRef *RoleRefApplyConfiguration `json:"roleRef,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/roleref.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/roleref.go index a02a36be89..25aab93791 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/roleref.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/roleref.go @@ -23,11 +23,11 @@ package v1alpha1 // // RoleRef contains information that points to the role being used type RoleRefApplyConfiguration struct { - // APIGroup is the group for the resource being referenced + // apiGroup is the group for the resource being referenced APIGroup *string `json:"apiGroup,omitempty"` - // Kind is the type of resource being referenced + // kind is the type of resource being referenced Kind *string `json:"kind,omitempty"` - // Name is the name of resource being referenced + // name is the name of resource being referenced Name *string `json:"name,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/subject.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/subject.go index d24f865d4e..51a5b4d4b4 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/subject.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1alpha1/subject.go @@ -24,16 +24,16 @@ package v1alpha1 // Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, // or a value for non-objects such as user and group names. type SubjectApplyConfiguration struct { - // Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". + // kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". // If the Authorizer does not recognized the kind value, the Authorizer should report an error. Kind *string `json:"kind,omitempty"` - // APIVersion holds the API group and version of the referenced subject. + // apiVersion holds the API group and version of the referenced subject. // Defaults to "v1" for ServiceAccount subjects. // Defaults to "rbac.authorization.k8s.io/v1alpha1" for User and Group subjects. APIVersion *string `json:"apiVersion,omitempty"` - // Name of the object being referenced. + // name of the object being referenced. Name *string `json:"name,omitempty"` - // Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty + // namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty // the Authorizer should report an error. Namespace *string `json:"namespace,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/aggregationrule.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/aggregationrule.go index b4c6bd5aed..8064db4dd5 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/aggregationrule.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/aggregationrule.go @@ -27,7 +27,7 @@ import ( // // AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole type AggregationRuleApplyConfiguration struct { - // ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. + // clusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. // If any of the selectors match, then the ClusterRole's permissions will be added ClusterRoleSelectors []v1.LabelSelectorApplyConfiguration `json:"clusterRoleSelectors,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/clusterrole.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/clusterrole.go index a105df5f0d..dacb3b17b9 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/clusterrole.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/clusterrole.go @@ -33,12 +33,12 @@ import ( // ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRole, and will no longer be served in v1.22. type ClusterRoleApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object's metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Rules holds all the PolicyRules for this ClusterRole + // rules holds all the PolicyRules for this ClusterRole Rules []PolicyRuleApplyConfiguration `json:"rules,omitempty"` - // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. + // aggregationRule is an optional field that describes how to build the Rules for this ClusterRole. // If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be // stomped by the controller. AggregationRule *AggregationRuleApplyConfiguration `json:"aggregationRule,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/clusterrolebinding.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/clusterrolebinding.go index c519c6e078..0b400e124d 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/clusterrolebinding.go @@ -34,12 +34,12 @@ import ( // and adds who information via Subject. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBinding, and will no longer be served in v1.22. type ClusterRoleBindingApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object's metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Subjects holds references to the objects the role applies to. + // subjects holds references to the objects the role applies to. Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` - // RoleRef can only reference a ClusterRole in the global namespace. + // roleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. RoleRef *RoleRefApplyConfiguration `json:"roleRef,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/policyrule.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/policyrule.go index bf3a5a5086..c5cf6a8fcf 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/policyrule.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/policyrule.go @@ -28,17 +28,17 @@ package v1beta1 // PolicyRule holds information that describes a policy rule, but does not contain information // about who the rule applies to or which namespace the rule applies to. type PolicyRuleApplyConfiguration struct { - // Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. + // verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. Verbs []string `json:"verbs,omitempty"` - // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of + // apiGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of // the enumerated resources in any API group will be allowed. "" represents the core API group and "*" represents all API groups. APIGroups []string `json:"apiGroups,omitempty"` - // Resources is a list of resources this rule applies to. '*' represents all resources in the specified apiGroups. + // resources is a list of resources this rule applies to. '*' represents all resources in the specified apiGroups. // '*/foo' represents the subresource 'foo' for all resources in the specified apiGroups. Resources []string `json:"resources,omitempty"` - // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. + // resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. ResourceNames []string `json:"resourceNames,omitempty"` - // NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path + // nonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path // Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. // Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. NonResourceURLs []string `json:"nonResourceURLs,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/role.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/role.go index d0a4c20c68..df72d643b3 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/role.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/role.go @@ -33,10 +33,10 @@ import ( // Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 Role, and will no longer be served in v1.22. type RoleApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object's metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Rules holds all the PolicyRules for this Role + // rules holds all the PolicyRules for this Role Rules []PolicyRuleApplyConfiguration `json:"rules,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/rolebinding.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/rolebinding.go index 64669c1033..f851aab7b7 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/rolebinding.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/rolebinding.go @@ -35,12 +35,12 @@ import ( // namespace only have effect in that namespace. // Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBinding, and will no longer be served in v1.22. type RoleBindingApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object's metadata. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Subjects holds references to the objects the role applies to. + // subjects holds references to the objects the role applies to. Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` - // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. + // roleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. RoleRef *RoleRefApplyConfiguration `json:"roleRef,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/roleref.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/roleref.go index 350930af7a..63d1c40c1d 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/roleref.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/roleref.go @@ -23,11 +23,11 @@ package v1beta1 // // RoleRef contains information that points to the role being used type RoleRefApplyConfiguration struct { - // APIGroup is the group for the resource being referenced + // apiGroup is the group for the resource being referenced APIGroup *string `json:"apiGroup,omitempty"` - // Kind is the type of resource being referenced + // kind is the type of resource being referenced Kind *string `json:"kind,omitempty"` - // Name is the name of resource being referenced + // name is the name of resource being referenced Name *string `json:"name,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/subject.go b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/subject.go index 8abbaa9fb3..083c8a1a2d 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/subject.go +++ b/vendor/k8s.io/client-go/applyconfigurations/rbac/v1beta1/subject.go @@ -24,16 +24,16 @@ package v1beta1 // Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, // or a value for non-objects such as user and group names. type SubjectApplyConfiguration struct { - // Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". + // kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". // If the Authorizer does not recognized the kind value, the Authorizer should report an error. Kind *string `json:"kind,omitempty"` - // APIGroup holds the API group of the referenced subject. + // apiGroup holds the API group of the referenced subject. // Defaults to "" for ServiceAccount subjects. // Defaults to "rbac.authorization.k8s.io" for User and Group subjects. APIGroup *string `json:"apiGroup,omitempty"` - // Name of the object being referenced. + // name of the object being referenced. Name *string `json:"name,omitempty"` - // Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty + // namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty // the Authorizer should report an error. Namespace *string `json:"namespace,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/capacityrequestpolicyrange.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/capacityrequestpolicyrange.go index b3bade6113..057b1dfd13 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/capacityrequestpolicyrange.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/capacityrequestpolicyrange.go @@ -27,6 +27,13 @@ import ( // // CapacityRequestPolicyRange defines a valid range for consumable capacity values. // +// If the DRAFractionalCapacityRange feature gate is +// enabled and at least one of Min, Max, or Step is a fractional quantity (i.e. +// its value is not an integer), milli-unit arithmetic is used instead, +// supporting values with up to 3 decimal places (e.g. 100m = 0.1). +// The largest supported value then is 1000 times smaller compared to using 64-bit integers. +// Otherwise, all comparisons use 64-bit integer arithmetic via resource.Quantity.Value(). +// // - If the requested amount is less than Min, it is rounded up to the Min value. // - If Step is set and the requested amount is between Min and Max but not aligned with Step, // it will be rounded up to the next value equal to Min + (n * Step). diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/celdeviceselector.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/celdeviceselector.go index 15ec20da40..d5ca19905d 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/celdeviceselector.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/celdeviceselector.go @@ -33,7 +33,7 @@ type CELDeviceSelectorApplyConfiguration struct { // - driver (string): the name of the driver which defines this device. // - attributes (map[string]object): the device's attributes, grouped by prefix // (e.g. device.attributes["dra.example.com"] evaluates to an object with all - // of the attributes which were prefixed by "dra.example.com". + // of the attributes which were prefixed by "dra.example.com"). // - capacity (map[string]object): the device's capacities, grouped by prefix. // - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device // (v1.34+ with the DRAConsumableCapacity feature enabled). @@ -66,6 +66,15 @@ type CELDeviceSelectorApplyConfiguration struct { // A robust expression should check for the existence of attributes // before referencing them. // + // Common errors: + // - "no such key": Use optional chaining (.? followed by orValue()) + // or guarding the check with has() for optional fields. + // See CEL Optional Types for details: + // https://pkg.go.dev/github.com/google/cel-go@v0.17.4/cel#OptionalTypes + // + // For more CEL expression syntax and examples, see: + // https://kubernetes.io/docs/reference/using-api/cel/ + // // For ease of use, the cel.bind() function is enabled, and can be used // to simplify expressions that access multiple attributes with the // same domain. For example: diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/device.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/device.go index f19b9000cd..4ebb005fd7 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/device.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/device.go @@ -114,7 +114,7 @@ type DeviceApplyConfiguration struct { // If AllowMultipleAllocations is set to true, the device can be allocated more than once, // and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not. AllowMultipleAllocations *bool `json:"allowMultipleAllocations,omitempty"` - // NodeAllocatableResourceMappings defines the mapping of node resources + // NodeAllocatableResources defines the mapping of node resources // that are managed by the DRA driver exposing this device. This includes resources currently // reported in v1.Node `status.allocatable` that are not extended resources // (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). @@ -125,7 +125,7 @@ type DeviceApplyConfiguration struct { // dependencies of an accelerator device. // The keys of this map are the node-allocatable resource names (e.g., "cpu", "memory"). // Extended resource names are not permitted as keys. - NodeAllocatableResourceMappings map[apicorev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration `json:"nodeAllocatableResourceMappings,omitempty"` + NodeAllocatableResources map[apicorev1.ResourceName]NodeAllocatableResourceApplyConfiguration `json:"nodeAllocatableResources,omitempty"` } // DeviceApplyConfiguration constructs a declarative configuration of the Device type for use with @@ -256,16 +256,16 @@ func (b *DeviceApplyConfiguration) WithAllowMultipleAllocations(value bool) *Dev return b } -// WithNodeAllocatableResourceMappings puts the entries into the NodeAllocatableResourceMappings field in the declarative configuration +// WithNodeAllocatableResources puts the entries into the NodeAllocatableResources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the NodeAllocatableResourceMappings field, -// overwriting an existing map entries in NodeAllocatableResourceMappings field with the same key. -func (b *DeviceApplyConfiguration) WithNodeAllocatableResourceMappings(entries map[apicorev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration) *DeviceApplyConfiguration { - if b.NodeAllocatableResourceMappings == nil && len(entries) > 0 { - b.NodeAllocatableResourceMappings = make(map[apicorev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration, len(entries)) +// If called multiple times, the entries provided by each call will be put on the NodeAllocatableResources field, +// overwriting an existing map entries in NodeAllocatableResources field with the same key. +func (b *DeviceApplyConfiguration) WithNodeAllocatableResources(entries map[apicorev1.ResourceName]NodeAllocatableResourceApplyConfiguration) *DeviceApplyConfiguration { + if b.NodeAllocatableResources == nil && len(entries) > 0 { + b.NodeAllocatableResources = make(map[apicorev1.ResourceName]NodeAllocatableResourceApplyConfiguration, len(entries)) } for k, v := range entries { - b.NodeAllocatableResourceMappings[k] = v + b.NodeAllocatableResources[k] = v } return b } diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceallocationconfiguration.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceallocationconfiguration.go index 29e1ba427a..2cfca606d2 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceallocationconfiguration.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceallocationconfiguration.go @@ -38,7 +38,7 @@ type DeviceAllocationConfigurationApplyConfiguration struct { // and may include the subrequest using the format
[/]. If just // the main request is given, the configuration applies to all subrequests. Requests []string `json:"requests,omitempty"` - DeviceConfigurationApplyConfiguration `json:",inline"` + DeviceConfigurationApplyConfiguration `json:""` } // DeviceAllocationConfigurationApplyConfiguration constructs a declarative configuration of the DeviceAllocationConfiguration type for use with diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclaimconfiguration.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclaimconfiguration.go index 402cd877c9..2da8207609 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclaimconfiguration.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclaimconfiguration.go @@ -30,7 +30,7 @@ type DeviceClaimConfigurationApplyConfiguration struct { // and may include the subrequest using the format
[/]. If just // the main request is given, the configuration applies to all subrequests. Requests []string `json:"requests,omitempty"` - DeviceConfigurationApplyConfiguration `json:",inline"` + DeviceConfigurationApplyConfiguration `json:""` } // DeviceClaimConfigurationApplyConfiguration constructs a declarative configuration of the DeviceClaimConfiguration type for use with diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclass.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclass.go index 478f90bb04..49d6d7258d 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclass.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclass.go @@ -35,7 +35,7 @@ import ( // the device requests of a claim to apply these presets. // Cluster scoped. type DeviceClassApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Spec defines what can be allocated and how to configure it. diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclassconfiguration.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclassconfiguration.go index c47fd9f85c..062cde2ab8 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclassconfiguration.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclassconfiguration.go @@ -23,7 +23,7 @@ package v1 // // DeviceClassConfiguration is used in DeviceClass. type DeviceClassConfigurationApplyConfiguration struct { - DeviceConfigurationApplyConfiguration `json:",inline"` + DeviceConfigurationApplyConfiguration `json:""` } // DeviceClassConfigurationApplyConfiguration constructs a declarative configuration of the DeviceClassConfiguration type for use with diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclassspec.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclassspec.go index a6a3992c92..5e7d736199 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclassspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/deviceclassspec.go @@ -40,8 +40,6 @@ type DeviceClassSpecApplyConfiguration struct { // is picked to satisfy a pod's extended resource requests. // If two classes are created at the same time, then the name of the class // lexicographically sorted first is picked. - // - // This is a beta field. ExtendedResourceName *string `json:"extendedResourceName,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicecounterconsumption.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicecounterconsumption.go index 9bcd936db2..939894bea7 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicecounterconsumption.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicecounterconsumption.go @@ -31,6 +31,26 @@ type DeviceCounterConsumptionApplyConfiguration struct { // // The maximum number of counters is 32. Counters map[string]CounterApplyConfiguration `json:"counters,omitempty"` + // CompatibilityGroups is a list of opaque group names for + // this counter set consumption. + // + // Devices that consume counters from the same counter set may only be + // allocated at the same time ("co-allocated") if they all share at least + // one common group: the intersection of the CompatibilityGroups of all + // co-allocated devices on that counter set must be non-empty. Devices + // that consume from different counter sets are never compared via this + // field. + // + // An unset field, an explicit nil, and an empty list are equivalent and + // mean "no groups": such a device is only co-allocatable with sibling + // devices on the same counter set that also have no groups, and is never + // co-allocatable with a device that declares one or more groups. + // + // Group names are opaque and meaningful only within the + // publishing driver's pool. + // + // The maximum number of groups is 2, and the names must be unique. + CompatibilityGroups []string `json:"compatibilityGroups,omitempty"` } // DeviceCounterConsumptionApplyConfiguration constructs a declarative configuration of the DeviceCounterConsumption type for use with @@ -60,3 +80,13 @@ func (b *DeviceCounterConsumptionApplyConfiguration) WithCounters(entries map[st } return b } + +// WithCompatibilityGroups adds the given value to the CompatibilityGroups field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CompatibilityGroups field. +func (b *DeviceCounterConsumptionApplyConfiguration) WithCompatibilityGroups(values ...string) *DeviceCounterConsumptionApplyConfiguration { + for i := range values { + b.CompatibilityGroups = append(b.CompatibilityGroups, values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicederivedattribute.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicederivedattribute.go new file mode 100644 index 0000000000..9283a257d6 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicederivedattribute.go @@ -0,0 +1,95 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + resourcev1 "k8s.io/api/resource/v1" +) + +// DeviceDerivedAttributeApplyConfiguration represents a declarative configuration of the DeviceDerivedAttribute type for use +// with apply. +// +// DeviceDerivedAttribute defines a derived attribute computed via CEL. +type DeviceDerivedAttributeApplyConfiguration struct { + // Name is the identifier for this derived attribute, used in constraints. + // + // It must be a DNS subdomain followed by a slash ("/") followed by a C identifier + // (e.g. "example.com/numaNode" or "derived/numaNode"). + // + // If the chosen name matches an existing physical attribute from a driver, + // the derived attribute's expression will shadow the physical attribute, + // and its evaluated value will be used in constraints instead. When the goal + // is to define a derived attribute that is only used within the ResourceClaim + // and not meant to shadow an existing attribute, use a domain prefix that + // no DRA driver should be using (e.g. "derived/myAttribute"). + // + // It is not valid to define a derived attribute that isn't used in at least + // one constraint. + Name *resourcev1.FullyQualifiedName `json:"name,omitempty"` + // Expression is a CEL expression evaluated against each candidate device. + // The expression must evaluate to a primitive scalar (string, integer, + // boolean, or semver) or a list of these scalars ([]string, []int64, + // []bool, []semver) to act as a virtual grouping key. Any other return type + // is an error and causes CEL evaluation for the device to fail. + // + // The expression's input is an object named "device", which carries the + // same properties as in a CELDeviceSelector. + // + // When pod scheduling encounters CEL runtime errors (such as looking + // up an attribute that isn't defined) for some devices, it will abort + // allocation and fail scheduling for the Pod. Surfacing evaluation + // errors immediately prevents silent topology matching failures that are + // extremely hard to detect. A robust expression should, for example, check + // for the existence of attributes before referencing them to avoid + // runtime evaluation errors. + // + // The expression gets evaluated after a device has passed the other + // selector expressions for the request in which this expression is used. + // This allows writing expressions that are tailored towards the specific + // devices being requested (for example, by assuming the device is from a + // certain vendor and skipping those checks). + // + // The length of the expression must be smaller or equal to 10 Ki. The + // cost of evaluating it is also limited based on the estimated number + // of logical steps; the combined cost of all derived attributes in a + // claim is capped by a shared CEL cost budget. + Expression *string `json:"expression,omitempty"` +} + +// DeviceDerivedAttributeApplyConfiguration constructs a declarative configuration of the DeviceDerivedAttribute type for use with +// apply. +func DeviceDerivedAttribute() *DeviceDerivedAttributeApplyConfiguration { + return &DeviceDerivedAttributeApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *DeviceDerivedAttributeApplyConfiguration) WithName(value resourcev1.FullyQualifiedName) *DeviceDerivedAttributeApplyConfiguration { + b.Name = &value + return b +} + +// WithExpression sets the Expression field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Expression field is set to the value of the last call. +func (b *DeviceDerivedAttributeApplyConfiguration) WithExpression(value string) *DeviceDerivedAttributeApplyConfiguration { + b.Expression = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicerequestallocationresult.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicerequestallocationresult.go index 592a641756..a32440eaca 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicerequestallocationresult.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicerequestallocationresult.go @@ -94,6 +94,12 @@ type DeviceRequestAllocationResultApplyConfiguration struct { // This field is populated only for devices that allow multiple allocations. // All capacity entries are included, even if the consumed amount is zero. ConsumedCapacity map[resourcev1.QualifiedName]resource.Quantity `json:"consumedCapacity,omitempty"` + // SkipNodeOperations lists node-local resource operations (gRPC calls) + // that will be skipped for this allocated device when determining whether + // operations are necessary on the node. If all allocated devices for a driver in + // a claim skip an operation, that gRPC call will be skipped. It is a copy of + // the ResourceSlice.spec.skipNodeOperations value at the time when the device was allocated. + SkipNodeOperations []resourcev1.SkipNodeOperation `json:"skipNodeOperations,omitempty"` } // DeviceRequestAllocationResultApplyConfiguration constructs a declarative configuration of the DeviceRequestAllocationResult type for use with @@ -196,3 +202,13 @@ func (b *DeviceRequestAllocationResultApplyConfiguration) WithConsumedCapacity(e } return b } + +// WithSkipNodeOperations adds the given value to the SkipNodeOperations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SkipNodeOperations field. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithSkipNodeOperations(values ...resourcev1.SkipNodeOperation) *DeviceRequestAllocationResultApplyConfiguration { + for i := range values { + b.SkipNodeOperations = append(b.SkipNodeOperations, values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicesubrequest.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicesubrequest.go index d554522fa1..74a7e96124 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicesubrequest.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicesubrequest.go @@ -109,6 +109,27 @@ type DeviceSubRequestApplyConfiguration struct { // the request fails if there are devices that otherwise match the request, // and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request. Capacity *CapacityRequirementsApplyConfiguration `json:"capacity,omitempty"` + // DerivedAttributes defines a set of virtual attributes computed via CEL expressions + // for each candidate device. These virtual attributes can be referenced in + // `.devices.constraints` to align and match different devices (e.g., co-allocating + // a GPU and a NIC on the same NUMA node) even if their drivers publish different + // attributes. Derived attributes are not available via `device.attributes` + // in the CEL environment when evaluating selector expressions. + // + // Derived attributes allow you to extract, transform, or normalize topology + // information (such as extracting a NUMA index from a complex topology string or + // renaming a vendor-specific attribute) into a common virtual attribute name at + // scheduling time. The scheduler then evaluates these virtual attributes exactly + // like static attributes when matching constraints. + // + // Every derived attribute defined in this list must be referenced by at least one + // MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list. + // + // The maximum number of derived attributes is 32. + // + // This is an alpha field and requires enabling the DRADerivedAttributes + // feature gate. + DerivedAttributes []DeviceDerivedAttributeApplyConfiguration `json:"derivedAttributes,omitempty"` } // DeviceSubRequestApplyConfiguration constructs a declarative configuration of the DeviceSubRequest type for use with @@ -182,3 +203,16 @@ func (b *DeviceSubRequestApplyConfiguration) WithCapacity(value *CapacityRequire b.Capacity = value return b } + +// WithDerivedAttributes adds the given value to the DerivedAttributes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the DerivedAttributes field. +func (b *DeviceSubRequestApplyConfiguration) WithDerivedAttributes(values ...*DeviceDerivedAttributeApplyConfiguration) *DeviceSubRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDerivedAttributes") + } + b.DerivedAttributes = append(b.DerivedAttributes, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicetaintrule.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicetaintrule.go new file mode 100644 index 0000000000..e97d4855e6 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicetaintrule.go @@ -0,0 +1,294 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + resourcev1 "k8s.io/api/resource/v1" + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// DeviceTaintRuleApplyConfiguration represents a declarative configuration of the DeviceTaintRule type for use +// with apply. +// +// DeviceTaintRule adds one taint to all devices which match the selector. +// This has the same effect as if the taint was specified directly +// in the ResourceSlice by the DRA driver. +type DeviceTaintRuleApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:""` + // Standard object metadata + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // Spec specifies the selector and one taint. + // + // Changing the spec automatically increments the metadata.generation number. + Spec *DeviceTaintRuleSpecApplyConfiguration `json:"spec,omitempty"` + // Status provides information about what was requested in the spec. + Status *DeviceTaintRuleStatusApplyConfiguration `json:"status,omitempty"` +} + +// DeviceTaintRule constructs a declarative configuration of the DeviceTaintRule type for use with +// apply. +func DeviceTaintRule(name string) *DeviceTaintRuleApplyConfiguration { + b := &DeviceTaintRuleApplyConfiguration{} + b.WithName(name) + b.WithKind("DeviceTaintRule") + b.WithAPIVersion("resource.k8s.io/v1") + return b +} + +// ExtractDeviceTaintRuleFrom extracts the applied configuration owned by fieldManager from +// deviceTaintRule for the specified subresource. Pass an empty string for subresource to extract +// the main resource. Common subresources include "status", "scale", etc. +// deviceTaintRule must be a unmodified DeviceTaintRule API object that was retrieved from the Kubernetes API. +// ExtractDeviceTaintRuleFrom provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractDeviceTaintRuleFrom(deviceTaintRule *resourcev1.DeviceTaintRule, fieldManager string, subresource string) (*DeviceTaintRuleApplyConfiguration, error) { + b := &DeviceTaintRuleApplyConfiguration{} + err := managedfields.ExtractInto(deviceTaintRule, internal.Parser().Type("io.k8s.api.resource.v1.DeviceTaintRule"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(deviceTaintRule.Name) + + b.WithKind("DeviceTaintRule") + b.WithAPIVersion("resource.k8s.io/v1") + return b, nil +} + +// ExtractDeviceTaintRule extracts the applied configuration owned by fieldManager from +// deviceTaintRule. If no managedFields are found in deviceTaintRule for fieldManager, a +// DeviceTaintRuleApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// deviceTaintRule must be a unmodified DeviceTaintRule API object that was retrieved from the Kubernetes API. +// ExtractDeviceTaintRule provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractDeviceTaintRule(deviceTaintRule *resourcev1.DeviceTaintRule, fieldManager string) (*DeviceTaintRuleApplyConfiguration, error) { + return ExtractDeviceTaintRuleFrom(deviceTaintRule, fieldManager, "") +} + +// ExtractDeviceTaintRuleStatus extracts the applied configuration owned by fieldManager from +// deviceTaintRule for the status subresource. +func ExtractDeviceTaintRuleStatus(deviceTaintRule *resourcev1.DeviceTaintRule, fieldManager string) (*DeviceTaintRuleApplyConfiguration, error) { + return ExtractDeviceTaintRuleFrom(deviceTaintRule, fieldManager, "status") +} + +func (b DeviceTaintRuleApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithKind(value string) *DeviceTaintRuleApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithAPIVersion(value string) *DeviceTaintRuleApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithName(value string) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithGenerateName(value string) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithNamespace(value string) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithUID(value types.UID) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithResourceVersion(value string) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithGeneration(value int64) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *DeviceTaintRuleApplyConfiguration) WithLabels(entries map[string]string) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *DeviceTaintRuleApplyConfiguration) WithAnnotations(entries map[string]string) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *DeviceTaintRuleApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *DeviceTaintRuleApplyConfiguration) WithFinalizers(values ...string) *DeviceTaintRuleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *DeviceTaintRuleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithSpec(value *DeviceTaintRuleSpecApplyConfiguration) *DeviceTaintRuleApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *DeviceTaintRuleApplyConfiguration) WithStatus(value *DeviceTaintRuleStatusApplyConfiguration) *DeviceTaintRuleApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *DeviceTaintRuleApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *DeviceTaintRuleApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *DeviceTaintRuleApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *DeviceTaintRuleApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicetaintrulespec.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicetaintrulespec.go new file mode 100644 index 0000000000..694a5c4b2d --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicetaintrulespec.go @@ -0,0 +1,55 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// DeviceTaintRuleSpecApplyConfiguration represents a declarative configuration of the DeviceTaintRuleSpec type for use +// with apply. +// +// DeviceTaintRuleSpec specifies the selector and one taint. +type DeviceTaintRuleSpecApplyConfiguration struct { + // DeviceSelector defines which device(s) the taint is applied to. + // All selector criteria must be satisfied for a device to + // match. The empty selector matches all devices. Without + // a selector, no devices are matches. + DeviceSelector *DeviceTaintSelectorApplyConfiguration `json:"deviceSelector,omitempty"` + // The taint that gets applied to matching devices. + Taint *DeviceTaintApplyConfiguration `json:"taint,omitempty"` +} + +// DeviceTaintRuleSpecApplyConfiguration constructs a declarative configuration of the DeviceTaintRuleSpec type for use with +// apply. +func DeviceTaintRuleSpec() *DeviceTaintRuleSpecApplyConfiguration { + return &DeviceTaintRuleSpecApplyConfiguration{} +} + +// WithDeviceSelector sets the DeviceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeviceSelector field is set to the value of the last call. +func (b *DeviceTaintRuleSpecApplyConfiguration) WithDeviceSelector(value *DeviceTaintSelectorApplyConfiguration) *DeviceTaintRuleSpecApplyConfiguration { + b.DeviceSelector = value + return b +} + +// WithTaint sets the Taint field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Taint field is set to the value of the last call. +func (b *DeviceTaintRuleSpecApplyConfiguration) WithTaint(value *DeviceTaintApplyConfiguration) *DeviceTaintRuleSpecApplyConfiguration { + b.Taint = value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicetaintrulestatus.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicetaintrulestatus.go new file mode 100644 index 0000000000..568cc205ac --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicetaintrulestatus.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// DeviceTaintRuleStatusApplyConfiguration represents a declarative configuration of the DeviceTaintRuleStatus type for use +// with apply. +// +// DeviceTaintRuleStatus provides information about an on-going pod eviction. +type DeviceTaintRuleStatusApplyConfiguration struct { + // Conditions provide information about the state of the DeviceTaintRule + // and the cluster at some point in time, + // in a machine-readable and human-readable format. + // + // The following condition is currently defined as part of this API, more may + // get added: + // - Type: EvictionInProgress + // - Status: True if there are currently pods which need to be evicted, False otherwise + // (includes the effects which don't cause eviction). + // - Reason: not specified, may change + // - Message: includes information about number of pending pods and already evicted pods + // in a human-readable format, updated periodically, may change + // + // For `effect: None`, the condition above gets set once for each change to + // the spec, with the message containing information about what would happen + // if the effect was `NoExecute`. This feedback can be used to decide whether + // changing the effect to `NoExecute` will work as intended. It only gets + // set once to avoid having to constantly update the status. + // + // Must have 8 or fewer entries. + Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` +} + +// DeviceTaintRuleStatusApplyConfiguration constructs a declarative configuration of the DeviceTaintRuleStatus type for use with +// apply. +func DeviceTaintRuleStatus() *DeviceTaintRuleStatusApplyConfiguration { + return &DeviceTaintRuleStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *DeviceTaintRuleStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *DeviceTaintRuleStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicetaintselector.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicetaintselector.go new file mode 100644 index 0000000000..6d31934be2 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/devicetaintselector.go @@ -0,0 +1,76 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// DeviceTaintSelectorApplyConfiguration represents a declarative configuration of the DeviceTaintSelector type for use +// with apply. +// +// DeviceTaintSelector defines which device(s) a DeviceTaintRule applies to. +// The empty selector matches all devices. Without a selector, no devices +// are matched. +type DeviceTaintSelectorApplyConfiguration struct { + // If driver is set, only devices from that driver are selected. + // This fields corresponds to slice.spec.driver. + Driver *string `json:"driver,omitempty"` + // If pool is set, only devices in that pool are selected. + // + // Also setting the driver name may be useful to avoid + // ambiguity when different drivers use the same pool name, + // but this is not required because selecting pools from + // different drivers may also be useful, for example when + // drivers with node-local devices use the node name as + // their pool name. + Pool *string `json:"pool,omitempty"` + // If device is set, only devices with that name are selected. + // This field corresponds to slice.spec.devices[].name. + // + // Setting also driver and pool may be required to avoid ambiguity, + // but is not required. + Device *string `json:"device,omitempty"` +} + +// DeviceTaintSelectorApplyConfiguration constructs a declarative configuration of the DeviceTaintSelector type for use with +// apply. +func DeviceTaintSelector() *DeviceTaintSelectorApplyConfiguration { + return &DeviceTaintSelectorApplyConfiguration{} +} + +// WithDriver sets the Driver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Driver field is set to the value of the last call. +func (b *DeviceTaintSelectorApplyConfiguration) WithDriver(value string) *DeviceTaintSelectorApplyConfiguration { + b.Driver = &value + return b +} + +// WithPool sets the Pool field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pool field is set to the value of the last call. +func (b *DeviceTaintSelectorApplyConfiguration) WithPool(value string) *DeviceTaintSelectorApplyConfiguration { + b.Pool = &value + return b +} + +// WithDevice sets the Device field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Device field is set to the value of the last call. +func (b *DeviceTaintSelectorApplyConfiguration) WithDevice(value string) *DeviceTaintSelectorApplyConfiguration { + b.Device = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/exactdevicerequest.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/exactdevicerequest.go index 8eb0fd3526..68b3c2d40c 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/exactdevicerequest.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/exactdevicerequest.go @@ -106,6 +106,27 @@ type ExactDeviceRequestApplyConfiguration struct { // the request fails if there are devices that otherwise match the request, // and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request. Capacity *CapacityRequirementsApplyConfiguration `json:"capacity,omitempty"` + // DerivedAttributes defines a set of virtual attributes computed via CEL expressions + // for each candidate device. These virtual attributes can be referenced in + // `.devices.constraints` to align and match different devices (e.g., co-allocating + // a GPU and a NIC on the same NUMA node) even if their drivers publish different + // attributes. Derived attributes are not available via `device.attributes` + // in the CEL environment when evaluating selector expressions. + // + // Derived attributes allow you to extract, transform, or normalize topology + // information (such as extracting a NUMA index from a complex topology string or + // renaming a vendor-specific attribute) into a common virtual attribute name at + // scheduling time. The scheduler then evaluates these virtual attributes exactly + // like static attributes when matching constraints. + // + // Every derived attribute defined in this list must be referenced by at least one + // MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list. + // + // The maximum number of derived attributes is 32. + // + // This is an alpha field and requires enabling the DRADerivedAttributes + // feature gate. + DerivedAttributes []DeviceDerivedAttributeApplyConfiguration `json:"derivedAttributes,omitempty"` } // ExactDeviceRequestApplyConfiguration constructs a declarative configuration of the ExactDeviceRequest type for use with @@ -179,3 +200,16 @@ func (b *ExactDeviceRequestApplyConfiguration) WithCapacity(value *CapacityRequi b.Capacity = value return b } + +// WithDerivedAttributes adds the given value to the DerivedAttributes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the DerivedAttributes field. +func (b *ExactDeviceRequestApplyConfiguration) WithDerivedAttributes(values ...*DeviceDerivedAttributeApplyConfiguration) *ExactDeviceRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDerivedAttributes") + } + b.DerivedAttributes = append(b.DerivedAttributes, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/nodeallocatablemapping.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/nodeallocatablemapping.go new file mode 100644 index 0000000000..69ba07d5d2 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/nodeallocatablemapping.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + resourcev1 "k8s.io/api/resource/v1" + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// NodeAllocatableMappingApplyConfiguration represents a declarative configuration of the NodeAllocatableMapping type for use +// with apply. +// +// NodeAllocatableMapping defines how a DRA allocation directly translates into a node allocatable resource quantity. +// The mapping can be derived from either the count of allocated devices (via deviceMultiplier) or the specific capacity consumed (via capacityKey and capacityMultiplier). These options are mutually exclusive. +// Kubelet adds this mapped resource quantity from claim to both requests and limits at the pod-level cgroup, and to limits at the container-level cgroup for each container referencing the claim. +type NodeAllocatableMappingApplyConfiguration struct { + // CapacityKey references a capacity name defined as a key in the + // `spec.devices[*].capacity` map. When this field is set, the value associated with + // this key in the `status.allocation.devices.results[*].consumedCapacity` map + // (for a specific claim allocation) determines the base quantity for + // the node allocatable resource. `capacityMultiplier` must also be set and is + // multiplied with the base quantity. + // For example, if `spec.devices[*].capacity` has an entry "dra.example.com/memory": "128Gi", + // and this field is set to "dra.example.com/memory", then for a claim allocation + // that consumes { "dra.example.com/memory": "4Gi" } the base quantity for the + // node allocatable resource mapping will be "4Gi". + // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. + CapacityKey *resourcev1.QualifiedName `json:"capacityKey,omitempty"` + // CapacityMultiplier is used as a multiplier for the allocated capacity consumed. + // It is only valid if `capacityKey` is set. + // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. + // For example, if a Device's capacity "dra.example.com/cores" is consumed, + // and each "core" provides 2 "cpu"s, the mapping would be: + // {ResourceName: "cpu", capacityKey: "dra.example.com/cores", capacityMultiplier: "2"}. + // If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16. + CapacityMultiplier *resource.Quantity `json:"capacityMultiplier,omitempty"` + // DeviceMultiplier is used as a multiplier for the allocated device count in the claim. + // The final node allocatable resource amount is `deviceCount` * `deviceMultiplier`. + // For example, a DRA driver representing each cache complex (CCX) as a device would have + // {ResourceName: "cpu", deviceMultiplier: "8"} in its `nodeAllocatableResources`. + // If 2 devices (CCX) are allocated to the claim, 2 * 8 = 16 CPUs would be considered as allocated. + // It is only valid when `capacityKey` and `capacityMultiplier` are not set. + DeviceMultiplier *resource.Quantity `json:"deviceMultiplier,omitempty"` +} + +// NodeAllocatableMappingApplyConfiguration constructs a declarative configuration of the NodeAllocatableMapping type for use with +// apply. +func NodeAllocatableMapping() *NodeAllocatableMappingApplyConfiguration { + return &NodeAllocatableMappingApplyConfiguration{} +} + +// WithCapacityKey sets the CapacityKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CapacityKey field is set to the value of the last call. +func (b *NodeAllocatableMappingApplyConfiguration) WithCapacityKey(value resourcev1.QualifiedName) *NodeAllocatableMappingApplyConfiguration { + b.CapacityKey = &value + return b +} + +// WithCapacityMultiplier sets the CapacityMultiplier field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CapacityMultiplier field is set to the value of the last call. +func (b *NodeAllocatableMappingApplyConfiguration) WithCapacityMultiplier(value resource.Quantity) *NodeAllocatableMappingApplyConfiguration { + b.CapacityMultiplier = &value + return b +} + +// WithDeviceMultiplier sets the DeviceMultiplier field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeviceMultiplier field is set to the value of the last call. +func (b *NodeAllocatableMappingApplyConfiguration) WithDeviceMultiplier(value resource.Quantity) *NodeAllocatableMappingApplyConfiguration { + b.DeviceMultiplier = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/nodeallocatableoverhead.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/nodeallocatableoverhead.go new file mode 100644 index 0000000000..120fb94f28 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/nodeallocatableoverhead.go @@ -0,0 +1,67 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// NodeAllocatableOverheadApplyConfiguration represents a declarative configuration of the NodeAllocatableOverhead type for use +// with apply. +// +// NodeAllocatableOverhead defines auxiliary resource overheads incurred when allocating a device. +// Overheads can be specified as a fixed cost per pod referencing the claim, a variable cost per container reference, or both. +// Kubelet accounts for this overhead by adding it to both the pod-level and container-level cgroups of referencing containers. +type NodeAllocatableOverheadApplyConfiguration struct { + // PerPod is overhead applied once per pod referencing the claim on this node. + // This is a flat overhead incurred for every pod referencing the claim. + PerPod *resource.Quantity `json:"perPod,omitempty"` + // PerContainer is applied per container reference to the claim. + // This models overhead scaling linearly with the number of containers actively using the device. + // When both PerPod and PerContainer are specified, the total overhead allocated for each pod referencing + // the claim is computed as: + // Quantity = PerPod + (PerContainer * NumReferences) + // Kubelet accounts for this overhead in cgroups: + // - Pod-level cgroup (requests and limits): Kubelet adds PerPod + (PerContainer * NumReferences). + // - Container-level cgroup (limits only): Kubelet adds PerPod + PerContainer for each referencing container. + // This allows any single container to access the pod-level overhead, while the parent cgroup caps the total usage to account for PerPod exactly once. + PerContainer *resource.Quantity `json:"perContainer,omitempty"` +} + +// NodeAllocatableOverheadApplyConfiguration constructs a declarative configuration of the NodeAllocatableOverhead type for use with +// apply. +func NodeAllocatableOverhead() *NodeAllocatableOverheadApplyConfiguration { + return &NodeAllocatableOverheadApplyConfiguration{} +} + +// WithPerPod sets the PerPod field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PerPod field is set to the value of the last call. +func (b *NodeAllocatableOverheadApplyConfiguration) WithPerPod(value resource.Quantity) *NodeAllocatableOverheadApplyConfiguration { + b.PerPod = &value + return b +} + +// WithPerContainer sets the PerContainer field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PerContainer field is set to the value of the last call. +func (b *NodeAllocatableOverheadApplyConfiguration) WithPerContainer(value resource.Quantity) *NodeAllocatableOverheadApplyConfiguration { + b.PerContainer = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/nodeallocatableresource.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/nodeallocatableresource.go new file mode 100644 index 0000000000..fc13ebdde8 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/nodeallocatableresource.go @@ -0,0 +1,65 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// NodeAllocatableResourceApplyConfiguration represents a declarative configuration of the NodeAllocatableResource type for use +// with apply. +// +// NodeAllocatableResource defines the translation between the DRA device/capacity +// units requested to the corresponding quantity of the node allocatable resource. +// At least one of Mapping or Overhead must be specified. Not specifying either is an invalid configuration. +type NodeAllocatableResourceApplyConfiguration struct { + // Mapping is used when the device directly models a node allocatable resource like standard CPU or memory + // (e.g., with a CPU DRA driver). The calculated quantity is accounted for exactly once per claim instance + // on the node. To prevent node cgroup isolation friction, the scheduler explicitly + // blocks sharing mapped device claims across multiple pods. + Mapping *NodeAllocatableMappingApplyConfiguration `json:"mapping,omitempty"` + // Overhead contains fields for modeling auxiliary overhead incurred on node allocatable resources + // when allocating devices that are not themselves modeling a node allocatable resource (e.g., host memory overhead for GPUs). + // Sharing overhead-mapped claims across multiple pods is allowed. The node allocatable overhead is accounted + // for individually for each pod referencing the claim. + // Overhead is always subtracted from the node's allocatable capacity for the resource, even when mapping + // is specified for the same resource. + // Eg: If a device models memory capacity per socket as a consumable capacity pool via Mapping (with CapacityKey), + // any overhead specified for the same resource will be subtracted from the node's general allocatable capacity + // and not from the per-socket capacity pool in Mapping. + Overhead *NodeAllocatableOverheadApplyConfiguration `json:"overhead,omitempty"` +} + +// NodeAllocatableResourceApplyConfiguration constructs a declarative configuration of the NodeAllocatableResource type for use with +// apply. +func NodeAllocatableResource() *NodeAllocatableResourceApplyConfiguration { + return &NodeAllocatableResourceApplyConfiguration{} +} + +// WithMapping sets the Mapping field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Mapping field is set to the value of the last call. +func (b *NodeAllocatableResourceApplyConfiguration) WithMapping(value *NodeAllocatableMappingApplyConfiguration) *NodeAllocatableResourceApplyConfiguration { + b.Mapping = value + return b +} + +// WithOverhead sets the Overhead field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Overhead field is set to the value of the last call. +func (b *NodeAllocatableResourceApplyConfiguration) WithOverhead(value *NodeAllocatableOverheadApplyConfiguration) *NodeAllocatableResourceApplyConfiguration { + b.Overhead = value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/nodeallocatableresourcemapping.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/nodeallocatableresourcemapping.go deleted file mode 100644 index 600d96af89..0000000000 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/nodeallocatableresourcemapping.go +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -import ( - resourcev1 "k8s.io/api/resource/v1" - resource "k8s.io/apimachinery/pkg/api/resource" -) - -// NodeAllocatableResourceMappingApplyConfiguration represents a declarative configuration of the NodeAllocatableResourceMapping type for use -// with apply. -// -// NodeAllocatableResourceMapping defines the translation between the DRA device/capacity -// units requested to the corresponding quantity of the node allocatable resource. -type NodeAllocatableResourceMappingApplyConfiguration struct { - // CapacityKey references a capacity name defined as a key in the - // `spec.devices[*].capacity` map. When this field is set, the value associated with - // this key in the `status.allocation.devices.results[*].consumedCapacity` map - // (for a specific claim allocation) determines the base quantity for - // the node allocatable resource. If `allocationMultiplier` is also set, it is - // multiplied with the base quantity. - // For example, if `spec.devices[*].capacity` has an entry "dra.example.com/memory": "128Gi", - // and this field is set to "dra.example.com/memory", then for a claim allocation - // that consumes { "dra.example.com/memory": "4Gi" } the base quantity for the - // node allocatable resource mapping will be "4Gi", and `allocationMultiplier` should - // be omitted or set to "1". - CapacityKey *resourcev1.QualifiedName `json:"capacityKey,omitempty"` - // AllocationMultiplier is used as a multiplier for the allocated device count or the allocated capacity in the claim. - // It defaults to 1 if not specified. How the field is used also depends on whether `capacityKey` is set. - // 1. If `capacityKey` is NOT set: `allocationMultiplier` multiplies the device count allocated to the claim. - // a. A DRA driver representing each CPU core as a device would have - // {ResourceName: "cpu", allocationMultiplier: "2"} in its - // `nodeAllocatableResourceMappings`. If 4 devices are allocated to the claim, - // 4 * 2 CPUs would be considered as allocated and subtracted from the node's capacity. - // b. A GPU device that needs additional node memory per GPU allocation would - // have {ResourceName: "memory", allocationMultiplier: "2Gi"}. Each allocated - // GPU device instance of this type will account for 2Gi of memory. - // - // 2. If `capacityKey` IS set: `allocationMultiplier` is multiplied by the amount of that capacity consumed. - // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `allocationMultiplier`. - // For example, if a Device's capacity "dra.example.com/cores" is consumed, - // and each "core" provides 2 "cpu"s, the mapping would be: - // {ResourceName: "cpu", capacityKey: "dra.example.com/cores", allocationMultiplier: "2"}. - // If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16. - AllocationMultiplier *resource.Quantity `json:"allocationMultiplier,omitempty"` -} - -// NodeAllocatableResourceMappingApplyConfiguration constructs a declarative configuration of the NodeAllocatableResourceMapping type for use with -// apply. -func NodeAllocatableResourceMapping() *NodeAllocatableResourceMappingApplyConfiguration { - return &NodeAllocatableResourceMappingApplyConfiguration{} -} - -// WithCapacityKey sets the CapacityKey field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CapacityKey field is set to the value of the last call. -func (b *NodeAllocatableResourceMappingApplyConfiguration) WithCapacityKey(value resourcev1.QualifiedName) *NodeAllocatableResourceMappingApplyConfiguration { - b.CapacityKey = &value - return b -} - -// WithAllocationMultiplier sets the AllocationMultiplier field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the AllocationMultiplier field is set to the value of the last call. -func (b *NodeAllocatableResourceMappingApplyConfiguration) WithAllocationMultiplier(value resource.Quantity) *NodeAllocatableResourceMappingApplyConfiguration { - b.AllocationMultiplier = &value - return b -} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceclaim.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceclaim.go index 5a87ea3cbc..ec3504e623 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceclaim.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceclaim.go @@ -36,7 +36,7 @@ import ( // stanza tracks whether this claim has been satisfied and what specific // resources have been allocated. type ResourceClaimApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Spec describes what is being requested and how to configure it. diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceclaimtemplate.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceclaimtemplate.go index cee18f3797..2f2fa25069 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceclaimtemplate.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceclaimtemplate.go @@ -32,7 +32,7 @@ import ( // // ResourceClaimTemplate is used to produce ResourceClaim objects. type ResourceClaimTemplateApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Describes the ResourceClaim that is to be generated. diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourcepool.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourcepool.go index 2c779f3cad..4dce50617c 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourcepool.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourcepool.go @@ -25,6 +25,8 @@ package v1 type ResourcePoolApplyConfiguration struct { // Name is used to identify the pool. For node-local devices, this // is often the node name, but this is not required. + // A field selector can be used to list only ResourceSlice objects + // belonging to a certain pool. // // It must not be longer than 253 characters and must consist of one or more DNS sub-domains // separated by slashes. This field is immutable. diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceslice.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceslice.go index 7a3eec9d5c..d7eb3d6893 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceslice.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceslice.go @@ -52,7 +52,7 @@ import ( // For resources that are not local to a node, the node name is not set. Instead, // the driver may use a node selector to specify where the devices are available. type ResourceSliceApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` + metav1.TypeMetaApplyConfiguration `json:""` // Standard object metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Contains the information published by the driver. diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceslicespec.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceslicespec.go index b268fc8d7c..a7c858e0ea 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceslicespec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1/resourceslicespec.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + resourcev1 "k8s.io/api/resource/v1" corev1 "k8s.io/client-go/applyconfigurations/core/v1" ) @@ -82,6 +83,28 @@ type ResourceSliceSpecApplyConfiguration struct { // // The maximum number of counter sets is 8. SharedCounters []CounterSetApplyConfiguration `json:"sharedCounters,omitempty"` + // PartitionTypeAttribute names a string device attribute (by fully + // qualified name, e.g. "gpu.example.com/profile") whose value labels + // each device with its partition type, such as "Full" or "Half" for a + // MIG-style GPU. + // + // When set, every partitionable device in the slice must carry the attribute + // and devices sharing a value must share the same ConsumesCounters cost. + PartitionTypeAttribute *resourcev1.FullyQualifiedName `json:"partitionTypeAttribute,omitempty"` + // SkipNodeOperations lists node-local resource operations (gRPC calls) + // that will be skipped for the devices in this slice when determining whether + // operations are necessary on the node. If all allocated devices for a driver in + // a claim skip an operation, that gRPC call will be skipped. Valid values are: + // + // - "NodePrepareResources": NodePrepareResources gRPC calls are skipped. This + // value cannot be specified unless "NodeUnprepareResources" is also listed + // (or "*" is specified). + // - "NodeUnprepareResources": NodeUnprepareResources gRPC calls are skipped. + // - "*": All node-local resource operations are skipped. + // + // Other values may be added in the future. The kubelet must ignore unknown + // values. + SkipNodeOperations []resourcev1.SkipNodeOperation `json:"skipNodeOperations,omitempty"` } // ResourceSliceSpecApplyConfiguration constructs a declarative configuration of the ResourceSliceSpec type for use with @@ -163,3 +186,21 @@ func (b *ResourceSliceSpecApplyConfiguration) WithSharedCounters(values ...*Coun } return b } + +// WithPartitionTypeAttribute sets the PartitionTypeAttribute field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PartitionTypeAttribute field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithPartitionTypeAttribute(value resourcev1.FullyQualifiedName) *ResourceSliceSpecApplyConfiguration { + b.PartitionTypeAttribute = &value + return b +} + +// WithSkipNodeOperations adds the given value to the SkipNodeOperations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SkipNodeOperations field. +func (b *ResourceSliceSpecApplyConfiguration) WithSkipNodeOperations(values ...resourcev1.SkipNodeOperation) *ResourceSliceSpecApplyConfiguration { + for i := range values { + b.SkipNodeOperations = append(b.SkipNodeOperations, values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintrule.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintrule.go index b28d015de3..4824d6ccf8 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintrule.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/devicetaintrule.go @@ -34,7 +34,7 @@ import ( // This has the same effect as if the taint was specified directly // in the ResourceSlice by the DRA driver. type DeviceTaintRuleApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Spec specifies the selector and one taint. diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/partitiontypestatus.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/partitiontypestatus.go new file mode 100644 index 0000000000..f6222c71fd --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/partitiontypestatus.go @@ -0,0 +1,77 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// PartitionTypeStatusApplyConfiguration represents a declarative configuration of the PartitionTypeStatus type for use +// with apply. +// +// PartitionTypeStatus reports allocatability for a single partition type, +// identified by the value of a grouping attribute. +type PartitionTypeStatusApplyConfiguration struct { + // Attribute is the fully qualified name of the device attribute whose value + // groups this entry. It is the PartitionTypeAttribute declared by the + // devices' own slice, or the default named in the request when their slice + // declares none. + Attribute *string `json:"attribute,omitempty"` + // Type is the partition type value (e.g. "Full" or "Half"). + Type *string `json:"type,omitempty"` + // Total is the number of devices of this partition type in the pool. + Total *int32 `json:"total,omitempty"` + // Allocatable is the number of additional devices of this partition type + // that could still be allocated given current shared-counter consumption. + Allocatable *int32 `json:"allocatable,omitempty"` +} + +// PartitionTypeStatusApplyConfiguration constructs a declarative configuration of the PartitionTypeStatus type for use with +// apply. +func PartitionTypeStatus() *PartitionTypeStatusApplyConfiguration { + return &PartitionTypeStatusApplyConfiguration{} +} + +// WithAttribute sets the Attribute field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Attribute field is set to the value of the last call. +func (b *PartitionTypeStatusApplyConfiguration) WithAttribute(value string) *PartitionTypeStatusApplyConfiguration { + b.Attribute = &value + return b +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *PartitionTypeStatusApplyConfiguration) WithType(value string) *PartitionTypeStatusApplyConfiguration { + b.Type = &value + return b +} + +// WithTotal sets the Total field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Total field is set to the value of the last call. +func (b *PartitionTypeStatusApplyConfiguration) WithTotal(value int32) *PartitionTypeStatusApplyConfiguration { + b.Total = &value + return b +} + +// WithAllocatable sets the Allocatable field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Allocatable field is set to the value of the last call. +func (b *PartitionTypeStatusApplyConfiguration) WithAllocatable(value int32) *PartitionTypeStatusApplyConfiguration { + b.Allocatable = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/poolstatus.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/poolstatus.go index 343fe8247d..3daeed07dc 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/poolstatus.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/poolstatus.go @@ -63,6 +63,19 @@ type PoolStatusApplyConfiguration struct { // validated (e.g., incomplete slice publication). When set, device // count fields and ResourceSliceCount may be unset. ValidationError *string `json:"validationError,omitempty"` + // PartitionSummary reports allocatability per (attribute, partition type) + // for a partitionable pool that publishes SharedCounters. Each entry names + // the grouping attribute it was resolved from: the PartitionTypeAttribute + // declared by a device's own slice, or for devices whose slice declares + // none, the default named in the request. A pool that mixes partitions + // declared under different attributes reports each independently. When no + // slice declares an attribute and the request names no default, the pool + // reports no partition summary. + PartitionSummary []PartitionTypeStatusApplyConfiguration `json:"partitionSummary,omitempty"` + // ShareableSummary reports aggregate capacity for a pool that contains + // devices with AllowMultipleAllocations. It is populated only when at + // least one device in the pool is shareable. + ShareableSummary *ShareableSummaryStatusApplyConfiguration `json:"shareableSummary,omitempty"` } // PoolStatusApplyConfiguration constructs a declarative configuration of the PoolStatus type for use with @@ -150,3 +163,24 @@ func (b *PoolStatusApplyConfiguration) WithValidationError(value string) *PoolSt b.ValidationError = &value return b } + +// WithPartitionSummary adds the given value to the PartitionSummary field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PartitionSummary field. +func (b *PoolStatusApplyConfiguration) WithPartitionSummary(values ...*PartitionTypeStatusApplyConfiguration) *PoolStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPartitionSummary") + } + b.PartitionSummary = append(b.PartitionSummary, *values[i]) + } + return b +} + +// WithShareableSummary sets the ShareableSummary field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ShareableSummary field is set to the value of the last call. +func (b *PoolStatusApplyConfiguration) WithShareableSummary(value *ShareableSummaryStatusApplyConfiguration) *PoolStatusApplyConfiguration { + b.ShareableSummary = value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourcepoolstatusrequest.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourcepoolstatusrequest.go index aee4d0ed90..e5b82c28ae 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourcepoolstatusrequest.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourcepoolstatusrequest.go @@ -34,7 +34,7 @@ import ( // based on the provided filters. Once status is set, the request is considered complete and will not be reprocessed. // Users should delete and recreate requests to get updated information. type ResourcePoolStatusRequestApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Spec defines the filters for which pools to include in the status. diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourcepoolstatusrequestspec.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourcepoolstatusrequestspec.go index bb86727321..85fd362a25 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourcepoolstatusrequestspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/resourcepoolstatusrequestspec.go @@ -40,6 +40,19 @@ type ResourcePoolStatusRequestSpecApplyConfiguration struct { // Minimum: 1 // Maximum: 1000 Limit *int32 `json:"limit,omitempty"` + // DefaultPartitionTypeAttribute optionally names a device attribute (by its + // fully qualified name, e.g. "gpu.example.com/profile") to use as the default + // grouping attribute for partitionable devices whose slice has not declared + // one themselves. + // + // A slice's own PartitionTypeAttribute always takes precedence. This default + // applies only to devices whose slice does not declare one, so that a request + // can still get an accurate partitionSummary from a driver that has not + // been updated to declare it. When neither the slice nor this default names + // an attribute, a partitionable pool reports no partitionSummary. + // + // Must include the domain qualifier. + DefaultPartitionTypeAttribute *string `json:"defaultPartitionTypeAttribute,omitempty"` } // ResourcePoolStatusRequestSpecApplyConfiguration constructs a declarative configuration of the ResourcePoolStatusRequestSpec type for use with @@ -71,3 +84,11 @@ func (b *ResourcePoolStatusRequestSpecApplyConfiguration) WithLimit(value int32) b.Limit = &value return b } + +// WithDefaultPartitionTypeAttribute sets the DefaultPartitionTypeAttribute field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DefaultPartitionTypeAttribute field is set to the value of the last call. +func (b *ResourcePoolStatusRequestSpecApplyConfiguration) WithDefaultPartitionTypeAttribute(value string) *ResourcePoolStatusRequestSpecApplyConfiguration { + b.DefaultPartitionTypeAttribute = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/shareablecapacitystatus.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/shareablecapacitystatus.go new file mode 100644 index 0000000000..1e90896373 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/shareablecapacitystatus.go @@ -0,0 +1,77 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// ShareableCapacityStatusApplyConfiguration represents a declarative configuration of the ShareableCapacityStatus type for use +// with apply. +// +// ShareableCapacityStatus reports aggregate amounts for a single shareable +// capacity key. +type ShareableCapacityStatusApplyConfiguration struct { + // Name is the capacity name. + Name *string `json:"name,omitempty"` + // Total is the sum of this capacity across shareable devices in the pool. + Total *resource.Quantity `json:"total,omitempty"` + // Consumed is the amount drawn by current allocations. + Consumed *resource.Quantity `json:"consumed,omitempty"` + // Available is Total minus Consumed, never negative. + Available *resource.Quantity `json:"available,omitempty"` +} + +// ShareableCapacityStatusApplyConfiguration constructs a declarative configuration of the ShareableCapacityStatus type for use with +// apply. +func ShareableCapacityStatus() *ShareableCapacityStatusApplyConfiguration { + return &ShareableCapacityStatusApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ShareableCapacityStatusApplyConfiguration) WithName(value string) *ShareableCapacityStatusApplyConfiguration { + b.Name = &value + return b +} + +// WithTotal sets the Total field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Total field is set to the value of the last call. +func (b *ShareableCapacityStatusApplyConfiguration) WithTotal(value resource.Quantity) *ShareableCapacityStatusApplyConfiguration { + b.Total = &value + return b +} + +// WithConsumed sets the Consumed field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Consumed field is set to the value of the last call. +func (b *ShareableCapacityStatusApplyConfiguration) WithConsumed(value resource.Quantity) *ShareableCapacityStatusApplyConfiguration { + b.Consumed = &value + return b +} + +// WithAvailable sets the Available field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Available field is set to the value of the last call. +func (b *ShareableCapacityStatusApplyConfiguration) WithAvailable(value resource.Quantity) *ShareableCapacityStatusApplyConfiguration { + b.Available = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/shareablesummarystatus.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/shareablesummarystatus.go new file mode 100644 index 0000000000..0a52934279 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha3/shareablesummarystatus.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// ShareableSummaryStatusApplyConfiguration represents a declarative configuration of the ShareableSummaryStatus type for use +// with apply. +// +// ShareableSummaryStatus reports aggregate capacity for a pool that contains +// devices with AllowMultipleAllocations. +type ShareableSummaryStatusApplyConfiguration struct { + // FullyAvailableDevices is the number of shareable devices with no + // capacity consumed. + FullyAvailableDevices *int32 `json:"fullyAvailableDevices,omitempty"` + // PartiallyAvailableDevices is the number of shareable devices with some + // but not all capacity consumed. + PartiallyAvailableDevices *int32 `json:"partiallyAvailableDevices,omitempty"` + // Capacity reports aggregate total, consumed, and available amounts per + // shareable capacity key across the pool. + Capacity []ShareableCapacityStatusApplyConfiguration `json:"capacity,omitempty"` +} + +// ShareableSummaryStatusApplyConfiguration constructs a declarative configuration of the ShareableSummaryStatus type for use with +// apply. +func ShareableSummaryStatus() *ShareableSummaryStatusApplyConfiguration { + return &ShareableSummaryStatusApplyConfiguration{} +} + +// WithFullyAvailableDevices sets the FullyAvailableDevices field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FullyAvailableDevices field is set to the value of the last call. +func (b *ShareableSummaryStatusApplyConfiguration) WithFullyAvailableDevices(value int32) *ShareableSummaryStatusApplyConfiguration { + b.FullyAvailableDevices = &value + return b +} + +// WithPartiallyAvailableDevices sets the PartiallyAvailableDevices field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PartiallyAvailableDevices field is set to the value of the last call. +func (b *ShareableSummaryStatusApplyConfiguration) WithPartiallyAvailableDevices(value int32) *ShareableSummaryStatusApplyConfiguration { + b.PartiallyAvailableDevices = &value + return b +} + +// WithCapacity adds the given value to the Capacity field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Capacity field. +func (b *ShareableSummaryStatusApplyConfiguration) WithCapacity(values ...*ShareableCapacityStatusApplyConfiguration) *ShareableSummaryStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithCapacity") + } + b.Capacity = append(b.Capacity, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/basicdevice.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/basicdevice.go index 64527b2938..5d4c565e8a 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/basicdevice.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/basicdevice.go @@ -110,7 +110,7 @@ type BasicDeviceApplyConfiguration struct { // If AllowMultipleAllocations is set to true, the device can be allocated more than once, // and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not. AllowMultipleAllocations *bool `json:"allowMultipleAllocations,omitempty"` - // NodeAllocatableResourceMappings defines the mapping of node resources + // NodeAllocatableResources defines the mapping of node resources // that are managed by the DRA driver exposing this device. This includes resources currently // reported in v1.Node `status.allocatable` that are not extended resources // (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). @@ -121,7 +121,7 @@ type BasicDeviceApplyConfiguration struct { // dependencies of an accelerator device. // The keys of this map are the node-allocatable resource names (e.g., "cpu", "memory"). // Extended resource names are not permitted as keys. - NodeAllocatableResourceMappings map[corev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration `json:"nodeAllocatableResourceMappings,omitempty"` + NodeAllocatableResources map[corev1.ResourceName]NodeAllocatableResourceApplyConfiguration `json:"nodeAllocatableResources,omitempty"` } // BasicDeviceApplyConfiguration constructs a declarative configuration of the BasicDevice type for use with @@ -244,16 +244,16 @@ func (b *BasicDeviceApplyConfiguration) WithAllowMultipleAllocations(value bool) return b } -// WithNodeAllocatableResourceMappings puts the entries into the NodeAllocatableResourceMappings field in the declarative configuration +// WithNodeAllocatableResources puts the entries into the NodeAllocatableResources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the NodeAllocatableResourceMappings field, -// overwriting an existing map entries in NodeAllocatableResourceMappings field with the same key. -func (b *BasicDeviceApplyConfiguration) WithNodeAllocatableResourceMappings(entries map[corev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration) *BasicDeviceApplyConfiguration { - if b.NodeAllocatableResourceMappings == nil && len(entries) > 0 { - b.NodeAllocatableResourceMappings = make(map[corev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration, len(entries)) +// If called multiple times, the entries provided by each call will be put on the NodeAllocatableResources field, +// overwriting an existing map entries in NodeAllocatableResources field with the same key. +func (b *BasicDeviceApplyConfiguration) WithNodeAllocatableResources(entries map[corev1.ResourceName]NodeAllocatableResourceApplyConfiguration) *BasicDeviceApplyConfiguration { + if b.NodeAllocatableResources == nil && len(entries) > 0 { + b.NodeAllocatableResources = make(map[corev1.ResourceName]NodeAllocatableResourceApplyConfiguration, len(entries)) } for k, v := range entries { - b.NodeAllocatableResourceMappings[k] = v + b.NodeAllocatableResources[k] = v } return b } diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/capacityrequestpolicyrange.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/capacityrequestpolicyrange.go index cddfe6daf9..9216d4deb5 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/capacityrequestpolicyrange.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/capacityrequestpolicyrange.go @@ -27,6 +27,13 @@ import ( // // CapacityRequestPolicyRange defines a valid range for consumable capacity values. // +// If the DRAFractionalCapacityRange feature gate is +// enabled and at least one of Min, Max, or Step is a fractional quantity (i.e. +// its value is not an integer), milli-unit arithmetic is used instead, +// supporting values with up to 3 decimal places (e.g. 100m = 0.1). +// The largest supported value then is 1000 times smaller compared to using 64-bit integers. +// Otherwise, all comparisons use 64-bit integer arithmetic via resource.Quantity.Value(). +// // - If the requested amount is less than Min, it is rounded up to the Min value. // - If Step is set and the requested amount is between Min and Max but not aligned with Step, // it will be rounded up to the next value equal to Min + (n * Step). diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/celdeviceselector.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/celdeviceselector.go index ba65467ae5..40663836d6 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/celdeviceselector.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/celdeviceselector.go @@ -33,7 +33,7 @@ type CELDeviceSelectorApplyConfiguration struct { // - driver (string): the name of the driver which defines this device. // - attributes (map[string]object): the device's attributes, grouped by prefix // (e.g. device.attributes["dra.example.com"] evaluates to an object with all - // of the attributes which were prefixed by "dra.example.com". + // of the attributes which were prefixed by "dra.example.com"). // - capacity (map[string]object): the device's capacities, grouped by prefix. // - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device // (v1.34+ with the DRAConsumableCapacity feature enabled). @@ -66,6 +66,15 @@ type CELDeviceSelectorApplyConfiguration struct { // A robust expression should check for the existence of attributes // before referencing them. // + // Common errors: + // - "no such key": Use optional chaining (.? followed by orValue()) + // or guarding the check with has() for optional fields. + // See CEL Optional Types for details: + // https://pkg.go.dev/github.com/google/cel-go@v0.17.4/cel#OptionalTypes + // + // For more CEL expression syntax and examples, see: + // https://kubernetes.io/docs/reference/using-api/cel/ + // // For ease of use, the cel.bind() function is enabled, and can be used // to simplify expressions that access multiple attributes with the // same domain. For example: diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceallocationconfiguration.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceallocationconfiguration.go index 314ff5fa71..f26f528fbe 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceallocationconfiguration.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceallocationconfiguration.go @@ -38,7 +38,7 @@ type DeviceAllocationConfigurationApplyConfiguration struct { // and may include the subrequest using the format
[/]. If just // the main request is given, the configuration applies to all subrequests. Requests []string `json:"requests,omitempty"` - DeviceConfigurationApplyConfiguration `json:",inline"` + DeviceConfigurationApplyConfiguration `json:""` } // DeviceAllocationConfigurationApplyConfiguration constructs a declarative configuration of the DeviceAllocationConfiguration type for use with diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclaimconfiguration.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclaimconfiguration.go index 2c7faab5b9..1b094a80cb 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclaimconfiguration.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclaimconfiguration.go @@ -30,7 +30,7 @@ type DeviceClaimConfigurationApplyConfiguration struct { // and may include the subrequest using the format
[/]. If just // the main request is given, the configuration applies to all subrequests. Requests []string `json:"requests,omitempty"` - DeviceConfigurationApplyConfiguration `json:",inline"` + DeviceConfigurationApplyConfiguration `json:""` } // DeviceClaimConfigurationApplyConfiguration constructs a declarative configuration of the DeviceClaimConfiguration type for use with diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclass.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclass.go index b0fcbac6fb..a242986f95 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclass.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclass.go @@ -38,7 +38,7 @@ import ( // This is an alpha type and requires enabling the DynamicResourceAllocation // feature gate. type DeviceClassApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Spec defines what can be allocated and how to configure it. diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclassconfiguration.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclassconfiguration.go index d521f01e12..b87b5407ce 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclassconfiguration.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclassconfiguration.go @@ -23,7 +23,7 @@ package v1beta1 // // DeviceClassConfiguration is used in DeviceClass. type DeviceClassConfigurationApplyConfiguration struct { - DeviceConfigurationApplyConfiguration `json:",inline"` + DeviceConfigurationApplyConfiguration `json:""` } // DeviceClassConfigurationApplyConfiguration constructs a declarative configuration of the DeviceClassConfiguration type for use with diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclassspec.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclassspec.go index c234bdd732..d01256a3e1 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclassspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/deviceclassspec.go @@ -40,8 +40,6 @@ type DeviceClassSpecApplyConfiguration struct { // is picked to satisfy a pod's extended resource requests. // If two classes are created at the same time, then the name of the class // lexicographically sorted first is picked. - // - // This is a beta field. ExtendedResourceName *string `json:"extendedResourceName,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicecounterconsumption.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicecounterconsumption.go index 1b1956c5cf..667a88bd1c 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicecounterconsumption.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicecounterconsumption.go @@ -31,6 +31,26 @@ type DeviceCounterConsumptionApplyConfiguration struct { // // The maximum number of counters is 32. Counters map[string]CounterApplyConfiguration `json:"counters,omitempty"` + // CompatibilityGroups is a list of opaque group names for + // this counter set consumption. + // + // Devices that consume counters from the same counter set may only be + // allocated at the same time ("co-allocated") if they all share at least + // one common group: the intersection of the CompatibilityGroups of all + // co-allocated devices on that counter set must be non-empty. Devices + // that consume from different counter sets are never compared via this + // field. + // + // An unset field, an explicit nil, and an empty list are equivalent and + // mean "no groups": such a device is only co-allocatable with sibling + // devices on the same counter set that also have no groups, and is never + // co-allocatable with a device that declares one or more groups. + // + // Group names are opaque and meaningful only within the + // publishing driver's pool. + // + // The maximum number of groups is 2, and the names must be unique. + CompatibilityGroups []string `json:"compatibilityGroups,omitempty"` } // DeviceCounterConsumptionApplyConfiguration constructs a declarative configuration of the DeviceCounterConsumption type for use with @@ -60,3 +80,13 @@ func (b *DeviceCounterConsumptionApplyConfiguration) WithCounters(entries map[st } return b } + +// WithCompatibilityGroups adds the given value to the CompatibilityGroups field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CompatibilityGroups field. +func (b *DeviceCounterConsumptionApplyConfiguration) WithCompatibilityGroups(values ...string) *DeviceCounterConsumptionApplyConfiguration { + for i := range values { + b.CompatibilityGroups = append(b.CompatibilityGroups, values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicederivedattribute.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicederivedattribute.go new file mode 100644 index 0000000000..0c560d70bc --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicederivedattribute.go @@ -0,0 +1,95 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + resourcev1beta1 "k8s.io/api/resource/v1beta1" +) + +// DeviceDerivedAttributeApplyConfiguration represents a declarative configuration of the DeviceDerivedAttribute type for use +// with apply. +// +// DeviceDerivedAttribute defines a derived attribute computed via CEL. +type DeviceDerivedAttributeApplyConfiguration struct { + // Name is the identifier for this derived attribute, used in constraints. + // + // It must be a DNS subdomain followed by a slash ("/") followed by a C identifier + // (e.g. "example.com/numaNode" or "derived/numaNode"). + // + // If the chosen name matches an existing physical attribute from a driver, + // the derived attribute's expression will shadow the physical attribute, + // and its evaluated value will be used in constraints instead. When the goal + // is to define a derived attribute that is only used within the ResourceClaim + // and not meant to shadow an existing attribute, use a domain prefix that + // no DRA driver should be using (e.g. "derived/myAttribute"). + // + // It is not valid to define a derived attribute that isn't used in at least + // one constraint. + Name *resourcev1beta1.FullyQualifiedName `json:"name,omitempty"` + // Expression is a CEL expression evaluated against each candidate device. + // The expression must evaluate to a primitive scalar (string, integer, + // boolean, or semver) or a list of these scalars ([]string, []int64, + // []bool, []semver) to act as a virtual grouping key. Any other return type + // is an error and causes CEL evaluation for the device to fail. + // + // The expression's input is an object named "device", which carries the + // same properties as in a CELDeviceSelector. + // + // When pod scheduling encounters CEL runtime errors (such as looking + // up an attribute that isn't defined) for some devices, it will abort + // allocation and fail scheduling for the Pod. Surfacing evaluation + // errors immediately prevents silent topology matching failures that are + // extremely hard to detect. A robust expression should, for example, check + // for the existence of attributes before referencing them to avoid + // runtime evaluation errors. + // + // The expression gets evaluated after a device has passed the other + // selector expressions for the request in which this expression is used. + // This allows writing expressions that are tailored towards the specific + // devices being requested (for example, by assuming the device is from a + // certain vendor and skipping those checks). + // + // The length of the expression must be smaller or equal to 10 Ki. The + // cost of evaluating it is also limited based on the estimated number + // of logical steps; the combined cost of all derived attributes in a + // claim is capped by a shared CEL cost budget. + Expression *string `json:"expression,omitempty"` +} + +// DeviceDerivedAttributeApplyConfiguration constructs a declarative configuration of the DeviceDerivedAttribute type for use with +// apply. +func DeviceDerivedAttribute() *DeviceDerivedAttributeApplyConfiguration { + return &DeviceDerivedAttributeApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *DeviceDerivedAttributeApplyConfiguration) WithName(value resourcev1beta1.FullyQualifiedName) *DeviceDerivedAttributeApplyConfiguration { + b.Name = &value + return b +} + +// WithExpression sets the Expression field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Expression field is set to the value of the last call. +func (b *DeviceDerivedAttributeApplyConfiguration) WithExpression(value string) *DeviceDerivedAttributeApplyConfiguration { + b.Expression = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicerequest.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicerequest.go index fdcb928a57..caa52fcd22 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicerequest.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicerequest.go @@ -149,6 +149,27 @@ type DeviceRequestApplyConfiguration struct { // the request fails if there are devices that otherwise match the request, // and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request. Capacity *CapacityRequirementsApplyConfiguration `json:"capacity,omitempty"` + // DerivedAttributes defines a set of virtual attributes computed via CEL expressions + // for each candidate device. These virtual attributes can be referenced in + // `.devices.constraints` to align and match different devices (e.g., co-allocating + // a GPU and a NIC on the same NUMA node) even if their drivers publish different + // attributes. Derived attributes are not available via `device.attributes` + // in the CEL environment when evaluating selector expressions. + // + // Derived attributes allow you to extract, transform, or normalize topology + // information (such as extracting a NUMA index from a complex topology string or + // renaming a vendor-specific attribute) into a common virtual attribute name at + // scheduling time. The scheduler then evaluates these virtual attributes exactly + // like static attributes when matching constraints. + // + // Every derived attribute defined in this list must be referenced by at least one + // MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list. + // + // The maximum number of derived attributes is 32. + // + // This is an alpha field and requires enabling the DRADerivedAttributes + // feature gate. + DerivedAttributes []DeviceDerivedAttributeApplyConfiguration `json:"derivedAttributes,omitempty"` } // DeviceRequestApplyConfiguration constructs a declarative configuration of the DeviceRequest type for use with @@ -243,3 +264,16 @@ func (b *DeviceRequestApplyConfiguration) WithCapacity(value *CapacityRequiremen b.Capacity = value return b } + +// WithDerivedAttributes adds the given value to the DerivedAttributes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the DerivedAttributes field. +func (b *DeviceRequestApplyConfiguration) WithDerivedAttributes(values ...*DeviceDerivedAttributeApplyConfiguration) *DeviceRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDerivedAttributes") + } + b.DerivedAttributes = append(b.DerivedAttributes, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicerequestallocationresult.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicerequestallocationresult.go index 3a47b9c1f6..d356dd841c 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicerequestallocationresult.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicerequestallocationresult.go @@ -95,6 +95,12 @@ type DeviceRequestAllocationResultApplyConfiguration struct { // This field is populated only for devices that allow multiple allocations. // All capacity entries are included, even if the consumed amount is zero. ConsumedCapacity map[resourcev1beta1.QualifiedName]resource.Quantity `json:"consumedCapacity,omitempty"` + // SkipNodeOperations lists node-local resource operations (gRPC calls) + // that will be skipped for this allocated device when determining whether + // operations are necessary on the node. If all allocated devices for a driver in + // a claim skip an operation, that gRPC call will be skipped. It is a copy of + // the ResourceSlice.spec.skipNodeOperations value at the time when the device was allocated. + SkipNodeOperations []resourcev1beta1.SkipNodeOperation `json:"skipNodeOperations,omitempty"` } // DeviceRequestAllocationResultApplyConfiguration constructs a declarative configuration of the DeviceRequestAllocationResult type for use with @@ -197,3 +203,13 @@ func (b *DeviceRequestAllocationResultApplyConfiguration) WithConsumedCapacity(e } return b } + +// WithSkipNodeOperations adds the given value to the SkipNodeOperations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SkipNodeOperations field. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithSkipNodeOperations(values ...resourcev1beta1.SkipNodeOperation) *DeviceRequestAllocationResultApplyConfiguration { + for i := range values { + b.SkipNodeOperations = append(b.SkipNodeOperations, values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicesubrequest.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicesubrequest.go index ae7bf65a04..3810b539f8 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicesubrequest.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/devicesubrequest.go @@ -110,6 +110,27 @@ type DeviceSubRequestApplyConfiguration struct { // the request fails if there are devices that otherwise match the request, // and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request. Capacity *CapacityRequirementsApplyConfiguration `json:"capacity,omitempty"` + // DerivedAttributes defines a set of virtual attributes computed via CEL expressions + // for each candidate device. These virtual attributes can be referenced in + // `.devices.constraints` to align and match different devices (e.g., co-allocating + // a GPU and a NIC on the same NUMA node) even if their drivers publish different + // attributes. Derived attributes are not available via `device.attributes` + // in the CEL environment when evaluating selector expressions. + // + // Derived attributes allow you to extract, transform, or normalize topology + // information (such as extracting a NUMA index from a complex topology string or + // renaming a vendor-specific attribute) into a common virtual attribute name at + // scheduling time. The scheduler then evaluates these virtual attributes exactly + // like static attributes when matching constraints. + // + // Every derived attribute defined in this list must be referenced by at least one + // MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list. + // + // The maximum number of derived attributes is 32. + // + // This is an alpha field and requires enabling the DRADerivedAttributes + // feature gate. + DerivedAttributes []DeviceDerivedAttributeApplyConfiguration `json:"derivedAttributes,omitempty"` } // DeviceSubRequestApplyConfiguration constructs a declarative configuration of the DeviceSubRequest type for use with @@ -183,3 +204,16 @@ func (b *DeviceSubRequestApplyConfiguration) WithCapacity(value *CapacityRequire b.Capacity = value return b } + +// WithDerivedAttributes adds the given value to the DerivedAttributes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the DerivedAttributes field. +func (b *DeviceSubRequestApplyConfiguration) WithDerivedAttributes(values ...*DeviceDerivedAttributeApplyConfiguration) *DeviceSubRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDerivedAttributes") + } + b.DerivedAttributes = append(b.DerivedAttributes, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/nodeallocatablemapping.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/nodeallocatablemapping.go new file mode 100644 index 0000000000..a95af3ab64 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/nodeallocatablemapping.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + resourcev1beta1 "k8s.io/api/resource/v1beta1" + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// NodeAllocatableMappingApplyConfiguration represents a declarative configuration of the NodeAllocatableMapping type for use +// with apply. +// +// NodeAllocatableMapping defines how a DRA allocation directly translates into a node allocatable resource quantity. +// The mapping can be derived from either the count of allocated devices or the specific capacity consumed. These options are mutually exclusive. +// Kubelet adds this mapped resource quantity from claim to both requests and limits at the pod-level cgroup, and to limits at the container-level cgroup for each container referencing the claim. +type NodeAllocatableMappingApplyConfiguration struct { + // CapacityKey references a capacity name defined as a key in the + // `spec.devices[*].capacity` map. When this field is set, the value associated with + // this key in the `status.allocation.devices.results[*].consumedCapacity` map + // (for a specific claim allocation) determines the base quantity for + // the node allocatable resource. `capacityMultiplier` must also be set and is + // multiplied with the base quantity. + // For example, if `spec.devices[*].capacity` has an entry "dra.example.com/memory": "128Gi", + // and this field is set to "dra.example.com/memory", then for a claim allocation + // that consumes { "dra.example.com/memory": "4Gi" } the base quantity for the + // node allocatable resource mapping will be "4Gi". + // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. + CapacityKey *resourcev1beta1.QualifiedName `json:"capacityKey,omitempty"` + // CapacityMultiplier is used as a multiplier for the allocated capacity consumed. + // It is only valid if `capacityKey` is set. + // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. + // For example, if a Device's capacity "dra.example.com/cores" is consumed, + // and each "core" provides 2 "cpu"s, the mapping would be: + // {ResourceName: "cpu", capacityKey: "dra.example.com/cores", capacityMultiplier: "2"}. + // If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16. + CapacityMultiplier *resource.Quantity `json:"capacityMultiplier,omitempty"` + // DeviceMultiplier is used as a multiplier for the allocated device count in the claim. + // The final node allocatable resource amount is `deviceCount` * `deviceMultiplier`. + // For example, a DRA driver representing each cache complex (CCX) as a device would have + // {ResourceName: "cpu", deviceMultiplier: "8"} in its `nodeAllocatableResources`. + // If 2 devices (CCX) are allocated to the claim, 2 * 8 = 16 CPUs would be considered as allocated. + // It is only valid when `capacityKey` and `capacityMultiplier` are not set. + DeviceMultiplier *resource.Quantity `json:"deviceMultiplier,omitempty"` +} + +// NodeAllocatableMappingApplyConfiguration constructs a declarative configuration of the NodeAllocatableMapping type for use with +// apply. +func NodeAllocatableMapping() *NodeAllocatableMappingApplyConfiguration { + return &NodeAllocatableMappingApplyConfiguration{} +} + +// WithCapacityKey sets the CapacityKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CapacityKey field is set to the value of the last call. +func (b *NodeAllocatableMappingApplyConfiguration) WithCapacityKey(value resourcev1beta1.QualifiedName) *NodeAllocatableMappingApplyConfiguration { + b.CapacityKey = &value + return b +} + +// WithCapacityMultiplier sets the CapacityMultiplier field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CapacityMultiplier field is set to the value of the last call. +func (b *NodeAllocatableMappingApplyConfiguration) WithCapacityMultiplier(value resource.Quantity) *NodeAllocatableMappingApplyConfiguration { + b.CapacityMultiplier = &value + return b +} + +// WithDeviceMultiplier sets the DeviceMultiplier field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeviceMultiplier field is set to the value of the last call. +func (b *NodeAllocatableMappingApplyConfiguration) WithDeviceMultiplier(value resource.Quantity) *NodeAllocatableMappingApplyConfiguration { + b.DeviceMultiplier = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/nodeallocatableoverhead.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/nodeallocatableoverhead.go new file mode 100644 index 0000000000..00526a9253 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/nodeallocatableoverhead.go @@ -0,0 +1,67 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// NodeAllocatableOverheadApplyConfiguration represents a declarative configuration of the NodeAllocatableOverhead type for use +// with apply. +// +// NodeAllocatableOverhead defines auxiliary resource overheads incurred when allocating a device. +// Overheads can be specified as a fixed cost per pod referencing the claim, a variable cost per container reference, or both. +// Kubelet accounts for this overhead by adding it to both the pod-level and container-level cgroups of referencing containers. +type NodeAllocatableOverheadApplyConfiguration struct { + // PerPod is overhead applied once per pod referencing the claim on this node. + // This is a flat overhead incurred for every pod referencing the claim. + PerPod *resource.Quantity `json:"perPod,omitempty"` + // PerContainer is applied per container reference to the claim. + // This models overhead scaling linearly with the number of containers actively using the device. + // When both PerPod and PerContainer are specified, the total overhead allocated for each pod referencing + // the claim is computed as: + // Quantity = PerPod + (PerContainer * NumReferences) + // Kubelet accounts for this overhead in cgroups: + // - Pod-level cgroup (requests and limits): Kubelet adds PerPod + (PerContainer * NumReferences). + // - Container-level cgroup (limits only): Kubelet adds PerPod + PerContainer for each referencing container. + // This allows any single container to access the pod-level overhead, while the parent cgroup caps the total usage to account for PerPod exactly once. + PerContainer *resource.Quantity `json:"perContainer,omitempty"` +} + +// NodeAllocatableOverheadApplyConfiguration constructs a declarative configuration of the NodeAllocatableOverhead type for use with +// apply. +func NodeAllocatableOverhead() *NodeAllocatableOverheadApplyConfiguration { + return &NodeAllocatableOverheadApplyConfiguration{} +} + +// WithPerPod sets the PerPod field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PerPod field is set to the value of the last call. +func (b *NodeAllocatableOverheadApplyConfiguration) WithPerPod(value resource.Quantity) *NodeAllocatableOverheadApplyConfiguration { + b.PerPod = &value + return b +} + +// WithPerContainer sets the PerContainer field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PerContainer field is set to the value of the last call. +func (b *NodeAllocatableOverheadApplyConfiguration) WithPerContainer(value resource.Quantity) *NodeAllocatableOverheadApplyConfiguration { + b.PerContainer = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/nodeallocatableresource.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/nodeallocatableresource.go new file mode 100644 index 0000000000..11df524b95 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/nodeallocatableresource.go @@ -0,0 +1,65 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// NodeAllocatableResourceApplyConfiguration represents a declarative configuration of the NodeAllocatableResource type for use +// with apply. +// +// NodeAllocatableResource defines the translation between the DRA device/capacity +// units requested to the corresponding quantity of the node allocatable resource. +// At least one of Mapping or Overhead must be specified. Not specifying either is an invalid configuration. +type NodeAllocatableResourceApplyConfiguration struct { + // Mapping is used when the device directly models a node allocatable resource like standard CPU or memory + // (e.g., with a CPU DRA driver). The calculated quantity is accounted for exactly once per claim instance + // on the node. To prevent node cgroup isolation friction, the scheduler explicitly + // blocks sharing mapped device claims across multiple pods. + Mapping *NodeAllocatableMappingApplyConfiguration `json:"mapping,omitempty"` + // Overhead contains fields for modeling auxiliary overhead incurred on node allocatable resources + // when allocating devices that are not themselves modeling a node allocatable resource (e.g., host memory overhead for GPUs). + // Sharing overhead-mapped claims across multiple pods is allowed. The node allocatable overhead is accounted + // for individually for each pod referencing the claim. + // Overhead is always subtracted from the node's allocatable capacity for the resource, even when mapping + // is specified for the same resource. + // Eg: If a device models memory capacity per socket as a consumable capacity pool via Mapping (with CapacityKey), + // any overhead specified for the same resource will be subtracted from the node's general allocatable capacity + // and not from the per-socket capacity pool in Mapping. + Overhead *NodeAllocatableOverheadApplyConfiguration `json:"overhead,omitempty"` +} + +// NodeAllocatableResourceApplyConfiguration constructs a declarative configuration of the NodeAllocatableResource type for use with +// apply. +func NodeAllocatableResource() *NodeAllocatableResourceApplyConfiguration { + return &NodeAllocatableResourceApplyConfiguration{} +} + +// WithMapping sets the Mapping field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Mapping field is set to the value of the last call. +func (b *NodeAllocatableResourceApplyConfiguration) WithMapping(value *NodeAllocatableMappingApplyConfiguration) *NodeAllocatableResourceApplyConfiguration { + b.Mapping = value + return b +} + +// WithOverhead sets the Overhead field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Overhead field is set to the value of the last call. +func (b *NodeAllocatableResourceApplyConfiguration) WithOverhead(value *NodeAllocatableOverheadApplyConfiguration) *NodeAllocatableResourceApplyConfiguration { + b.Overhead = value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/nodeallocatableresourcemapping.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/nodeallocatableresourcemapping.go deleted file mode 100644 index 5cdc2c7512..0000000000 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/nodeallocatableresourcemapping.go +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -import ( - resourcev1beta1 "k8s.io/api/resource/v1beta1" - resource "k8s.io/apimachinery/pkg/api/resource" -) - -// NodeAllocatableResourceMappingApplyConfiguration represents a declarative configuration of the NodeAllocatableResourceMapping type for use -// with apply. -// -// NodeAllocatableResourceMapping defines the translation between the DRA device/capacity -// units requested to the corresponding quantity of the node allocatable resource. -type NodeAllocatableResourceMappingApplyConfiguration struct { - // CapacityKey references a capacity name defined as a key in the - // `spec.devices[*].capacity` map. When this field is set, the value associated with - // this key in the `status.allocation.devices.results[*].consumedCapacity` map - // (for a specific claim allocation) determines the base quantity for - // the node allocatable resource. If `allocationMultiplier` is also set, it is - // multiplied with the base quantity. - // For example, if `spec.devices[*].capacity` has an entry "dra.example.com/memory": "128Gi", - // and this field is set to "dra.example.com/memory", then for a claim allocation - // that consumes { "dra.example.com/memory": "4Gi" } the base quantity for the - // node allocatable resource mapping will be "4Gi", and `allocationMultiplier` should - // be omitted or set to "1". - CapacityKey *resourcev1beta1.QualifiedName `json:"capacityKey,omitempty"` - // AllocationMultiplier is used as a multiplier for the allocated device count or the allocated capacity in the claim. - // It defaults to 1 if not specified. How the field is used also depends on whether `capacityKey` is set. - // 1. If `capacityKey` is NOT set: `allocationMultiplier` multiplies the device count allocated to the claim. - // a. A DRA driver representing each CPU core as a device would have - // {ResourceName: "cpu", allocationMultiplier: "2"} in its - // `nodeAllocatableResourceMappings`. If 4 devices are allocated to the claim, - // 4 * 2 CPUs would be considered as allocated and subtracted from the node's capacity. - // b. A GPU device that needs additional node memory per GPU allocation would - // have {ResourceName: "memory", allocationMultiplier: "2Gi"}. Each allocated - // GPU device instance of this type will account for 2Gi of memory. - // - // 2. If `capacityKey` IS set: `allocationMultiplier` is multiplied by the amount of that capacity consumed. - // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `allocationMultiplier`. - // For example, if a Device's capacity "dra.example.com/cores" is consumed, - // and each "core" provides 2 "cpu"s, the mapping would be: - // {ResourceName: "cpu", capacityKey: "dra.example.com/cores", allocationMultiplier: "2"}. - // If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16. - AllocationMultiplier *resource.Quantity `json:"allocationMultiplier,omitempty"` -} - -// NodeAllocatableResourceMappingApplyConfiguration constructs a declarative configuration of the NodeAllocatableResourceMapping type for use with -// apply. -func NodeAllocatableResourceMapping() *NodeAllocatableResourceMappingApplyConfiguration { - return &NodeAllocatableResourceMappingApplyConfiguration{} -} - -// WithCapacityKey sets the CapacityKey field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CapacityKey field is set to the value of the last call. -func (b *NodeAllocatableResourceMappingApplyConfiguration) WithCapacityKey(value resourcev1beta1.QualifiedName) *NodeAllocatableResourceMappingApplyConfiguration { - b.CapacityKey = &value - return b -} - -// WithAllocationMultiplier sets the AllocationMultiplier field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the AllocationMultiplier field is set to the value of the last call. -func (b *NodeAllocatableResourceMappingApplyConfiguration) WithAllocationMultiplier(value resource.Quantity) *NodeAllocatableResourceMappingApplyConfiguration { - b.AllocationMultiplier = &value - return b -} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceclaim.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceclaim.go index aaeaf687d6..a617fecd84 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceclaim.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceclaim.go @@ -39,7 +39,7 @@ import ( // This is an alpha type and requires enabling the DynamicResourceAllocation // feature gate. type ResourceClaimApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Spec describes what is being requested and how to configure it. diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceclaimtemplate.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceclaimtemplate.go index fe42003266..4c1eba7cd9 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceclaimtemplate.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceclaimtemplate.go @@ -35,7 +35,7 @@ import ( // This is an alpha type and requires enabling the DynamicResourceAllocation // feature gate. type ResourceClaimTemplateApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Describes the ResourceClaim that is to be generated. diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourcepool.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourcepool.go index eff9e042c8..3452dd18ba 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourcepool.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourcepool.go @@ -25,6 +25,8 @@ package v1beta1 type ResourcePoolApplyConfiguration struct { // Name is used to identify the pool. For node-local devices, this // is often the node name, but this is not required. + // A field selector can be used to list only ResourceSlice objects + // belonging to a certain pool. // // It must not be longer than 253 characters and must consist of one or more DNS sub-domains // separated by slashes. This field is immutable. diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceslice.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceslice.go index c9ec6a7b74..c6b5fc59c6 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceslice.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceslice.go @@ -55,7 +55,7 @@ import ( // This is an alpha type and requires enabling the DynamicResourceAllocation // feature gate. type ResourceSliceApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Contains the information published by the driver. diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceslicespec.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceslicespec.go index 2302486433..d463e72383 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceslicespec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta1/resourceslicespec.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + resourcev1beta1 "k8s.io/api/resource/v1beta1" v1 "k8s.io/client-go/applyconfigurations/core/v1" ) @@ -82,6 +83,28 @@ type ResourceSliceSpecApplyConfiguration struct { // // The maximum number of counter sets is 8. SharedCounters []CounterSetApplyConfiguration `json:"sharedCounters,omitempty"` + // PartitionTypeAttribute names a string device attribute (by fully + // qualified name, e.g. "gpu.example.com/profile") whose value labels + // each device with its partition type, such as "Full" or "Half" for a + // MIG-style GPU. + // + // When set, every partitionable device in the slice must carry the attribute + // and devices sharing a value must share the same ConsumesCounters cost. + PartitionTypeAttribute *resourcev1beta1.FullyQualifiedName `json:"partitionTypeAttribute,omitempty"` + // SkipNodeOperations lists node-local resource operations (gRPC calls) + // that will be skipped for the devices in this slice when determining whether + // operations are necessary on the node. If all allocated devices for a driver in + // a claim skip an operation, that gRPC call will be skipped. Valid values are: + // + // - "NodePrepareResources": NodePrepareResources gRPC calls are skipped. This + // value cannot be specified unless "NodeUnprepareResources" is also listed + // (or "*" is specified). + // - "NodeUnprepareResources": NodeUnprepareResources gRPC calls are skipped. + // - "*": All node-local resource operations are skipped. + // + // Other values may be added in the future. The kubelet must ignore unknown + // values. + SkipNodeOperations []resourcev1beta1.SkipNodeOperation `json:"skipNodeOperations,omitempty"` } // ResourceSliceSpecApplyConfiguration constructs a declarative configuration of the ResourceSliceSpec type for use with @@ -163,3 +186,21 @@ func (b *ResourceSliceSpecApplyConfiguration) WithSharedCounters(values ...*Coun } return b } + +// WithPartitionTypeAttribute sets the PartitionTypeAttribute field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PartitionTypeAttribute field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithPartitionTypeAttribute(value resourcev1beta1.FullyQualifiedName) *ResourceSliceSpecApplyConfiguration { + b.PartitionTypeAttribute = &value + return b +} + +// WithSkipNodeOperations adds the given value to the SkipNodeOperations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SkipNodeOperations field. +func (b *ResourceSliceSpecApplyConfiguration) WithSkipNodeOperations(values ...resourcev1beta1.SkipNodeOperation) *ResourceSliceSpecApplyConfiguration { + for i := range values { + b.SkipNodeOperations = append(b.SkipNodeOperations, values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/capacityrequestpolicyrange.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/capacityrequestpolicyrange.go index bd9a734221..60e71b9045 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/capacityrequestpolicyrange.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/capacityrequestpolicyrange.go @@ -27,6 +27,13 @@ import ( // // CapacityRequestPolicyRange defines a valid range for consumable capacity values. // +// If the DRAFractionalCapacityRange feature gate is +// enabled and at least one of Min, Max, or Step is a fractional quantity (i.e. +// its value is not an integer), milli-unit arithmetic is used instead, +// supporting values with up to 3 decimal places (e.g. 100m = 0.1). +// The largest supported value then is 1000 times smaller compared to using 64-bit integers. +// Otherwise, all comparisons use 64-bit integer arithmetic via resource.Quantity.Value(). +// // - If the requested amount is less than Min, it is rounded up to the Min value. // - If Step is set and the requested amount is between Min and Max but not aligned with Step, // it will be rounded up to the next value equal to Min + (n * Step). diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/celdeviceselector.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/celdeviceselector.go index a184590ebe..73485f5029 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/celdeviceselector.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/celdeviceselector.go @@ -33,7 +33,7 @@ type CELDeviceSelectorApplyConfiguration struct { // - driver (string): the name of the driver which defines this device. // - attributes (map[string]object): the device's attributes, grouped by prefix // (e.g. device.attributes["dra.example.com"] evaluates to an object with all - // of the attributes which were prefixed by "dra.example.com". + // of the attributes which were prefixed by "dra.example.com"). // - capacity (map[string]object): the device's capacities, grouped by prefix. // - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device // (v1.34+ with the DRAConsumableCapacity feature enabled). @@ -66,6 +66,15 @@ type CELDeviceSelectorApplyConfiguration struct { // A robust expression should check for the existence of attributes // before referencing them. // + // Common errors: + // - "no such key": Use optional chaining (.? followed by orValue()) + // or guarding the check with has() for optional fields. + // See CEL Optional Types for details: + // https://pkg.go.dev/github.com/google/cel-go@v0.17.4/cel#OptionalTypes + // + // For more CEL expression syntax and examples, see: + // https://kubernetes.io/docs/reference/using-api/cel/ + // // For ease of use, the cel.bind() function is enabled, and can be used // to simplify expressions that access multiple attributes with the // same domain. For example: diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/device.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/device.go index b3985b0ca5..71e2440be7 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/device.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/device.go @@ -114,7 +114,7 @@ type DeviceApplyConfiguration struct { // If AllowMultipleAllocations is set to true, the device can be allocated more than once, // and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not. AllowMultipleAllocations *bool `json:"allowMultipleAllocations,omitempty"` - // NodeAllocatableResourceMappings defines the mapping of node resources + // NodeAllocatableResources defines the mapping of node resources // that are managed by the DRA driver exposing this device. This includes resources currently // reported in v1.Node `status.allocatable` that are not extended resources // (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). @@ -125,7 +125,7 @@ type DeviceApplyConfiguration struct { // dependencies of an accelerator device. // The keys of this map are the node-allocatable resource names (e.g., "cpu", "memory"). // Extended resource names are not permitted as keys. - NodeAllocatableResourceMappings map[corev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration `json:"nodeAllocatableResourceMappings,omitempty"` + NodeAllocatableResources map[corev1.ResourceName]NodeAllocatableResourceApplyConfiguration `json:"nodeAllocatableResources,omitempty"` } // DeviceApplyConfiguration constructs a declarative configuration of the Device type for use with @@ -256,16 +256,16 @@ func (b *DeviceApplyConfiguration) WithAllowMultipleAllocations(value bool) *Dev return b } -// WithNodeAllocatableResourceMappings puts the entries into the NodeAllocatableResourceMappings field in the declarative configuration +// WithNodeAllocatableResources puts the entries into the NodeAllocatableResources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the NodeAllocatableResourceMappings field, -// overwriting an existing map entries in NodeAllocatableResourceMappings field with the same key. -func (b *DeviceApplyConfiguration) WithNodeAllocatableResourceMappings(entries map[corev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration) *DeviceApplyConfiguration { - if b.NodeAllocatableResourceMappings == nil && len(entries) > 0 { - b.NodeAllocatableResourceMappings = make(map[corev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration, len(entries)) +// If called multiple times, the entries provided by each call will be put on the NodeAllocatableResources field, +// overwriting an existing map entries in NodeAllocatableResources field with the same key. +func (b *DeviceApplyConfiguration) WithNodeAllocatableResources(entries map[corev1.ResourceName]NodeAllocatableResourceApplyConfiguration) *DeviceApplyConfiguration { + if b.NodeAllocatableResources == nil && len(entries) > 0 { + b.NodeAllocatableResources = make(map[corev1.ResourceName]NodeAllocatableResourceApplyConfiguration, len(entries)) } for k, v := range entries { - b.NodeAllocatableResourceMappings[k] = v + b.NodeAllocatableResources[k] = v } return b } diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceallocationconfiguration.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceallocationconfiguration.go index cbfb0c1f26..fb0c7e6bea 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceallocationconfiguration.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceallocationconfiguration.go @@ -38,7 +38,7 @@ type DeviceAllocationConfigurationApplyConfiguration struct { // and may include the subrequest using the format
[/]. If just // the main request is given, the configuration applies to all subrequests. Requests []string `json:"requests,omitempty"` - DeviceConfigurationApplyConfiguration `json:",inline"` + DeviceConfigurationApplyConfiguration `json:""` } // DeviceAllocationConfigurationApplyConfiguration constructs a declarative configuration of the DeviceAllocationConfiguration type for use with diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclaimconfiguration.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclaimconfiguration.go index 59a4f50f6b..34876049f7 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclaimconfiguration.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclaimconfiguration.go @@ -30,7 +30,7 @@ type DeviceClaimConfigurationApplyConfiguration struct { // and may include the subrequest using the format
[/]. If just // the main request is given, the configuration applies to all subrequests. Requests []string `json:"requests,omitempty"` - DeviceConfigurationApplyConfiguration `json:",inline"` + DeviceConfigurationApplyConfiguration `json:""` } // DeviceClaimConfigurationApplyConfiguration constructs a declarative configuration of the DeviceClaimConfiguration type for use with diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclass.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclass.go index 439e03c6d0..687af43937 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclass.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclass.go @@ -38,7 +38,7 @@ import ( // This is an alpha type and requires enabling the DynamicResourceAllocation // feature gate. type DeviceClassApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Spec defines what can be allocated and how to configure it. diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclassconfiguration.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclassconfiguration.go index f668fcf865..6b3f04366c 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclassconfiguration.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclassconfiguration.go @@ -23,7 +23,7 @@ package v1beta2 // // DeviceClassConfiguration is used in DeviceClass. type DeviceClassConfigurationApplyConfiguration struct { - DeviceConfigurationApplyConfiguration `json:",inline"` + DeviceConfigurationApplyConfiguration `json:""` } // DeviceClassConfigurationApplyConfiguration constructs a declarative configuration of the DeviceClassConfiguration type for use with diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclassspec.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclassspec.go index 4ae2eaa29f..fc510c6ff1 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclassspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/deviceclassspec.go @@ -40,8 +40,6 @@ type DeviceClassSpecApplyConfiguration struct { // is picked to satisfy a pod's extended resource requests. // If two classes are created at the same time, then the name of the class // lexicographically sorted first is picked. - // - // This is a beta field. ExtendedResourceName *string `json:"extendedResourceName,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicecounterconsumption.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicecounterconsumption.go index f636ccdbd8..e94c38fc74 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicecounterconsumption.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicecounterconsumption.go @@ -31,6 +31,26 @@ type DeviceCounterConsumptionApplyConfiguration struct { // // The maximum number of counters is 32. Counters map[string]CounterApplyConfiguration `json:"counters,omitempty"` + // CompatibilityGroups is a list of opaque group names for + // this counter set consumption. + // + // Devices that consume counters from the same counter set may only be + // allocated at the same time ("co-allocated") if they all share at least + // one common group: the intersection of the CompatibilityGroups of all + // co-allocated devices on that counter set must be non-empty. Devices + // that consume from different counter sets are never compared via this + // field. + // + // An unset field, an explicit nil, and an empty list are equivalent and + // mean "no groups": such a device is only co-allocatable with sibling + // devices on the same counter set that also have no groups, and is never + // co-allocatable with a device that declares one or more groups. + // + // Group names are opaque and meaningful only within the + // publishing driver's pool. + // + // The maximum number of groups is 2, and the names must be unique. + CompatibilityGroups []string `json:"compatibilityGroups,omitempty"` } // DeviceCounterConsumptionApplyConfiguration constructs a declarative configuration of the DeviceCounterConsumption type for use with @@ -60,3 +80,13 @@ func (b *DeviceCounterConsumptionApplyConfiguration) WithCounters(entries map[st } return b } + +// WithCompatibilityGroups adds the given value to the CompatibilityGroups field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CompatibilityGroups field. +func (b *DeviceCounterConsumptionApplyConfiguration) WithCompatibilityGroups(values ...string) *DeviceCounterConsumptionApplyConfiguration { + for i := range values { + b.CompatibilityGroups = append(b.CompatibilityGroups, values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicederivedattribute.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicederivedattribute.go new file mode 100644 index 0000000000..6b57b3f1a1 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicederivedattribute.go @@ -0,0 +1,95 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resourcev1beta2 "k8s.io/api/resource/v1beta2" +) + +// DeviceDerivedAttributeApplyConfiguration represents a declarative configuration of the DeviceDerivedAttribute type for use +// with apply. +// +// DeviceDerivedAttribute defines a derived attribute computed via CEL. +type DeviceDerivedAttributeApplyConfiguration struct { + // Name is the identifier for this derived attribute, used in constraints. + // + // It must be a DNS subdomain followed by a slash ("/") followed by a C identifier + // (e.g. "example.com/numaNode" or "derived/numaNode"). + // + // If the chosen name matches an existing physical attribute from a driver, + // the derived attribute's expression will shadow the physical attribute, + // and its evaluated value will be used in constraints instead. When the goal + // is to define a derived attribute that is only used within the ResourceClaim + // and not meant to shadow an existing attribute, use a domain prefix that + // no DRA driver should be using (e.g. "derived/myAttribute"). + // + // It is not valid to define a derived attribute that isn't used in at least + // one constraint. + Name *resourcev1beta2.FullyQualifiedName `json:"name,omitempty"` + // Expression is a CEL expression evaluated against each candidate device. + // The expression must evaluate to a primitive scalar (string, integer, + // boolean, or semver) or a list of these scalars ([]string, []int64, + // []bool, []semver) to act as a virtual grouping key. Any other return type + // is an error and causes CEL evaluation for the device to fail. + // + // The expression's input is an object named "device", which carries the + // same properties as in a CELDeviceSelector. + // + // When pod scheduling encounters CEL runtime errors (such as looking + // up an attribute that isn't defined) for some devices, it will abort + // allocation and fail scheduling for the Pod. Surfacing evaluation + // errors immediately prevents silent topology matching failures that are + // extremely hard to detect. A robust expression should, for example, check + // for the existence of attributes before referencing them to avoid + // runtime evaluation errors. + // + // The expression gets evaluated after a device has passed the other + // selector expressions for the request in which this expression is used. + // This allows writing expressions that are tailored towards the specific + // devices being requested (for example, by assuming the device is from a + // certain vendor and skipping those checks). + // + // The length of the expression must be smaller or equal to 10 Ki. The + // cost of evaluating it is also limited based on the estimated number + // of logical steps; the combined cost of all derived attributes in a + // claim is capped by a shared CEL cost budget. + Expression *string `json:"expression,omitempty"` +} + +// DeviceDerivedAttributeApplyConfiguration constructs a declarative configuration of the DeviceDerivedAttribute type for use with +// apply. +func DeviceDerivedAttribute() *DeviceDerivedAttributeApplyConfiguration { + return &DeviceDerivedAttributeApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *DeviceDerivedAttributeApplyConfiguration) WithName(value resourcev1beta2.FullyQualifiedName) *DeviceDerivedAttributeApplyConfiguration { + b.Name = &value + return b +} + +// WithExpression sets the Expression field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Expression field is set to the value of the last call. +func (b *DeviceDerivedAttributeApplyConfiguration) WithExpression(value string) *DeviceDerivedAttributeApplyConfiguration { + b.Expression = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicerequestallocationresult.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicerequestallocationresult.go index a274e5706c..e80cd933ec 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicerequestallocationresult.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicerequestallocationresult.go @@ -95,6 +95,12 @@ type DeviceRequestAllocationResultApplyConfiguration struct { // This field is populated only for devices that allow multiple allocations. // All capacity entries are included, even if the consumed amount is zero. ConsumedCapacity map[resourcev1beta2.QualifiedName]resource.Quantity `json:"consumedCapacity,omitempty"` + // SkipNodeOperations lists node-local resource operations (gRPC calls) + // that will be skipped for this allocated device when determining whether + // operations are necessary on the node. If all allocated devices for a driver in + // a claim skip an operation, that gRPC call will be skipped. It is a copy of + // the ResourceSlice.spec.skipNodeOperations value at the time when the device was allocated. + SkipNodeOperations []resourcev1beta2.SkipNodeOperation `json:"skipNodeOperations,omitempty"` } // DeviceRequestAllocationResultApplyConfiguration constructs a declarative configuration of the DeviceRequestAllocationResult type for use with @@ -197,3 +203,13 @@ func (b *DeviceRequestAllocationResultApplyConfiguration) WithConsumedCapacity(e } return b } + +// WithSkipNodeOperations adds the given value to the SkipNodeOperations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SkipNodeOperations field. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithSkipNodeOperations(values ...resourcev1beta2.SkipNodeOperation) *DeviceRequestAllocationResultApplyConfiguration { + for i := range values { + b.SkipNodeOperations = append(b.SkipNodeOperations, values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicesubrequest.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicesubrequest.go index d9f4a5cb57..f0c882185d 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicesubrequest.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicesubrequest.go @@ -109,6 +109,27 @@ type DeviceSubRequestApplyConfiguration struct { // the request fails if there are devices that otherwise match the request, // and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request. Capacity *CapacityRequirementsApplyConfiguration `json:"capacity,omitempty"` + // DerivedAttributes defines a set of virtual attributes computed via CEL expressions + // for each candidate device. These virtual attributes can be referenced in + // `.devices.constraints` to align and match different devices (e.g., co-allocating + // a GPU and a NIC on the same NUMA node) even if their drivers publish different + // attributes. Derived attributes are not available via `device.attributes` + // in the CEL environment when evaluating selector expressions. + // + // Derived attributes allow you to extract, transform, or normalize topology + // information (such as extracting a NUMA index from a complex topology string or + // renaming a vendor-specific attribute) into a common virtual attribute name at + // scheduling time. The scheduler then evaluates these virtual attributes exactly + // like static attributes when matching constraints. + // + // Every derived attribute defined in this list must be referenced by at least one + // MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list. + // + // The maximum number of derived attributes is 32. + // + // This is an alpha field and requires enabling the DRADerivedAttributes + // feature gate. + DerivedAttributes []DeviceDerivedAttributeApplyConfiguration `json:"derivedAttributes,omitempty"` } // DeviceSubRequestApplyConfiguration constructs a declarative configuration of the DeviceSubRequest type for use with @@ -182,3 +203,16 @@ func (b *DeviceSubRequestApplyConfiguration) WithCapacity(value *CapacityRequire b.Capacity = value return b } + +// WithDerivedAttributes adds the given value to the DerivedAttributes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the DerivedAttributes field. +func (b *DeviceSubRequestApplyConfiguration) WithDerivedAttributes(values ...*DeviceDerivedAttributeApplyConfiguration) *DeviceSubRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDerivedAttributes") + } + b.DerivedAttributes = append(b.DerivedAttributes, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicetaintrule.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicetaintrule.go index 18b2aca188..5e7a5a0cbb 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicetaintrule.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/devicetaintrule.go @@ -34,7 +34,7 @@ import ( // This has the same effect as if the taint was specified directly // in the ResourceSlice by the DRA driver. type DeviceTaintRuleApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Spec specifies the selector and one taint. diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/exactdevicerequest.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/exactdevicerequest.go index bda1152701..b23786194d 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/exactdevicerequest.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/exactdevicerequest.go @@ -107,6 +107,27 @@ type ExactDeviceRequestApplyConfiguration struct { // the request fails if there are devices that otherwise match the request, // and have this capacity, with a value >= the requested amount, but which cannot be allocated to this request. Capacity *CapacityRequirementsApplyConfiguration `json:"capacity,omitempty"` + // DerivedAttributes defines a set of virtual attributes computed via CEL expressions + // for each candidate device. These virtual attributes can be referenced in + // `.devices.constraints` to align and match different devices (e.g., co-allocating + // a GPU and a NIC on the same NUMA node) even if their drivers publish different + // attributes. Derived attributes are not available via `device.attributes` + // in the CEL environment when evaluating selector expressions. + // + // Derived attributes allow you to extract, transform, or normalize topology + // information (such as extracting a NUMA index from a complex topology string or + // renaming a vendor-specific attribute) into a common virtual attribute name at + // scheduling time. The scheduler then evaluates these virtual attributes exactly + // like static attributes when matching constraints. + // + // Every derived attribute defined in this list must be referenced by at least one + // MatchAttribute or DistinctAttribute constraint in the `.devices.constraints` list. + // + // The maximum number of derived attributes is 32. + // + // This is an alpha field and requires enabling the DRADerivedAttributes + // feature gate. + DerivedAttributes []DeviceDerivedAttributeApplyConfiguration `json:"derivedAttributes,omitempty"` } // ExactDeviceRequestApplyConfiguration constructs a declarative configuration of the ExactDeviceRequest type for use with @@ -180,3 +201,16 @@ func (b *ExactDeviceRequestApplyConfiguration) WithCapacity(value *CapacityRequi b.Capacity = value return b } + +// WithDerivedAttributes adds the given value to the DerivedAttributes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the DerivedAttributes field. +func (b *ExactDeviceRequestApplyConfiguration) WithDerivedAttributes(values ...*DeviceDerivedAttributeApplyConfiguration) *ExactDeviceRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDerivedAttributes") + } + b.DerivedAttributes = append(b.DerivedAttributes, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/nodeallocatablemapping.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/nodeallocatablemapping.go new file mode 100644 index 0000000000..50b4069736 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/nodeallocatablemapping.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resourcev1beta2 "k8s.io/api/resource/v1beta2" + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// NodeAllocatableMappingApplyConfiguration represents a declarative configuration of the NodeAllocatableMapping type for use +// with apply. +// +// NodeAllocatableMapping defines how a DRA allocation directly translates into a node allocatable resource quantity. +// The mapping can be derived from either the count of allocated devices (via deviceMultiplier) or the specific capacity consumed (via capacityKey and capacityMultiplier). These options are mutually exclusive. +// Kubelet adds this mapped resource quantity from claim to both requests and limits at the pod-level cgroup, and to limits at the container-level cgroup for each container referencing the claim. +type NodeAllocatableMappingApplyConfiguration struct { + // CapacityKey references a capacity name defined as a key in the + // `spec.devices[*].capacity` map. When this field is set, the value associated with + // this key in the `status.allocation.devices.results[*].consumedCapacity` map + // (for a specific claim allocation) determines the base quantity for + // the node allocatable resource. `capacityMultiplier` must also be set and is + // multiplied with the base quantity. + // For example, if `spec.devices[*].capacity` has an entry "dra.example.com/memory": "128Gi", + // and this field is set to "dra.example.com/memory", then for a claim allocation + // that consumes { "dra.example.com/memory": "4Gi" } the base quantity for the + // node allocatable resource mapping will be "4Gi". + // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. + CapacityKey *resourcev1beta2.QualifiedName `json:"capacityKey,omitempty"` + // CapacityMultiplier is used as a multiplier for the allocated capacity consumed. + // It is only valid if `capacityKey` is set. + // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `capacityMultiplier`. + // For example, if a Device's capacity "dra.example.com/cores" is consumed, + // and each "core" provides 2 "cpu"s, the mapping would be: + // {ResourceName: "cpu", capacityKey: "dra.example.com/cores", capacityMultiplier: "2"}. + // If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16. + CapacityMultiplier *resource.Quantity `json:"capacityMultiplier,omitempty"` + // DeviceMultiplier is used as a multiplier for the allocated device count in the claim. + // The final node allocatable resource amount is `deviceCount` * `deviceMultiplier`. + // For example, a DRA driver representing each cache complex (CCX) as a device would have + // {ResourceName: "cpu", deviceMultiplier: "8"} in its `nodeAllocatableResources`. + // If 2 devices (CCX) are allocated to the claim, 2 * 8 = 16 CPUs would be considered as allocated. + // It is only valid when `capacityKey` and `capacityMultiplier` are not set. + DeviceMultiplier *resource.Quantity `json:"deviceMultiplier,omitempty"` +} + +// NodeAllocatableMappingApplyConfiguration constructs a declarative configuration of the NodeAllocatableMapping type for use with +// apply. +func NodeAllocatableMapping() *NodeAllocatableMappingApplyConfiguration { + return &NodeAllocatableMappingApplyConfiguration{} +} + +// WithCapacityKey sets the CapacityKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CapacityKey field is set to the value of the last call. +func (b *NodeAllocatableMappingApplyConfiguration) WithCapacityKey(value resourcev1beta2.QualifiedName) *NodeAllocatableMappingApplyConfiguration { + b.CapacityKey = &value + return b +} + +// WithCapacityMultiplier sets the CapacityMultiplier field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CapacityMultiplier field is set to the value of the last call. +func (b *NodeAllocatableMappingApplyConfiguration) WithCapacityMultiplier(value resource.Quantity) *NodeAllocatableMappingApplyConfiguration { + b.CapacityMultiplier = &value + return b +} + +// WithDeviceMultiplier sets the DeviceMultiplier field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeviceMultiplier field is set to the value of the last call. +func (b *NodeAllocatableMappingApplyConfiguration) WithDeviceMultiplier(value resource.Quantity) *NodeAllocatableMappingApplyConfiguration { + b.DeviceMultiplier = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/nodeallocatableoverhead.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/nodeallocatableoverhead.go new file mode 100644 index 0000000000..49205e8997 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/nodeallocatableoverhead.go @@ -0,0 +1,67 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// NodeAllocatableOverheadApplyConfiguration represents a declarative configuration of the NodeAllocatableOverhead type for use +// with apply. +// +// NodeAllocatableOverhead defines auxiliary resource overheads incurred when allocating a device. +// Overheads can be specified as a fixed cost per pod referencing the claim, a variable cost per container reference, or both. +// Kubelet accounts for this overhead by adding it to both the pod-level and container-level cgroups of referencing containers. +type NodeAllocatableOverheadApplyConfiguration struct { + // PerPod is overhead applied once per pod referencing the claim on this node. + // This is a flat overhead incurred for every pod referencing the claim. + PerPod *resource.Quantity `json:"perPod,omitempty"` + // PerContainer is applied per container reference to the claim. + // This models overhead scaling linearly with the number of containers actively using the device. + // When both PerPod and PerContainer are specified, the total overhead allocated for each pod referencing + // the claim is computed as: + // Quantity = PerPod + (PerContainer * NumReferences) + // Kubelet accounts for this overhead in cgroups: + // - Pod-level cgroup (requests and limits): Kubelet adds PerPod + (PerContainer * NumReferences). + // - Container-level cgroup (limits only): Kubelet adds PerPod + PerContainer for each referencing container. + // This allows any single container to access the pod-level overhead, while the parent cgroup caps the total usage to account for PerPod exactly once. + PerContainer *resource.Quantity `json:"perContainer,omitempty"` +} + +// NodeAllocatableOverheadApplyConfiguration constructs a declarative configuration of the NodeAllocatableOverhead type for use with +// apply. +func NodeAllocatableOverhead() *NodeAllocatableOverheadApplyConfiguration { + return &NodeAllocatableOverheadApplyConfiguration{} +} + +// WithPerPod sets the PerPod field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PerPod field is set to the value of the last call. +func (b *NodeAllocatableOverheadApplyConfiguration) WithPerPod(value resource.Quantity) *NodeAllocatableOverheadApplyConfiguration { + b.PerPod = &value + return b +} + +// WithPerContainer sets the PerContainer field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PerContainer field is set to the value of the last call. +func (b *NodeAllocatableOverheadApplyConfiguration) WithPerContainer(value resource.Quantity) *NodeAllocatableOverheadApplyConfiguration { + b.PerContainer = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/nodeallocatableresource.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/nodeallocatableresource.go new file mode 100644 index 0000000000..ce116f3d47 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/nodeallocatableresource.go @@ -0,0 +1,65 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// NodeAllocatableResourceApplyConfiguration represents a declarative configuration of the NodeAllocatableResource type for use +// with apply. +// +// NodeAllocatableResource defines the translation between the DRA device/capacity +// units requested to the corresponding quantity of the node allocatable resource. +// At least one of Mapping or Overhead must be specified. Not specifying either is an invalid configuration. +type NodeAllocatableResourceApplyConfiguration struct { + // Mapping is used when the device directly models a node allocatable resource like standard CPU or memory + // (e.g., with a CPU DRA driver). The calculated quantity is accounted for exactly once per claim instance + // on the node. To prevent node cgroup isolation friction, the scheduler explicitly + // blocks sharing mapped device claims across multiple pods. + Mapping *NodeAllocatableMappingApplyConfiguration `json:"mapping,omitempty"` + // Overhead contains fields for modeling auxiliary overhead incurred on node allocatable resources + // when allocating devices that are not themselves modeling a node allocatable resource (e.g., host memory overhead for GPUs). + // Sharing overhead-mapped claims across multiple pods is allowed. The node allocatable overhead is accounted + // for individually for each pod referencing the claim. + // Overhead is always subtracted from the node's allocatable capacity for the resource, even when mapping + // is specified for the same resource. + // Eg: If a device models memory capacity per socket as a consumable capacity pool via Mapping (with CapacityKey), + // any overhead specified for the same resource will be subtracted from the node's general allocatable capacity + // and not from the per-socket capacity pool in Mapping. + Overhead *NodeAllocatableOverheadApplyConfiguration `json:"overhead,omitempty"` +} + +// NodeAllocatableResourceApplyConfiguration constructs a declarative configuration of the NodeAllocatableResource type for use with +// apply. +func NodeAllocatableResource() *NodeAllocatableResourceApplyConfiguration { + return &NodeAllocatableResourceApplyConfiguration{} +} + +// WithMapping sets the Mapping field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Mapping field is set to the value of the last call. +func (b *NodeAllocatableResourceApplyConfiguration) WithMapping(value *NodeAllocatableMappingApplyConfiguration) *NodeAllocatableResourceApplyConfiguration { + b.Mapping = value + return b +} + +// WithOverhead sets the Overhead field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Overhead field is set to the value of the last call. +func (b *NodeAllocatableResourceApplyConfiguration) WithOverhead(value *NodeAllocatableOverheadApplyConfiguration) *NodeAllocatableResourceApplyConfiguration { + b.Overhead = value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/nodeallocatableresourcemapping.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/nodeallocatableresourcemapping.go deleted file mode 100644 index b1490b5e75..0000000000 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/nodeallocatableresourcemapping.go +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta2 - -import ( - resourcev1beta2 "k8s.io/api/resource/v1beta2" - resource "k8s.io/apimachinery/pkg/api/resource" -) - -// NodeAllocatableResourceMappingApplyConfiguration represents a declarative configuration of the NodeAllocatableResourceMapping type for use -// with apply. -// -// NodeAllocatableResourceMapping defines the translation between the DRA device/capacity -// units requested to the corresponding quantity of the node allocatable resource. -type NodeAllocatableResourceMappingApplyConfiguration struct { - // CapacityKey references a capacity name defined as a key in the - // `spec.devices[*].capacity` map. When this field is set, the value associated with - // this key in the `status.allocation.devices.results[*].consumedCapacity` map - // (for a specific claim allocation) determines the base quantity for - // the node allocatable resource. If `allocationMultiplier` is also set, it is - // multiplied with the base quantity. - // For example, if `spec.devices[*].capacity` has an entry "dra.example.com/memory": "128Gi", - // and this field is set to "dra.example.com/memory", then for a claim allocation - // that consumes { "dra.example.com/memory": "4Gi" } the base quantity for the - // node allocatable resource mapping will be "4Gi", and `allocationMultiplier` should - // be omitted or set to "1". - CapacityKey *resourcev1beta2.QualifiedName `json:"capacityKey,omitempty"` - // AllocationMultiplier is used as a multiplier for the allocated device count or the allocated capacity in the claim. - // It defaults to 1 if not specified. How the field is used also depends on whether `capacityKey` is set. - // 1. If `capacityKey` is NOT set: `allocationMultiplier` multiplies the device count allocated to the claim. - // a. A DRA driver representing each CPU core as a device would have - // {ResourceName: "cpu", allocationMultiplier: "2"} in its - // `nodeAllocatableResourceMappings`. If 4 devices are allocated to the claim, - // 4 * 2 CPUs would be considered as allocated and subtracted from the node's capacity. - // b. A GPU device that needs additional node memory per GPU allocation would - // have {ResourceName: "memory", allocationMultiplier: "2Gi"}. Each allocated - // GPU device instance of this type will account for 2Gi of memory. - // - // 2. If `capacityKey` IS set: `allocationMultiplier` is multiplied by the amount of that capacity consumed. - // The final node allocatable resource amount is `consumedCapacity[capacityKey]` * `allocationMultiplier`. - // For example, if a Device's capacity "dra.example.com/cores" is consumed, - // and each "core" provides 2 "cpu"s, the mapping would be: - // {ResourceName: "cpu", capacityKey: "dra.example.com/cores", allocationMultiplier: "2"}. - // If a claim consumes 8 "dra.example.com/cores", the CPU footprint is 8 * 2 = 16. - AllocationMultiplier *resource.Quantity `json:"allocationMultiplier,omitempty"` -} - -// NodeAllocatableResourceMappingApplyConfiguration constructs a declarative configuration of the NodeAllocatableResourceMapping type for use with -// apply. -func NodeAllocatableResourceMapping() *NodeAllocatableResourceMappingApplyConfiguration { - return &NodeAllocatableResourceMappingApplyConfiguration{} -} - -// WithCapacityKey sets the CapacityKey field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CapacityKey field is set to the value of the last call. -func (b *NodeAllocatableResourceMappingApplyConfiguration) WithCapacityKey(value resourcev1beta2.QualifiedName) *NodeAllocatableResourceMappingApplyConfiguration { - b.CapacityKey = &value - return b -} - -// WithAllocationMultiplier sets the AllocationMultiplier field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the AllocationMultiplier field is set to the value of the last call. -func (b *NodeAllocatableResourceMappingApplyConfiguration) WithAllocationMultiplier(value resource.Quantity) *NodeAllocatableResourceMappingApplyConfiguration { - b.AllocationMultiplier = &value - return b -} diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaim.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaim.go index e35d087cd6..7b8e86139e 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaim.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaim.go @@ -39,7 +39,7 @@ import ( // This is an alpha type and requires enabling the DynamicResourceAllocation // feature gate. type ResourceClaimApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Spec describes what is being requested and how to configure it. diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimtemplate.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimtemplate.go index 999521cee2..35e5adbdfc 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimtemplate.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceclaimtemplate.go @@ -35,7 +35,7 @@ import ( // This is an alpha type and requires enabling the DynamicResourceAllocation // feature gate. type ResourceClaimTemplateApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Describes the ResourceClaim that is to be generated. diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourcepool.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourcepool.go index f5b0c9b618..4d631c3976 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourcepool.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourcepool.go @@ -25,6 +25,8 @@ package v1beta2 type ResourcePoolApplyConfiguration struct { // Name is used to identify the pool. For node-local devices, this // is often the node name, but this is not required. + // A field selector can be used to list only ResourceSlice objects + // belonging to a certain pool. // // It must not be longer than 253 characters and must consist of one or more DNS sub-domains // separated by slashes. This field is immutable. diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceslice.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceslice.go index dbbe7b2ea2..89eae2d216 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceslice.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceslice.go @@ -55,7 +55,7 @@ import ( // This is an alpha type and requires enabling the DynamicResourceAllocation // feature gate. type ResourceSliceApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Contains the information published by the driver. diff --git a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceslicespec.go b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceslicespec.go index 2efc7d0750..cdd52c111a 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceslicespec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/resource/v1beta2/resourceslicespec.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta2 import ( + resourcev1beta2 "k8s.io/api/resource/v1beta2" v1 "k8s.io/client-go/applyconfigurations/core/v1" ) @@ -82,6 +83,28 @@ type ResourceSliceSpecApplyConfiguration struct { // // The maximum number of counter sets is 8. SharedCounters []CounterSetApplyConfiguration `json:"sharedCounters,omitempty"` + // PartitionTypeAttribute names a string device attribute (by fully + // qualified name, e.g. "gpu.example.com/profile") whose value labels + // each device with its partition type, such as "Full" or "Half" for a + // MIG-style GPU. + // + // When set, every partitionable device in the slice must carry the attribute + // and devices sharing a value must share the same ConsumesCounters cost. + PartitionTypeAttribute *resourcev1beta2.FullyQualifiedName `json:"partitionTypeAttribute,omitempty"` + // SkipNodeOperations lists node-local resource operations (gRPC calls) + // that will be skipped for the devices in this slice when determining whether + // operations are necessary on the node. If all allocated devices for a driver in + // a claim skip an operation, that gRPC call will be skipped. Valid values are: + // + // - "NodePrepareResources": NodePrepareResources gRPC calls are skipped. This + // value cannot be specified unless "NodeUnprepareResources" is also listed + // (or "*" is specified). + // - "NodeUnprepareResources": NodeUnprepareResources gRPC calls are skipped. + // - "*": All node-local resource operations are skipped. + // + // Other values may be added in the future. The kubelet must ignore unknown + // values. + SkipNodeOperations []resourcev1beta2.SkipNodeOperation `json:"skipNodeOperations,omitempty"` } // ResourceSliceSpecApplyConfiguration constructs a declarative configuration of the ResourceSliceSpec type for use with @@ -163,3 +186,21 @@ func (b *ResourceSliceSpecApplyConfiguration) WithSharedCounters(values ...*Coun } return b } + +// WithPartitionTypeAttribute sets the PartitionTypeAttribute field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PartitionTypeAttribute field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithPartitionTypeAttribute(value resourcev1beta2.FullyQualifiedName) *ResourceSliceSpecApplyConfiguration { + b.PartitionTypeAttribute = &value + return b +} + +// WithSkipNodeOperations adds the given value to the SkipNodeOperations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SkipNodeOperations field. +func (b *ResourceSliceSpecApplyConfiguration) WithSkipNodeOperations(values ...resourcev1beta2.SkipNodeOperation) *ResourceSliceSpecApplyConfiguration { + for i := range values { + b.SkipNodeOperations = append(b.SkipNodeOperations, values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1/priorityclass.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1/priorityclass.go index 4056dcdd2f..b8612d6cbb 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1/priorityclass.go +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1/priorityclass.go @@ -34,8 +34,8 @@ import ( // PriorityClass defines mapping from a priority class name to the priority // integer value. The value can be any valid integer. type PriorityClassApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // value represents the integer value of this priority class. This is the actual priority that pods diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgrouptemplatereference.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgrouptemplatereference.go deleted file mode 100644 index f8b1f61ffc..0000000000 --- a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgrouptemplatereference.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -// PodGroupTemplateReferenceApplyConfiguration represents a declarative configuration of the PodGroupTemplateReference type for use -// with apply. -// -// PodGroupTemplateReference references a PodGroup template defined in some object (e.g. Workload). -// Exactly one reference must be set. -type PodGroupTemplateReferenceApplyConfiguration struct { - // Workload references the PodGroupTemplate within the Workload object that was used to create - // the PodGroup. - Workload *WorkloadPodGroupTemplateReferenceApplyConfiguration `json:"workload,omitempty"` -} - -// PodGroupTemplateReferenceApplyConfiguration constructs a declarative configuration of the PodGroupTemplateReference type for use with -// apply. -func PodGroupTemplateReference() *PodGroupTemplateReferenceApplyConfiguration { - return &PodGroupTemplateReferenceApplyConfiguration{} -} - -// WithWorkload sets the Workload field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Workload field is set to the value of the last call. -func (b *PodGroupTemplateReferenceApplyConfiguration) WithWorkload(value *WorkloadPodGroupTemplateReferenceApplyConfiguration) *PodGroupTemplateReferenceApplyConfiguration { - b.Workload = value - return b -} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/workloadpodgrouptemplatereference.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/workloadpodgrouptemplatereference.go deleted file mode 100644 index ff3ab06c8d..0000000000 --- a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/workloadpodgrouptemplatereference.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -// WorkloadPodGroupTemplateReferenceApplyConfiguration represents a declarative configuration of the WorkloadPodGroupTemplateReference type for use -// with apply. -// -// WorkloadPodGroupTemplateReference references the PodGroupTemplate within the Workload object. -type WorkloadPodGroupTemplateReferenceApplyConfiguration struct { - // WorkloadName defines the name of the Workload object. - WorkloadName *string `json:"workloadName,omitempty"` - // PodGroupTemplateName defines the PodGroupTemplate name within the Workload object. - PodGroupTemplateName *string `json:"podGroupTemplateName,omitempty"` -} - -// WorkloadPodGroupTemplateReferenceApplyConfiguration constructs a declarative configuration of the WorkloadPodGroupTemplateReference type for use with -// apply. -func WorkloadPodGroupTemplateReference() *WorkloadPodGroupTemplateReferenceApplyConfiguration { - return &WorkloadPodGroupTemplateReferenceApplyConfiguration{} -} - -// WithWorkloadName sets the WorkloadName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the WorkloadName field is set to the value of the last call. -func (b *WorkloadPodGroupTemplateReferenceApplyConfiguration) WithWorkloadName(value string) *WorkloadPodGroupTemplateReferenceApplyConfiguration { - b.WorkloadName = &value - return b -} - -// WithPodGroupTemplateName sets the PodGroupTemplateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the PodGroupTemplateName field is set to the value of the last call. -func (b *WorkloadPodGroupTemplateReferenceApplyConfiguration) WithPodGroupTemplateName(value string) *WorkloadPodGroupTemplateReferenceApplyConfiguration { - b.PodGroupTemplateName = &value - return b -} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositedisruptionmode.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositedisruptionmode.go new file mode 100644 index 0000000000..70ff0162ac --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositedisruptionmode.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" +) + +// CompositeDisruptionModeApplyConfiguration represents a declarative configuration of the CompositeDisruptionMode type for use +// with apply. +// +// CompositeDisruptionMode defines how individual entities within a composite pod group can be disrupted. +// Exactly one mode must be set. +type CompositeDisruptionModeApplyConfiguration struct { + // single specifies that children groups can be disrupted independently from each other. + Single *schedulingv1alpha3.SingleCompositeDisruptionMode `json:"single,omitempty"` + // all specifies that all children groups can only be disrupted together. + All *schedulingv1alpha3.AllCompositeDisruptionMode `json:"all,omitempty"` +} + +// CompositeDisruptionModeApplyConfiguration constructs a declarative configuration of the CompositeDisruptionMode type for use with +// apply. +func CompositeDisruptionMode() *CompositeDisruptionModeApplyConfiguration { + return &CompositeDisruptionModeApplyConfiguration{} +} + +// WithSingle sets the Single field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Single field is set to the value of the last call. +func (b *CompositeDisruptionModeApplyConfiguration) WithSingle(value schedulingv1alpha3.SingleCompositeDisruptionMode) *CompositeDisruptionModeApplyConfiguration { + b.Single = &value + return b +} + +// WithAll sets the All field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the All field is set to the value of the last call. +func (b *CompositeDisruptionModeApplyConfiguration) WithAll(value schedulingv1alpha3.AllCompositeDisruptionMode) *CompositeDisruptionModeApplyConfiguration { + b.All = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositegangschedulingpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositegangschedulingpolicy.go new file mode 100644 index 0000000000..c462b55a9e --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositegangschedulingpolicy.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// CompositeGangSchedulingPolicyApplyConfiguration represents a declarative configuration of the CompositeGangSchedulingPolicy type for use +// with apply. +// +// CompositeGangSchedulingPolicy indicates that the groups belonging to the composite group +// should be scheduled using all-or-nothing semantics. +type CompositeGangSchedulingPolicyApplyConfiguration struct { + // minGroupCount is the minimum number of child groups that must be schedulable + // or scheduled at the same time for the scheduler to admit the entire group. + // It must be a positive integer. + MinGroupCount *int32 `json:"minGroupCount,omitempty"` +} + +// CompositeGangSchedulingPolicyApplyConfiguration constructs a declarative configuration of the CompositeGangSchedulingPolicy type for use with +// apply. +func CompositeGangSchedulingPolicy() *CompositeGangSchedulingPolicyApplyConfiguration { + return &CompositeGangSchedulingPolicyApplyConfiguration{} +} + +// WithMinGroupCount sets the MinGroupCount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinGroupCount field is set to the value of the last call. +func (b *CompositeGangSchedulingPolicyApplyConfiguration) WithMinGroupCount(value int32) *CompositeGangSchedulingPolicyApplyConfiguration { + b.MinGroupCount = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositepodgroup.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositepodgroup.go new file mode 100644 index 0000000000..e408c0a791 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositepodgroup.go @@ -0,0 +1,296 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// CompositePodGroupApplyConfiguration represents a declarative configuration of the CompositePodGroup type for use +// with apply. +// +// CompositePodGroup represents a runtime instance of pod groups grouped together. +// CompositePodGroups are created by workload controllers (LWS, JobSet, etc...) from +// Workload.compositePodGroupTemplates. +// CompositePodGroup API enablement is toggled by the CompositePodGroup feature gate. +type CompositePodGroupApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec defines the desired state of the CompositePodGroup. + Spec *CompositePodGroupSpecApplyConfiguration `json:"spec,omitempty"` + // status represents the current observed state of the CompositePodGroup. + Status *CompositePodGroupStatusApplyConfiguration `json:"status,omitempty"` +} + +// CompositePodGroup constructs a declarative configuration of the CompositePodGroup type for use with +// apply. +func CompositePodGroup(name, namespace string) *CompositePodGroupApplyConfiguration { + b := &CompositePodGroupApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("CompositePodGroup") + b.WithAPIVersion("scheduling.k8s.io/v1alpha3") + return b +} + +// ExtractCompositePodGroupFrom extracts the applied configuration owned by fieldManager from +// compositePodGroup for the specified subresource. Pass an empty string for subresource to extract +// the main resource. Common subresources include "status", "scale", etc. +// compositePodGroup must be a unmodified CompositePodGroup API object that was retrieved from the Kubernetes API. +// ExtractCompositePodGroupFrom provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractCompositePodGroupFrom(compositePodGroup *schedulingv1alpha3.CompositePodGroup, fieldManager string, subresource string) (*CompositePodGroupApplyConfiguration, error) { + b := &CompositePodGroupApplyConfiguration{} + err := managedfields.ExtractInto(compositePodGroup, internal.Parser().Type("io.k8s.api.scheduling.v1alpha3.CompositePodGroup"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(compositePodGroup.Name) + b.WithNamespace(compositePodGroup.Namespace) + + b.WithKind("CompositePodGroup") + b.WithAPIVersion("scheduling.k8s.io/v1alpha3") + return b, nil +} + +// ExtractCompositePodGroup extracts the applied configuration owned by fieldManager from +// compositePodGroup. If no managedFields are found in compositePodGroup for fieldManager, a +// CompositePodGroupApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// compositePodGroup must be a unmodified CompositePodGroup API object that was retrieved from the Kubernetes API. +// ExtractCompositePodGroup provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractCompositePodGroup(compositePodGroup *schedulingv1alpha3.CompositePodGroup, fieldManager string) (*CompositePodGroupApplyConfiguration, error) { + return ExtractCompositePodGroupFrom(compositePodGroup, fieldManager, "") +} + +// ExtractCompositePodGroupStatus extracts the applied configuration owned by fieldManager from +// compositePodGroup for the status subresource. +func ExtractCompositePodGroupStatus(compositePodGroup *schedulingv1alpha3.CompositePodGroup, fieldManager string) (*CompositePodGroupApplyConfiguration, error) { + return ExtractCompositePodGroupFrom(compositePodGroup, fieldManager, "status") +} + +func (b CompositePodGroupApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *CompositePodGroupApplyConfiguration) WithKind(value string) *CompositePodGroupApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *CompositePodGroupApplyConfiguration) WithAPIVersion(value string) *CompositePodGroupApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *CompositePodGroupApplyConfiguration) WithName(value string) *CompositePodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *CompositePodGroupApplyConfiguration) WithGenerateName(value string) *CompositePodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *CompositePodGroupApplyConfiguration) WithNamespace(value string) *CompositePodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *CompositePodGroupApplyConfiguration) WithUID(value types.UID) *CompositePodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *CompositePodGroupApplyConfiguration) WithResourceVersion(value string) *CompositePodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *CompositePodGroupApplyConfiguration) WithGeneration(value int64) *CompositePodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *CompositePodGroupApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CompositePodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *CompositePodGroupApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CompositePodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *CompositePodGroupApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CompositePodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *CompositePodGroupApplyConfiguration) WithLabels(entries map[string]string) *CompositePodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *CompositePodGroupApplyConfiguration) WithAnnotations(entries map[string]string) *CompositePodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *CompositePodGroupApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CompositePodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *CompositePodGroupApplyConfiguration) WithFinalizers(values ...string) *CompositePodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *CompositePodGroupApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *CompositePodGroupApplyConfiguration) WithSpec(value *CompositePodGroupSpecApplyConfiguration) *CompositePodGroupApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *CompositePodGroupApplyConfiguration) WithStatus(value *CompositePodGroupStatusApplyConfiguration) *CompositePodGroupApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *CompositePodGroupApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *CompositePodGroupApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *CompositePodGroupApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *CompositePodGroupApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositepodgroupschedulingconstraints.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositepodgroupschedulingconstraints.go new file mode 100644 index 0000000000..4c6fe983c0 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositepodgroupschedulingconstraints.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// CompositePodGroupSchedulingConstraintsApplyConfiguration represents a declarative configuration of the CompositePodGroupSchedulingConstraints type for use +// with apply. +// +// CompositePodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a CompositePodGroup. +type CompositePodGroupSchedulingConstraintsApplyConfiguration struct { + // topology defines the topology constraints for the composite pod group. + // Currently only a single topology constraint can be specified. This may change in the future. + Topology []TopologyConstraintApplyConfiguration `json:"topology,omitempty"` +} + +// CompositePodGroupSchedulingConstraintsApplyConfiguration constructs a declarative configuration of the CompositePodGroupSchedulingConstraints type for use with +// apply. +func CompositePodGroupSchedulingConstraints() *CompositePodGroupSchedulingConstraintsApplyConfiguration { + return &CompositePodGroupSchedulingConstraintsApplyConfiguration{} +} + +// WithTopology adds the given value to the Topology field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Topology field. +func (b *CompositePodGroupSchedulingConstraintsApplyConfiguration) WithTopology(values ...*TopologyConstraintApplyConfiguration) *CompositePodGroupSchedulingConstraintsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTopology") + } + b.Topology = append(b.Topology, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositepodgroupschedulingpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositepodgroupschedulingpolicy.go new file mode 100644 index 0000000000..c98be7fbe3 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositepodgroupschedulingpolicy.go @@ -0,0 +1,59 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" +) + +// CompositePodGroupSchedulingPolicyApplyConfiguration represents a declarative configuration of the CompositePodGroupSchedulingPolicy type for use +// with apply. +// +// CompositePodGroupSchedulingPolicy defines the scheduling configuration for a CompositePodGroup. +// Exactly one policy must be set. +type CompositePodGroupSchedulingPolicyApplyConfiguration struct { + // basic specifies that the groups of this composite group should be scheduled independently. + // This field is immutable. + Basic *schedulingv1alpha3.CompositeBasicSchedulingPolicy `json:"basic,omitempty"` + // gang specifies that the groups of this composite group should be scheduled using + // all-or-nothing semantics. + Gang *CompositeGangSchedulingPolicyApplyConfiguration `json:"gang,omitempty"` +} + +// CompositePodGroupSchedulingPolicyApplyConfiguration constructs a declarative configuration of the CompositePodGroupSchedulingPolicy type for use with +// apply. +func CompositePodGroupSchedulingPolicy() *CompositePodGroupSchedulingPolicyApplyConfiguration { + return &CompositePodGroupSchedulingPolicyApplyConfiguration{} +} + +// WithBasic sets the Basic field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Basic field is set to the value of the last call. +func (b *CompositePodGroupSchedulingPolicyApplyConfiguration) WithBasic(value schedulingv1alpha3.CompositeBasicSchedulingPolicy) *CompositePodGroupSchedulingPolicyApplyConfiguration { + b.Basic = &value + return b +} + +// WithGang sets the Gang field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Gang field is set to the value of the last call. +func (b *CompositePodGroupSchedulingPolicyApplyConfiguration) WithGang(value *CompositeGangSchedulingPolicyApplyConfiguration) *CompositePodGroupSchedulingPolicyApplyConfiguration { + b.Gang = value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositepodgroupspec.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositepodgroupspec.go new file mode 100644 index 0000000000..16bc538a54 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositepodgroupspec.go @@ -0,0 +1,144 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" +) + +// CompositePodGroupSpecApplyConfiguration represents a declarative configuration of the CompositePodGroupSpec type for use +// with apply. +// +// CompositePodGroupSpec defines the desired state of CompositePodGroup. +type CompositePodGroupSpecApplyConfiguration struct { + // parentCompositePodGroupName contains the name of the parent composite pod group + // within the same namespace as this composite pod group. It must be a DNS name. + // If it's nil, then this composite pod group is a root of a workload's hierarchy. + // This field is immutable. + ParentCompositePodGroupName *string `json:"parentCompositePodGroupName,omitempty"` + // workloadRef references an optional CompositePodGroup template within the + // Workload object that was used to create the CompositePodGroup. + // This field is required. + // This field is immutable. + WorkloadRef *WorkloadReferenceApplyConfiguration `json:"workloadRef,omitempty"` + // schedulingPolicy defines the scheduling policy for this instance of the CompositePodGroup. + // Controllers are expected to fill this field by copying it from a CompositePodGroupTemplate. + // This field is immutable. + SchedulingPolicy *CompositePodGroupSchedulingPolicyApplyConfiguration `json:"schedulingPolicy,omitempty"` + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this CompositePodGroup. + // Controllers are expected to fill this field by copying it from a CompositePodGroupTemplate. + // This field is immutable. + SchedulingConstraints *CompositePodGroupSchedulingConstraintsApplyConfiguration `json:"schedulingConstraints,omitempty"` + // disruptionMode defines the mode in which a given CompositePodGroup can be disrupted. + // Controllers are expected to fill this field by copying it from a CompositePodGroupTemplate. + // One of Single, All. Defaults to Single if unset. + // This field is immutable. + DisruptionMode *CompositeDisruptionModeApplyConfiguration `json:"disruptionMode,omitempty"` + // priorityClassName defines the priority that should be considered when scheduling this CompositePodGroup. + // Controllers are expected to fill this field by copying it from a CompositePodGroupTemplate. + // If left unspecified, it is validated and resolved similarly to the PriorityClassName field in Pods + // (i.e. if no priority class is specified, admission control can set this to the global default + // priority class if it exists. Otherwise, the composite pod group's priority will be zero). + // This field is immutable. + PriorityClassName *string `json:"priorityClassName,omitempty"` + // priority is the value of priority of this composite pod group. Various system components + // use this field to find the priority of the composite pod group. When Priority Admission + // Controller is enabled, it prevents users from setting this field. The admission + // controller populates this field from PriorityClassName. + // The higher the value, the higher the priority. + // This field is immutable. + Priority *int32 `json:"priority,omitempty"` + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. + // When Priority Admission Controller is enabled, it populates this field from PriorityClassName, + // and defaults to PreemptLowerPriority if value is unset in PriorityClass. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + PreemptionPolicy *schedulingv1alpha3.PreemptionPolicy `json:"preemptionPolicy,omitempty"` +} + +// CompositePodGroupSpecApplyConfiguration constructs a declarative configuration of the CompositePodGroupSpec type for use with +// apply. +func CompositePodGroupSpec() *CompositePodGroupSpecApplyConfiguration { + return &CompositePodGroupSpecApplyConfiguration{} +} + +// WithParentCompositePodGroupName sets the ParentCompositePodGroupName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ParentCompositePodGroupName field is set to the value of the last call. +func (b *CompositePodGroupSpecApplyConfiguration) WithParentCompositePodGroupName(value string) *CompositePodGroupSpecApplyConfiguration { + b.ParentCompositePodGroupName = &value + return b +} + +// WithWorkloadRef sets the WorkloadRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the WorkloadRef field is set to the value of the last call. +func (b *CompositePodGroupSpecApplyConfiguration) WithWorkloadRef(value *WorkloadReferenceApplyConfiguration) *CompositePodGroupSpecApplyConfiguration { + b.WorkloadRef = value + return b +} + +// WithSchedulingPolicy sets the SchedulingPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SchedulingPolicy field is set to the value of the last call. +func (b *CompositePodGroupSpecApplyConfiguration) WithSchedulingPolicy(value *CompositePodGroupSchedulingPolicyApplyConfiguration) *CompositePodGroupSpecApplyConfiguration { + b.SchedulingPolicy = value + return b +} + +// WithSchedulingConstraints sets the SchedulingConstraints field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SchedulingConstraints field is set to the value of the last call. +func (b *CompositePodGroupSpecApplyConfiguration) WithSchedulingConstraints(value *CompositePodGroupSchedulingConstraintsApplyConfiguration) *CompositePodGroupSpecApplyConfiguration { + b.SchedulingConstraints = value + return b +} + +// WithDisruptionMode sets the DisruptionMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DisruptionMode field is set to the value of the last call. +func (b *CompositePodGroupSpecApplyConfiguration) WithDisruptionMode(value *CompositeDisruptionModeApplyConfiguration) *CompositePodGroupSpecApplyConfiguration { + b.DisruptionMode = value + return b +} + +// WithPriorityClassName sets the PriorityClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PriorityClassName field is set to the value of the last call. +func (b *CompositePodGroupSpecApplyConfiguration) WithPriorityClassName(value string) *CompositePodGroupSpecApplyConfiguration { + b.PriorityClassName = &value + return b +} + +// WithPriority sets the Priority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Priority field is set to the value of the last call. +func (b *CompositePodGroupSpecApplyConfiguration) WithPriority(value int32) *CompositePodGroupSpecApplyConfiguration { + b.Priority = &value + return b +} + +// WithPreemptionPolicy sets the PreemptionPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PreemptionPolicy field is set to the value of the last call. +func (b *CompositePodGroupSpecApplyConfiguration) WithPreemptionPolicy(value schedulingv1alpha3.PreemptionPolicy) *CompositePodGroupSpecApplyConfiguration { + b.PreemptionPolicy = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositepodgroupstatus.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositepodgroupstatus.go new file mode 100644 index 0000000000..7c96916526 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositepodgroupstatus.go @@ -0,0 +1,72 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// CompositePodGroupStatusApplyConfiguration represents a declarative configuration of the CompositePodGroupStatus type for use +// with apply. +// +// CompositePodGroupStatus represents information about the status of a composite pod group. +type CompositePodGroupStatusApplyConfiguration struct { + // conditions represent the latest observations of the CompositePodGroup's state. + // + // Known condition types: + // - "CompositePodGroupInitiallyScheduled": Indicates whether the overall scheduling requirement + // for the subtree under this CompositePodGroup has been satisfied. Once this condition + // transitions to True, it serves as a terminal state and will never revert to False, + // even if pods are subsequently deleted and group constraints are no longer met. + // - "DisruptionTarget": Indicates whether the CompositePodGroup is about to be terminated + // due to disruption such as preemption. + // + // Known reasons for the CompositePodGroupInitiallyScheduled condition: + // - "Unschedulable": The CompositePodGroup's subtree could not be placed due to resource constraints, + // affinity/anti-affinity, or topological constraints. + // - "SchedulerError": The CompositePodGroup cannot be scheduled due to some internal error + // that occurred during scheduling. + // - "Invalid": Set to True when kube-scheduler detects an invalid group layout during + // runtime validation. The `message` field details the specific layout violation (such as + // a detected cycle, exceeding the maximum depth of 4, or referencing multiple distinct Workloads). + // + // Known reasons for the DisruptionTarget condition: + // - "PreemptionByScheduler": The CompositePodGroup was targeted by the scheduler's preemption loop + // to free up capacity for higher-priority preemptors. + Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` +} + +// CompositePodGroupStatusApplyConfiguration constructs a declarative configuration of the CompositePodGroupStatus type for use with +// apply. +func CompositePodGroupStatus() *CompositePodGroupStatusApplyConfiguration { + return &CompositePodGroupStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *CompositePodGroupStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *CompositePodGroupStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositepodgrouptemplate.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositepodgrouptemplate.go new file mode 100644 index 0000000000..fd8aadc2ed --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/compositepodgrouptemplate.go @@ -0,0 +1,157 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" +) + +// CompositePodGroupTemplateApplyConfiguration represents a declarative configuration of the CompositePodGroupTemplate type for use +// with apply. +// +// CompositePodGroupTemplate represents a template for a CompositePodGroup with a scheduling policy. +type CompositePodGroupTemplateApplyConfiguration struct { + // name is a unique identifier for the CompositePodGroupTemplate within the Workload. + // It must be a DNS label. This field is required. + Name *string `json:"name,omitempty"` + // schedulingPolicy defines the scheduling policy for this template. + SchedulingPolicy *CompositePodGroupSchedulingPolicyApplyConfiguration `json:"schedulingPolicy,omitempty"` + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this CompositePodGroupTemplate. + // This field is immutable. + SchedulingConstraints *CompositePodGroupSchedulingConstraintsApplyConfiguration `json:"schedulingConstraints,omitempty"` + // disruptionMode defines the mode in which a given CompositePodGroup can be disrupted. + // One of Single, All. + // This field is immutable. + DisruptionMode *CompositeDisruptionModeApplyConfiguration `json:"disruptionMode,omitempty"` + // priorityClassName indicates the priority that should be considered when scheduling + // a composite pod group created from this template. If no priority class is specified, + // admission control can set this to the global default priority class if it exists. + // Otherwise, composite pod groups created from this template will have the priority set + // to zero. + // This field is immutable. + PriorityClassName *string `json:"priorityClassName,omitempty"` + // priority is the value of priority of composite pod groups created from this template. + // Various system components use this field to find the priority of the composite pod group. + // When Priority Admission Controller is enabled, it prevents users from setting this field. + // The admission controller populates this field from PriorityClassName. + // The higher the value, the higher the priority. + // This field is immutable. + Priority *int32 `json:"priority,omitempty"` + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + PreemptionPolicy *schedulingv1alpha3.PreemptionPolicy `json:"preemptionPolicy,omitempty"` + // podGroupTemplates is the list of templates for children PodGroups. + // The maximum number of templates is 8. At least one entry in CompositePodGroupTemplates + // or PodGroupTemplates must be set. + PodGroupTemplates []PodGroupTemplateApplyConfiguration `json:"podGroupTemplates,omitempty"` + // compositePodGroupTemplates is the list of templates for children CompositePodGroups. + // The maximum number of templates is 8. At least one entry in CompositePodGroupTemplates + // or PodGroupTemplates must be set. + CompositePodGroupTemplates []CompositePodGroupTemplateApplyConfiguration `json:"compositePodGroupTemplates,omitempty"` +} + +// CompositePodGroupTemplateApplyConfiguration constructs a declarative configuration of the CompositePodGroupTemplate type for use with +// apply. +func CompositePodGroupTemplate() *CompositePodGroupTemplateApplyConfiguration { + return &CompositePodGroupTemplateApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *CompositePodGroupTemplateApplyConfiguration) WithName(value string) *CompositePodGroupTemplateApplyConfiguration { + b.Name = &value + return b +} + +// WithSchedulingPolicy sets the SchedulingPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SchedulingPolicy field is set to the value of the last call. +func (b *CompositePodGroupTemplateApplyConfiguration) WithSchedulingPolicy(value *CompositePodGroupSchedulingPolicyApplyConfiguration) *CompositePodGroupTemplateApplyConfiguration { + b.SchedulingPolicy = value + return b +} + +// WithSchedulingConstraints sets the SchedulingConstraints field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SchedulingConstraints field is set to the value of the last call. +func (b *CompositePodGroupTemplateApplyConfiguration) WithSchedulingConstraints(value *CompositePodGroupSchedulingConstraintsApplyConfiguration) *CompositePodGroupTemplateApplyConfiguration { + b.SchedulingConstraints = value + return b +} + +// WithDisruptionMode sets the DisruptionMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DisruptionMode field is set to the value of the last call. +func (b *CompositePodGroupTemplateApplyConfiguration) WithDisruptionMode(value *CompositeDisruptionModeApplyConfiguration) *CompositePodGroupTemplateApplyConfiguration { + b.DisruptionMode = value + return b +} + +// WithPriorityClassName sets the PriorityClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PriorityClassName field is set to the value of the last call. +func (b *CompositePodGroupTemplateApplyConfiguration) WithPriorityClassName(value string) *CompositePodGroupTemplateApplyConfiguration { + b.PriorityClassName = &value + return b +} + +// WithPriority sets the Priority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Priority field is set to the value of the last call. +func (b *CompositePodGroupTemplateApplyConfiguration) WithPriority(value int32) *CompositePodGroupTemplateApplyConfiguration { + b.Priority = &value + return b +} + +// WithPreemptionPolicy sets the PreemptionPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PreemptionPolicy field is set to the value of the last call. +func (b *CompositePodGroupTemplateApplyConfiguration) WithPreemptionPolicy(value schedulingv1alpha3.PreemptionPolicy) *CompositePodGroupTemplateApplyConfiguration { + b.PreemptionPolicy = &value + return b +} + +// WithPodGroupTemplates adds the given value to the PodGroupTemplates field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PodGroupTemplates field. +func (b *CompositePodGroupTemplateApplyConfiguration) WithPodGroupTemplates(values ...*PodGroupTemplateApplyConfiguration) *CompositePodGroupTemplateApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPodGroupTemplates") + } + b.PodGroupTemplates = append(b.PodGroupTemplates, *values[i]) + } + return b +} + +// WithCompositePodGroupTemplates adds the given value to the CompositePodGroupTemplates field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CompositePodGroupTemplates field. +func (b *CompositePodGroupTemplateApplyConfiguration) WithCompositePodGroupTemplates(values ...*CompositePodGroupTemplateApplyConfiguration) *CompositePodGroupTemplateApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithCompositePodGroupTemplates") + } + b.CompositePodGroupTemplates = append(b.CompositePodGroupTemplates, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/disruptionmode.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/disruptionmode.go new file mode 100644 index 0000000000..b500fd3600 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/disruptionmode.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" +) + +// DisruptionModeApplyConfiguration represents a declarative configuration of the DisruptionMode type for use +// with apply. +// +// DisruptionMode defines how individual entities within a group can be disrupted. +// Exactly one mode can be set. +type DisruptionModeApplyConfiguration struct { + // single specifies that children can be disrupted independently from each other. + Single *schedulingv1alpha3.SingleDisruptionMode `json:"single,omitempty"` + // all specifies that all children can only be disrupted together. + All *schedulingv1alpha3.AllDisruptionMode `json:"all,omitempty"` +} + +// DisruptionModeApplyConfiguration constructs a declarative configuration of the DisruptionMode type for use with +// apply. +func DisruptionMode() *DisruptionModeApplyConfiguration { + return &DisruptionModeApplyConfiguration{} +} + +// WithSingle sets the Single field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Single field is set to the value of the last call. +func (b *DisruptionModeApplyConfiguration) WithSingle(value schedulingv1alpha3.SingleDisruptionMode) *DisruptionModeApplyConfiguration { + b.Single = &value + return b +} + +// WithAll sets the All field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the All field is set to the value of the last call. +func (b *DisruptionModeApplyConfiguration) WithAll(value schedulingv1alpha3.AllDisruptionMode) *DisruptionModeApplyConfiguration { + b.All = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/gangschedulingpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/gangschedulingpolicy.go new file mode 100644 index 0000000000..f0d3561ba4 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/gangschedulingpolicy.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// GangSchedulingPolicyApplyConfiguration represents a declarative configuration of the GangSchedulingPolicy type for use +// with apply. +// +// GangSchedulingPolicy defines the parameters for gang scheduling. +type GangSchedulingPolicyApplyConfiguration struct { + // minCount is the minimum number of pods that must be schedulable or scheduled + // at the same time for the scheduler to admit the entire group. + // It must be a positive integer. This field is mutable to support workload scaling. + // + // Note that the scheduler operates on an eventually consistent model. Updates + // to minCount may not be immediately reflected in scheduling decisions due to + // propagation delays. If minCount is updated while a scheduling cycle is in + // progress for that group, the new value may not take effect until the next + // cycle. Moreover, minCount is only enforced during scheduling, meaning that + // modifications to this field do not affect already-scheduled pods, applying + // only to those evaluated in future cycles. + MinCount *int32 `json:"minCount,omitempty"` +} + +// GangSchedulingPolicyApplyConfiguration constructs a declarative configuration of the GangSchedulingPolicy type for use with +// apply. +func GangSchedulingPolicy() *GangSchedulingPolicyApplyConfiguration { + return &GangSchedulingPolicyApplyConfiguration{} +} + +// WithMinCount sets the MinCount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinCount field is set to the value of the last call. +func (b *GangSchedulingPolicyApplyConfiguration) WithMinCount(value int32) *GangSchedulingPolicyApplyConfiguration { + b.MinCount = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroup.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroup.go similarity index 95% rename from vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroup.go rename to vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroup.go index ee28510624..4970d44cb9 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroup.go +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroup.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2" + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" @@ -35,13 +35,13 @@ import ( // Workload.podGroupTemplates. // PodGroup API enablement is toggled by the GenericWorkload feature gate. type PodGroupApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Spec defines the desired state of the PodGroup. + // spec defines the desired state of the PodGroup. Spec *PodGroupSpecApplyConfiguration `json:"spec,omitempty"` - // Status represents the current observed state of the PodGroup. + // status represents the current observed state of the PodGroup. Status *PodGroupStatusApplyConfiguration `json:"status,omitempty"` } @@ -52,7 +52,7 @@ func PodGroup(name, namespace string) *PodGroupApplyConfiguration { b.WithName(name) b.WithNamespace(namespace) b.WithKind("PodGroup") - b.WithAPIVersion("scheduling.k8s.io/v1alpha2") + b.WithAPIVersion("scheduling.k8s.io/v1alpha3") return b } @@ -63,9 +63,9 @@ func PodGroup(name, namespace string) *PodGroupApplyConfiguration { // ExtractPodGroupFrom provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. -func ExtractPodGroupFrom(podGroup *schedulingv1alpha2.PodGroup, fieldManager string, subresource string) (*PodGroupApplyConfiguration, error) { +func ExtractPodGroupFrom(podGroup *schedulingv1alpha3.PodGroup, fieldManager string, subresource string) (*PodGroupApplyConfiguration, error) { b := &PodGroupApplyConfiguration{} - err := managedfields.ExtractInto(podGroup, internal.Parser().Type("io.k8s.api.scheduling.v1alpha2.PodGroup"), fieldManager, b, subresource) + err := managedfields.ExtractInto(podGroup, internal.Parser().Type("io.k8s.api.scheduling.v1alpha3.PodGroup"), fieldManager, b, subresource) if err != nil { return nil, err } @@ -73,7 +73,7 @@ func ExtractPodGroupFrom(podGroup *schedulingv1alpha2.PodGroup, fieldManager str b.WithNamespace(podGroup.Namespace) b.WithKind("PodGroup") - b.WithAPIVersion("scheduling.k8s.io/v1alpha2") + b.WithAPIVersion("scheduling.k8s.io/v1alpha3") return b, nil } @@ -87,13 +87,13 @@ func ExtractPodGroupFrom(podGroup *schedulingv1alpha2.PodGroup, fieldManager str // ExtractPodGroup provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. -func ExtractPodGroup(podGroup *schedulingv1alpha2.PodGroup, fieldManager string) (*PodGroupApplyConfiguration, error) { +func ExtractPodGroup(podGroup *schedulingv1alpha3.PodGroup, fieldManager string) (*PodGroupApplyConfiguration, error) { return ExtractPodGroupFrom(podGroup, fieldManager, "") } // ExtractPodGroupStatus extracts the applied configuration owned by fieldManager from // podGroup for the status subresource. -func ExtractPodGroupStatus(podGroup *schedulingv1alpha2.PodGroup, fieldManager string) (*PodGroupApplyConfiguration, error) { +func ExtractPodGroupStatus(podGroup *schedulingv1alpha3.PodGroup, fieldManager string) (*PodGroupApplyConfiguration, error) { return ExtractPodGroupFrom(podGroup, fieldManager, "status") } diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroupresourceclaim.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroupresourceclaim.go similarity index 95% rename from vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroupresourceclaim.go rename to vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroupresourceclaim.go index a7b21b530b..cb132a07d6 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroupresourceclaim.go +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroupresourceclaim.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // PodGroupResourceClaimApplyConfiguration represents a declarative configuration of the PodGroupResourceClaim type for use // with apply. @@ -30,17 +30,17 @@ package v1alpha2 // own Spec.ResourceClaims. The Pod's claim must match all fields of the // PodGroup's claim exactly. type PodGroupResourceClaimApplyConfiguration struct { - // Name uniquely identifies this resource claim inside the PodGroup. + // name uniquely identifies this resource claim inside the PodGroup. // This must be a DNS_LABEL. Name *string `json:"name,omitempty"` - // ResourceClaimName is the name of a ResourceClaim object in the same + // resourceClaimName is the name of a ResourceClaim object in the same // namespace as this PodGroup. The ResourceClaim will be reserved for the // PodGroup instead of its individual pods. // // Exactly one of ResourceClaimName and ResourceClaimTemplateName must // be set. ResourceClaimName *string `json:"resourceClaimName,omitempty"` - // ResourceClaimTemplateName is the name of a ResourceClaimTemplate + // resourceClaimTemplateName is the name of a ResourceClaimTemplate // object in the same namespace as this PodGroup. // // The template will be used to create a new ResourceClaim, which will diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroupresourceclaimstatus.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroupresourceclaimstatus.go similarity index 94% rename from vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroupresourceclaimstatus.go rename to vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroupresourceclaimstatus.go index 5f8498b13e..e3250d82d8 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroupresourceclaimstatus.go +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroupresourceclaimstatus.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // PodGroupResourceClaimStatusApplyConfiguration represents a declarative configuration of the PodGroupResourceClaimStatus type for use // with apply. @@ -25,11 +25,11 @@ package v1alpha2 // PodGroupResourceClaim which references a ResourceClaimTemplate. It stores the // generated name for the corresponding ResourceClaim. type PodGroupResourceClaimStatusApplyConfiguration struct { - // Name uniquely identifies this resource claim inside the PodGroup. This + // name uniquely identifies this resource claim inside the PodGroup. This // must match the name of an entry in podgroup.spec.resourceClaims, which // implies that the string must be a DNS_LABEL. Name *string `json:"name,omitempty"` - // ResourceClaimName is the name of the ResourceClaim that was generated for + // resourceClaimName is the name of the ResourceClaim that was generated for // the PodGroup in the namespace of the PodGroup. If this is unset, then // generating a ResourceClaim was not necessary. The // podgroup.spec.resourceClaims entry can be ignored in this case. diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroupschedulingconstraints.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroupschedulingconstraints.go similarity index 96% rename from vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroupschedulingconstraints.go rename to vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroupschedulingconstraints.go index eda72ea50e..5dadef14bf 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroupschedulingconstraints.go +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroupschedulingconstraints.go @@ -16,14 +16,14 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // PodGroupSchedulingConstraintsApplyConfiguration represents a declarative configuration of the PodGroupSchedulingConstraints type for use // with apply. // // PodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a PodGroup. type PodGroupSchedulingConstraintsApplyConfiguration struct { - // Topology defines the topology constraints for the pod group. + // topology defines the topology constraints for the pod group. // Currently only a single topology constraint can be specified. This may change in the future. Topology []TopologyConstraintApplyConfiguration `json:"topology,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroupschedulingpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroupschedulingpolicy.go similarity index 67% rename from vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroupschedulingpolicy.go rename to vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroupschedulingpolicy.go index 02be5f27eb..67232d1925 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroupschedulingpolicy.go +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroupschedulingpolicy.go @@ -16,23 +16,28 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2" + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" ) // PodGroupSchedulingPolicyApplyConfiguration represents a declarative configuration of the PodGroupSchedulingPolicy type for use // with apply. // // PodGroupSchedulingPolicy defines the scheduling configuration for a PodGroup. -// Exactly one policy must be set. +// Exactly one policy must be set. The policy is chosen at creation time by setting either the +// Basic or Gang field. The PodGroup may not change policy after creation. +// Fields within chosen policy may be updated after creation when their individual fields allow it. type PodGroupSchedulingPolicyApplyConfiguration struct { - // Basic specifies that the pods in this group should be scheduled using - // standard Kubernetes scheduling behavior. - Basic *schedulingv1alpha2.BasicSchedulingPolicy `json:"basic,omitempty"` - // Gang specifies that the pods in this group should be scheduled using - // all-or-nothing semantics. + // basic specifies that the pods in this group should be scheduled using + // standard Kubernetes scheduling behavior. Setting this field at group creation time + // opts this group to basic scheduling; this field cannot be changed afterward. + Basic *schedulingv1alpha3.BasicSchedulingPolicy `json:"basic,omitempty"` + // gang specifies that the pods in this group should be scheduled using + // all-or-nothing semantics. Setting this field at group creation time + // opts this group to gang scheduling; this field cannot be set or unset afterward. + // The minCount field within Gang scheduling policy remains mutable after group creation. Gang *GangSchedulingPolicyApplyConfiguration `json:"gang,omitempty"` } @@ -45,7 +50,7 @@ func PodGroupSchedulingPolicy() *PodGroupSchedulingPolicyApplyConfiguration { // WithBasic sets the Basic field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Basic field is set to the value of the last call. -func (b *PodGroupSchedulingPolicyApplyConfiguration) WithBasic(value schedulingv1alpha2.BasicSchedulingPolicy) *PodGroupSchedulingPolicyApplyConfiguration { +func (b *PodGroupSchedulingPolicyApplyConfiguration) WithBasic(value schedulingv1alpha3.BasicSchedulingPolicy) *PodGroupSchedulingPolicyApplyConfiguration { b.Basic = &value return b } diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroupspec.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroupspec.go new file mode 100644 index 0000000000..5ca2ee1aba --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroupspec.go @@ -0,0 +1,168 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" +) + +// PodGroupSpecApplyConfiguration represents a declarative configuration of the PodGroupSpec type for use +// with apply. +// +// PodGroupSpec defines the desired state of a PodGroup. +type PodGroupSpecApplyConfiguration struct { + // parentCompositePodGroupName contains the name of the parent composite pod group + // within the same namespace as this pod group. + // If it's nil, then this pod group is a root of a workload's hierarchy. + // This field is used only when the CompositePodGroup feature gate is enabled. + // This field is immutable. + ParentCompositePodGroupName *string `json:"parentCompositePodGroupName,omitempty"` + // workloadRef references an optional PodGroup template within the Workload + // object that was used to create the PodGroup. + // This field is immutable. + WorkloadRef *WorkloadReferenceApplyConfiguration `json:"workloadRef,omitempty"` + // schedulingPolicy defines the scheduling policy for this instance of the PodGroup. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + SchedulingPolicy *PodGroupSchedulingPolicyApplyConfiguration `json:"schedulingPolicy,omitempty"` + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroup. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // This field is immutable. + // This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. + SchedulingConstraints *PodGroupSchedulingConstraintsApplyConfiguration `json:"schedulingConstraints,omitempty"` + // resourceClaims defines which ResourceClaims may be shared among Pods in + // the group. Pods consume the devices allocated to a PodGroup's claim by + // defining a claim in its own Spec.ResourceClaims that matches the + // PodGroup's claim exactly. The claim must have the same name and refer to + // the same ResourceClaim or ResourceClaimTemplate. + // + // This is a beta-level field and requires that the + // DRAWorkloadResourceClaims feature gate is enabled. + // + // This field is immutable. + ResourceClaims []PodGroupResourceClaimApplyConfiguration `json:"resourceClaims,omitempty"` + // disruptionMode defines the mode in which a given PodGroup can be disrupted. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // One of Single, All. Defaults to Single if unset. + // This field is immutable. + DisruptionMode *DisruptionModeApplyConfiguration `json:"disruptionMode,omitempty"` + // priorityClassName defines the priority that should be considered when scheduling this pod group. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // Otherwise, it is validated and resolved similarly to the PriorityClassName on PodGroupTemplate + // (i.e. if no priority class is specified, admission control can set this to the global default + // priority class if it exists. Otherwise, the pod group's priority will be zero). + // This field is immutable. + PriorityClassName *string `json:"priorityClassName,omitempty"` + // priority is the value of priority of this pod group. Various system components + // use this field to find the priority of the pod group. When Priority Admission + // Controller is enabled, it prevents users from setting this field. The admission + // controller populates this field from PriorityClassName. + // The higher the value, the higher the priority. + // This field is immutable. + Priority *int32 `json:"priority,omitempty"` + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. + // When Priority Admission Controller is enabled, it populates this field from PriorityClassName, + // and defaults to PreemptLowerPriority if value is unset in PriorityClass. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + PreemptionPolicy *schedulingv1alpha3.PreemptionPolicy `json:"preemptionPolicy,omitempty"` +} + +// PodGroupSpecApplyConfiguration constructs a declarative configuration of the PodGroupSpec type for use with +// apply. +func PodGroupSpec() *PodGroupSpecApplyConfiguration { + return &PodGroupSpecApplyConfiguration{} +} + +// WithParentCompositePodGroupName sets the ParentCompositePodGroupName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ParentCompositePodGroupName field is set to the value of the last call. +func (b *PodGroupSpecApplyConfiguration) WithParentCompositePodGroupName(value string) *PodGroupSpecApplyConfiguration { + b.ParentCompositePodGroupName = &value + return b +} + +// WithWorkloadRef sets the WorkloadRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the WorkloadRef field is set to the value of the last call. +func (b *PodGroupSpecApplyConfiguration) WithWorkloadRef(value *WorkloadReferenceApplyConfiguration) *PodGroupSpecApplyConfiguration { + b.WorkloadRef = value + return b +} + +// WithSchedulingPolicy sets the SchedulingPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SchedulingPolicy field is set to the value of the last call. +func (b *PodGroupSpecApplyConfiguration) WithSchedulingPolicy(value *PodGroupSchedulingPolicyApplyConfiguration) *PodGroupSpecApplyConfiguration { + b.SchedulingPolicy = value + return b +} + +// WithSchedulingConstraints sets the SchedulingConstraints field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SchedulingConstraints field is set to the value of the last call. +func (b *PodGroupSpecApplyConfiguration) WithSchedulingConstraints(value *PodGroupSchedulingConstraintsApplyConfiguration) *PodGroupSpecApplyConfiguration { + b.SchedulingConstraints = value + return b +} + +// WithResourceClaims adds the given value to the ResourceClaims field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ResourceClaims field. +func (b *PodGroupSpecApplyConfiguration) WithResourceClaims(values ...*PodGroupResourceClaimApplyConfiguration) *PodGroupSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResourceClaims") + } + b.ResourceClaims = append(b.ResourceClaims, *values[i]) + } + return b +} + +// WithDisruptionMode sets the DisruptionMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DisruptionMode field is set to the value of the last call. +func (b *PodGroupSpecApplyConfiguration) WithDisruptionMode(value *DisruptionModeApplyConfiguration) *PodGroupSpecApplyConfiguration { + b.DisruptionMode = value + return b +} + +// WithPriorityClassName sets the PriorityClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PriorityClassName field is set to the value of the last call. +func (b *PodGroupSpecApplyConfiguration) WithPriorityClassName(value string) *PodGroupSpecApplyConfiguration { + b.PriorityClassName = &value + return b +} + +// WithPriority sets the Priority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Priority field is set to the value of the last call. +func (b *PodGroupSpecApplyConfiguration) WithPriority(value int32) *PodGroupSpecApplyConfiguration { + b.Priority = &value + return b +} + +// WithPreemptionPolicy sets the PreemptionPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PreemptionPolicy field is set to the value of the last call. +func (b *PodGroupSpecApplyConfiguration) WithPreemptionPolicy(value schedulingv1alpha3.PreemptionPolicy) *PodGroupSpecApplyConfiguration { + b.PreemptionPolicy = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroupstatus.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroupstatus.go new file mode 100644 index 0000000000..af0b5d31da --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgroupstatus.go @@ -0,0 +1,83 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// PodGroupStatusApplyConfiguration represents a declarative configuration of the PodGroupStatus type for use +// with apply. +// +// PodGroupStatus represents information about the status of a pod group. +type PodGroupStatusApplyConfiguration struct { + // conditions represent the latest observations of the PodGroup's state. + // + // Known condition types: + // - "PodGroupInitiallyScheduled": Indicates whether the scheduling requirement has been satisfied. + // Once this condition transitions to True, it serves as a terminal state and will never revert to False, + // even if pods are subsequently evicted and group constraints are no longer met. + // - "DisruptionTarget": Indicates whether the PodGroup is about to be terminated + // due to disruption such as preemption. + // + // Known reasons for the PodGroupInitiallyScheduled condition: + // - "Unschedulable": The PodGroup cannot be scheduled due to resource constraints, + // affinity/anti-affinity rules, or insufficient capacity for the gang. + // - "SchedulerError": The PodGroup cannot be scheduled due to some internal error + // that happened during scheduling, for example due to nodeAffinity parsing errors. + // + // Known reasons for the DisruptionTarget condition: + // - "PreemptionByScheduler": The PodGroup was preempted by the scheduler to make room for + // higher-priority PodGroups or Pods. + Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` + // resourceClaimStatuses is status of resource claims. + ResourceClaimStatuses []PodGroupResourceClaimStatusApplyConfiguration `json:"resourceClaimStatuses,omitempty"` +} + +// PodGroupStatusApplyConfiguration constructs a declarative configuration of the PodGroupStatus type for use with +// apply. +func PodGroupStatus() *PodGroupStatusApplyConfiguration { + return &PodGroupStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *PodGroupStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *PodGroupStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithResourceClaimStatuses adds the given value to the ResourceClaimStatuses field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ResourceClaimStatuses field. +func (b *PodGroupStatusApplyConfiguration) WithResourceClaimStatuses(values ...*PodGroupResourceClaimStatusApplyConfiguration) *PodGroupStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResourceClaimStatuses") + } + b.ResourceClaimStatuses = append(b.ResourceClaimStatuses, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgrouptemplate.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgrouptemplate.go new file mode 100644 index 0000000000..b004ac0b32 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/podgrouptemplate.go @@ -0,0 +1,143 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" +) + +// PodGroupTemplateApplyConfiguration represents a declarative configuration of the PodGroupTemplate type for use +// with apply. +// +// PodGroupTemplate represents a template for a set of pods with a scheduling policy. +type PodGroupTemplateApplyConfiguration struct { + // name is a unique identifier for the PodGroupTemplate within the Workload. + // It must be a DNS label. This field is immutable. + Name *string `json:"name,omitempty"` + // schedulingPolicy defines the scheduling policy for this PodGroupTemplate. + SchedulingPolicy *PodGroupSchedulingPolicyApplyConfiguration `json:"schedulingPolicy,omitempty"` + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroupTemplate. + // This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. + // This field is immutable. + SchedulingConstraints *PodGroupSchedulingConstraintsApplyConfiguration `json:"schedulingConstraints,omitempty"` + // resourceClaims defines which ResourceClaims may be shared among Pods in + // the group. Pods consume the devices allocated to a PodGroup's claim by + // defining a claim in its own Spec.ResourceClaims that matches the + // PodGroup's claim exactly. The claim must have the same name and refer to + // the same ResourceClaim or ResourceClaimTemplate. + // + // This is a beta-level field and requires that the + // DRAWorkloadResourceClaims feature gate is enabled. + // + // This field is immutable. + ResourceClaims []PodGroupResourceClaimApplyConfiguration `json:"resourceClaims,omitempty"` + // disruptionMode defines the mode in which a given PodGroup can be disrupted. + // One of Single, All. + // This field is immutable. + DisruptionMode *DisruptionModeApplyConfiguration `json:"disruptionMode,omitempty"` + // priorityClassName indicates the priority that should be considered when scheduling + // a pod group created from this template. + // This field is immutable. + PriorityClassName *string `json:"priorityClassName,omitempty"` + // priority is the value of priority of pod groups created from this template. Various + // system components use this field to find the priority of the pod group. + // The higher the value, the higher the priority. + // This field is immutable. + Priority *int32 `json:"priority,omitempty"` + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + PreemptionPolicy *schedulingv1alpha3.PreemptionPolicy `json:"preemptionPolicy,omitempty"` +} + +// PodGroupTemplateApplyConfiguration constructs a declarative configuration of the PodGroupTemplate type for use with +// apply. +func PodGroupTemplate() *PodGroupTemplateApplyConfiguration { + return &PodGroupTemplateApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PodGroupTemplateApplyConfiguration) WithName(value string) *PodGroupTemplateApplyConfiguration { + b.Name = &value + return b +} + +// WithSchedulingPolicy sets the SchedulingPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SchedulingPolicy field is set to the value of the last call. +func (b *PodGroupTemplateApplyConfiguration) WithSchedulingPolicy(value *PodGroupSchedulingPolicyApplyConfiguration) *PodGroupTemplateApplyConfiguration { + b.SchedulingPolicy = value + return b +} + +// WithSchedulingConstraints sets the SchedulingConstraints field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SchedulingConstraints field is set to the value of the last call. +func (b *PodGroupTemplateApplyConfiguration) WithSchedulingConstraints(value *PodGroupSchedulingConstraintsApplyConfiguration) *PodGroupTemplateApplyConfiguration { + b.SchedulingConstraints = value + return b +} + +// WithResourceClaims adds the given value to the ResourceClaims field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ResourceClaims field. +func (b *PodGroupTemplateApplyConfiguration) WithResourceClaims(values ...*PodGroupResourceClaimApplyConfiguration) *PodGroupTemplateApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResourceClaims") + } + b.ResourceClaims = append(b.ResourceClaims, *values[i]) + } + return b +} + +// WithDisruptionMode sets the DisruptionMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DisruptionMode field is set to the value of the last call. +func (b *PodGroupTemplateApplyConfiguration) WithDisruptionMode(value *DisruptionModeApplyConfiguration) *PodGroupTemplateApplyConfiguration { + b.DisruptionMode = value + return b +} + +// WithPriorityClassName sets the PriorityClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PriorityClassName field is set to the value of the last call. +func (b *PodGroupTemplateApplyConfiguration) WithPriorityClassName(value string) *PodGroupTemplateApplyConfiguration { + b.PriorityClassName = &value + return b +} + +// WithPriority sets the Priority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Priority field is set to the value of the last call. +func (b *PodGroupTemplateApplyConfiguration) WithPriority(value int32) *PodGroupTemplateApplyConfiguration { + b.Priority = &value + return b +} + +// WithPreemptionPolicy sets the PreemptionPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PreemptionPolicy field is set to the value of the last call. +func (b *PodGroupTemplateApplyConfiguration) WithPreemptionPolicy(value schedulingv1alpha3.PreemptionPolicy) *PodGroupTemplateApplyConfiguration { + b.PreemptionPolicy = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/topologyconstraint.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/topologyconstraint.go similarity index 95% rename from vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/topologyconstraint.go rename to vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/topologyconstraint.go index 92727eb2bb..b1c4f26389 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/topologyconstraint.go +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/topologyconstraint.go @@ -16,14 +16,14 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // TopologyConstraintApplyConfiguration represents a declarative configuration of the TopologyConstraint type for use // with apply. // // TopologyConstraint defines a topology constraint for a PodGroup. type TopologyConstraintApplyConfiguration struct { - // Key specifies the key of the node label representing the topology domain. + // key specifies the key of the node label representing the topology domain. // All pods within the PodGroup must be colocated within the same domain instance. // Different PodGroups can land on different domain instances even if they derive from the same PodGroupTemplate. // Examples: "topology.kubernetes.io/rack" diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/typedlocalobjectreference.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/typedlocalobjectreference.go similarity index 94% rename from vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/typedlocalobjectreference.go rename to vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/typedlocalobjectreference.go index cfbbc48e07..e8303eb66e 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/typedlocalobjectreference.go +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/typedlocalobjectreference.go @@ -16,22 +16,22 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // TypedLocalObjectReferenceApplyConfiguration represents a declarative configuration of the TypedLocalObjectReference type for use // with apply. // // TypedLocalObjectReference allows to reference typed object inside the same namespace. type TypedLocalObjectReferenceApplyConfiguration struct { - // APIGroup is the group for the resource being referenced. + // apiGroup is the group for the resource being referenced. // If APIGroup is empty, the specified Kind must be in the core API group. // For any other third-party types, setting APIGroup is required. // It must be a DNS subdomain. APIGroup *string `json:"apiGroup,omitempty"` - // Kind is the type of resource being referenced. + // kind is the type of resource being referenced. // It must be a path segment name. Kind *string `json:"kind,omitempty"` - // Name is the name of resource being referenced. + // name is the name of resource being referenced. // It must be a path segment name. Name *string `json:"name,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/workload.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workload.go similarity index 96% rename from vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/workload.go rename to vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workload.go index 787095d238..6088ead036 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/workload.go +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workload.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2" + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" @@ -35,11 +35,11 @@ import ( // including scheduling, preemption, eviction and other phases. // Workload API enablement is toggled by the GenericWorkload feature gate. type WorkloadApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Spec defines the desired behavior of a Workload. + // spec defines the desired behavior of a Workload. Spec *WorkloadSpecApplyConfiguration `json:"spec,omitempty"` } @@ -50,7 +50,7 @@ func Workload(name, namespace string) *WorkloadApplyConfiguration { b.WithName(name) b.WithNamespace(namespace) b.WithKind("Workload") - b.WithAPIVersion("scheduling.k8s.io/v1alpha2") + b.WithAPIVersion("scheduling.k8s.io/v1alpha3") return b } @@ -61,9 +61,9 @@ func Workload(name, namespace string) *WorkloadApplyConfiguration { // ExtractWorkloadFrom provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. -func ExtractWorkloadFrom(workload *schedulingv1alpha2.Workload, fieldManager string, subresource string) (*WorkloadApplyConfiguration, error) { +func ExtractWorkloadFrom(workload *schedulingv1alpha3.Workload, fieldManager string, subresource string) (*WorkloadApplyConfiguration, error) { b := &WorkloadApplyConfiguration{} - err := managedfields.ExtractInto(workload, internal.Parser().Type("io.k8s.api.scheduling.v1alpha2.Workload"), fieldManager, b, subresource) + err := managedfields.ExtractInto(workload, internal.Parser().Type("io.k8s.api.scheduling.v1alpha3.Workload"), fieldManager, b, subresource) if err != nil { return nil, err } @@ -71,7 +71,7 @@ func ExtractWorkloadFrom(workload *schedulingv1alpha2.Workload, fieldManager str b.WithNamespace(workload.Namespace) b.WithKind("Workload") - b.WithAPIVersion("scheduling.k8s.io/v1alpha2") + b.WithAPIVersion("scheduling.k8s.io/v1alpha3") return b, nil } @@ -85,7 +85,7 @@ func ExtractWorkloadFrom(workload *schedulingv1alpha2.Workload, fieldManager str // ExtractWorkload provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. -func ExtractWorkload(workload *schedulingv1alpha2.Workload, fieldManager string) (*WorkloadApplyConfiguration, error) { +func ExtractWorkload(workload *schedulingv1alpha3.Workload, fieldManager string) (*WorkloadApplyConfiguration, error) { return ExtractWorkloadFrom(workload, fieldManager, "") } diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadpodgroupdisruptionmode.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadpodgroupdisruptionmode.go new file mode 100644 index 0000000000..4a524de531 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadpodgroupdisruptionmode.go @@ -0,0 +1,78 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" +) + +// WorkloadPodGroupDisruptionModeApplyConfiguration represents a declarative configuration of the WorkloadPodGroupDisruptionMode type for use +// with apply. +// +// WorkloadPodGroupDisruptionMode defines how individual pods within a +// group can be disrupted. Exactly one mode must be set. +// +// --- +// +// This is a reusable building block meant to be embedded in a controller's own +// API, next to its other scheduling fields (for example, in a Job's +// spec.scheduling). It's recommended to freeze the field after creation +// (+k8s:immutable), since the selected mode is immutable in the compiled +// Workload. For example, +// +// type JobSchedulingConfiguration struct { +// // DisruptionMode defines the mode in which the Job's pods can be disrupted. +// // One of Single, All. +// // This field is immutable after creation: it may not be added or removed, +// // and the selected mode may not be changed. +// // +optional +// // +k8s:optional +// // +k8s:immutable +// DisruptionMode *schedulingv1alpha3.WorkloadPodGroupDisruptionMode `json:"disruptionMode,omitempty" protobuf:"bytes,N,opt,name=disruptionMode"` +// +// // other scheduling fields +// } +type WorkloadPodGroupDisruptionModeApplyConfiguration struct { + // single specifies that pods can be disrupted independently from each other. + Single *schedulingv1alpha3.WorkloadPodGroupSingleDisruptionMode `json:"single,omitempty"` + // all specifies that all pods in the group must be disrupted together. + All *schedulingv1alpha3.WorkloadPodGroupAllDisruptionMode `json:"all,omitempty"` +} + +// WorkloadPodGroupDisruptionModeApplyConfiguration constructs a declarative configuration of the WorkloadPodGroupDisruptionMode type for use with +// apply. +func WorkloadPodGroupDisruptionMode() *WorkloadPodGroupDisruptionModeApplyConfiguration { + return &WorkloadPodGroupDisruptionModeApplyConfiguration{} +} + +// WithSingle sets the Single field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Single field is set to the value of the last call. +func (b *WorkloadPodGroupDisruptionModeApplyConfiguration) WithSingle(value schedulingv1alpha3.WorkloadPodGroupSingleDisruptionMode) *WorkloadPodGroupDisruptionModeApplyConfiguration { + b.Single = &value + return b +} + +// WithAll sets the All field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the All field is set to the value of the last call. +func (b *WorkloadPodGroupDisruptionModeApplyConfiguration) WithAll(value schedulingv1alpha3.WorkloadPodGroupAllDisruptionMode) *WorkloadPodGroupDisruptionModeApplyConfiguration { + b.All = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadpodgroupgangschedulingpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadpodgroupgangschedulingpolicy.go new file mode 100644 index 0000000000..4464dfc2a5 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadpodgroupgangschedulingpolicy.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// WorkloadPodGroupGangSchedulingPolicyApplyConfiguration represents a declarative configuration of the WorkloadPodGroupGangSchedulingPolicy type for use +// with apply. +// +// WorkloadPodGroupGangSchedulingPolicy defines the parameters for gang +// (all-or-nothing) scheduling. +type WorkloadPodGroupGangSchedulingPolicyApplyConfiguration struct { + // minCount is the minimum number of pods that must be scheduled + // at the same time for the scheduler to admit the entire group. + // This field is optional. If it is not specified, the controller + // should inject a context-specific sane default (e.g., + // parallelism for a Job). + // If set, it must be a positive integer. + MinCount *int32 `json:"minCount,omitempty"` +} + +// WorkloadPodGroupGangSchedulingPolicyApplyConfiguration constructs a declarative configuration of the WorkloadPodGroupGangSchedulingPolicy type for use with +// apply. +func WorkloadPodGroupGangSchedulingPolicy() *WorkloadPodGroupGangSchedulingPolicyApplyConfiguration { + return &WorkloadPodGroupGangSchedulingPolicyApplyConfiguration{} +} + +// WithMinCount sets the MinCount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinCount field is set to the value of the last call. +func (b *WorkloadPodGroupGangSchedulingPolicyApplyConfiguration) WithMinCount(value int32) *WorkloadPodGroupGangSchedulingPolicyApplyConfiguration { + b.MinCount = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadpodgroupresourceclaim.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadpodgroupresourceclaim.go new file mode 100644 index 0000000000..a34c5a2e55 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadpodgroupresourceclaim.go @@ -0,0 +1,98 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// WorkloadPodGroupResourceClaimApplyConfiguration represents a declarative configuration of the WorkloadPodGroupResourceClaim type for use +// with apply. +// +// WorkloadPodGroupResourceClaim references a dynamic resource claim +// that is shared across pods in the group. +// +// --- +// +// This is a reusable building block meant to be embedded in a controller's own +// API as a list, next to its other scheduling fields (for example, in a Job's +// spec.scheduling). It's recommended to freeze the whole list after creation +// (+k8s:immutable), since the list is immutable in the compiled Workload. For +// example, +// +// type JobSchedulingConfiguration struct { +// // ResourceClaims lists the ResourceClaims shared among the group's pods. +// // At most 4 claims may be set, matching the limit on the resulting PodGroup. +// // This list is immutable after creation: entries may neither be added, +// // removed, nor modified. +// // +optional +// // +patchMergeKey=name +// // +patchStrategy=merge +// // +listType=map +// // +listMapKey=name +// // +k8s:optional +// // +k8s:listType=map +// // +k8s:listMapKey=name +// // +k8s:maxItems=4 +// // +k8s:immutable +// ResourceClaims []schedulingv1alpha3.WorkloadPodGroupResourceClaim `json:"resourceClaims,omitempty" protobuf:"bytes,N,rep,name=resourceClaims"` +// +// // other scheduling fields +// } +type WorkloadPodGroupResourceClaimApplyConfiguration struct { + // name uniquely identifies this resource claim inside the group. + // This field is required. It must be a DNS_LABEL. + Name *string `json:"name,omitempty"` + // resourceClaimName is the name of a ResourceClaim object in the same + // namespace. + // This field is optional. If it is not specified, no resource claim + // is used. If set, it must be a DNS subdomain. + ResourceClaimName *string `json:"resourceClaimName,omitempty"` + // resourceClaimTemplateName is the name of a ResourceClaimTemplate + // object in the same namespace. + // This field is optional. If it is not specified, no resource claim + // template is used. If set, it must be a DNS subdomain. + ResourceClaimTemplateName *string `json:"resourceClaimTemplateName,omitempty"` +} + +// WorkloadPodGroupResourceClaimApplyConfiguration constructs a declarative configuration of the WorkloadPodGroupResourceClaim type for use with +// apply. +func WorkloadPodGroupResourceClaim() *WorkloadPodGroupResourceClaimApplyConfiguration { + return &WorkloadPodGroupResourceClaimApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *WorkloadPodGroupResourceClaimApplyConfiguration) WithName(value string) *WorkloadPodGroupResourceClaimApplyConfiguration { + b.Name = &value + return b +} + +// WithResourceClaimName sets the ResourceClaimName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceClaimName field is set to the value of the last call. +func (b *WorkloadPodGroupResourceClaimApplyConfiguration) WithResourceClaimName(value string) *WorkloadPodGroupResourceClaimApplyConfiguration { + b.ResourceClaimName = &value + return b +} + +// WithResourceClaimTemplateName sets the ResourceClaimTemplateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceClaimTemplateName field is set to the value of the last call. +func (b *WorkloadPodGroupResourceClaimApplyConfiguration) WithResourceClaimTemplateName(value string) *WorkloadPodGroupResourceClaimApplyConfiguration { + b.ResourceClaimTemplateName = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadpodgroupschedulingconstraints.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadpodgroupschedulingconstraints.go new file mode 100644 index 0000000000..1721ca6cbf --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadpodgroupschedulingconstraints.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// WorkloadPodGroupSchedulingConstraintsApplyConfiguration represents a declarative configuration of the WorkloadPodGroupSchedulingConstraints type for use +// with apply. +// +// WorkloadPodGroupSchedulingConstraints defines leaf-level scheduling +// constraints, such as topology. +// +// --- +// +// This is a reusable building block meant to be embedded in a controller's own +// API, next to its other scheduling fields (for example, in a Job's +// spec.scheduling). It's recommended to freeze the field after creation +// (+k8s:immutable), since constraints are immutable in the compiled Workload. +// For example, +// +// type JobSchedulingConfiguration struct { +// // SchedulingConstraints defines scheduling constraints (e.g. topology) +// // for the Job's pods. +// // This field is immutable after creation. +// // +optional +// // +k8s:optional +// // +k8s:immutable +// SchedulingConstraints *schedulingv1alpha3.WorkloadPodGroupSchedulingConstraints `json:"schedulingConstraints,omitempty" protobuf:"bytes,N,opt,name=schedulingConstraints"` +// +// // other scheduling fields +// } +type WorkloadPodGroupSchedulingConstraintsApplyConfiguration struct { + // topology specifies desired topological placements for all pods + // within the pod group. + // If unset, no topology placement is requested. + Topology []TopologyConstraintApplyConfiguration `json:"topology,omitempty"` +} + +// WorkloadPodGroupSchedulingConstraintsApplyConfiguration constructs a declarative configuration of the WorkloadPodGroupSchedulingConstraints type for use with +// apply. +func WorkloadPodGroupSchedulingConstraints() *WorkloadPodGroupSchedulingConstraintsApplyConfiguration { + return &WorkloadPodGroupSchedulingConstraintsApplyConfiguration{} +} + +// WithTopology adds the given value to the Topology field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Topology field. +func (b *WorkloadPodGroupSchedulingConstraintsApplyConfiguration) WithTopology(values ...*TopologyConstraintApplyConfiguration) *WorkloadPodGroupSchedulingConstraintsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTopology") + } + b.Topology = append(b.Topology, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadpodgroupschedulingpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadpodgroupschedulingpolicy.go new file mode 100644 index 0000000000..13a1249d88 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadpodgroupschedulingpolicy.go @@ -0,0 +1,84 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" +) + +// WorkloadPodGroupSchedulingPolicyApplyConfiguration represents a declarative configuration of the WorkloadPodGroupSchedulingPolicy type for use +// with apply. +// +// WorkloadPodGroupSchedulingPolicy defines the scheduling policy for a +// group of pods managed by a workload controller. +// Exactly one policy must be set. +// +// --- +// +// This is a reusable building block meant to be embedded in a controller's own +// API, next to its other scheduling fields (for example, in a Job's +// spec.scheduling). It's recommended to block changing the policy +// after creation, while still allowing gang.minCount to change. DV cannot +// express that only gang.minCount is mutable while the basic/gang variant is +// frozen, so the embedder must enforce variant immutability with hand-written +// validation. For example, +// +// type JobSchedulingConfiguration struct { +// // SchedulingPolicy defines the scheduling policy for this Job. +// // Exactly one of Basic or Gang must be set. +// // This field is immutable after creation: the policy may not be added or +// // removed. The policy variant (basic/gang) is frozen by the controller's +// // hand-written validation; only schedulingPolicy.gang.minCount may be changed. +// // +optional +// // +k8s:optional +// // +k8s:update=NoSet +// // +k8s:update=NoUnset +// SchedulingPolicy *schedulingv1alpha3.WorkloadPodGroupSchedulingPolicy `json:"schedulingPolicy,omitempty" protobuf:"bytes,N,opt,name=schedulingPolicy"` +// +// // other scheduling fields +// } +type WorkloadPodGroupSchedulingPolicyApplyConfiguration struct { + // basic specifies that standard, pod-by-pod Kubernetes scheduling + // behavior should be used. + Basic *schedulingv1alpha3.WorkloadPodGroupBasicSchedulingPolicy `json:"basic,omitempty"` + // gang specifies all-or-nothing scheduling semantics. + Gang *WorkloadPodGroupGangSchedulingPolicyApplyConfiguration `json:"gang,omitempty"` +} + +// WorkloadPodGroupSchedulingPolicyApplyConfiguration constructs a declarative configuration of the WorkloadPodGroupSchedulingPolicy type for use with +// apply. +func WorkloadPodGroupSchedulingPolicy() *WorkloadPodGroupSchedulingPolicyApplyConfiguration { + return &WorkloadPodGroupSchedulingPolicyApplyConfiguration{} +} + +// WithBasic sets the Basic field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Basic field is set to the value of the last call. +func (b *WorkloadPodGroupSchedulingPolicyApplyConfiguration) WithBasic(value schedulingv1alpha3.WorkloadPodGroupBasicSchedulingPolicy) *WorkloadPodGroupSchedulingPolicyApplyConfiguration { + b.Basic = &value + return b +} + +// WithGang sets the Gang field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Gang field is set to the value of the last call. +func (b *WorkloadPodGroupSchedulingPolicyApplyConfiguration) WithGang(value *WorkloadPodGroupGangSchedulingPolicyApplyConfiguration) *WorkloadPodGroupSchedulingPolicyApplyConfiguration { + b.Gang = value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadreference.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadreference.go new file mode 100644 index 0000000000..e7dd7c7c5e --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadreference.go @@ -0,0 +1,58 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// WorkloadReferenceApplyConfiguration represents a declarative configuration of the WorkloadReference type for use +// with apply. +// +// WorkloadReference references the Workload object together with the template +// that was used to create a particular PodGroup. +type WorkloadReferenceApplyConfiguration struct { + // workloadName is the name of the Workload object that contains a template + // that was used when creating a pod group. It must + // be a DNS name. + // This field is required. + WorkloadName *string `json:"workloadName,omitempty"` + // templateName is the name of a template within the Workload object that + // was used to create a pod group. It must be a DNS label. + // This field is required. + TemplateName *string `json:"templateName,omitempty"` +} + +// WorkloadReferenceApplyConfiguration constructs a declarative configuration of the WorkloadReference type for use with +// apply. +func WorkloadReference() *WorkloadReferenceApplyConfiguration { + return &WorkloadReferenceApplyConfiguration{} +} + +// WithWorkloadName sets the WorkloadName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the WorkloadName field is set to the value of the last call. +func (b *WorkloadReferenceApplyConfiguration) WithWorkloadName(value string) *WorkloadReferenceApplyConfiguration { + b.WorkloadName = &value + return b +} + +// WithTemplateName sets the TemplateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TemplateName field is set to the value of the last call. +func (b *WorkloadReferenceApplyConfiguration) WithTemplateName(value string) *WorkloadReferenceApplyConfiguration { + b.TemplateName = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadspec.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadspec.go new file mode 100644 index 0000000000..475b998745 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha3/workloadspec.go @@ -0,0 +1,82 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// WorkloadSpecApplyConfiguration represents a declarative configuration of the WorkloadSpec type for use +// with apply. +// +// WorkloadSpec defines the desired state of a Workload. +type WorkloadSpecApplyConfiguration struct { + // controllerRef is an optional reference to the controlling object, such as a + // Deployment or Job. This field is intended for use by tools like CLIs + // to provide a link back to the original workload definition. + // This field is immutable. + ControllerRef *TypedLocalObjectReferenceApplyConfiguration `json:"controllerRef,omitempty"` + // podGroupTemplates is the list of templates that make up the Workload. + // The maximum number of templates is 8. Templates cannot be added or removed after the workload is created. + // Existing templates may still be updated where their individual fields allow it. + // Exactly one of CompositePodGroupTemplates and PodGroupTemplates must be set. + PodGroupTemplates []PodGroupTemplateApplyConfiguration `json:"podGroupTemplates,omitempty"` + // compositePodGroupTemplates is the list of CompositePodGroup templates that make up the Workload. + // The maximum number of templates is 8. This field is immutable. + // Exactly one of CompositePodGroupTemplates and PodGroupTemplates must be set. + // + // This field is used only when the CompositePodGroup feature gate is enabled. + CompositePodGroupTemplates []CompositePodGroupTemplateApplyConfiguration `json:"compositePodGroupTemplates,omitempty"` +} + +// WorkloadSpecApplyConfiguration constructs a declarative configuration of the WorkloadSpec type for use with +// apply. +func WorkloadSpec() *WorkloadSpecApplyConfiguration { + return &WorkloadSpecApplyConfiguration{} +} + +// WithControllerRef sets the ControllerRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ControllerRef field is set to the value of the last call. +func (b *WorkloadSpecApplyConfiguration) WithControllerRef(value *TypedLocalObjectReferenceApplyConfiguration) *WorkloadSpecApplyConfiguration { + b.ControllerRef = value + return b +} + +// WithPodGroupTemplates adds the given value to the PodGroupTemplates field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PodGroupTemplates field. +func (b *WorkloadSpecApplyConfiguration) WithPodGroupTemplates(values ...*PodGroupTemplateApplyConfiguration) *WorkloadSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPodGroupTemplates") + } + b.PodGroupTemplates = append(b.PodGroupTemplates, *values[i]) + } + return b +} + +// WithCompositePodGroupTemplates adds the given value to the CompositePodGroupTemplates field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CompositePodGroupTemplates field. +func (b *WorkloadSpecApplyConfiguration) WithCompositePodGroupTemplates(values ...*CompositePodGroupTemplateApplyConfiguration) *WorkloadSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithCompositePodGroupTemplates") + } + b.CompositePodGroupTemplates = append(b.CompositePodGroupTemplates, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/compositedisruptionmode.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/compositedisruptionmode.go new file mode 100644 index 0000000000..40f9a62984 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/compositedisruptionmode.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" +) + +// CompositeDisruptionModeApplyConfiguration represents a declarative configuration of the CompositeDisruptionMode type for use +// with apply. +// +// CompositeDisruptionMode defines how individual entities within a composite pod group can be disrupted. +// Exactly one mode must be set. +type CompositeDisruptionModeApplyConfiguration struct { + // single specifies that children groups can be disrupted independently from each other. + Single *schedulingv1beta1.SingleCompositeDisruptionMode `json:"single,omitempty"` + // all specifies that all children groups can only be disrupted together. + All *schedulingv1beta1.AllCompositeDisruptionMode `json:"all,omitempty"` +} + +// CompositeDisruptionModeApplyConfiguration constructs a declarative configuration of the CompositeDisruptionMode type for use with +// apply. +func CompositeDisruptionMode() *CompositeDisruptionModeApplyConfiguration { + return &CompositeDisruptionModeApplyConfiguration{} +} + +// WithSingle sets the Single field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Single field is set to the value of the last call. +func (b *CompositeDisruptionModeApplyConfiguration) WithSingle(value schedulingv1beta1.SingleCompositeDisruptionMode) *CompositeDisruptionModeApplyConfiguration { + b.Single = &value + return b +} + +// WithAll sets the All field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the All field is set to the value of the last call. +func (b *CompositeDisruptionModeApplyConfiguration) WithAll(value schedulingv1beta1.AllCompositeDisruptionMode) *CompositeDisruptionModeApplyConfiguration { + b.All = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/compositegangschedulingpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/compositegangschedulingpolicy.go new file mode 100644 index 0000000000..fc007af154 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/compositegangschedulingpolicy.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// CompositeGangSchedulingPolicyApplyConfiguration represents a declarative configuration of the CompositeGangSchedulingPolicy type for use +// with apply. +// +// CompositeGangSchedulingPolicy indicates that the groups belonging to the composite group +// should be scheduled using all-or-nothing semantics. +type CompositeGangSchedulingPolicyApplyConfiguration struct { + // minGroupCount is the minimum number of child groups that must be schedulable + // or scheduled at the same time for the scheduler to admit the entire group. + // It must be a positive integer. + MinGroupCount *int32 `json:"minGroupCount,omitempty"` +} + +// CompositeGangSchedulingPolicyApplyConfiguration constructs a declarative configuration of the CompositeGangSchedulingPolicy type for use with +// apply. +func CompositeGangSchedulingPolicy() *CompositeGangSchedulingPolicyApplyConfiguration { + return &CompositeGangSchedulingPolicyApplyConfiguration{} +} + +// WithMinGroupCount sets the MinGroupCount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinGroupCount field is set to the value of the last call. +func (b *CompositeGangSchedulingPolicyApplyConfiguration) WithMinGroupCount(value int32) *CompositeGangSchedulingPolicyApplyConfiguration { + b.MinGroupCount = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/compositepodgroupschedulingconstraints.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/compositepodgroupschedulingconstraints.go new file mode 100644 index 0000000000..56361230cd --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/compositepodgroupschedulingconstraints.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// CompositePodGroupSchedulingConstraintsApplyConfiguration represents a declarative configuration of the CompositePodGroupSchedulingConstraints type for use +// with apply. +// +// CompositePodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a CompositePodGroup. +type CompositePodGroupSchedulingConstraintsApplyConfiguration struct { + // topology defines the topology constraints for the composite pod group. + // Currently only a single topology constraint can be specified. This may change in the future. + Topology []TopologyConstraintApplyConfiguration `json:"topology,omitempty"` +} + +// CompositePodGroupSchedulingConstraintsApplyConfiguration constructs a declarative configuration of the CompositePodGroupSchedulingConstraints type for use with +// apply. +func CompositePodGroupSchedulingConstraints() *CompositePodGroupSchedulingConstraintsApplyConfiguration { + return &CompositePodGroupSchedulingConstraintsApplyConfiguration{} +} + +// WithTopology adds the given value to the Topology field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Topology field. +func (b *CompositePodGroupSchedulingConstraintsApplyConfiguration) WithTopology(values ...*TopologyConstraintApplyConfiguration) *CompositePodGroupSchedulingConstraintsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTopology") + } + b.Topology = append(b.Topology, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/compositepodgroupschedulingpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/compositepodgroupschedulingpolicy.go new file mode 100644 index 0000000000..8c8905d77d --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/compositepodgroupschedulingpolicy.go @@ -0,0 +1,59 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" +) + +// CompositePodGroupSchedulingPolicyApplyConfiguration represents a declarative configuration of the CompositePodGroupSchedulingPolicy type for use +// with apply. +// +// CompositePodGroupSchedulingPolicy defines the scheduling configuration for a CompositePodGroup. +// Exactly one policy must be set. +type CompositePodGroupSchedulingPolicyApplyConfiguration struct { + // basic specifies that the groups of this composite group should be scheduled independently. + // This field is immutable. + Basic *schedulingv1beta1.CompositeBasicSchedulingPolicy `json:"basic,omitempty"` + // gang specifies that the groups of this composite group should be scheduled using + // all-or-nothing semantics. + Gang *CompositeGangSchedulingPolicyApplyConfiguration `json:"gang,omitempty"` +} + +// CompositePodGroupSchedulingPolicyApplyConfiguration constructs a declarative configuration of the CompositePodGroupSchedulingPolicy type for use with +// apply. +func CompositePodGroupSchedulingPolicy() *CompositePodGroupSchedulingPolicyApplyConfiguration { + return &CompositePodGroupSchedulingPolicyApplyConfiguration{} +} + +// WithBasic sets the Basic field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Basic field is set to the value of the last call. +func (b *CompositePodGroupSchedulingPolicyApplyConfiguration) WithBasic(value schedulingv1beta1.CompositeBasicSchedulingPolicy) *CompositePodGroupSchedulingPolicyApplyConfiguration { + b.Basic = &value + return b +} + +// WithGang sets the Gang field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Gang field is set to the value of the last call. +func (b *CompositePodGroupSchedulingPolicyApplyConfiguration) WithGang(value *CompositeGangSchedulingPolicyApplyConfiguration) *CompositePodGroupSchedulingPolicyApplyConfiguration { + b.Gang = value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/compositepodgrouptemplate.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/compositepodgrouptemplate.go new file mode 100644 index 0000000000..511b4cca54 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/compositepodgrouptemplate.go @@ -0,0 +1,157 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" +) + +// CompositePodGroupTemplateApplyConfiguration represents a declarative configuration of the CompositePodGroupTemplate type for use +// with apply. +// +// CompositePodGroupTemplate represents a template for a CompositePodGroup with a scheduling policy. +type CompositePodGroupTemplateApplyConfiguration struct { + // name is a unique identifier for the CompositePodGroupTemplate within the Workload. + // It must be a DNS label. This field is required. + Name *string `json:"name,omitempty"` + // schedulingPolicy defines the scheduling policy for this template. + SchedulingPolicy *CompositePodGroupSchedulingPolicyApplyConfiguration `json:"schedulingPolicy,omitempty"` + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this CompositePodGroupTemplate. + // This field is immutable. + SchedulingConstraints *CompositePodGroupSchedulingConstraintsApplyConfiguration `json:"schedulingConstraints,omitempty"` + // disruptionMode defines the mode in which a given CompositePodGroup can be disrupted. + // One of Single, All. + // This field is immutable. + DisruptionMode *CompositeDisruptionModeApplyConfiguration `json:"disruptionMode,omitempty"` + // priorityClassName indicates the priority that should be considered when scheduling + // a composite pod group created from this template. If no priority class is specified, + // admission control can set this to the global default priority class if it exists. + // Otherwise, composite pod groups created from this template will have the priority set + // to zero. + // This field is immutable. + PriorityClassName *string `json:"priorityClassName,omitempty"` + // priority is the value of priority of composite pod groups created from this template. + // Various system components use this field to find the priority of the composite pod group. + // When Priority Admission Controller is enabled, it prevents users from setting this field. + // The admission controller populates this field from PriorityClassName. + // The higher the value, the higher the priority. + // This field is immutable. + Priority *int32 `json:"priority,omitempty"` + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + PreemptionPolicy *schedulingv1beta1.PreemptionPolicy `json:"preemptionPolicy,omitempty"` + // podGroupTemplates is the list of templates for children PodGroups. + // The maximum number of templates is 8. At least one entry in CompositePodGroupTemplates + // or PodGroupTemplates must be set. + PodGroupTemplates []PodGroupTemplateApplyConfiguration `json:"podGroupTemplates,omitempty"` + // compositePodGroupTemplates is the list of templates for children CompositePodGroups. + // The maximum number of templates is 8. At least one entry in CompositePodGroupTemplates + // or PodGroupTemplates must be set. + CompositePodGroupTemplates []CompositePodGroupTemplateApplyConfiguration `json:"compositePodGroupTemplates,omitempty"` +} + +// CompositePodGroupTemplateApplyConfiguration constructs a declarative configuration of the CompositePodGroupTemplate type for use with +// apply. +func CompositePodGroupTemplate() *CompositePodGroupTemplateApplyConfiguration { + return &CompositePodGroupTemplateApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *CompositePodGroupTemplateApplyConfiguration) WithName(value string) *CompositePodGroupTemplateApplyConfiguration { + b.Name = &value + return b +} + +// WithSchedulingPolicy sets the SchedulingPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SchedulingPolicy field is set to the value of the last call. +func (b *CompositePodGroupTemplateApplyConfiguration) WithSchedulingPolicy(value *CompositePodGroupSchedulingPolicyApplyConfiguration) *CompositePodGroupTemplateApplyConfiguration { + b.SchedulingPolicy = value + return b +} + +// WithSchedulingConstraints sets the SchedulingConstraints field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SchedulingConstraints field is set to the value of the last call. +func (b *CompositePodGroupTemplateApplyConfiguration) WithSchedulingConstraints(value *CompositePodGroupSchedulingConstraintsApplyConfiguration) *CompositePodGroupTemplateApplyConfiguration { + b.SchedulingConstraints = value + return b +} + +// WithDisruptionMode sets the DisruptionMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DisruptionMode field is set to the value of the last call. +func (b *CompositePodGroupTemplateApplyConfiguration) WithDisruptionMode(value *CompositeDisruptionModeApplyConfiguration) *CompositePodGroupTemplateApplyConfiguration { + b.DisruptionMode = value + return b +} + +// WithPriorityClassName sets the PriorityClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PriorityClassName field is set to the value of the last call. +func (b *CompositePodGroupTemplateApplyConfiguration) WithPriorityClassName(value string) *CompositePodGroupTemplateApplyConfiguration { + b.PriorityClassName = &value + return b +} + +// WithPriority sets the Priority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Priority field is set to the value of the last call. +func (b *CompositePodGroupTemplateApplyConfiguration) WithPriority(value int32) *CompositePodGroupTemplateApplyConfiguration { + b.Priority = &value + return b +} + +// WithPreemptionPolicy sets the PreemptionPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PreemptionPolicy field is set to the value of the last call. +func (b *CompositePodGroupTemplateApplyConfiguration) WithPreemptionPolicy(value schedulingv1beta1.PreemptionPolicy) *CompositePodGroupTemplateApplyConfiguration { + b.PreemptionPolicy = &value + return b +} + +// WithPodGroupTemplates adds the given value to the PodGroupTemplates field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PodGroupTemplates field. +func (b *CompositePodGroupTemplateApplyConfiguration) WithPodGroupTemplates(values ...*PodGroupTemplateApplyConfiguration) *CompositePodGroupTemplateApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPodGroupTemplates") + } + b.PodGroupTemplates = append(b.PodGroupTemplates, *values[i]) + } + return b +} + +// WithCompositePodGroupTemplates adds the given value to the CompositePodGroupTemplates field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CompositePodGroupTemplates field. +func (b *CompositePodGroupTemplateApplyConfiguration) WithCompositePodGroupTemplates(values ...*CompositePodGroupTemplateApplyConfiguration) *CompositePodGroupTemplateApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithCompositePodGroupTemplates") + } + b.CompositePodGroupTemplates = append(b.CompositePodGroupTemplates, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/disruptionmode.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/disruptionmode.go new file mode 100644 index 0000000000..de1d2c8d3b --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/disruptionmode.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" +) + +// DisruptionModeApplyConfiguration represents a declarative configuration of the DisruptionMode type for use +// with apply. +// +// DisruptionMode defines how individual entities within a group can be disrupted. +// Exactly one mode can be set. +type DisruptionModeApplyConfiguration struct { + // single specifies that children can be disrupted independently from each other. + Single *schedulingv1beta1.SingleDisruptionMode `json:"single,omitempty"` + // all specifies that all children can only be disrupted together. + All *schedulingv1beta1.AllDisruptionMode `json:"all,omitempty"` +} + +// DisruptionModeApplyConfiguration constructs a declarative configuration of the DisruptionMode type for use with +// apply. +func DisruptionMode() *DisruptionModeApplyConfiguration { + return &DisruptionModeApplyConfiguration{} +} + +// WithSingle sets the Single field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Single field is set to the value of the last call. +func (b *DisruptionModeApplyConfiguration) WithSingle(value schedulingv1beta1.SingleDisruptionMode) *DisruptionModeApplyConfiguration { + b.Single = &value + return b +} + +// WithAll sets the All field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the All field is set to the value of the last call. +func (b *DisruptionModeApplyConfiguration) WithAll(value schedulingv1beta1.AllDisruptionMode) *DisruptionModeApplyConfiguration { + b.All = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/gangschedulingpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/gangschedulingpolicy.go similarity index 71% rename from vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/gangschedulingpolicy.go rename to vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/gangschedulingpolicy.go index 987a89013b..0c6d1a4d3e 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/gangschedulingpolicy.go +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/gangschedulingpolicy.go @@ -16,16 +16,24 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 // GangSchedulingPolicyApplyConfiguration represents a declarative configuration of the GangSchedulingPolicy type for use // with apply. // // GangSchedulingPolicy defines the parameters for gang scheduling. type GangSchedulingPolicyApplyConfiguration struct { - // MinCount is the minimum number of pods that must be schedulable or scheduled + // minCount is the minimum number of pods that must be schedulable or scheduled // at the same time for the scheduler to admit the entire group. - // It must be a positive integer. + // It must be a positive integer. This field is mutable to support workload scaling. + // + // Note that the scheduler operates on an eventually consistent model. Updates + // to minCount may not be immediately reflected in scheduling decisions due to + // propagation delays. If minCount is updated while a scheduling cycle is in + // progress for that group, the new value may not take effect until the next + // cycle. Moreover, minCount is only enforced during scheduling, meaning that + // modifications to this field do not affect already-scheduled pods, applying + // only to those evaluated in future cycles. MinCount *int32 `json:"minCount,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroup.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroup.go new file mode 100644 index 0000000000..0bdbc2d4e9 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroup.go @@ -0,0 +1,296 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// PodGroupApplyConfiguration represents a declarative configuration of the PodGroup type for use +// with apply. +// +// PodGroup represents a runtime instance of pods grouped together. +// PodGroups are created by workload controllers (Job, LWS, JobSet, etc...) from +// Workload.podGroupTemplates. +// PodGroup API enablement is toggled by the GenericWorkload feature gate. +type PodGroupApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec defines the desired state of the PodGroup. + Spec *PodGroupSpecApplyConfiguration `json:"spec,omitempty"` + // status represents the current observed state of the PodGroup. + Status *PodGroupStatusApplyConfiguration `json:"status,omitempty"` +} + +// PodGroup constructs a declarative configuration of the PodGroup type for use with +// apply. +func PodGroup(name, namespace string) *PodGroupApplyConfiguration { + b := &PodGroupApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("PodGroup") + b.WithAPIVersion("scheduling.k8s.io/v1beta1") + return b +} + +// ExtractPodGroupFrom extracts the applied configuration owned by fieldManager from +// podGroup for the specified subresource. Pass an empty string for subresource to extract +// the main resource. Common subresources include "status", "scale", etc. +// podGroup must be a unmodified PodGroup API object that was retrieved from the Kubernetes API. +// ExtractPodGroupFrom provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractPodGroupFrom(podGroup *schedulingv1beta1.PodGroup, fieldManager string, subresource string) (*PodGroupApplyConfiguration, error) { + b := &PodGroupApplyConfiguration{} + err := managedfields.ExtractInto(podGroup, internal.Parser().Type("io.k8s.api.scheduling.v1beta1.PodGroup"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(podGroup.Name) + b.WithNamespace(podGroup.Namespace) + + b.WithKind("PodGroup") + b.WithAPIVersion("scheduling.k8s.io/v1beta1") + return b, nil +} + +// ExtractPodGroup extracts the applied configuration owned by fieldManager from +// podGroup. If no managedFields are found in podGroup for fieldManager, a +// PodGroupApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// podGroup must be a unmodified PodGroup API object that was retrieved from the Kubernetes API. +// ExtractPodGroup provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractPodGroup(podGroup *schedulingv1beta1.PodGroup, fieldManager string) (*PodGroupApplyConfiguration, error) { + return ExtractPodGroupFrom(podGroup, fieldManager, "") +} + +// ExtractPodGroupStatus extracts the applied configuration owned by fieldManager from +// podGroup for the status subresource. +func ExtractPodGroupStatus(podGroup *schedulingv1beta1.PodGroup, fieldManager string) (*PodGroupApplyConfiguration, error) { + return ExtractPodGroupFrom(podGroup, fieldManager, "status") +} + +func (b PodGroupApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *PodGroupApplyConfiguration) WithKind(value string) *PodGroupApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *PodGroupApplyConfiguration) WithAPIVersion(value string) *PodGroupApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PodGroupApplyConfiguration) WithName(value string) *PodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *PodGroupApplyConfiguration) WithGenerateName(value string) *PodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *PodGroupApplyConfiguration) WithNamespace(value string) *PodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *PodGroupApplyConfiguration) WithUID(value types.UID) *PodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *PodGroupApplyConfiguration) WithResourceVersion(value string) *PodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *PodGroupApplyConfiguration) WithGeneration(value int64) *PodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *PodGroupApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *PodGroupApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *PodGroupApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *PodGroupApplyConfiguration) WithLabels(entries map[string]string) *PodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *PodGroupApplyConfiguration) WithAnnotations(entries map[string]string) *PodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *PodGroupApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *PodGroupApplyConfiguration) WithFinalizers(values ...string) *PodGroupApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *PodGroupApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *PodGroupApplyConfiguration) WithSpec(value *PodGroupSpecApplyConfiguration) *PodGroupApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *PodGroupApplyConfiguration) WithStatus(value *PodGroupStatusApplyConfiguration) *PodGroupApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *PodGroupApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *PodGroupApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PodGroupApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *PodGroupApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroupresourceclaim.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroupresourceclaim.go new file mode 100644 index 0000000000..6b4de69ffe --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroupresourceclaim.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// PodGroupResourceClaimApplyConfiguration represents a declarative configuration of the PodGroupResourceClaim type for use +// with apply. +// +// PodGroupResourceClaim references exactly one ResourceClaim, either directly +// or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim +// for the PodGroup. +// +// It adds a name to it that uniquely identifies the ResourceClaim inside the PodGroup. +// Pods that need access to the ResourceClaim define a matching reference in its +// own Spec.ResourceClaims. The Pod's claim must match all fields of the +// PodGroup's claim exactly. +type PodGroupResourceClaimApplyConfiguration struct { + // name uniquely identifies this resource claim inside the PodGroup. + // This must be a DNS_LABEL. + Name *string `json:"name,omitempty"` + // resourceClaimName is the name of a ResourceClaim object in the same + // namespace as this PodGroup. The ResourceClaim will be reserved for the + // PodGroup instead of its individual pods. + // + // Exactly one of ResourceClaimName and ResourceClaimTemplateName must + // be set. + ResourceClaimName *string `json:"resourceClaimName,omitempty"` + // resourceClaimTemplateName is the name of a ResourceClaimTemplate + // object in the same namespace as this PodGroup. + // + // The template will be used to create a new ResourceClaim, which will + // be bound to this PodGroup. When this PodGroup is deleted, the ResourceClaim + // will also be deleted. The PodGroup 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 podgroup.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. + ResourceClaimTemplateName *string `json:"resourceClaimTemplateName,omitempty"` +} + +// PodGroupResourceClaimApplyConfiguration constructs a declarative configuration of the PodGroupResourceClaim type for use with +// apply. +func PodGroupResourceClaim() *PodGroupResourceClaimApplyConfiguration { + return &PodGroupResourceClaimApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PodGroupResourceClaimApplyConfiguration) WithName(value string) *PodGroupResourceClaimApplyConfiguration { + b.Name = &value + return b +} + +// WithResourceClaimName sets the ResourceClaimName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceClaimName field is set to the value of the last call. +func (b *PodGroupResourceClaimApplyConfiguration) WithResourceClaimName(value string) *PodGroupResourceClaimApplyConfiguration { + b.ResourceClaimName = &value + return b +} + +// WithResourceClaimTemplateName sets the ResourceClaimTemplateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceClaimTemplateName field is set to the value of the last call. +func (b *PodGroupResourceClaimApplyConfiguration) WithResourceClaimTemplateName(value string) *PodGroupResourceClaimApplyConfiguration { + b.ResourceClaimTemplateName = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroupresourceclaimstatus.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroupresourceclaimstatus.go new file mode 100644 index 0000000000..4b41f4e5f8 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroupresourceclaimstatus.go @@ -0,0 +1,59 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// PodGroupResourceClaimStatusApplyConfiguration represents a declarative configuration of the PodGroupResourceClaimStatus type for use +// with apply. +// +// PodGroupResourceClaimStatus is stored in the PodGroupStatus for each +// PodGroupResourceClaim which references a ResourceClaimTemplate. It stores the +// generated name for the corresponding ResourceClaim. +type PodGroupResourceClaimStatusApplyConfiguration struct { + // name uniquely identifies this resource claim inside the PodGroup. This + // must match the name of an entry in podgroup.spec.resourceClaims, which + // implies that the string must be a DNS_LABEL. + Name *string `json:"name,omitempty"` + // resourceClaimName is the name of the ResourceClaim that was generated for + // the PodGroup in the namespace of the PodGroup. If this is unset, then + // generating a ResourceClaim was not necessary. The + // podgroup.spec.resourceClaims entry can be ignored in this case. + ResourceClaimName *string `json:"resourceClaimName,omitempty"` +} + +// PodGroupResourceClaimStatusApplyConfiguration constructs a declarative configuration of the PodGroupResourceClaimStatus type for use with +// apply. +func PodGroupResourceClaimStatus() *PodGroupResourceClaimStatusApplyConfiguration { + return &PodGroupResourceClaimStatusApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PodGroupResourceClaimStatusApplyConfiguration) WithName(value string) *PodGroupResourceClaimStatusApplyConfiguration { + b.Name = &value + return b +} + +// WithResourceClaimName sets the ResourceClaimName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceClaimName field is set to the value of the last call. +func (b *PodGroupResourceClaimStatusApplyConfiguration) WithResourceClaimName(value string) *PodGroupResourceClaimStatusApplyConfiguration { + b.ResourceClaimName = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroupschedulingconstraints.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroupschedulingconstraints.go new file mode 100644 index 0000000000..11a0ec79b7 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroupschedulingconstraints.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// PodGroupSchedulingConstraintsApplyConfiguration represents a declarative configuration of the PodGroupSchedulingConstraints type for use +// with apply. +// +// PodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a PodGroup. +type PodGroupSchedulingConstraintsApplyConfiguration struct { + // topology defines the topology constraints for the pod group. + // Currently only a single topology constraint can be specified. This may change in the future. + Topology []TopologyConstraintApplyConfiguration `json:"topology,omitempty"` +} + +// PodGroupSchedulingConstraintsApplyConfiguration constructs a declarative configuration of the PodGroupSchedulingConstraints type for use with +// apply. +func PodGroupSchedulingConstraints() *PodGroupSchedulingConstraintsApplyConfiguration { + return &PodGroupSchedulingConstraintsApplyConfiguration{} +} + +// WithTopology adds the given value to the Topology field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Topology field. +func (b *PodGroupSchedulingConstraintsApplyConfiguration) WithTopology(values ...*TopologyConstraintApplyConfiguration) *PodGroupSchedulingConstraintsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTopology") + } + b.Topology = append(b.Topology, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroupschedulingpolicy.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroupschedulingpolicy.go new file mode 100644 index 0000000000..9cd2d05ab8 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroupschedulingpolicy.go @@ -0,0 +1,64 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" +) + +// PodGroupSchedulingPolicyApplyConfiguration represents a declarative configuration of the PodGroupSchedulingPolicy type for use +// with apply. +// +// PodGroupSchedulingPolicy defines the scheduling configuration for a PodGroup. +// Exactly one policy must be set. The policy is chosen at creation time by setting either the +// Basic or Gang field. The PodGroup may not change policy after creation. +// Fields within chosen policy may be updated after creation when their individual fields allow it. +type PodGroupSchedulingPolicyApplyConfiguration struct { + // basic specifies that the pods in this group should be scheduled using + // standard Kubernetes scheduling behavior. Setting this field at group creation time + // opts this group to basic scheduling; this field cannot be changed afterward. + Basic *schedulingv1beta1.BasicSchedulingPolicy `json:"basic,omitempty"` + // gang specifies that the pods in this group should be scheduled using + // all-or-nothing semantics. Setting this field at group creation time + // opts this group to gang scheduling; this field cannot be set or unset afterward. + // The minCount field within Gang scheduling policy remains mutable after group creation. + Gang *GangSchedulingPolicyApplyConfiguration `json:"gang,omitempty"` +} + +// PodGroupSchedulingPolicyApplyConfiguration constructs a declarative configuration of the PodGroupSchedulingPolicy type for use with +// apply. +func PodGroupSchedulingPolicy() *PodGroupSchedulingPolicyApplyConfiguration { + return &PodGroupSchedulingPolicyApplyConfiguration{} +} + +// WithBasic sets the Basic field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Basic field is set to the value of the last call. +func (b *PodGroupSchedulingPolicyApplyConfiguration) WithBasic(value schedulingv1beta1.BasicSchedulingPolicy) *PodGroupSchedulingPolicyApplyConfiguration { + b.Basic = &value + return b +} + +// WithGang sets the Gang field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Gang field is set to the value of the last call. +func (b *PodGroupSchedulingPolicyApplyConfiguration) WithGang(value *GangSchedulingPolicyApplyConfiguration) *PodGroupSchedulingPolicyApplyConfiguration { + b.Gang = value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroupspec.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroupspec.go similarity index 65% rename from vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroupspec.go rename to vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroupspec.go index 76538c6221..fb40a2f150 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroupspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroupspec.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( - schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2" + schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" ) // PodGroupSpecApplyConfiguration represents a declarative configuration of the PodGroupSpec type for use @@ -27,54 +27,61 @@ import ( // // PodGroupSpec defines the desired state of a PodGroup. type PodGroupSpecApplyConfiguration struct { - // PodGroupTemplateRef references an optional PodGroup template within other object - // (e.g. Workload) that was used to create the PodGroup. This field is immutable. - PodGroupTemplateRef *PodGroupTemplateReferenceApplyConfiguration `json:"podGroupTemplateRef,omitempty"` - // SchedulingPolicy defines the scheduling policy for this instance of the PodGroup. - // Controllers are expected to fill this field by copying it from a PodGroupTemplate. + // parentCompositePodGroupName contains the name of the parent composite pod group + // within the same namespace as this pod group. + // If it's nil, then this pod group is a root of a workload's hierarchy. + // This field is used only when the CompositePodGroup feature gate is enabled. + // This field is immutable. + ParentCompositePodGroupName *string `json:"parentCompositePodGroupName,omitempty"` + // workloadRef references an optional PodGroup template within the Workload + // object that was used to create the PodGroup. // This field is immutable. + WorkloadRef *WorkloadReferenceApplyConfiguration `json:"workloadRef,omitempty"` + // schedulingPolicy defines the scheduling policy for this instance of the PodGroup. + // Controllers are expected to fill this field by copying it from a PodGroupTemplate. SchedulingPolicy *PodGroupSchedulingPolicyApplyConfiguration `json:"schedulingPolicy,omitempty"` - // SchedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroup. + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroup. // Controllers are expected to fill this field by copying it from a PodGroupTemplate. // This field is immutable. // This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. SchedulingConstraints *PodGroupSchedulingConstraintsApplyConfiguration `json:"schedulingConstraints,omitempty"` - // ResourceClaims defines which ResourceClaims may be shared among Pods in + // resourceClaims defines which ResourceClaims may be shared among Pods in // the group. Pods consume the devices allocated to a PodGroup's claim by // defining a claim in its own Spec.ResourceClaims that matches the // PodGroup's claim exactly. The claim must have the same name and refer to // the same ResourceClaim or ResourceClaimTemplate. // - // This is an alpha-level field and requires that the + // This is a beta-level field and requires that the // DRAWorkloadResourceClaims feature gate is enabled. // // This field is immutable. ResourceClaims []PodGroupResourceClaimApplyConfiguration `json:"resourceClaims,omitempty"` - // DisruptionMode defines the mode in which a given PodGroup can be disrupted. + // disruptionMode defines the mode in which a given PodGroup can be disrupted. // Controllers are expected to fill this field by copying it from a PodGroupTemplate. - // One of Pod, PodGroup. Defaults to Pod if unset. + // One of Single, All. Defaults to Single if unset. // This field is immutable. - // This field is available only when the WorkloadAwarePreemption feature gate - // is enabled. - DisruptionMode *schedulingv1alpha2.DisruptionMode `json:"disruptionMode,omitempty"` - // PriorityClassName defines the priority that should be considered when scheduling this pod group. + DisruptionMode *DisruptionModeApplyConfiguration `json:"disruptionMode,omitempty"` + // priorityClassName defines the priority that should be considered when scheduling this pod group. // Controllers are expected to fill this field by copying it from a PodGroupTemplate. // Otherwise, it is validated and resolved similarly to the PriorityClassName on PodGroupTemplate // (i.e. if no priority class is specified, admission control can set this to the global default // priority class if it exists. Otherwise, the pod group's priority will be zero). // This field is immutable. - // This field is available only when the WorkloadAwarePreemption feature gate - // is enabled. PriorityClassName *string `json:"priorityClassName,omitempty"` - // Priority is the value of priority of this pod group. Various system components + // priority is the value of priority of this pod group. Various system components // use this field to find the priority of the pod group. When Priority Admission // Controller is enabled, it prevents users from setting this field. The admission // controller populates this field from PriorityClassName. // The higher the value, the higher the priority. // This field is immutable. - // This field is available only when the WorkloadAwarePreemption feature gate - // is enabled. Priority *int32 `json:"priority,omitempty"` + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. + // When Priority Admission Controller is enabled, it populates this field from PriorityClassName, + // and defaults to PreemptLowerPriority if value is unset in PriorityClass. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + PreemptionPolicy *schedulingv1beta1.PreemptionPolicy `json:"preemptionPolicy,omitempty"` } // PodGroupSpecApplyConfiguration constructs a declarative configuration of the PodGroupSpec type for use with @@ -83,11 +90,19 @@ func PodGroupSpec() *PodGroupSpecApplyConfiguration { return &PodGroupSpecApplyConfiguration{} } -// WithPodGroupTemplateRef sets the PodGroupTemplateRef field in the declarative configuration to the given value +// WithParentCompositePodGroupName sets the ParentCompositePodGroupName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ParentCompositePodGroupName field is set to the value of the last call. +func (b *PodGroupSpecApplyConfiguration) WithParentCompositePodGroupName(value string) *PodGroupSpecApplyConfiguration { + b.ParentCompositePodGroupName = &value + return b +} + +// WithWorkloadRef sets the WorkloadRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the PodGroupTemplateRef field is set to the value of the last call. -func (b *PodGroupSpecApplyConfiguration) WithPodGroupTemplateRef(value *PodGroupTemplateReferenceApplyConfiguration) *PodGroupSpecApplyConfiguration { - b.PodGroupTemplateRef = value +// If called multiple times, the WorkloadRef field is set to the value of the last call. +func (b *PodGroupSpecApplyConfiguration) WithWorkloadRef(value *WorkloadReferenceApplyConfiguration) *PodGroupSpecApplyConfiguration { + b.WorkloadRef = value return b } @@ -123,8 +138,8 @@ func (b *PodGroupSpecApplyConfiguration) WithResourceClaims(values ...*PodGroupR // WithDisruptionMode sets the DisruptionMode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DisruptionMode field is set to the value of the last call. -func (b *PodGroupSpecApplyConfiguration) WithDisruptionMode(value schedulingv1alpha2.DisruptionMode) *PodGroupSpecApplyConfiguration { - b.DisruptionMode = &value +func (b *PodGroupSpecApplyConfiguration) WithDisruptionMode(value *DisruptionModeApplyConfiguration) *PodGroupSpecApplyConfiguration { + b.DisruptionMode = value return b } @@ -143,3 +158,11 @@ func (b *PodGroupSpecApplyConfiguration) WithPriority(value int32) *PodGroupSpec b.Priority = &value return b } + +// WithPreemptionPolicy sets the PreemptionPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PreemptionPolicy field is set to the value of the last call. +func (b *PodGroupSpecApplyConfiguration) WithPreemptionPolicy(value schedulingv1beta1.PreemptionPolicy) *PodGroupSpecApplyConfiguration { + b.PreemptionPolicy = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroupstatus.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroupstatus.go similarity index 87% rename from vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroupstatus.go rename to vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroupstatus.go index c8c4b30da9..f52dd7cd2b 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgroupstatus.go +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgroupstatus.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" @@ -27,14 +27,16 @@ import ( // // PodGroupStatus represents information about the status of a pod group. type PodGroupStatusApplyConfiguration struct { - // Conditions represent the latest observations of the PodGroup's state. + // conditions represent the latest observations of the PodGroup's state. // // Known condition types: - // - "PodGroupScheduled": Indicates whether the scheduling requirement has been satisfied. + // - "PodGroupInitiallyScheduled": Indicates whether the scheduling requirement has been satisfied. + // Once this condition transitions to True, it serves as a terminal state and will never revert to False, + // even if pods are subsequently evicted and group constraints are no longer met. // - "DisruptionTarget": Indicates whether the PodGroup is about to be terminated // due to disruption such as preemption. // - // Known reasons for the PodGroupScheduled condition: + // Known reasons for the PodGroupInitiallyScheduled condition: // - "Unschedulable": The PodGroup cannot be scheduled due to resource constraints, // affinity/anti-affinity rules, or insufficient capacity for the gang. // - "SchedulerError": The PodGroup cannot be scheduled due to some internal error @@ -44,7 +46,7 @@ type PodGroupStatusApplyConfiguration struct { // - "PreemptionByScheduler": The PodGroup was preempted by the scheduler to make room for // higher-priority PodGroups or Pods. Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` - // Status of resource claims. + // resourceClaimStatuses is status of resource claims. ResourceClaimStatuses []PodGroupResourceClaimStatusApplyConfiguration `json:"resourceClaimStatuses,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgrouptemplate.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgrouptemplate.go similarity index 76% rename from vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgrouptemplate.go rename to vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgrouptemplate.go index 695caf2997..e53e7d41cd 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/podgrouptemplate.go +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/podgrouptemplate.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 import ( - schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2" + schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" ) // PodGroupTemplateApplyConfiguration represents a declarative configuration of the PodGroupTemplate type for use @@ -27,45 +27,44 @@ import ( // // PodGroupTemplate represents a template for a set of pods with a scheduling policy. type PodGroupTemplateApplyConfiguration struct { - // Name is a unique identifier for the PodGroupTemplate within the Workload. + // name is a unique identifier for the PodGroupTemplate within the Workload. // It must be a DNS label. This field is immutable. Name *string `json:"name,omitempty"` - // SchedulingPolicy defines the scheduling policy for this PodGroupTemplate. + // schedulingPolicy defines the scheduling policy for this PodGroupTemplate. SchedulingPolicy *PodGroupSchedulingPolicyApplyConfiguration `json:"schedulingPolicy,omitempty"` - // SchedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroupTemplate. + // schedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroupTemplate. // This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. + // This field is immutable. SchedulingConstraints *PodGroupSchedulingConstraintsApplyConfiguration `json:"schedulingConstraints,omitempty"` - // ResourceClaims defines which ResourceClaims may be shared among Pods in + // resourceClaims defines which ResourceClaims may be shared among Pods in // the group. Pods consume the devices allocated to a PodGroup's claim by // defining a claim in its own Spec.ResourceClaims that matches the // PodGroup's claim exactly. The claim must have the same name and refer to // the same ResourceClaim or ResourceClaimTemplate. // - // This is an alpha-level field and requires that the + // This is a beta-level field and requires that the // DRAWorkloadResourceClaims feature gate is enabled. // // This field is immutable. ResourceClaims []PodGroupResourceClaimApplyConfiguration `json:"resourceClaims,omitempty"` - // DisruptionMode defines the mode in which a given PodGroup can be disrupted. - // One of Pod, PodGroup. - // This field is available only when the WorkloadAwarePreemption feature gate - // is enabled. - DisruptionMode *schedulingv1alpha2.DisruptionMode `json:"disruptionMode,omitempty"` - // PriorityClassName indicates the priority that should be considered when scheduling - // a pod group created from this template. If no priority class is specified, admission - // control can set this to the global default priority class if it exists. Otherwise, - // pod groups created from this template will have the priority set to zero. - // This field is available only when the WorkloadAwarePreemption feature gate - // is enabled. + // disruptionMode defines the mode in which a given PodGroup can be disrupted. + // One of Single, All. + // This field is immutable. + DisruptionMode *DisruptionModeApplyConfiguration `json:"disruptionMode,omitempty"` + // priorityClassName indicates the priority that should be considered when scheduling + // a pod group created from this template. + // This field is immutable. PriorityClassName *string `json:"priorityClassName,omitempty"` - // Priority is the value of priority of pod groups created from this template. Various - // system components use this field to find the priority of the pod group. When - // Priority Admission Controller is enabled, it prevents users from setting this field. - // The admission controller populates this field from PriorityClassName. + // priority is the value of priority of pod groups created from this template. Various + // system components use this field to find the priority of the pod group. // The higher the value, the higher the priority. - // This field is available only when the WorkloadAwarePreemption feature gate - // is enabled. + // This field is immutable. Priority *int32 `json:"priority,omitempty"` + // preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. + // One of Never, PreemptLowerPriority. + // This field is immutable. + // This field is available only when the PodGroupPreemptionPolicy feature gate is enabled. + PreemptionPolicy *schedulingv1beta1.PreemptionPolicy `json:"preemptionPolicy,omitempty"` } // PodGroupTemplateApplyConfiguration constructs a declarative configuration of the PodGroupTemplate type for use with @@ -114,8 +113,8 @@ func (b *PodGroupTemplateApplyConfiguration) WithResourceClaims(values ...*PodGr // WithDisruptionMode sets the DisruptionMode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DisruptionMode field is set to the value of the last call. -func (b *PodGroupTemplateApplyConfiguration) WithDisruptionMode(value schedulingv1alpha2.DisruptionMode) *PodGroupTemplateApplyConfiguration { - b.DisruptionMode = &value +func (b *PodGroupTemplateApplyConfiguration) WithDisruptionMode(value *DisruptionModeApplyConfiguration) *PodGroupTemplateApplyConfiguration { + b.DisruptionMode = value return b } @@ -134,3 +133,11 @@ func (b *PodGroupTemplateApplyConfiguration) WithPriority(value int32) *PodGroup b.Priority = &value return b } + +// WithPreemptionPolicy sets the PreemptionPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PreemptionPolicy field is set to the value of the last call. +func (b *PodGroupTemplateApplyConfiguration) WithPreemptionPolicy(value schedulingv1beta1.PreemptionPolicy) *PodGroupTemplateApplyConfiguration { + b.PreemptionPolicy = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/priorityclass.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/priorityclass.go index 5fab5624ec..3c918fe901 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/priorityclass.go +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/priorityclass.go @@ -35,8 +35,8 @@ import ( // PriorityClass defines mapping from a priority class name to the priority // integer value. The value can be any valid integer. type PriorityClassApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // value represents the integer value of this priority class. This is the actual priority that pods diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/topologyconstraint.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/topologyconstraint.go new file mode 100644 index 0000000000..52bd8a77b5 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/topologyconstraint.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// TopologyConstraintApplyConfiguration represents a declarative configuration of the TopologyConstraint type for use +// with apply. +// +// TopologyConstraint defines a topology constraint for a PodGroup. +type TopologyConstraintApplyConfiguration struct { + // key specifies the key of the node label representing the topology domain. + // All pods within the PodGroup must be colocated within the same domain instance. + // Different PodGroups can land on different domain instances even if they derive from the same PodGroupTemplate. + // Examples: "topology.kubernetes.io/rack" + Key *string `json:"key,omitempty"` +} + +// TopologyConstraintApplyConfiguration constructs a declarative configuration of the TopologyConstraint type for use with +// apply. +func TopologyConstraint() *TopologyConstraintApplyConfiguration { + return &TopologyConstraintApplyConfiguration{} +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *TopologyConstraintApplyConfiguration) WithKey(value string) *TopologyConstraintApplyConfiguration { + b.Key = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/typedlocalobjectreference.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/typedlocalobjectreference.go new file mode 100644 index 0000000000..4eb57815f0 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/typedlocalobjectreference.go @@ -0,0 +1,67 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// TypedLocalObjectReferenceApplyConfiguration represents a declarative configuration of the TypedLocalObjectReference type for use +// with apply. +// +// TypedLocalObjectReference allows to reference typed object inside the same namespace. +type TypedLocalObjectReferenceApplyConfiguration struct { + // apiGroup is the group for the resource being referenced. + // If apiGroup is empty, the specified Kind must be in the core API group. + // For any other third-party types, setting apiGroup is required. + // It must be a DNS subdomain. + APIGroup *string `json:"apiGroup,omitempty"` + // kind is the type of resource being referenced. + // It must be a path segment name. + Kind *string `json:"kind,omitempty"` + // name is the name of resource being referenced. + // It must be a path segment name. + Name *string `json:"name,omitempty"` +} + +// TypedLocalObjectReferenceApplyConfiguration constructs a declarative configuration of the TypedLocalObjectReference type for use with +// apply. +func TypedLocalObjectReference() *TypedLocalObjectReferenceApplyConfiguration { + return &TypedLocalObjectReferenceApplyConfiguration{} +} + +// WithAPIGroup sets the APIGroup field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIGroup field is set to the value of the last call. +func (b *TypedLocalObjectReferenceApplyConfiguration) WithAPIGroup(value string) *TypedLocalObjectReferenceApplyConfiguration { + b.APIGroup = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *TypedLocalObjectReferenceApplyConfiguration) WithKind(value string) *TypedLocalObjectReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *TypedLocalObjectReferenceApplyConfiguration) WithName(value string) *TypedLocalObjectReferenceApplyConfiguration { + b.Name = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/workload.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/workload.go new file mode 100644 index 0000000000..179620a4a3 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/workload.go @@ -0,0 +1,280 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// WorkloadApplyConfiguration represents a declarative configuration of the Workload type for use +// with apply. +// +// Workload allows for expressing scheduling constraints that should be used +// when managing the lifecycle of workloads from the scheduling perspective, +// including scheduling, preemption, eviction and other phases. +// Workload API enablement is toggled by the GenericWorkload feature gate. +type WorkloadApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec defines the desired behavior of a Workload. + Spec *WorkloadSpecApplyConfiguration `json:"spec,omitempty"` +} + +// Workload constructs a declarative configuration of the Workload type for use with +// apply. +func Workload(name, namespace string) *WorkloadApplyConfiguration { + b := &WorkloadApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Workload") + b.WithAPIVersion("scheduling.k8s.io/v1beta1") + return b +} + +// ExtractWorkloadFrom extracts the applied configuration owned by fieldManager from +// workload for the specified subresource. Pass an empty string for subresource to extract +// the main resource. Common subresources include "status", "scale", etc. +// workload must be a unmodified Workload API object that was retrieved from the Kubernetes API. +// ExtractWorkloadFrom provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractWorkloadFrom(workload *schedulingv1beta1.Workload, fieldManager string, subresource string) (*WorkloadApplyConfiguration, error) { + b := &WorkloadApplyConfiguration{} + err := managedfields.ExtractInto(workload, internal.Parser().Type("io.k8s.api.scheduling.v1beta1.Workload"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(workload.Name) + b.WithNamespace(workload.Namespace) + + b.WithKind("Workload") + b.WithAPIVersion("scheduling.k8s.io/v1beta1") + return b, nil +} + +// ExtractWorkload extracts the applied configuration owned by fieldManager from +// workload. If no managedFields are found in workload for fieldManager, a +// WorkloadApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// workload must be a unmodified Workload API object that was retrieved from the Kubernetes API. +// ExtractWorkload provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractWorkload(workload *schedulingv1beta1.Workload, fieldManager string) (*WorkloadApplyConfiguration, error) { + return ExtractWorkloadFrom(workload, fieldManager, "") +} + +func (b WorkloadApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *WorkloadApplyConfiguration) WithKind(value string) *WorkloadApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *WorkloadApplyConfiguration) WithAPIVersion(value string) *WorkloadApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *WorkloadApplyConfiguration) WithName(value string) *WorkloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *WorkloadApplyConfiguration) WithGenerateName(value string) *WorkloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *WorkloadApplyConfiguration) WithNamespace(value string) *WorkloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *WorkloadApplyConfiguration) WithUID(value types.UID) *WorkloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *WorkloadApplyConfiguration) WithResourceVersion(value string) *WorkloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *WorkloadApplyConfiguration) WithGeneration(value int64) *WorkloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *WorkloadApplyConfiguration) WithCreationTimestamp(value metav1.Time) *WorkloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *WorkloadApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *WorkloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *WorkloadApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *WorkloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *WorkloadApplyConfiguration) WithLabels(entries map[string]string) *WorkloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *WorkloadApplyConfiguration) WithAnnotations(entries map[string]string) *WorkloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *WorkloadApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *WorkloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *WorkloadApplyConfiguration) WithFinalizers(values ...string) *WorkloadApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *WorkloadApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *WorkloadApplyConfiguration) WithSpec(value *WorkloadSpecApplyConfiguration) *WorkloadApplyConfiguration { + b.Spec = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *WorkloadApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *WorkloadApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *WorkloadApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *WorkloadApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/workloadreference.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/workloadreference.go new file mode 100644 index 0000000000..ee6a1aee84 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/workloadreference.go @@ -0,0 +1,58 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// WorkloadReferenceApplyConfiguration represents a declarative configuration of the WorkloadReference type for use +// with apply. +// +// WorkloadReference references the Workload object together with the template +// that was used to create a particular PodGroup. +type WorkloadReferenceApplyConfiguration struct { + // workloadName is the name of the Workload object that contains a template + // that was used when creating a pod group. It must + // be a DNS name. + // This field is required. + WorkloadName *string `json:"workloadName,omitempty"` + // templateName is the name of a template within the Workload object that + // was used to create a pod group. It must be a DNS label. + // This field is required. + TemplateName *string `json:"templateName,omitempty"` +} + +// WorkloadReferenceApplyConfiguration constructs a declarative configuration of the WorkloadReference type for use with +// apply. +func WorkloadReference() *WorkloadReferenceApplyConfiguration { + return &WorkloadReferenceApplyConfiguration{} +} + +// WithWorkloadName sets the WorkloadName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the WorkloadName field is set to the value of the last call. +func (b *WorkloadReferenceApplyConfiguration) WithWorkloadName(value string) *WorkloadReferenceApplyConfiguration { + b.WorkloadName = &value + return b +} + +// WithTemplateName sets the TemplateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TemplateName field is set to the value of the last call. +func (b *WorkloadReferenceApplyConfiguration) WithTemplateName(value string) *WorkloadReferenceApplyConfiguration { + b.TemplateName = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/workloadspec.go b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/workloadspec.go similarity index 63% rename from vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/workloadspec.go rename to vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/workloadspec.go index 33eb8a5c09..36a4e37fcd 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1alpha2/workloadspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/scheduling/v1beta1/workloadspec.go @@ -16,21 +16,29 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1beta1 // WorkloadSpecApplyConfiguration represents a declarative configuration of the WorkloadSpec type for use // with apply. // // WorkloadSpec defines the desired state of a Workload. type WorkloadSpecApplyConfiguration struct { - // ControllerRef is an optional reference to the controlling object, such as a + // controllerRef is an optional reference to the controlling object, such as a // Deployment or Job. This field is intended for use by tools like CLIs // to provide a link back to the original workload definition. // This field is immutable. ControllerRef *TypedLocalObjectReferenceApplyConfiguration `json:"controllerRef,omitempty"` - // PodGroupTemplates is the list of templates that make up the Workload. - // The maximum number of templates is 8. This field is immutable. + // podGroupTemplates is the list of templates that make up the Workload. + // The maximum number of templates is 8. Templates cannot be added or removed after the workload is created. + // Existing templates may still be updated where their individual fields allow it. + // Exactly one of CompositePodGroupTemplates and PodGroupTemplates must be set. PodGroupTemplates []PodGroupTemplateApplyConfiguration `json:"podGroupTemplates,omitempty"` + // compositePodGroupTemplates is the list of CompositePodGroup templates that make up the Workload. + // The maximum number of templates is 8. This field is immutable. + // Exactly one of CompositePodGroupTemplates and PodGroupTemplates must be set. + // + // This field is used only when the CompositePodGroup feature gate is enabled. + CompositePodGroupTemplates []CompositePodGroupTemplateApplyConfiguration `json:"compositePodGroupTemplates,omitempty"` } // WorkloadSpecApplyConfiguration constructs a declarative configuration of the WorkloadSpec type for use with @@ -59,3 +67,16 @@ func (b *WorkloadSpecApplyConfiguration) WithPodGroupTemplates(values ...*PodGro } return b } + +// WithCompositePodGroupTemplates adds the given value to the CompositePodGroupTemplates field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CompositePodGroupTemplates field. +func (b *WorkloadSpecApplyConfiguration) WithCompositePodGroupTemplates(values ...*CompositePodGroupTemplateApplyConfiguration) *WorkloadSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithCompositePodGroupTemplates") + } + b.CompositePodGroupTemplates = append(b.CompositePodGroupTemplates, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csidriver.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csidriver.go index 39ce1eb045..a4a1bb11c4 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csidriver.go +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csidriver.go @@ -36,8 +36,8 @@ import ( // Kubelet uses this object to determine whether pod information needs to be passed on mount. // CSIDriver objects are non-namespaced. type CSIDriverApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // metadata.Name indicates the name of the CSI driver that this object // refers to; it MUST be the same name returned by the CSI GetPluginName() // call for that driver. diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csidriverspec.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csidriverspec.go index 4a715c141b..839b714167 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csidriverspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csidriverspec.go @@ -178,7 +178,7 @@ type CSIDriverSpecApplyConfiguration struct { // // Default behavior if unset is to pass tokens in the VolumeContext field. ServiceAccountTokenInSecrets *bool `json:"serviceAccountTokenInSecrets,omitempty"` - // PreventPodSchedulingIfMissing indicates that the CSI driver wants to prevent pod + // preventPodSchedulingIfMissing indicates that the CSI driver wants to prevent pod // scheduling if the CSI driver on the node is missing. // // Enabling this option will prevent the scheduler (or any other @@ -193,7 +193,7 @@ type CSIDriverSpecApplyConfiguration struct { // newly created node may be rejected by the scheduler because of missing CSI driver // information from the node. // - // This is an alpha feature and requires the VolumeLimitScaling feature gate to be enabled. + // This is a beta feature and requires the VolumeLimitScaling feature gate to be enabled. // Default is "false". PreventPodSchedulingIfMissing *bool `json:"preventPodSchedulingIfMissing,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csinode.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csinode.go index e0b7f349e2..9a43dc622c 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csinode.go +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csinode.go @@ -40,12 +40,14 @@ import ( // enough that it doesn't create this object. // CSINode has an OwnerReference that points to the corresponding node object. type CSINodeApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // metadata.name must be the Kubernetes node name. *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec is the specification of CSINode Spec *CSINodeSpecApplyConfiguration `json:"spec,omitempty"` + // status contains health and status information for the node's storage. + Status *CSINodeStatusApplyConfiguration `json:"status,omitempty"` } // CSINode constructs a declarative configuration of the CSINode type for use with @@ -92,6 +94,12 @@ func ExtractCSINode(cSINode *storagev1.CSINode, fieldManager string) (*CSINodeAp return ExtractCSINodeFrom(cSINode, fieldManager, "") } +// ExtractCSINodeStatus extracts the applied configuration owned by fieldManager from +// cSINode for the status subresource. +func ExtractCSINodeStatus(cSINode *storagev1.CSINode, fieldManager string) (*CSINodeApplyConfiguration, error) { + return ExtractCSINodeFrom(cSINode, fieldManager, "status") +} + func (b CSINodeApplyConfiguration) IsApplyConfiguration() {} // WithKind sets the Kind field in the declarative configuration to the given value @@ -260,6 +268,14 @@ func (b *CSINodeApplyConfiguration) WithSpec(value *CSINodeSpecApplyConfiguratio return b } +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *CSINodeApplyConfiguration) WithStatus(value *CSINodeStatusApplyConfiguration) *CSINodeApplyConfiguration { + b.Status = value + return b +} + // GetKind retrieves the value of the Kind field in the declarative configuration. func (b *CSINodeApplyConfiguration) GetKind() *string { return b.TypeMetaApplyConfiguration.Kind diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csinodestatus.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csinodestatus.go new file mode 100644 index 0000000000..35294a3c29 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csinodestatus.go @@ -0,0 +1,47 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// CSINodeStatusApplyConfiguration represents a declarative configuration of the CSINodeStatus type for use +// with apply. +// +// CSINodeStatus contains health and status information for storage on a node. +type CSINodeStatusApplyConfiguration struct { + // storageHealth contains backend health reports for CSI drivers registered on the node. + StorageHealth []StorageHealthApplyConfiguration `json:"storageHealth,omitempty"` +} + +// CSINodeStatusApplyConfiguration constructs a declarative configuration of the CSINodeStatus type for use with +// apply. +func CSINodeStatus() *CSINodeStatusApplyConfiguration { + return &CSINodeStatusApplyConfiguration{} +} + +// WithStorageHealth adds the given value to the StorageHealth field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the StorageHealth field. +func (b *CSINodeStatusApplyConfiguration) WithStorageHealth(values ...*StorageHealthApplyConfiguration) *CSINodeStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithStorageHealth") + } + b.StorageHealth = append(b.StorageHealth, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csistoragecapacity.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csistoragecapacity.go index 8682c4349f..9ae931534b 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csistoragecapacity.go +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/csistoragecapacity.go @@ -56,8 +56,8 @@ import ( // the scheduler assumes that capacity is insufficient and tries some other // node. type CSIStorageCapacityApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // The name has no particular meaning. It must be a DNS subdomain (dots allowed, 253 characters). // To ensure that there are no conflicts with other CSI drivers on the cluster, // the recommendation is to use csisc-, a generated name, or a reverse-domain name diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1/storageclass.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/storageclass.go index 766b795c47..f4fdf32d0b 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/storage/v1/storageclass.go +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/storageclass.go @@ -38,8 +38,8 @@ import ( // StorageClasses are non-namespaced; the name of the storage class // according to etcd is in ObjectMeta.Name. type StorageClassApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // provisioner indicates the type of the provisioner. diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1/storagehealth.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/storagehealth.go new file mode 100644 index 0000000000..9d232b2e66 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/storagehealth.go @@ -0,0 +1,58 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// StorageHealthApplyConfiguration represents a declarative configuration of the StorageHealth type for use +// with apply. +// +// StorageHealth contains storage backend health reported by a CSI driver on a node. +type StorageHealthApplyConfiguration struct { + // name is the CSI driver name, matching CSINodeDriver.name. + Name *string `json:"name,omitempty"` + // healthConditions are the adverse storage backend conditions reported by the CSI driver. + // At most 16 conditions may be reported. + HealthConditions []StorageHealthConditionApplyConfiguration `json:"healthConditions,omitempty"` +} + +// StorageHealthApplyConfiguration constructs a declarative configuration of the StorageHealth type for use with +// apply. +func StorageHealth() *StorageHealthApplyConfiguration { + return &StorageHealthApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *StorageHealthApplyConfiguration) WithName(value string) *StorageHealthApplyConfiguration { + b.Name = &value + return b +} + +// WithHealthConditions adds the given value to the HealthConditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the HealthConditions field. +func (b *StorageHealthApplyConfiguration) WithHealthConditions(values ...*StorageHealthConditionApplyConfiguration) *StorageHealthApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithHealthConditions") + } + b.HealthConditions = append(b.HealthConditions, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1/storagehealthcondition.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/storagehealthcondition.go new file mode 100644 index 0000000000..518d00821c --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/storagehealthcondition.go @@ -0,0 +1,102 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" + storagev1 "k8s.io/api/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// StorageHealthConditionApplyConfiguration represents a declarative configuration of the StorageHealthCondition type for use +// with apply. +// +// StorageHealthCondition represents an adverse health condition reported +// by a CSI driver for its storage backend on a node. +type StorageHealthConditionApplyConfiguration struct { + // status is the health status category. + // One of "StorageUnreachable", "StorageDegraded". + Status *storagev1.StorageHealthStatusType `json:"status,omitempty"` + // reason is a brief CamelCase machine-parseable reason. + // Maximum permitted length of a reason is 256 characters. + Reason *string `json:"reason,omitempty"` + // message is a human-readable description. + // Maximum permitted length of a message is 1024 characters. + Message *string `json:"message,omitempty"` + // accessMode is the access mode affected. Nil means all access modes are affected. + AccessMode *corev1.PersistentVolumeAccessMode `json:"accessMode,omitempty"` + // volumeMode is the volume mode affected. Nil means both are affected. + VolumeMode *corev1.PersistentVolumeMode `json:"volumeMode,omitempty"` + // lastTransitionTime is when this condition first appeared at its current state. + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` +} + +// StorageHealthConditionApplyConfiguration constructs a declarative configuration of the StorageHealthCondition type for use with +// apply. +func StorageHealthCondition() *StorageHealthConditionApplyConfiguration { + return &StorageHealthConditionApplyConfiguration{} +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *StorageHealthConditionApplyConfiguration) WithStatus(value storagev1.StorageHealthStatusType) *StorageHealthConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *StorageHealthConditionApplyConfiguration) WithReason(value string) *StorageHealthConditionApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *StorageHealthConditionApplyConfiguration) WithMessage(value string) *StorageHealthConditionApplyConfiguration { + b.Message = &value + return b +} + +// WithAccessMode sets the AccessMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AccessMode field is set to the value of the last call. +func (b *StorageHealthConditionApplyConfiguration) WithAccessMode(value corev1.PersistentVolumeAccessMode) *StorageHealthConditionApplyConfiguration { + b.AccessMode = &value + return b +} + +// WithVolumeMode sets the VolumeMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeMode field is set to the value of the last call. +func (b *StorageHealthConditionApplyConfiguration) WithVolumeMode(value corev1.PersistentVolumeMode) *StorageHealthConditionApplyConfiguration { + b.VolumeMode = &value + return b +} + +// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTransitionTime field is set to the value of the last call. +func (b *StorageHealthConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *StorageHealthConditionApplyConfiguration { + b.LastTransitionTime = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1/volumeattachment.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/volumeattachment.go index 6240421803..2f958f3cde 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/storage/v1/volumeattachment.go +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/volumeattachment.go @@ -35,8 +35,8 @@ import ( // // VolumeAttachment objects are non-namespaced. type VolumeAttachmentApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec represents specification of the desired attach/detach volume behavior. diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1/volumeattributesclass.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/volumeattributesclass.go index aee276c3d7..9e2e8db131 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/storage/v1/volumeattributesclass.go +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1/volumeattributesclass.go @@ -34,11 +34,11 @@ import ( // defined by the CSI driver. The class can be specified during dynamic provisioning // of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning. type VolumeAttributesClassApplyConfiguration struct { - metav1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + metav1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Name of the CSI driver + // driverName is the name of the CSI driver // This field is immutable. DriverName *string `json:"driverName,omitempty"` // parameters hold volume attributes defined by the CSI driver. These values diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/csistoragecapacity.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/csistoragecapacity.go index e52c1adf4f..9885263cd8 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/csistoragecapacity.go +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/csistoragecapacity.go @@ -56,8 +56,8 @@ import ( // the scheduler assumes that capacity is insufficient and tries some other // node. type CSIStorageCapacityApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. The name has no particular meaning. It must be + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. The name has no particular meaning. It must be // be a DNS subdomain (dots allowed, 253 characters). To ensure that // there are no conflicts with other CSI drivers on the cluster, the recommendation // is to use csisc-, a generated name, or a reverse-domain name which ends diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattachment.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattachment.go index bd214650ba..839abce4b1 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattachment.go +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattachment.go @@ -35,8 +35,8 @@ import ( // // VolumeAttachment objects are non-namespaced. type VolumeAttachmentApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec represents specification of the desired attach/detach volume behavior. diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattributesclass.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattributesclass.go index 62ff6dcbf9..c384c1722a 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattributesclass.go +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattributesclass.go @@ -34,11 +34,11 @@ import ( // defined by the CSI driver. The class can be specified during dynamic provisioning // of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning. type VolumeAttributesClassApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Name of the CSI driver + // driverName is the name of the CSI driver // This field is immutable. DriverName *string `json:"driverName,omitempty"` // parameters hold volume attributes defined by the CSI driver. These values diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csidriver.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csidriver.go index bace6d42b6..4a50776999 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csidriver.go +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csidriver.go @@ -39,8 +39,8 @@ import ( // Kubelet uses this object to determine whether pod information needs to be passed on mount. // CSIDriver objects are non-namespaced. type CSIDriverApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // metadata.Name indicates the name of the CSI driver that this object // refers to; it MUST be the same name returned by the CSI GetPluginName() // call for that driver. diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csidriverspec.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csidriverspec.go index cec76d9fd8..624fad712c 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csidriverspec.go +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csidriverspec.go @@ -178,7 +178,7 @@ type CSIDriverSpecApplyConfiguration struct { // // Default behavior if unset is to pass tokens in the VolumeContext field. ServiceAccountTokenInSecrets *bool `json:"serviceAccountTokenInSecrets,omitempty"` - // PreventPodSchedulingIfMissing indicates that the CSI driver wants to prevent pod + // preventPodSchedulingIfMissing indicates that the CSI driver wants to prevent pod // scheduling if the CSI driver on the node is missing. // // Enabling this option will prevent the scheduler (or any other @@ -193,7 +193,7 @@ type CSIDriverSpecApplyConfiguration struct { // newly created node may be rejected by the scheduler because of missing CSI driver // information from the node. // - // This is an alpha feature and requires the VolumeLimitScaling feature gate to be enabled. + // This is a beta feature and requires the VolumeLimitScaling feature gate to be enabled. // Default is "false". PreventPodSchedulingIfMissing *bool `json:"preventPodSchedulingIfMissing,omitempty"` } diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csinode.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csinode.go index 7f6907275e..f1496eb190 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csinode.go +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csinode.go @@ -42,11 +42,14 @@ import ( // enough that it doesn't create this object. // CSINode has an OwnerReference that points to the corresponding node object. type CSINodeApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // metadata.name must be the Kubernetes node name. *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec is the specification of CSINode Spec *CSINodeSpecApplyConfiguration `json:"spec,omitempty"` + // status contains health and status information for the node's storage. + Status *CSINodeStatusApplyConfiguration `json:"status,omitempty"` } // CSINode constructs a declarative configuration of the CSINode type for use with @@ -93,6 +96,12 @@ func ExtractCSINode(cSINode *storagev1beta1.CSINode, fieldManager string) (*CSIN return ExtractCSINodeFrom(cSINode, fieldManager, "") } +// ExtractCSINodeStatus extracts the applied configuration owned by fieldManager from +// cSINode for the status subresource. +func ExtractCSINodeStatus(cSINode *storagev1beta1.CSINode, fieldManager string) (*CSINodeApplyConfiguration, error) { + return ExtractCSINodeFrom(cSINode, fieldManager, "status") +} + func (b CSINodeApplyConfiguration) IsApplyConfiguration() {} // WithKind sets the Kind field in the declarative configuration to the given value @@ -261,6 +270,14 @@ func (b *CSINodeApplyConfiguration) WithSpec(value *CSINodeSpecApplyConfiguratio return b } +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *CSINodeApplyConfiguration) WithStatus(value *CSINodeStatusApplyConfiguration) *CSINodeApplyConfiguration { + b.Status = value + return b +} + // GetKind retrieves the value of the Kind field in the declarative configuration. func (b *CSINodeApplyConfiguration) GetKind() *string { return b.TypeMetaApplyConfiguration.Kind diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csinodestatus.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csinodestatus.go new file mode 100644 index 0000000000..85ab831078 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csinodestatus.go @@ -0,0 +1,47 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// CSINodeStatusApplyConfiguration represents a declarative configuration of the CSINodeStatus type for use +// with apply. +// +// CSINodeStatus contains health and status information for storage on a node. +type CSINodeStatusApplyConfiguration struct { + // storageHealth contains backend health reports for CSI drivers registered on the node. + StorageHealth []StorageHealthApplyConfiguration `json:"storageHealth,omitempty"` +} + +// CSINodeStatusApplyConfiguration constructs a declarative configuration of the CSINodeStatus type for use with +// apply. +func CSINodeStatus() *CSINodeStatusApplyConfiguration { + return &CSINodeStatusApplyConfiguration{} +} + +// WithStorageHealth adds the given value to the StorageHealth field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the StorageHealth field. +func (b *CSINodeStatusApplyConfiguration) WithStorageHealth(values ...*StorageHealthApplyConfiguration) *CSINodeStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithStorageHealth") + } + b.StorageHealth = append(b.StorageHealth, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csistoragecapacity.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csistoragecapacity.go index e27221e82c..34f1830e97 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csistoragecapacity.go +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/csistoragecapacity.go @@ -56,8 +56,8 @@ import ( // the scheduler assumes that capacity is insufficient and tries some other // node. type CSIStorageCapacityApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. The name has no particular meaning. It must be + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. The name has no particular meaning. It must be // be a DNS subdomain (dots allowed, 253 characters). To ensure that // there are no conflicts with other CSI drivers on the cluster, the recommendation // is to use csisc-, a generated name, or a reverse-domain name which ends diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/storageclass.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/storageclass.go index 49bf87ac59..d45801926b 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/storageclass.go +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/storageclass.go @@ -38,8 +38,8 @@ import ( // StorageClasses are non-namespaced; the name of the storage class // according to etcd is in ObjectMeta.Name. type StorageClassApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // provisioner indicates the type of the provisioner. diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/storagehealth.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/storagehealth.go new file mode 100644 index 0000000000..ccd30766e2 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/storagehealth.go @@ -0,0 +1,58 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// StorageHealthApplyConfiguration represents a declarative configuration of the StorageHealth type for use +// with apply. +// +// StorageHealth contains storage backend health reported by a CSI driver on a node. +type StorageHealthApplyConfiguration struct { + // name is the CSI driver name, matching CSINodeDriver.name. + Name *string `json:"name,omitempty"` + // healthConditions are the adverse storage backend conditions reported by the CSI driver. + // At most 16 conditions may be reported. + HealthConditions []StorageHealthConditionApplyConfiguration `json:"healthConditions,omitempty"` +} + +// StorageHealthApplyConfiguration constructs a declarative configuration of the StorageHealth type for use with +// apply. +func StorageHealth() *StorageHealthApplyConfiguration { + return &StorageHealthApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *StorageHealthApplyConfiguration) WithName(value string) *StorageHealthApplyConfiguration { + b.Name = &value + return b +} + +// WithHealthConditions adds the given value to the HealthConditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the HealthConditions field. +func (b *StorageHealthApplyConfiguration) WithHealthConditions(values ...*StorageHealthConditionApplyConfiguration) *StorageHealthApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithHealthConditions") + } + b.HealthConditions = append(b.HealthConditions, *values[i]) + } + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/storagehealthcondition.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/storagehealthcondition.go new file mode 100644 index 0000000000..6fd4e6bfa1 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/storagehealthcondition.go @@ -0,0 +1,102 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "k8s.io/api/core/v1" + storagev1beta1 "k8s.io/api/storage/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// StorageHealthConditionApplyConfiguration represents a declarative configuration of the StorageHealthCondition type for use +// with apply. +// +// StorageHealthCondition represents an adverse health condition reported +// by a CSI driver for its storage backend on a node. +type StorageHealthConditionApplyConfiguration struct { + // status is the health status category. + // One of "StorageUnreachable", "StorageDegraded". + Status *storagev1beta1.StorageHealthStatusType `json:"status,omitempty"` + // reason is a brief CamelCase machine-parseable reason. + // Maximum permitted length of a reason is 256 characters. + Reason *string `json:"reason,omitempty"` + // message is a human-readable description. + // Maximum permitted length of a message is 1024 characters. + Message *string `json:"message,omitempty"` + // accessMode is the access mode affected. Nil means all access modes are affected. + AccessMode *v1.PersistentVolumeAccessMode `json:"accessMode,omitempty"` + // volumeMode is the volume mode affected. Nil means both are affected. + VolumeMode *v1.PersistentVolumeMode `json:"volumeMode,omitempty"` + // lastTransitionTime is when this condition first appeared at its current state. + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` +} + +// StorageHealthConditionApplyConfiguration constructs a declarative configuration of the StorageHealthCondition type for use with +// apply. +func StorageHealthCondition() *StorageHealthConditionApplyConfiguration { + return &StorageHealthConditionApplyConfiguration{} +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *StorageHealthConditionApplyConfiguration) WithStatus(value storagev1beta1.StorageHealthStatusType) *StorageHealthConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *StorageHealthConditionApplyConfiguration) WithReason(value string) *StorageHealthConditionApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *StorageHealthConditionApplyConfiguration) WithMessage(value string) *StorageHealthConditionApplyConfiguration { + b.Message = &value + return b +} + +// WithAccessMode sets the AccessMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AccessMode field is set to the value of the last call. +func (b *StorageHealthConditionApplyConfiguration) WithAccessMode(value v1.PersistentVolumeAccessMode) *StorageHealthConditionApplyConfiguration { + b.AccessMode = &value + return b +} + +// WithVolumeMode sets the VolumeMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeMode field is set to the value of the last call. +func (b *StorageHealthConditionApplyConfiguration) WithVolumeMode(value v1.PersistentVolumeMode) *StorageHealthConditionApplyConfiguration { + b.VolumeMode = &value + return b +} + +// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTransitionTime field is set to the value of the last call. +func (b *StorageHealthConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *StorageHealthConditionApplyConfiguration { + b.LastTransitionTime = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/volumeattachment.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/volumeattachment.go index da938bd301..25ffcd1402 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/volumeattachment.go +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/volumeattachment.go @@ -35,8 +35,8 @@ import ( // // VolumeAttachment objects are non-namespaced. type VolumeAttachmentApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // spec represents specification of the desired attach/detach volume behavior. diff --git a/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/volumeattributesclass.go b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/volumeattributesclass.go index 7d04a86c84..1eab6c2cac 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/volumeattributesclass.go +++ b/vendor/k8s.io/client-go/applyconfigurations/storage/v1beta1/volumeattributesclass.go @@ -34,11 +34,11 @@ import ( // defined by the CSI driver. The class can be specified during dynamic provisioning // of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning. type VolumeAttributesClassApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - // Standard object's metadata. + v1.TypeMetaApplyConfiguration `json:""` + // metadata is the standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - // Name of the CSI driver + // driverName is the name of the CSI driver // This field is immutable. DriverName *string `json:"driverName,omitempty"` // parameters hold volume attributes defined by the CSI driver. These values diff --git a/vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1/storageversionmigration.go b/vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1/storageversionmigration.go new file mode 100644 index 0000000000..b42000e712 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1/storageversionmigration.go @@ -0,0 +1,292 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + storagemigrationv1 "k8s.io/api/storagemigration/v1" + apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// StorageVersionMigrationApplyConfiguration represents a declarative configuration of the StorageVersionMigration type for use +// with apply. +// +// StorageVersionMigration represents a migration of stored data to the latest +// storage version. +type StorageVersionMigrationApplyConfiguration struct { + metav1.TypeMetaApplyConfiguration `json:""` + // Standard object metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *metav1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // Specification of the migration. + Spec *StorageVersionMigrationSpecApplyConfiguration `json:"spec,omitempty"` + // Status of the migration. + Status *StorageVersionMigrationStatusApplyConfiguration `json:"status,omitempty"` +} + +// StorageVersionMigration constructs a declarative configuration of the StorageVersionMigration type for use with +// apply. +func StorageVersionMigration(name string) *StorageVersionMigrationApplyConfiguration { + b := &StorageVersionMigrationApplyConfiguration{} + b.WithName(name) + b.WithKind("StorageVersionMigration") + b.WithAPIVersion("storagemigration.k8s.io/v1") + return b +} + +// ExtractStorageVersionMigrationFrom extracts the applied configuration owned by fieldManager from +// storageVersionMigration for the specified subresource. Pass an empty string for subresource to extract +// the main resource. Common subresources include "status", "scale", etc. +// storageVersionMigration must be a unmodified StorageVersionMigration API object that was retrieved from the Kubernetes API. +// ExtractStorageVersionMigrationFrom provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractStorageVersionMigrationFrom(storageVersionMigration *storagemigrationv1.StorageVersionMigration, fieldManager string, subresource string) (*StorageVersionMigrationApplyConfiguration, error) { + b := &StorageVersionMigrationApplyConfiguration{} + err := managedfields.ExtractInto(storageVersionMigration, internal.Parser().Type("io.k8s.api.storagemigration.v1.StorageVersionMigration"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(storageVersionMigration.Name) + + b.WithKind("StorageVersionMigration") + b.WithAPIVersion("storagemigration.k8s.io/v1") + return b, nil +} + +// ExtractStorageVersionMigration extracts the applied configuration owned by fieldManager from +// storageVersionMigration. If no managedFields are found in storageVersionMigration for fieldManager, a +// StorageVersionMigrationApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// storageVersionMigration must be a unmodified StorageVersionMigration API object that was retrieved from the Kubernetes API. +// ExtractStorageVersionMigration provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +func ExtractStorageVersionMigration(storageVersionMigration *storagemigrationv1.StorageVersionMigration, fieldManager string) (*StorageVersionMigrationApplyConfiguration, error) { + return ExtractStorageVersionMigrationFrom(storageVersionMigration, fieldManager, "") +} + +// ExtractStorageVersionMigrationStatus extracts the applied configuration owned by fieldManager from +// storageVersionMigration for the status subresource. +func ExtractStorageVersionMigrationStatus(storageVersionMigration *storagemigrationv1.StorageVersionMigration, fieldManager string) (*StorageVersionMigrationApplyConfiguration, error) { + return ExtractStorageVersionMigrationFrom(storageVersionMigration, fieldManager, "status") +} + +func (b StorageVersionMigrationApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *StorageVersionMigrationApplyConfiguration) WithKind(value string) *StorageVersionMigrationApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *StorageVersionMigrationApplyConfiguration) WithAPIVersion(value string) *StorageVersionMigrationApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *StorageVersionMigrationApplyConfiguration) WithName(value string) *StorageVersionMigrationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *StorageVersionMigrationApplyConfiguration) WithGenerateName(value string) *StorageVersionMigrationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *StorageVersionMigrationApplyConfiguration) WithNamespace(value string) *StorageVersionMigrationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *StorageVersionMigrationApplyConfiguration) WithUID(value types.UID) *StorageVersionMigrationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *StorageVersionMigrationApplyConfiguration) WithResourceVersion(value string) *StorageVersionMigrationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *StorageVersionMigrationApplyConfiguration) WithGeneration(value int64) *StorageVersionMigrationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *StorageVersionMigrationApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *StorageVersionMigrationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *StorageVersionMigrationApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *StorageVersionMigrationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *StorageVersionMigrationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *StorageVersionMigrationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *StorageVersionMigrationApplyConfiguration) WithLabels(entries map[string]string) *StorageVersionMigrationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *StorageVersionMigrationApplyConfiguration) WithAnnotations(entries map[string]string) *StorageVersionMigrationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *StorageVersionMigrationApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *StorageVersionMigrationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *StorageVersionMigrationApplyConfiguration) WithFinalizers(values ...string) *StorageVersionMigrationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *StorageVersionMigrationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &metav1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *StorageVersionMigrationApplyConfiguration) WithSpec(value *StorageVersionMigrationSpecApplyConfiguration) *StorageVersionMigrationApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *StorageVersionMigrationApplyConfiguration) WithStatus(value *StorageVersionMigrationStatusApplyConfiguration) *StorageVersionMigrationApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *StorageVersionMigrationApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *StorageVersionMigrationApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *StorageVersionMigrationApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *StorageVersionMigrationApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1/storageversionmigrationspec.go b/vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1/storageversionmigrationspec.go new file mode 100644 index 0000000000..2c8603560b --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1/storageversionmigrationspec.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// StorageVersionMigrationSpecApplyConfiguration represents a declarative configuration of the StorageVersionMigrationSpec type for use +// with apply. +// +// Spec of the storage version migration. +type StorageVersionMigrationSpecApplyConfiguration struct { + // The resource that is being migrated. The migrator sends requests to + // the endpoint serving the resource. + // Immutable. + Resource *metav1.GroupResourceApplyConfiguration `json:"resource,omitempty"` +} + +// StorageVersionMigrationSpecApplyConfiguration constructs a declarative configuration of the StorageVersionMigrationSpec type for use with +// apply. +func StorageVersionMigrationSpec() *StorageVersionMigrationSpecApplyConfiguration { + return &StorageVersionMigrationSpecApplyConfiguration{} +} + +// WithResource sets the Resource field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Resource field is set to the value of the last call. +func (b *StorageVersionMigrationSpecApplyConfiguration) WithResource(value *metav1.GroupResourceApplyConfiguration) *StorageVersionMigrationSpecApplyConfiguration { + b.Resource = value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1/storageversionmigrationstatus.go b/vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1/storageversionmigrationstatus.go new file mode 100644 index 0000000000..14bc869731 --- /dev/null +++ b/vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1/storageversionmigrationstatus.go @@ -0,0 +1,63 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// StorageVersionMigrationStatusApplyConfiguration represents a declarative configuration of the StorageVersionMigrationStatus type for use +// with apply. +// +// Status of the storage version migration. +type StorageVersionMigrationStatusApplyConfiguration struct { + // The latest available observations of the migration's current state. + Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` + // ResourceVersion to compare with the GC cache for performing the migration. + // This is the current resource version of given group, version and resource when + // kube-controller-manager first observes this StorageVersionMigration resource. + ResourceVersion *string `json:"resourceVersion,omitempty"` +} + +// StorageVersionMigrationStatusApplyConfiguration constructs a declarative configuration of the StorageVersionMigrationStatus type for use with +// apply. +func StorageVersionMigrationStatus() *StorageVersionMigrationStatusApplyConfiguration { + return &StorageVersionMigrationStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *StorageVersionMigrationStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *StorageVersionMigrationStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *StorageVersionMigrationStatusApplyConfiguration) WithResourceVersion(value string) *StorageVersionMigrationStatusApplyConfiguration { + b.ResourceVersion = &value + return b +} diff --git a/vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1beta1/storageversionmigration.go b/vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1beta1/storageversionmigration.go index e52fa5d813..f82428997f 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1beta1/storageversionmigration.go +++ b/vendor/k8s.io/client-go/applyconfigurations/storagemigration/v1beta1/storageversionmigration.go @@ -33,7 +33,7 @@ import ( // StorageVersionMigration represents a migration of stored data to the latest // storage version. type StorageVersionMigrationApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` // Standard object metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/vendor/k8s.io/client-go/applyconfigurations/utils.go b/vendor/k8s.io/client-go/applyconfigurations/utils.go index 355051fc8d..f498c284ee 100644 --- a/vendor/k8s.io/client-go/applyconfigurations/utils.go +++ b/vendor/k8s.io/client-go/applyconfigurations/utils.go @@ -47,6 +47,7 @@ import ( flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" v1beta3 "k8s.io/api/flowcontrol/v1beta3" imagepolicyv1alpha1 "k8s.io/api/imagepolicy/v1alpha1" + lifecyclev1alpha1 "k8s.io/api/lifecycle/v1alpha1" networkingv1 "k8s.io/api/networking/v1" networkingv1beta1 "k8s.io/api/networking/v1beta1" nodev1 "k8s.io/api/node/v1" @@ -62,11 +63,12 @@ import ( resourcev1beta1 "k8s.io/api/resource/v1beta1" resourcev1beta2 "k8s.io/api/resource/v1beta2" schedulingv1 "k8s.io/api/scheduling/v1" - schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2" + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" storagev1 "k8s.io/api/storage/v1" storagev1alpha1 "k8s.io/api/storage/v1alpha1" storagev1beta1 "k8s.io/api/storage/v1beta1" + storagemigrationv1 "k8s.io/api/storagemigration/v1" storagemigrationv1beta1 "k8s.io/api/storagemigration/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -101,6 +103,7 @@ import ( flowcontrolv1beta3 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3" applyconfigurationsimagepolicyv1alpha1 "k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1" internal "k8s.io/client-go/applyconfigurations/internal" + applyconfigurationslifecyclev1alpha1 "k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1" applyconfigurationsmetav1 "k8s.io/client-go/applyconfigurations/meta/v1" applyconfigurationsnetworkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" applyconfigurationsnetworkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" @@ -117,11 +120,12 @@ import ( applyconfigurationsresourcev1beta1 "k8s.io/client-go/applyconfigurations/resource/v1beta1" applyconfigurationsresourcev1beta2 "k8s.io/client-go/applyconfigurations/resource/v1beta2" applyconfigurationsschedulingv1 "k8s.io/client-go/applyconfigurations/scheduling/v1" - applyconfigurationsschedulingv1alpha2 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha2" + applyconfigurationsschedulingv1alpha3 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha3" applyconfigurationsschedulingv1beta1 "k8s.io/client-go/applyconfigurations/scheduling/v1beta1" applyconfigurationsstoragev1 "k8s.io/client-go/applyconfigurations/storage/v1" applyconfigurationsstoragev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" applyconfigurationsstoragev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" + applyconfigurationsstoragemigrationv1 "k8s.io/client-go/applyconfigurations/storagemigration/v1" applyconfigurationsstoragemigrationv1beta1 "k8s.io/client-go/applyconfigurations/storagemigration/v1beta1" ) @@ -510,6 +514,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsbatchv1.JobApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("JobCondition"): return &applyconfigurationsbatchv1.JobConditionApplyConfiguration{} + case batchv1.SchemeGroupVersion.WithKind("JobSchedulingConfiguration"): + return &applyconfigurationsbatchv1.JobSchedulingConfigurationApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("JobSpec"): return &applyconfigurationsbatchv1.JobSpecApplyConfiguration{} case batchv1.SchemeGroupVersion.WithKind("JobStatus"): @@ -550,6 +556,16 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscertificatesv1.CertificateSigningRequestSpecApplyConfiguration{} case certificatesv1.SchemeGroupVersion.WithKind("CertificateSigningRequestStatus"): return &applyconfigurationscertificatesv1.CertificateSigningRequestStatusApplyConfiguration{} + case certificatesv1.SchemeGroupVersion.WithKind("ClusterTrustBundle"): + return &applyconfigurationscertificatesv1.ClusterTrustBundleApplyConfiguration{} + case certificatesv1.SchemeGroupVersion.WithKind("ClusterTrustBundleSpec"): + return &applyconfigurationscertificatesv1.ClusterTrustBundleSpecApplyConfiguration{} + case certificatesv1.SchemeGroupVersion.WithKind("PodCertificateRequest"): + return &applyconfigurationscertificatesv1.PodCertificateRequestApplyConfiguration{} + case certificatesv1.SchemeGroupVersion.WithKind("PodCertificateRequestSpec"): + return &applyconfigurationscertificatesv1.PodCertificateRequestSpecApplyConfiguration{} + case certificatesv1.SchemeGroupVersion.WithKind("PodCertificateRequestStatus"): + return &applyconfigurationscertificatesv1.PodCertificateRequestStatusApplyConfiguration{} // Group=certificates.k8s.io, Version=v1alpha1 case certificatesv1alpha1.SchemeGroupVersion.WithKind("ClusterTrustBundle"): @@ -710,6 +726,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.EventSeriesApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("EventSource"): return &applyconfigurationscorev1.EventSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("EvictionResponder"): + return &applyconfigurationscorev1.EvictionResponderApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ExecAction"): return &applyconfigurationscorev1.ExecActionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("FCVolumeSource"): @@ -790,6 +808,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.NodeAddressApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeAffinity"): return &applyconfigurationscorev1.NodeAffinityApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeAllocatableMappedResources"): + return &applyconfigurationscorev1.NodeAllocatableMappedResourcesApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeAllocatableOverheadResources"): + return &applyconfigurationscorev1.NodeAllocatableOverheadResourcesApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeAllocatableResourceClaimStatus"): return &applyconfigurationscorev1.NodeAllocatableResourceClaimStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeCondition"): @@ -802,6 +824,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.NodeDaemonEndpointsApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeFeatures"): return &applyconfigurationscorev1.NodeFeaturesApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodePodPreemptionPolicy"): + return &applyconfigurationscorev1.NodePodPreemptionPolicyApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeRuntimeHandler"): return &applyconfigurationscorev1.NodeRuntimeHandlerApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeRuntimeHandlerFeatures"): @@ -888,6 +912,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.PodTemplateApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PodTemplateSpec"): return &applyconfigurationscorev1.PodTemplateSpecApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodVolumeHealth"): + return &applyconfigurationscorev1.PodVolumeHealthApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PortStatus"): return &applyconfigurationscorev1.PortStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("PortworxVolumeSource"): @@ -998,6 +1024,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.VolumeApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("VolumeDevice"): return &applyconfigurationscorev1.VolumeDeviceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("VolumeHealthCondition"): + return &applyconfigurationscorev1.VolumeHealthConditionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("VolumeHealthStatus"): + return &applyconfigurationscorev1.VolumeHealthStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("VolumeMount"): return &applyconfigurationscorev1.VolumeMountApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("VolumeMountStatus"): @@ -1335,6 +1365,34 @@ func ForKind(kind schema.GroupVersionKind) interface{} { case apiserverinternalv1alpha1.SchemeGroupVersion.WithKind("StorageVersionStatus"): return &applyconfigurationsapiserverinternalv1alpha1.StorageVersionStatusApplyConfiguration{} + // Group=lifecycle.k8s.io, Version=v1alpha1 + case lifecyclev1alpha1.SchemeGroupVersion.WithKind("Eviction"): + return &applyconfigurationslifecyclev1alpha1.EvictionApplyConfiguration{} + case lifecyclev1alpha1.SchemeGroupVersion.WithKind("EvictionPodReference"): + return &applyconfigurationslifecyclev1alpha1.EvictionPodReferenceApplyConfiguration{} + case lifecyclev1alpha1.SchemeGroupVersion.WithKind("EvictionRequest"): + return &applyconfigurationslifecyclev1alpha1.EvictionRequestApplyConfiguration{} + case lifecyclev1alpha1.SchemeGroupVersion.WithKind("EvictionRequestPodReference"): + return &applyconfigurationslifecyclev1alpha1.EvictionRequestPodReferenceApplyConfiguration{} + case lifecyclev1alpha1.SchemeGroupVersion.WithKind("EvictionRequestSpec"): + return &applyconfigurationslifecyclev1alpha1.EvictionRequestSpecApplyConfiguration{} + case lifecyclev1alpha1.SchemeGroupVersion.WithKind("EvictionRequestStatus"): + return &applyconfigurationslifecyclev1alpha1.EvictionRequestStatusApplyConfiguration{} + case lifecyclev1alpha1.SchemeGroupVersion.WithKind("EvictionRequestTarget"): + return &applyconfigurationslifecyclev1alpha1.EvictionRequestTargetApplyConfiguration{} + case lifecyclev1alpha1.SchemeGroupVersion.WithKind("EvictionSpec"): + return &applyconfigurationslifecyclev1alpha1.EvictionSpecApplyConfiguration{} + case lifecyclev1alpha1.SchemeGroupVersion.WithKind("EvictionStatus"): + return &applyconfigurationslifecyclev1alpha1.EvictionStatusApplyConfiguration{} + case lifecyclev1alpha1.SchemeGroupVersion.WithKind("EvictionTarget"): + return &applyconfigurationslifecyclev1alpha1.EvictionTargetApplyConfiguration{} + case lifecyclev1alpha1.SchemeGroupVersion.WithKind("Requester"): + return &applyconfigurationslifecyclev1alpha1.RequesterApplyConfiguration{} + case lifecyclev1alpha1.SchemeGroupVersion.WithKind("ResponderStatus"): + return &applyconfigurationslifecyclev1alpha1.ResponderStatusApplyConfiguration{} + case lifecyclev1alpha1.SchemeGroupVersion.WithKind("TargetResponder"): + return &applyconfigurationslifecyclev1alpha1.TargetResponderApplyConfiguration{} + // Group=meta.k8s.io, Version=v1 case metav1.SchemeGroupVersion.WithKind("Condition"): return &applyconfigurationsmetav1.ConditionApplyConfiguration{} @@ -1606,6 +1664,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsresourcev1.DeviceConstraintApplyConfiguration{} case resourcev1.SchemeGroupVersion.WithKind("DeviceCounterConsumption"): return &applyconfigurationsresourcev1.DeviceCounterConsumptionApplyConfiguration{} + case resourcev1.SchemeGroupVersion.WithKind("DeviceDerivedAttribute"): + return &applyconfigurationsresourcev1.DeviceDerivedAttributeApplyConfiguration{} case resourcev1.SchemeGroupVersion.WithKind("DeviceRequest"): return &applyconfigurationsresourcev1.DeviceRequestApplyConfiguration{} case resourcev1.SchemeGroupVersion.WithKind("DeviceRequestAllocationResult"): @@ -1616,14 +1676,26 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsresourcev1.DeviceSubRequestApplyConfiguration{} case resourcev1.SchemeGroupVersion.WithKind("DeviceTaint"): return &applyconfigurationsresourcev1.DeviceTaintApplyConfiguration{} + case resourcev1.SchemeGroupVersion.WithKind("DeviceTaintRule"): + return &applyconfigurationsresourcev1.DeviceTaintRuleApplyConfiguration{} + case resourcev1.SchemeGroupVersion.WithKind("DeviceTaintRuleSpec"): + return &applyconfigurationsresourcev1.DeviceTaintRuleSpecApplyConfiguration{} + case resourcev1.SchemeGroupVersion.WithKind("DeviceTaintRuleStatus"): + return &applyconfigurationsresourcev1.DeviceTaintRuleStatusApplyConfiguration{} + case resourcev1.SchemeGroupVersion.WithKind("DeviceTaintSelector"): + return &applyconfigurationsresourcev1.DeviceTaintSelectorApplyConfiguration{} case resourcev1.SchemeGroupVersion.WithKind("DeviceToleration"): return &applyconfigurationsresourcev1.DeviceTolerationApplyConfiguration{} case resourcev1.SchemeGroupVersion.WithKind("ExactDeviceRequest"): return &applyconfigurationsresourcev1.ExactDeviceRequestApplyConfiguration{} case resourcev1.SchemeGroupVersion.WithKind("NetworkDeviceData"): return &applyconfigurationsresourcev1.NetworkDeviceDataApplyConfiguration{} - case resourcev1.SchemeGroupVersion.WithKind("NodeAllocatableResourceMapping"): - return &applyconfigurationsresourcev1.NodeAllocatableResourceMappingApplyConfiguration{} + case resourcev1.SchemeGroupVersion.WithKind("NodeAllocatableMapping"): + return &applyconfigurationsresourcev1.NodeAllocatableMappingApplyConfiguration{} + case resourcev1.SchemeGroupVersion.WithKind("NodeAllocatableOverhead"): + return &applyconfigurationsresourcev1.NodeAllocatableOverheadApplyConfiguration{} + case resourcev1.SchemeGroupVersion.WithKind("NodeAllocatableResource"): + return &applyconfigurationsresourcev1.NodeAllocatableResourceApplyConfiguration{} case resourcev1.SchemeGroupVersion.WithKind("OpaqueDeviceConfiguration"): return &applyconfigurationsresourcev1.OpaqueDeviceConfigurationApplyConfiguration{} case resourcev1.SchemeGroupVersion.WithKind("ResourceClaim"): @@ -1656,6 +1728,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &resourcev1alpha3.DeviceTaintRuleStatusApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("DeviceTaintSelector"): return &resourcev1alpha3.DeviceTaintSelectorApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("PartitionTypeStatus"): + return &resourcev1alpha3.PartitionTypeStatusApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("PoolStatus"): return &resourcev1alpha3.PoolStatusApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("ResourcePoolStatusRequest"): @@ -1664,6 +1738,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &resourcev1alpha3.ResourcePoolStatusRequestSpecApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("ResourcePoolStatusRequestStatus"): return &resourcev1alpha3.ResourcePoolStatusRequestStatusApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ShareableCapacityStatus"): + return &resourcev1alpha3.ShareableCapacityStatusApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ShareableSummaryStatus"): + return &resourcev1alpha3.ShareableSummaryStatusApplyConfiguration{} // Group=resource.k8s.io, Version=v1beta1 case resourcev1beta1.SchemeGroupVersion.WithKind("AllocatedDeviceStatus"): @@ -1710,6 +1788,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsresourcev1beta1.DeviceConstraintApplyConfiguration{} case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceCounterConsumption"): return &applyconfigurationsresourcev1beta1.DeviceCounterConsumptionApplyConfiguration{} + case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceDerivedAttribute"): + return &applyconfigurationsresourcev1beta1.DeviceDerivedAttributeApplyConfiguration{} case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceRequest"): return &applyconfigurationsresourcev1beta1.DeviceRequestApplyConfiguration{} case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceRequestAllocationResult"): @@ -1724,8 +1804,12 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsresourcev1beta1.DeviceTolerationApplyConfiguration{} case resourcev1beta1.SchemeGroupVersion.WithKind("NetworkDeviceData"): return &applyconfigurationsresourcev1beta1.NetworkDeviceDataApplyConfiguration{} - case resourcev1beta1.SchemeGroupVersion.WithKind("NodeAllocatableResourceMapping"): - return &applyconfigurationsresourcev1beta1.NodeAllocatableResourceMappingApplyConfiguration{} + case resourcev1beta1.SchemeGroupVersion.WithKind("NodeAllocatableMapping"): + return &applyconfigurationsresourcev1beta1.NodeAllocatableMappingApplyConfiguration{} + case resourcev1beta1.SchemeGroupVersion.WithKind("NodeAllocatableOverhead"): + return &applyconfigurationsresourcev1beta1.NodeAllocatableOverheadApplyConfiguration{} + case resourcev1beta1.SchemeGroupVersion.WithKind("NodeAllocatableResource"): + return &applyconfigurationsresourcev1beta1.NodeAllocatableResourceApplyConfiguration{} case resourcev1beta1.SchemeGroupVersion.WithKind("OpaqueDeviceConfiguration"): return &applyconfigurationsresourcev1beta1.OpaqueDeviceConfigurationApplyConfiguration{} case resourcev1beta1.SchemeGroupVersion.WithKind("ResourceClaim"): @@ -1790,6 +1874,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsresourcev1beta2.DeviceConstraintApplyConfiguration{} case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceCounterConsumption"): return &applyconfigurationsresourcev1beta2.DeviceCounterConsumptionApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceDerivedAttribute"): + return &applyconfigurationsresourcev1beta2.DeviceDerivedAttributeApplyConfiguration{} case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceRequest"): return &applyconfigurationsresourcev1beta2.DeviceRequestApplyConfiguration{} case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceRequestAllocationResult"): @@ -1814,8 +1900,12 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsresourcev1beta2.ExactDeviceRequestApplyConfiguration{} case resourcev1beta2.SchemeGroupVersion.WithKind("NetworkDeviceData"): return &applyconfigurationsresourcev1beta2.NetworkDeviceDataApplyConfiguration{} - case resourcev1beta2.SchemeGroupVersion.WithKind("NodeAllocatableResourceMapping"): - return &applyconfigurationsresourcev1beta2.NodeAllocatableResourceMappingApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("NodeAllocatableMapping"): + return &applyconfigurationsresourcev1beta2.NodeAllocatableMappingApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("NodeAllocatableOverhead"): + return &applyconfigurationsresourcev1beta2.NodeAllocatableOverheadApplyConfiguration{} + case resourcev1beta2.SchemeGroupVersion.WithKind("NodeAllocatableResource"): + return &applyconfigurationsresourcev1beta2.NodeAllocatableResourceApplyConfiguration{} case resourcev1beta2.SchemeGroupVersion.WithKind("OpaqueDeviceConfiguration"): return &applyconfigurationsresourcev1beta2.OpaqueDeviceConfigurationApplyConfiguration{} case resourcev1beta2.SchemeGroupVersion.WithKind("ResourceClaim"): @@ -1841,41 +1931,107 @@ func ForKind(kind schema.GroupVersionKind) interface{} { case schedulingv1.SchemeGroupVersion.WithKind("PriorityClass"): return &applyconfigurationsschedulingv1.PriorityClassApplyConfiguration{} - // Group=scheduling.k8s.io, Version=v1alpha2 - case schedulingv1alpha2.SchemeGroupVersion.WithKind("GangSchedulingPolicy"): - return &applyconfigurationsschedulingv1alpha2.GangSchedulingPolicyApplyConfiguration{} - case schedulingv1alpha2.SchemeGroupVersion.WithKind("PodGroup"): - return &applyconfigurationsschedulingv1alpha2.PodGroupApplyConfiguration{} - case schedulingv1alpha2.SchemeGroupVersion.WithKind("PodGroupResourceClaim"): - return &applyconfigurationsschedulingv1alpha2.PodGroupResourceClaimApplyConfiguration{} - case schedulingv1alpha2.SchemeGroupVersion.WithKind("PodGroupResourceClaimStatus"): - return &applyconfigurationsschedulingv1alpha2.PodGroupResourceClaimStatusApplyConfiguration{} - case schedulingv1alpha2.SchemeGroupVersion.WithKind("PodGroupSchedulingConstraints"): - return &applyconfigurationsschedulingv1alpha2.PodGroupSchedulingConstraintsApplyConfiguration{} - case schedulingv1alpha2.SchemeGroupVersion.WithKind("PodGroupSchedulingPolicy"): - return &applyconfigurationsschedulingv1alpha2.PodGroupSchedulingPolicyApplyConfiguration{} - case schedulingv1alpha2.SchemeGroupVersion.WithKind("PodGroupSpec"): - return &applyconfigurationsschedulingv1alpha2.PodGroupSpecApplyConfiguration{} - case schedulingv1alpha2.SchemeGroupVersion.WithKind("PodGroupStatus"): - return &applyconfigurationsschedulingv1alpha2.PodGroupStatusApplyConfiguration{} - case schedulingv1alpha2.SchemeGroupVersion.WithKind("PodGroupTemplate"): - return &applyconfigurationsschedulingv1alpha2.PodGroupTemplateApplyConfiguration{} - case schedulingv1alpha2.SchemeGroupVersion.WithKind("PodGroupTemplateReference"): - return &applyconfigurationsschedulingv1alpha2.PodGroupTemplateReferenceApplyConfiguration{} - case schedulingv1alpha2.SchemeGroupVersion.WithKind("TopologyConstraint"): - return &applyconfigurationsschedulingv1alpha2.TopologyConstraintApplyConfiguration{} - case schedulingv1alpha2.SchemeGroupVersion.WithKind("TypedLocalObjectReference"): - return &applyconfigurationsschedulingv1alpha2.TypedLocalObjectReferenceApplyConfiguration{} - case schedulingv1alpha2.SchemeGroupVersion.WithKind("Workload"): - return &applyconfigurationsschedulingv1alpha2.WorkloadApplyConfiguration{} - case schedulingv1alpha2.SchemeGroupVersion.WithKind("WorkloadPodGroupTemplateReference"): - return &applyconfigurationsschedulingv1alpha2.WorkloadPodGroupTemplateReferenceApplyConfiguration{} - case schedulingv1alpha2.SchemeGroupVersion.WithKind("WorkloadSpec"): - return &applyconfigurationsschedulingv1alpha2.WorkloadSpecApplyConfiguration{} + // Group=scheduling.k8s.io, Version=v1alpha3 + case schedulingv1alpha3.SchemeGroupVersion.WithKind("CompositeDisruptionMode"): + return &applyconfigurationsschedulingv1alpha3.CompositeDisruptionModeApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("CompositeGangSchedulingPolicy"): + return &applyconfigurationsschedulingv1alpha3.CompositeGangSchedulingPolicyApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("CompositePodGroup"): + return &applyconfigurationsschedulingv1alpha3.CompositePodGroupApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("CompositePodGroupSchedulingConstraints"): + return &applyconfigurationsschedulingv1alpha3.CompositePodGroupSchedulingConstraintsApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("CompositePodGroupSchedulingPolicy"): + return &applyconfigurationsschedulingv1alpha3.CompositePodGroupSchedulingPolicyApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("CompositePodGroupSpec"): + return &applyconfigurationsschedulingv1alpha3.CompositePodGroupSpecApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("CompositePodGroupStatus"): + return &applyconfigurationsschedulingv1alpha3.CompositePodGroupStatusApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("CompositePodGroupTemplate"): + return &applyconfigurationsschedulingv1alpha3.CompositePodGroupTemplateApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("DisruptionMode"): + return &applyconfigurationsschedulingv1alpha3.DisruptionModeApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("GangSchedulingPolicy"): + return &applyconfigurationsschedulingv1alpha3.GangSchedulingPolicyApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("PodGroup"): + return &applyconfigurationsschedulingv1alpha3.PodGroupApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("PodGroupResourceClaim"): + return &applyconfigurationsschedulingv1alpha3.PodGroupResourceClaimApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("PodGroupResourceClaimStatus"): + return &applyconfigurationsschedulingv1alpha3.PodGroupResourceClaimStatusApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("PodGroupSchedulingConstraints"): + return &applyconfigurationsschedulingv1alpha3.PodGroupSchedulingConstraintsApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("PodGroupSchedulingPolicy"): + return &applyconfigurationsschedulingv1alpha3.PodGroupSchedulingPolicyApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("PodGroupSpec"): + return &applyconfigurationsschedulingv1alpha3.PodGroupSpecApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("PodGroupStatus"): + return &applyconfigurationsschedulingv1alpha3.PodGroupStatusApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("PodGroupTemplate"): + return &applyconfigurationsschedulingv1alpha3.PodGroupTemplateApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("TopologyConstraint"): + return &applyconfigurationsschedulingv1alpha3.TopologyConstraintApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("TypedLocalObjectReference"): + return &applyconfigurationsschedulingv1alpha3.TypedLocalObjectReferenceApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("Workload"): + return &applyconfigurationsschedulingv1alpha3.WorkloadApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("WorkloadPodGroupDisruptionMode"): + return &applyconfigurationsschedulingv1alpha3.WorkloadPodGroupDisruptionModeApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("WorkloadPodGroupGangSchedulingPolicy"): + return &applyconfigurationsschedulingv1alpha3.WorkloadPodGroupGangSchedulingPolicyApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("WorkloadPodGroupResourceClaim"): + return &applyconfigurationsschedulingv1alpha3.WorkloadPodGroupResourceClaimApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("WorkloadPodGroupSchedulingConstraints"): + return &applyconfigurationsschedulingv1alpha3.WorkloadPodGroupSchedulingConstraintsApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("WorkloadPodGroupSchedulingPolicy"): + return &applyconfigurationsschedulingv1alpha3.WorkloadPodGroupSchedulingPolicyApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("WorkloadReference"): + return &applyconfigurationsschedulingv1alpha3.WorkloadReferenceApplyConfiguration{} + case schedulingv1alpha3.SchemeGroupVersion.WithKind("WorkloadSpec"): + return &applyconfigurationsschedulingv1alpha3.WorkloadSpecApplyConfiguration{} // Group=scheduling.k8s.io, Version=v1beta1 + case schedulingv1beta1.SchemeGroupVersion.WithKind("CompositeDisruptionMode"): + return &applyconfigurationsschedulingv1beta1.CompositeDisruptionModeApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("CompositeGangSchedulingPolicy"): + return &applyconfigurationsschedulingv1beta1.CompositeGangSchedulingPolicyApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("CompositePodGroupSchedulingConstraints"): + return &applyconfigurationsschedulingv1beta1.CompositePodGroupSchedulingConstraintsApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("CompositePodGroupSchedulingPolicy"): + return &applyconfigurationsschedulingv1beta1.CompositePodGroupSchedulingPolicyApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("CompositePodGroupTemplate"): + return &applyconfigurationsschedulingv1beta1.CompositePodGroupTemplateApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("DisruptionMode"): + return &applyconfigurationsschedulingv1beta1.DisruptionModeApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("GangSchedulingPolicy"): + return &applyconfigurationsschedulingv1beta1.GangSchedulingPolicyApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("PodGroup"): + return &applyconfigurationsschedulingv1beta1.PodGroupApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("PodGroupResourceClaim"): + return &applyconfigurationsschedulingv1beta1.PodGroupResourceClaimApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("PodGroupResourceClaimStatus"): + return &applyconfigurationsschedulingv1beta1.PodGroupResourceClaimStatusApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("PodGroupSchedulingConstraints"): + return &applyconfigurationsschedulingv1beta1.PodGroupSchedulingConstraintsApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("PodGroupSchedulingPolicy"): + return &applyconfigurationsschedulingv1beta1.PodGroupSchedulingPolicyApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("PodGroupSpec"): + return &applyconfigurationsschedulingv1beta1.PodGroupSpecApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("PodGroupStatus"): + return &applyconfigurationsschedulingv1beta1.PodGroupStatusApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("PodGroupTemplate"): + return &applyconfigurationsschedulingv1beta1.PodGroupTemplateApplyConfiguration{} case schedulingv1beta1.SchemeGroupVersion.WithKind("PriorityClass"): return &applyconfigurationsschedulingv1beta1.PriorityClassApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("TopologyConstraint"): + return &applyconfigurationsschedulingv1beta1.TopologyConstraintApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("TypedLocalObjectReference"): + return &applyconfigurationsschedulingv1beta1.TypedLocalObjectReferenceApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("Workload"): + return &applyconfigurationsschedulingv1beta1.WorkloadApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("WorkloadReference"): + return &applyconfigurationsschedulingv1beta1.WorkloadReferenceApplyConfiguration{} + case schedulingv1beta1.SchemeGroupVersion.WithKind("WorkloadSpec"): + return &applyconfigurationsschedulingv1beta1.WorkloadSpecApplyConfiguration{} // Group=storage.k8s.io, Version=v1 case storagev1.SchemeGroupVersion.WithKind("CSIDriver"): @@ -1888,10 +2044,16 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsstoragev1.CSINodeDriverApplyConfiguration{} case storagev1.SchemeGroupVersion.WithKind("CSINodeSpec"): return &applyconfigurationsstoragev1.CSINodeSpecApplyConfiguration{} + case storagev1.SchemeGroupVersion.WithKind("CSINodeStatus"): + return &applyconfigurationsstoragev1.CSINodeStatusApplyConfiguration{} case storagev1.SchemeGroupVersion.WithKind("CSIStorageCapacity"): return &applyconfigurationsstoragev1.CSIStorageCapacityApplyConfiguration{} case storagev1.SchemeGroupVersion.WithKind("StorageClass"): return &applyconfigurationsstoragev1.StorageClassApplyConfiguration{} + case storagev1.SchemeGroupVersion.WithKind("StorageHealth"): + return &applyconfigurationsstoragev1.StorageHealthApplyConfiguration{} + case storagev1.SchemeGroupVersion.WithKind("StorageHealthCondition"): + return &applyconfigurationsstoragev1.StorageHealthConditionApplyConfiguration{} case storagev1.SchemeGroupVersion.WithKind("TokenRequest"): return &applyconfigurationsstoragev1.TokenRequestApplyConfiguration{} case storagev1.SchemeGroupVersion.WithKind("VolumeAttachment"): @@ -1936,10 +2098,16 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsstoragev1beta1.CSINodeDriverApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("CSINodeSpec"): return &applyconfigurationsstoragev1beta1.CSINodeSpecApplyConfiguration{} + case storagev1beta1.SchemeGroupVersion.WithKind("CSINodeStatus"): + return &applyconfigurationsstoragev1beta1.CSINodeStatusApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("CSIStorageCapacity"): return &applyconfigurationsstoragev1beta1.CSIStorageCapacityApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("StorageClass"): return &applyconfigurationsstoragev1beta1.StorageClassApplyConfiguration{} + case storagev1beta1.SchemeGroupVersion.WithKind("StorageHealth"): + return &applyconfigurationsstoragev1beta1.StorageHealthApplyConfiguration{} + case storagev1beta1.SchemeGroupVersion.WithKind("StorageHealthCondition"): + return &applyconfigurationsstoragev1beta1.StorageHealthConditionApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("TokenRequest"): return &applyconfigurationsstoragev1beta1.TokenRequestApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("VolumeAttachment"): @@ -1957,6 +2125,14 @@ func ForKind(kind schema.GroupVersionKind) interface{} { case storagev1beta1.SchemeGroupVersion.WithKind("VolumeNodeResources"): return &applyconfigurationsstoragev1beta1.VolumeNodeResourcesApplyConfiguration{} + // Group=storagemigration.k8s.io, Version=v1 + case storagemigrationv1.SchemeGroupVersion.WithKind("StorageVersionMigration"): + return &applyconfigurationsstoragemigrationv1.StorageVersionMigrationApplyConfiguration{} + case storagemigrationv1.SchemeGroupVersion.WithKind("StorageVersionMigrationSpec"): + return &applyconfigurationsstoragemigrationv1.StorageVersionMigrationSpecApplyConfiguration{} + case storagemigrationv1.SchemeGroupVersion.WithKind("StorageVersionMigrationStatus"): + return &applyconfigurationsstoragemigrationv1.StorageVersionMigrationStatusApplyConfiguration{} + // Group=storagemigration.k8s.io, Version=v1beta1 case storagemigrationv1beta1.SchemeGroupVersion.WithKind("StorageVersionMigration"): return &applyconfigurationsstoragemigrationv1beta1.StorageVersionMigrationApplyConfiguration{} diff --git a/vendor/k8s.io/client-go/discovery/aggregated_discovery.go b/vendor/k8s.io/client-go/discovery/aggregated_discovery.go index 82d46b4895..2111b26454 100644 --- a/vendor/k8s.io/client-go/discovery/aggregated_discovery.go +++ b/vendor/k8s.io/client-go/discovery/aggregated_discovery.go @@ -20,7 +20,6 @@ import ( "fmt" apidiscovery "k8s.io/api/apidiscovery/v2" - apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" ) @@ -155,124 +154,3 @@ func convertAPISubresource(parent metav1.APIResource, in apidiscovery.APISubreso result.Verbs = in.Verbs return result, nil } - -// Please note the functions below will be removed in v1.35. They facilitate conversion -// between the deprecated type apidiscoveryv2beta1.APIGroupDiscoveryList. - -// SplitGroupsAndResourcesV2Beta1 transforms "aggregated" discovery top-level structure into -// the previous "unaggregated" discovery groups and resources. -// Deprecated: Please use SplitGroupsAndResources -func SplitGroupsAndResourcesV2Beta1(aggregatedGroups apidiscoveryv2beta1.APIGroupDiscoveryList) ( - *metav1.APIGroupList, - map[schema.GroupVersion]*metav1.APIResourceList, - map[schema.GroupVersion]error) { - // Aggregated group list will contain the entirety of discovery, including - // groups, versions, and resources. GroupVersions marked "stale" are failed. - groups := []*metav1.APIGroup{} - failedGVs := map[schema.GroupVersion]error{} - resourcesByGV := map[schema.GroupVersion]*metav1.APIResourceList{} - for _, aggGroup := range aggregatedGroups.Items { - group, resources, failed := convertAPIGroupv2beta1(aggGroup) - groups = append(groups, group) - for gv, resourceList := range resources { - resourcesByGV[gv] = resourceList - } - for gv, err := range failed { - failedGVs[gv] = err - } - } - // Transform slice of groups to group list before returning. - groupList := &metav1.APIGroupList{} - groupList.Groups = make([]metav1.APIGroup, 0, len(groups)) - for _, group := range groups { - groupList.Groups = append(groupList.Groups, *group) - } - return groupList, resourcesByGV, failedGVs -} - -// convertAPIGroupv2beta1 tranforms an "aggregated" APIGroupDiscovery to an "legacy" APIGroup, -// also returning the map of APIResourceList for resources within GroupVersions. -func convertAPIGroupv2beta1(g apidiscoveryv2beta1.APIGroupDiscovery) ( - *metav1.APIGroup, - map[schema.GroupVersion]*metav1.APIResourceList, - map[schema.GroupVersion]error) { - // Iterate through versions to convert to group and resources. - group := &metav1.APIGroup{} - gvResources := map[schema.GroupVersion]*metav1.APIResourceList{} - failedGVs := map[schema.GroupVersion]error{} - group.Name = g.ObjectMeta.Name - for _, v := range g.Versions { - gv := schema.GroupVersion{Group: g.Name, Version: v.Version} - if v.Freshness == apidiscoveryv2beta1.DiscoveryFreshnessStale { - failedGVs[gv] = StaleGroupVersionError{gv: gv} - continue - } - version := metav1.GroupVersionForDiscovery{} - version.GroupVersion = gv.String() - version.Version = v.Version - group.Versions = append(group.Versions, version) - // PreferredVersion is first non-stale Version - if group.PreferredVersion == (metav1.GroupVersionForDiscovery{}) { - group.PreferredVersion = version - } - resourceList := &metav1.APIResourceList{} - resourceList.GroupVersion = gv.String() - for _, r := range v.Resources { - resource, err := convertAPIResourcev2beta1(r) - if err == nil { - resourceList.APIResources = append(resourceList.APIResources, resource) - } - // Subresources field in new format get transformed into full APIResources. - // It is possible a partial result with an error was returned to be used - // as the parent resource for the subresource. - for _, subresource := range r.Subresources { - sr, err := convertAPISubresourcev2beta1(resource, subresource) - if err == nil { - resourceList.APIResources = append(resourceList.APIResources, sr) - } - } - } - gvResources[gv] = resourceList - } - return group, gvResources, failedGVs -} - -// convertAPIResource tranforms a APIResourceDiscovery to an APIResource. We are -// resilient to missing GVK, since this resource might be the parent resource -// for a subresource. If the parent is missing a GVK, it is not returned in -// discovery, and the subresource MUST have the GVK. -func convertAPIResourcev2beta1(in apidiscoveryv2beta1.APIResourceDiscovery) (metav1.APIResource, error) { - result := metav1.APIResource{ - Name: in.Resource, - SingularName: in.SingularResource, - Namespaced: in.Scope == apidiscoveryv2beta1.ScopeNamespace, - Verbs: in.Verbs, - ShortNames: in.ShortNames, - Categories: in.Categories, - } - // Can return partial result with error, which can be the parent for a - // subresource. Do not add this result to the returned discovery resources. - if in.ResponseKind == nil || (*in.ResponseKind) == emptyKind { - return result, fmt.Errorf("discovery resource %s missing GVK", in.Resource) - } - result.Group = in.ResponseKind.Group - result.Version = in.ResponseKind.Version - result.Kind = in.ResponseKind.Kind - return result, nil -} - -// convertAPISubresource tranforms a APISubresourceDiscovery to an APIResource. -func convertAPISubresourcev2beta1(parent metav1.APIResource, in apidiscoveryv2beta1.APISubresourceDiscovery) (metav1.APIResource, error) { - result := metav1.APIResource{} - if in.ResponseKind == nil || (*in.ResponseKind) == emptyKind { - return result, fmt.Errorf("subresource %s/%s missing GVK", parent.Name, in.Subresource) - } - result.Name = fmt.Sprintf("%s/%s", parent.Name, in.Subresource) - result.SingularName = parent.SingularName - result.Namespaced = parent.Namespaced - result.Group = in.ResponseKind.Group - result.Version = in.ResponseKind.Version - result.Kind = in.ResponseKind.Kind - result.Verbs = in.Verbs - return result, nil -} diff --git a/vendor/k8s.io/client-go/discovery/cached/disk/cached_discovery.go b/vendor/k8s.io/client-go/discovery/cached/disk/cached_discovery.go index 158810ee53..eb9ce79c16 100644 --- a/vendor/k8s.io/client-go/discovery/cached/disk/cached_discovery.go +++ b/vendor/k8s.io/client-go/discovery/cached/disk/cached_discovery.go @@ -17,6 +17,7 @@ limitations under the License. package disk import ( + "context" "errors" "io" "net/http" @@ -42,7 +43,7 @@ import ( // CachedDiscoveryClient implements the functions that discovery server-supported API groups, // versions and resources. type CachedDiscoveryClient struct { - delegate discovery.DiscoveryInterface + delegate discovery.DiscoveryInterfaceWithContext // cacheDirectory is the directory where discovery docs are held. It must be unique per host:port combination to work well. cacheDirectory string @@ -61,72 +62,104 @@ type CachedDiscoveryClient struct { fresh bool // caching openapi v3 client which wraps the delegate's client - openapiClient openapi.Client + openapiClient *cachedopenapi.Client } -var _ discovery.CachedDiscoveryInterface = &CachedDiscoveryClient{} +var ( + //nolint:staticcheck // Intentionally using the old interface here. + _ discovery.CachedDiscoveryInterface = &CachedDiscoveryClient{} + _ discovery.CachedDiscoveryInterfaceWithContext = &CachedDiscoveryClient{} +) // ServerResourcesForGroupVersion returns the supported resources for a group and version. +// +// ServerResourcesForGroupVersionWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerResourcesForGroupVersionWithContext instead. func (d *CachedDiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) { + return d.ServerResourcesForGroupVersionWithContext(context.Background(), groupVersion) +} + +// ServerResourcesForGroupVersionWithContext returns the supported resources for a group and version. +func (d *CachedDiscoveryClient) ServerResourcesForGroupVersionWithContext(ctx context.Context, groupVersion string) (*metav1.APIResourceList, error) { filename := filepath.Join(d.cacheDirectory, groupVersion, "serverresources.json") cachedBytes, err := d.getCachedFile(filename) // don't fail on errors, we either don't have a file or won't be able to run the cached check. Either way we can fallback. if err == nil { cachedResources := &metav1.APIResourceList{} if err := runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), cachedBytes, cachedResources); err == nil { - klog.V(10).Infof("returning cached discovery info from %v", filename) + klog.FromContext(ctx).V(10).Info("Returning cached discovery info", "fileName", filename) return cachedResources, nil } } - liveResources, err := d.delegate.ServerResourcesForGroupVersion(groupVersion) + liveResources, err := d.delegate.ServerResourcesForGroupVersionWithContext(ctx, groupVersion) if err != nil { - klog.V(3).Infof("skipped caching discovery info due to %v", err) + klog.FromContext(ctx).V(3).Info("Skipped caching discovery info due to error", "err", err) return liveResources, err } if liveResources == nil || len(liveResources.APIResources) == 0 { - klog.V(3).Infof("skipped caching discovery info, no resources found") + klog.FromContext(ctx).V(3).Info("skipped caching discovery info, no resources found") return liveResources, err } if err := d.writeCachedFile(filename, liveResources); err != nil { - klog.V(1).Infof("failed to write cache to %v due to %v", filename, err) + klog.FromContext(ctx).V(1).Info("Failed to write cache", "fileName", filename, "err", err) } return liveResources, nil } // ServerGroupsAndResources returns the supported groups and resources for all groups and versions. +// +// ServerGroupsAndResourcesWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerGroupsAndResourcesWithContext instead. func (d *CachedDiscoveryClient) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { - return discovery.ServerGroupsAndResources(d) + return d.ServerGroupsAndResourcesWithContext(context.Background()) +} + +// ServerGroupsAndResourcesWithContext returns the supported groups and resources for all groups and versions. +func (d *CachedDiscoveryClient) ServerGroupsAndResourcesWithContext(ctx context.Context) ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { + return discovery.ServerGroupsAndResourcesWithContext(ctx, d) } // ServerGroups returns the supported groups, with information like supported versions and the // preferred version. +// +// ServerGroupsWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerGroupsWithContext instead. func (d *CachedDiscoveryClient) ServerGroups() (*metav1.APIGroupList, error) { + return d.ServerGroupsWithContext(context.Background()) +} + +// ServerGroupsWithContext returns the supported groups, with information like supported versions and the +// preferred version. +func (d *CachedDiscoveryClient) ServerGroupsWithContext(ctx context.Context) (*metav1.APIGroupList, error) { filename := filepath.Join(d.cacheDirectory, "servergroups.json") cachedBytes, err := d.getCachedFile(filename) // don't fail on errors, we either don't have a file or won't be able to run the cached check. Either way we can fallback. if err == nil { cachedGroups := &metav1.APIGroupList{} if err := runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), cachedBytes, cachedGroups); err == nil { - klog.V(10).Infof("returning cached discovery info from %v", filename) + klog.FromContext(ctx).V(10).Info("Returning cached discovery info", "fileName", filename) return cachedGroups, nil } } - liveGroups, err := d.delegate.ServerGroups() + liveGroups, err := d.delegate.ServerGroupsWithContext(ctx) if err != nil { - klog.V(3).Infof("skipped caching discovery info due to %v", err) + klog.FromContext(ctx).V(3).Info("Skipped caching discovery info due to error", "err", err) return liveGroups, err } if liveGroups == nil || len(liveGroups.Groups) == 0 { - klog.V(3).Infof("skipped caching discovery info, no groups found") + klog.FromContext(ctx).V(3).Info("Skipped caching discovery info, no groups found") return liveGroups, err } if err := d.writeCachedFile(filename, liveGroups); err != nil { - klog.V(1).Infof("failed to write cache to %v due to %v", filename, err) + klog.FromContext(ctx).V(1).Info("Failed to write cache", "fileName", filename, "err", err) } return liveGroups, nil @@ -219,28 +252,75 @@ func (d *CachedDiscoveryClient) RESTClient() restclient.Interface { // ServerPreferredResources returns the supported resources with the version preferred by the // server. +// +// ServerPreferredResourcesWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerPreferredResourcesWithContext instead. func (d *CachedDiscoveryClient) ServerPreferredResources() ([]*metav1.APIResourceList, error) { - return discovery.ServerPreferredResources(d) + return d.ServerPreferredResourcesWithContext(context.Background()) +} + +// ServerPreferredResourcesWithContext returns the supported resources with the version preferred by the +// server. +func (d *CachedDiscoveryClient) ServerPreferredResourcesWithContext(ctx context.Context) ([]*metav1.APIResourceList, error) { + return discovery.ServerPreferredResourcesWithContext(ctx, d) } // ServerPreferredNamespacedResources returns the supported namespaced resources with the // version preferred by the server. +// +// ServerPreferredNamespacedResourcesWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerPreferredNamespacedResourcesWithContext instead. func (d *CachedDiscoveryClient) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) { - return discovery.ServerPreferredNamespacedResources(d) + return d.ServerPreferredNamespacedResourcesWithContext(context.Background()) +} + +// ServerPreferredNamespacedResourcesWithContext returns the supported namespaced resources with the +// version preferred by the server. +func (d *CachedDiscoveryClient) ServerPreferredNamespacedResourcesWithContext(ctx context.Context) ([]*metav1.APIResourceList, error) { + return discovery.ServerPreferredNamespacedResourcesWithContext(ctx, d) } // ServerVersion retrieves and parses the server's version (git version). +// +// ServerVersionWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerVersionWithContext instead. func (d *CachedDiscoveryClient) ServerVersion() (*version.Info, error) { - return d.delegate.ServerVersion() + return d.ServerVersionWithContext(context.Background()) +} + +// ServerVersionWithContext retrieves and parses the server's version (git version). +func (d *CachedDiscoveryClient) ServerVersionWithContext(ctx context.Context) (*version.Info, error) { + return d.delegate.ServerVersionWithContext(ctx) } // OpenAPISchema retrieves and parses the swagger API schema the server supports. +// +// OpenAPISchemaWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use OpenAPISchemaWithContext instead. func (d *CachedDiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) { - return d.delegate.OpenAPISchema() + return d.OpenAPISchemaWithContext(context.Background()) +} + +// OpenAPISchemaWithContext retrieves and parses the swagger API schema the server supports. +func (d *CachedDiscoveryClient) OpenAPISchemaWithContext(ctx context.Context) (*openapi_v2.Document, error) { + return d.delegate.OpenAPISchemaWithContext(ctx) } // OpenAPIV3 retrieves and parses the OpenAPIV3 specs exposed by the server func (d *CachedDiscoveryClient) OpenAPIV3() openapi.Client { + return d.openAPIV3(context.Background()) +} + +// OpenAPIV3WithContext retrieves and parses the OpenAPIV3 specs exposed by the server +func (d *CachedDiscoveryClient) OpenAPIV3WithContext(ctx context.Context) openapi.ClientWithContext { + return d.openAPIV3(ctx) +} + +func (d *CachedDiscoveryClient) openAPIV3(ctx context.Context) *cachedopenapi.Client { // Must take lock since Invalidate call may modify openapiClient d.mutex.Lock() defer d.mutex.Unlock() @@ -248,7 +328,7 @@ func (d *CachedDiscoveryClient) OpenAPIV3() openapi.Client { if d.openapiClient == nil { // Delegate is discovery client created with special HTTP client which // respects E-Tag cache responses to serve cache from disk. - d.openapiClient = cachedopenapi.NewClient(d.delegate.OpenAPIV3()) + d.openapiClient = cachedopenapi.NewClientWithContext(d.delegate.OpenAPIV3WithContext(ctx)) } return d.openapiClient @@ -256,7 +336,17 @@ func (d *CachedDiscoveryClient) OpenAPIV3() openapi.Client { // Fresh is supposed to tell the caller whether or not to retry if the cache // fails to find something (false = retry, true = no need to retry). +// +// FreshWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use FreshWithContext instead. func (d *CachedDiscoveryClient) Fresh() bool { + return d.FreshWithContext(context.Background()) +} + +// FreshWithContext is supposed to tell the caller whether or not to retry if the cache +// fails to find something (false = retry, true = no need to retry). +func (d *CachedDiscoveryClient) FreshWithContext(ctx context.Context) bool { d.mutex.Lock() defer d.mutex.Unlock() @@ -264,7 +354,16 @@ func (d *CachedDiscoveryClient) Fresh() bool { } // Invalidate enforces that no cached data is used in the future that is older than the current time. +// +// InvalidateWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use InvalidateWithContext instead. func (d *CachedDiscoveryClient) Invalidate() { + d.InvalidateWithContext(context.Background()) +} + +// InvalidateWithContext enforces that no cached data is used in the future that is older than the current time. +func (d *CachedDiscoveryClient) InvalidateWithContext(ctx context.Context) { d.mutex.Lock() defer d.mutex.Unlock() @@ -272,8 +371,16 @@ func (d *CachedDiscoveryClient) Invalidate() { d.fresh = true d.invalidated = true d.openapiClient = nil - if ad, ok := d.delegate.(discovery.CachedDiscoveryInterface); ok { - ad.Invalidate() + ad, ok := d.delegate.(discovery.CachedDiscoveryInterfaceWithContext) + if !ok { + //nolint:staticcheck // Intentionally using the old interface here. + if ad2, ok2 := d.delegate.(discovery.CachedDiscoveryInterface); ok2 { + ad = discovery.ToCachedDiscoveryInterfaceWithContext(ad2) + ok = true + } + } + if ok { + ad.InvalidateWithContext(ctx) } } @@ -283,6 +390,12 @@ func (d *CachedDiscoveryClient) WithLegacy() discovery.DiscoveryInterface { return d } +// WithLegacyWithContext returns current cached discovery client; +// current client does not support legacy-only discovery. +func (d *CachedDiscoveryClient) WithLegacyWithContext(ctx context.Context) discovery.DiscoveryInterfaceWithContext { + return d +} + // NewCachedDiscoveryClientForConfig creates a new DiscoveryClient for the given config, and wraps // the created client in a CachedDiscoveryClient. The provided configuration is updated with a // custom transport that understands cache responses. @@ -310,11 +423,11 @@ func NewCachedDiscoveryClientForConfig(config *restclient.Config, discoveryCache // The delegate caches the discovery groups and resources (memcache). "ServerGroups", // which usually only returns (and caches) the groups, can now store the resources as // well if the server supports the newer aggregated discovery format. - return newCachedDiscoveryClient(memory.NewMemCacheClient(discoveryClient), discoveryCacheDir, ttl), nil + return newCachedDiscoveryClient(memory.NewMemCacheClientWithContext(discoveryClient), discoveryCacheDir, ttl), nil } // NewCachedDiscoveryClient creates a new DiscoveryClient. cacheDirectory is the directory where discovery docs are held. It must be unique per host:port combination to work well. -func newCachedDiscoveryClient(delegate discovery.DiscoveryInterface, cacheDirectory string, ttl time.Duration) *CachedDiscoveryClient { +func newCachedDiscoveryClient(delegate discovery.DiscoveryInterfaceWithContext, cacheDirectory string, ttl time.Duration) *CachedDiscoveryClient { return &CachedDiscoveryClient{ delegate: delegate, cacheDirectory: cacheDirectory, diff --git a/vendor/k8s.io/client-go/discovery/cached/disk/round_tripper.go b/vendor/k8s.io/client-go/discovery/cached/disk/round_tripper.go index b978a2bed9..db26773b7e 100644 --- a/vendor/k8s.io/client-go/discovery/cached/disk/round_tripper.go +++ b/vendor/k8s.io/client-go/discovery/cached/disk/round_tripper.go @@ -60,7 +60,7 @@ func (rt *cacheRoundTripper) CancelRequest(req *http.Request) { if cr, ok := rt.rt.Transport.(canceler); ok { cr.CancelRequest(req) } else { - klog.Errorf("CancelRequest not implemented by %T", rt.rt.Transport) + klog.FromContext(req.Context()).Error(nil, "CancelRequest not implemented by round-tripper", "type", fmt.Sprintf("%T", rt.rt.Transport)) } } diff --git a/vendor/k8s.io/client-go/discovery/cached/memory/memcache.go b/vendor/k8s.io/client-go/discovery/cached/memory/memcache.go index 3829b3cc09..9334cafe5a 100644 --- a/vendor/k8s.io/client-go/discovery/cached/memory/memcache.go +++ b/vendor/k8s.io/client-go/discovery/cached/memory/memcache.go @@ -17,6 +17,7 @@ limitations under the License. package memory import ( + "context" "errors" "fmt" "sync" @@ -47,13 +48,13 @@ type cacheEntry struct { // TODO: Switch to a watch interface. Right now it will poll after each // Invalidate() call. type memCacheClient struct { - delegate discovery.DiscoveryInterface + delegate discovery.DiscoveryInterfaceWithContext lock sync.RWMutex groupToServerResources map[string]*cacheEntry groupList *metav1.APIGroupList cacheValid bool - openapiClient openapi.Client + openapiClient *cachedopenapi.Client receivedAggregatedDiscovery bool } @@ -72,6 +73,7 @@ func (e *emptyResponseError) Error() string { } var _ discovery.CachedDiscoveryInterface = &memCacheClient{} +var _ discovery.CachedDiscoveryInterfaceWithContext = &memCacheClient{} // isTransientConnectionError checks whether given error is "Connection refused" or // "Connection reset" error which usually means that apiserver is temporarily @@ -85,6 +87,11 @@ func isTransientConnectionError(err error) bool { } func isTransientError(err error) bool { + // Context cancelation is transient, retrying with a different context can work. + if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) { + return true + } + if isTransientConnectionError(err) { return true } @@ -98,10 +105,15 @@ func isTransientError(err error) bool { // ServerResourcesForGroupVersion returns the supported resources for a group and version. func (d *memCacheClient) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) { + return d.ServerResourcesForGroupVersionWithContext(context.Background(), groupVersion) +} + +// ServerResourcesForGroupVersion returns the supported resources for a group and version. +func (d *memCacheClient) ServerResourcesForGroupVersionWithContext(ctx context.Context, groupVersion string) (*metav1.APIResourceList, error) { d.lock.Lock() defer d.lock.Unlock() if !d.cacheValid { - if err := d.refreshLocked(); err != nil { + if err := d.refreshLocked(ctx); err != nil { return nil, err } } @@ -111,14 +123,14 @@ func (d *memCacheClient) ServerResourcesForGroupVersion(groupVersion string) (*m } if cachedVal.err != nil && isTransientError(cachedVal.err) { - r, err := d.serverResourcesForGroupVersion(groupVersion) + r, err := d.serverResourcesForGroupVersion(ctx, groupVersion) if err != nil { // Don't log "empty response" as an error; it is a common response for metrics. if _, emptyErr := err.(*emptyResponseError); emptyErr { // Log at same verbosity as disk cache. - klog.V(3).Infof("%v", err) + klog.FromContext(ctx).V(3).Info(err.Error()) } else { - utilruntime.HandleError(fmt.Errorf("couldn't get resource list for %v: %v", groupVersion, err)) + utilruntime.HandleErrorWithContext(ctx, err, "Couldn't get resource list", "gv", groupVersion) } } cachedVal = &cacheEntry{r, err} @@ -129,19 +141,43 @@ func (d *memCacheClient) ServerResourcesForGroupVersion(groupVersion string) (*m } // ServerGroupsAndResources returns the groups and supported resources for all groups and versions. +// +// ServerGroupsAndResourcesWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerGroupsAndResourcesWithContext instead. func (d *memCacheClient) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { - return discovery.ServerGroupsAndResources(d) + return d.ServerGroupsAndResourcesWithContext(context.Background()) +} + +// ServerGroupsAndResources returns the groups and supported resources for all groups and versions. +func (d *memCacheClient) ServerGroupsAndResourcesWithContext(ctx context.Context) ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { + return discovery.ServerGroupsAndResourcesWithContext(ctx, d) } // GroupsAndMaybeResources returns the list of APIGroups, and possibly the map of group/version // to resources. The returned groups will never be nil, but the resources map can be nil // if there are no cached resources. +// +// GroupsAndMaybeResourcesWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use GroupsAndMaybeResourcesWithContext instead. func (d *memCacheClient) GroupsAndMaybeResources() (*metav1.APIGroupList, map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error, error) { + return d.GroupsAndMaybeResourcesWithContext(context.Background()) +} + +// GroupsAndMaybeResourcesWithContext returns the list of APIGroups, and possibly the map of group/version +// to resources. The returned groups will never be nil, but the resources map can be nil +// if there are no cached resources. +func (d *memCacheClient) GroupsAndMaybeResourcesWithContext(ctx context.Context) (*metav1.APIGroupList, map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error, error) { + if err := ctx.Err(); err != nil { + return nil, nil, nil, err + } + d.lock.Lock() defer d.lock.Unlock() if !d.cacheValid { - if err := d.refreshLocked(); err != nil { + if err := d.refreshLocked(ctx); err != nil { return nil, nil, nil, err } } @@ -166,8 +202,15 @@ func (d *memCacheClient) GroupsAndMaybeResources() (*metav1.APIGroupList, map[sc return d.groupList, resourcesMap, failedGVs, nil } +// ServerGroupsWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerGroupsWithContext instead. func (d *memCacheClient) ServerGroups() (*metav1.APIGroupList, error) { - groups, _, _, err := d.GroupsAndMaybeResources() + return d.ServerGroupsWithContext(context.Background()) +} + +func (d *memCacheClient) ServerGroupsWithContext(ctx context.Context) (*metav1.APIGroupList, error) { + groups, _, _, err := d.GroupsAndMaybeResourcesWithContext(ctx) if err != nil { return nil, err } @@ -178,35 +221,81 @@ func (d *memCacheClient) RESTClient() restclient.Interface { return d.delegate.RESTClient() } +// ServerPreferredResourcesWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerPreferredResourcesWithContext instead. func (d *memCacheClient) ServerPreferredResources() ([]*metav1.APIResourceList, error) { - return discovery.ServerPreferredResources(d) + return d.ServerPreferredResourcesWithContext(context.Background()) } +func (d *memCacheClient) ServerPreferredResourcesWithContext(ctx context.Context) ([]*metav1.APIResourceList, error) { + return discovery.ServerPreferredResourcesWithContext(ctx, d) +} + +// ServerPreferredNamespacedResourcesWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerPreferredNamespacedResourcesWithContext instead. func (d *memCacheClient) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) { - return discovery.ServerPreferredNamespacedResources(d) + return d.ServerPreferredNamespacedResourcesWithContext(context.Background()) } +func (d *memCacheClient) ServerPreferredNamespacedResourcesWithContext(ctx context.Context) ([]*metav1.APIResourceList, error) { + return discovery.ServerPreferredNamespacedResourcesWithContext(ctx, d) +} + +// ServerVersionWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerVersionWithContext instead. func (d *memCacheClient) ServerVersion() (*version.Info, error) { - return d.delegate.ServerVersion() + return d.ServerVersionWithContext(context.Background()) +} + +func (d *memCacheClient) ServerVersionWithContext(ctx context.Context) (*version.Info, error) { + return d.delegate.ServerVersionWithContext(ctx) } +// OpenAPISchemaWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use OpenAPISchemaWithContext instead. func (d *memCacheClient) OpenAPISchema() (*openapi_v2.Document, error) { - return d.delegate.OpenAPISchema() + return d.OpenAPISchemaWithContext(context.Background()) +} + +func (d *memCacheClient) OpenAPISchemaWithContext(ctx context.Context) (*openapi_v2.Document, error) { + return d.delegate.OpenAPISchemaWithContext(ctx) } +// OpenAPIV3WithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use OpenAPIV3WithContext instead. func (d *memCacheClient) OpenAPIV3() openapi.Client { + return d.openAPIV3(context.Background()) +} + +func (d *memCacheClient) OpenAPIV3WithContext(ctx context.Context) openapi.ClientWithContext { + return d.openAPIV3(ctx) +} + +func (d *memCacheClient) openAPIV3(ctx context.Context) *cachedopenapi.Client { // Must take lock since Invalidate call may modify openapiClient d.lock.Lock() defer d.lock.Unlock() if d.openapiClient == nil { - d.openapiClient = cachedopenapi.NewClient(d.delegate.OpenAPIV3()) + d.openapiClient = cachedopenapi.NewClientWithContext(d.delegate.OpenAPIV3WithContext(ctx)) } return d.openapiClient } +// FreshWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use FreshWithContext instead. func (d *memCacheClient) Fresh() bool { + return d.FreshWithContext(context.Background()) +} + +func (d *memCacheClient) FreshWithContext(ctx context.Context) bool { d.lock.RLock() defer d.lock.RUnlock() // Return whether the cache is populated at all. It is still possible that @@ -217,7 +306,17 @@ func (d *memCacheClient) Fresh() bool { // Invalidate enforces that no cached data that is older than the current time // is used. +// +// InvalidateWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use InvalidateWithContext instead. func (d *memCacheClient) Invalidate() { + d.InvalidateWithContext(context.Background()) +} + +// InvalidateWithContext enforces that no cached data that is older than the current time +// is used. +func (d *memCacheClient) InvalidateWithContext(ctx context.Context) { d.lock.Lock() defer d.lock.Unlock() d.cacheValid = false @@ -225,24 +324,41 @@ func (d *memCacheClient) Invalidate() { d.groupList = nil d.openapiClient = nil d.receivedAggregatedDiscovery = false - if ad, ok := d.delegate.(discovery.CachedDiscoveryInterface); ok { - ad.Invalidate() + ad, ok := d.delegate.(discovery.CachedDiscoveryInterfaceWithContext) + if !ok { + //nolint:staticcheck // Intentionally using the old interface here. + ad2, ok2 := d.delegate.(discovery.CachedDiscoveryInterface) + if ok2 { + ad = discovery.ToCachedDiscoveryInterfaceWithContext(ad2) + ok = true + } + } + if ok { + ad.InvalidateWithContext(ctx) } } // refreshLocked refreshes the state of cache. The caller must hold d.lock for // writing. -func (d *memCacheClient) refreshLocked() error { +func (d *memCacheClient) refreshLocked(ctx context.Context) error { // TODO: Could this multiplicative set of calls be replaced by a single call // to ServerResources? If it's possible for more than one resulting // APIResourceList to have the same GroupVersion, the lists would need merged. var gl *metav1.APIGroupList var err error - if ad, ok := d.delegate.(discovery.AggregatedDiscoveryInterface); ok { + ad, ok := d.delegate.(discovery.AggregatedDiscoveryInterfaceWithContext) + if !ok { + //nolint:staticcheck // Intentionally using the old interface here. + if ad2, ok2 := d.delegate.(discovery.AggregatedDiscoveryInterface); ok2 { + ad = discovery.ToAggregatedDiscoveryInterfaceWithContext(ad2) + ok = true + } + } + if ok { var resources map[schema.GroupVersion]*metav1.APIResourceList var failedGVs map[schema.GroupVersion]error - gl, resources, failedGVs, err = ad.GroupsAndMaybeResources() + gl, resources, failedGVs, err = ad.GroupsAndMaybeResourcesWithContext(ctx) if resources != nil && err == nil { // Cache the resources. d.groupToServerResources = map[string]*cacheEntry{} @@ -259,10 +375,10 @@ func (d *memCacheClient) refreshLocked() error { return nil } } else { - gl, err = d.delegate.ServerGroups() + gl, err = d.delegate.ServerGroupsWithContext(ctx) } if err != nil || len(gl.Groups) == 0 { - utilruntime.HandleError(fmt.Errorf("couldn't get current server API group list: %v", err)) + utilruntime.HandleErrorWithContext(ctx, err, "Couldn't get current server API group list") return err } @@ -275,16 +391,16 @@ func (d *memCacheClient) refreshLocked() error { wg.Add(1) go func() { defer wg.Done() - defer utilruntime.HandleCrash() + defer utilruntime.HandleCrashWithContext(ctx) - r, err := d.serverResourcesForGroupVersion(gv) + r, err := d.serverResourcesForGroupVersion(ctx, gv) if err != nil { // Don't log "empty response" as an error; it is a common response for metrics. if _, emptyErr := err.(*emptyResponseError); emptyErr { // Log at same verbosity as disk cache. - klog.V(3).Infof("%v", err) + klog.FromContext(ctx).V(3).Info(err.Error()) } else { - utilruntime.HandleError(fmt.Errorf("couldn't get resource list for %v: %v", gv, err)) + utilruntime.HandleErrorWithContext(ctx, err, "Couldn't get resource list", "groupVersion", gv) } } @@ -301,8 +417,8 @@ func (d *memCacheClient) refreshLocked() error { return nil } -func (d *memCacheClient) serverResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) { - r, err := d.delegate.ServerResourcesForGroupVersion(groupVersion) +func (d *memCacheClient) serverResourcesForGroupVersion(ctx context.Context, groupVersion string) (*metav1.APIResourceList, error) { + r, err := d.delegate.ServerResourcesForGroupVersionWithContext(ctx, groupVersion) if err != nil { return r, err } @@ -314,16 +430,43 @@ func (d *memCacheClient) serverResourcesForGroupVersion(groupVersion string) (*m // WithLegacy returns current memory-cached discovery client; // current client does not support legacy-only discovery. +// +// WithLegacyWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use WithLegacyWithContext instead. func (d *memCacheClient) WithLegacy() discovery.DiscoveryInterface { return d } +// WithLegacyWithContext returns current memory-cached discovery client; +// current client does not support legacy-only discovery. +func (d *memCacheClient) WithLegacyWithContext(ctx context.Context) discovery.DiscoveryInterfaceWithContext { + return d +} + // NewMemCacheClient creates a new CachedDiscoveryInterface which caches // discovery information in memory and will stay up-to-date if Invalidate is // called with regularity. // // NOTE: The client will NOT resort to live lookups on cache misses. +// +// NewMemCacheClientWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use NewMemCacheClientWithContext instead. func NewMemCacheClient(delegate discovery.DiscoveryInterface) discovery.CachedDiscoveryInterface { + return newMemCacheClient(discovery.ToDiscoveryInterfaceWithContext(delegate)) +} + +// NewMemCacheClientWithContext creates a new CachedDiscoveryInterfaceWithContext which caches +// discovery information in memory and will stay up-to-date if Invalidate is +// called with regularity. +// +// NOTE: The client will NOT resort to live lookups on cache misses. +func NewMemCacheClientWithContext(delegate discovery.DiscoveryInterfaceWithContext) discovery.CachedDiscoveryInterfaceWithContext { + return newMemCacheClient(delegate) +} + +func newMemCacheClient(delegate discovery.DiscoveryInterfaceWithContext) *memCacheClient { return &memCacheClient{ delegate: delegate, groupToServerResources: map[string]*cacheEntry{}, diff --git a/vendor/k8s.io/client-go/discovery/discovery_client.go b/vendor/k8s.io/client-go/discovery/discovery_client.go index aae94f9b8a..355c701939 100644 --- a/vendor/k8s.io/client-go/discovery/discovery_client.go +++ b/vendor/k8s.io/client-go/discovery/discovery_client.go @@ -33,7 +33,6 @@ import ( "google.golang.org/protobuf/proto" apidiscoveryv2 "k8s.io/api/apidiscovery/v2" - apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -60,22 +59,24 @@ const ( defaultBurst = 300 AcceptV1 = runtime.ContentTypeJSON - // Aggregated discovery content-type (v2beta1). NOTE: content-type parameters + // Aggregated discovery content-type. NOTE: content-type parameters // MUST be ordered (g, v, as) for server in "Accept" header (BUT we are resilient // to ordering when comparing returned values in "Content-Type" header). - AcceptV2Beta1 = runtime.ContentTypeJSON + ";" + "g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList" AcceptV2 = runtime.ContentTypeJSON + ";" + "g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList" AcceptV2NoPeer = runtime.ContentTypeJSON + ";" + "g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList;profile=nopeer" // Prioritize aggregated discovery by placing first in the order of discovery accept types. - acceptDiscoveryFormats = AcceptV2 + "," + AcceptV2Beta1 + "," + AcceptV1 + acceptDiscoveryFormats = AcceptV2 + "," + AcceptV1 ) // Aggregated discovery content-type GVK. -var v2Beta1GVK = schema.GroupVersionKind{Group: "apidiscovery.k8s.io", Version: "v2beta1", Kind: "APIGroupDiscoveryList"} var v2GVK = schema.GroupVersionKind{Group: "apidiscovery.k8s.io", Version: "v2", Kind: "APIGroupDiscoveryList"} // DiscoveryInterface holds the methods that discover server-supported API groups, // versions and resources. +// +// DiscoveryInterfaceWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use DiscoveryInterfaceWithContext instead. type DiscoveryInterface interface { RESTClient() restclient.Interface ServerGroupsInterface @@ -86,22 +87,123 @@ type DiscoveryInterface interface { // Returns copy of current discovery client that will only // receive the legacy discovery format, or pointer to current // discovery client if it does not support legacy-only discovery. + // + // DiscoveryInterfaceWithContext.WithLegacyWithContext is a better alternative because it supports contextual logging and cancellation. + // + // Contextual logging: Use DiscoveryInterfaceWithContext.WithLegacyWithContext instead. WithLegacy() DiscoveryInterface } +// DiscoveryInterfaceWithContext holds the methods that discover server-supported API groups, +// versions and resources. +type DiscoveryInterfaceWithContext interface { + RESTClient() restclient.Interface + ServerGroupsInterfaceWithContext + ServerResourcesInterfaceWithContext + ServerVersionInterfaceWithContext + OpenAPISchemaInterfaceWithContext + OpenAPIV3SchemaInterfaceWithContext + // Returns copy of current discovery client that will only + // receive the legacy discovery format, or pointer to current + // discovery client if it does not support legacy-only discovery. + WithLegacyWithContext(ctx context.Context) DiscoveryInterfaceWithContext +} + +// DiscoveryInterfaces combines both interface variants. +type DiscoveryInterfaces interface { + DiscoveryInterface + DiscoveryInterfaceWithContext +} + +func ToDiscoveryInterfaceWithContext(i DiscoveryInterface) DiscoveryInterfaceWithContext { + if i == nil { + return nil + } + if i, ok := i.(DiscoveryInterfaceWithContext); ok { + return i + } + return &discoveryInterfaceWrapper{ + ServerGroupsInterfaceWithContext: ToServerGroupsInterfaceWithContext(i), + ServerResourcesInterfaceWithContext: ToServerResourcesInterfaceWithContext(i), + ServerVersionInterfaceWithContext: ToServerVersionInterfaceWithContext(i), + OpenAPISchemaInterfaceWithContext: ToOpenAPISchemaInterfaceWithContext(i), + OpenAPIV3SchemaInterfaceWithContext: OpenAPIV3ToSchemaInterfaceWithContext(i), + delegate: i, + } +} + +type discoveryInterfaceWrapper struct { + ServerGroupsInterfaceWithContext + ServerResourcesInterfaceWithContext + ServerVersionInterfaceWithContext + OpenAPISchemaInterfaceWithContext + OpenAPIV3SchemaInterfaceWithContext + delegate DiscoveryInterface +} + +func (i *discoveryInterfaceWrapper) RESTClient() restclient.Interface { + return i.delegate.RESTClient() +} + +func (i *discoveryInterfaceWrapper) WithLegacyWithContext(ctx context.Context) DiscoveryInterfaceWithContext { + return ToDiscoveryInterfaceWithContext(i.delegate.WithLegacy()) +} + // AggregatedDiscoveryInterface extends DiscoveryInterface to include a method to possibly // return discovery resources along with the discovery groups, which is what the newer // aggregated discovery format does (APIGroupDiscoveryList). +// +// AggregatedDiscoveryInterfaceWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use AggregatedDiscoveryInterfaceWithContext instead. type AggregatedDiscoveryInterface interface { DiscoveryInterface + // AggregatedDiscoveryInterfaceWithContext.GroupsAndMaybeResourcesWithContext is a better alternative because it supports contextual logging and cancellation. + // + // Contextual logging: Use AggregatedDiscoveryInterfaceWithContext.GroupsAndMaybeResourcesWithContext instead. GroupsAndMaybeResources() (*metav1.APIGroupList, map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error, error) } +// AggregatedDiscoveryInterfaceWithContext extends DiscoveryInterface to include a method to possibly +// return discovery resources along with the discovery groups, which is what the newer +// aggregated discovery format does (APIGroupDiscoveryList). +type AggregatedDiscoveryInterfaceWithContext interface { + DiscoveryInterfaceWithContext + + GroupsAndMaybeResourcesWithContext(ctx context.Context) (*metav1.APIGroupList, map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error, error) +} + +func ToAggregatedDiscoveryInterfaceWithContext(i AggregatedDiscoveryInterface) AggregatedDiscoveryInterfaceWithContext { + if i == nil { + return nil + } + if i, ok := i.(AggregatedDiscoveryInterfaceWithContext); ok { + return i + } + return &aggregatedDiscoveryInterfaceWrapper{ + DiscoveryInterfaceWithContext: ToDiscoveryInterfaceWithContext(i), + delegate: i, + } +} + +type aggregatedDiscoveryInterfaceWrapper struct { + DiscoveryInterfaceWithContext + delegate AggregatedDiscoveryInterface +} + +func (i *aggregatedDiscoveryInterfaceWrapper) GroupsAndMaybeResourcesWithContext(ctx context.Context) (*metav1.APIGroupList, map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error, error) { + return i.delegate.GroupsAndMaybeResources() +} + // CachedDiscoveryInterface is a DiscoveryInterface with cache invalidation and freshness. // Note that If the ServerResourcesForGroupVersion method returns a cache miss // error, the user needs to explicitly call Invalidate to clear the cache, // otherwise the same cache miss error will be returned next time. +// +// CachedDiscoveryInterfaceWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use CachedDiscoveryInterfaceWithContext instead. type CachedDiscoveryInterface interface { DiscoveryInterface // Fresh is supposed to tell the caller whether or not to retry if the cache @@ -109,58 +211,343 @@ type CachedDiscoveryInterface interface { // // TODO: this needs to be revisited, this interface can't be locked properly // and doesn't make a lot of sense. + // + // CachedDiscoveryInterfaceWithContext.FreshWithContext is a better alternative because it supports contextual logging and cancellation. + // + // Contextual logging: Use CachedDiscoveryInterfaceWithContext.FreshWithContext instead. Fresh() bool // Invalidate enforces that no cached data that is older than the current time // is used. + // + // CachedDiscoveryInterfaceWithContext.InvalidateWithContext is a better alternative because it supports contextual logging and cancellation. + // + // Contextual logging: Use CachedDiscoveryInterfaceWithContext.InvalidateWithContext instead. Invalidate() } +// CachedDiscoveryInterfaceWithContext is a DiscoveryInterfaceWithContext with cache invalidation and freshness. +// Note that If the ServerResourcesForGroupVersion method returns a cache miss +// error, the user needs to explicitly call Invalidate to clear the cache, +// otherwise the same cache miss error will be returned next time. +type CachedDiscoveryInterfaceWithContext interface { + DiscoveryInterfaceWithContext + // Fresh is supposed to tell the caller whether or not to retry if the cache + // fails to find something (false = retry, true = no need to retry). + // + // TODO: this needs to be revisited, this interface can't be locked properly + // and doesn't make a lot of sense. + FreshWithContext(ctx context.Context) bool + // Invalidate enforces that no cached data that is older than the current time + // is used. + InvalidateWithContext(ctx context.Context) +} + +func ToCachedDiscoveryInterfaceWithContext(i CachedDiscoveryInterface) CachedDiscoveryInterfaceWithContext { + if i == nil { + return nil + } + if i, ok := i.(CachedDiscoveryInterfaceWithContext); ok { + return i + } + return &cachedDiscoveryInterfaceWrapper{ + DiscoveryInterfaceWithContext: ToDiscoveryInterfaceWithContext(i), + delegate: i, + } +} + +type cachedDiscoveryInterfaceWrapper struct { + DiscoveryInterfaceWithContext + delegate CachedDiscoveryInterface +} + +func (i *cachedDiscoveryInterfaceWrapper) FreshWithContext(ctx context.Context) bool { + return i.delegate.Fresh() +} + +func (i *cachedDiscoveryInterfaceWrapper) InvalidateWithContext(ctx context.Context) { + i.delegate.Invalidate() +} + // ServerGroupsInterface has methods for obtaining supported groups on the API server +// +// ServerGroupsInterfaceWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerGroupsInterfaceWithContext instead. type ServerGroupsInterface interface { // ServerGroups returns the supported groups, with information like supported versions and the // preferred version. + // + // ServerGroupsInterfaceWithContext.ServerGroups is a better alternative because it supports contextual logging and cancellation. + // + // Contextual logging: Use ServerGroupsInterfaceWithContext.ServerGroups instead. ServerGroups() (*metav1.APIGroupList, error) } +// ServerGroupsInterfaceWithContext has methods for obtaining supported groups on the API server +type ServerGroupsInterfaceWithContext interface { + // ServerGroups returns the supported groups, with information like supported versions and the + // preferred version. + ServerGroupsWithContext(ctx context.Context) (*metav1.APIGroupList, error) +} + +func ToServerGroupsInterfaceWithContext(i ServerGroupsInterface) ServerGroupsInterfaceWithContext { + if i == nil { + return nil + } + if i, ok := i.(ServerGroupsInterfaceWithContext); ok { + return i + } + return &serverGroupsInterfaceWrapper{ + delegate: i, + } +} + +type serverGroupsInterfaceWrapper struct { + delegate ServerGroupsInterface +} + +func (i *serverGroupsInterfaceWrapper) ServerGroupsWithContext(ctx context.Context) (*metav1.APIGroupList, error) { + return i.delegate.ServerGroups() +} + // ServerResourcesInterface has methods for obtaining supported resources on the API server +// +// ServerGroupsAndResourcesWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerGroupsAndResourcesWithContext instead. type ServerResourcesInterface interface { // ServerResourcesForGroupVersion returns the supported resources for a group and version. + // + // ServerGroupsAndResourcesWithContext.ServerResourcesForGroupVersionWithContext is a better alternative because it supports contextual logging and cancellation. + // + // Contextual logging: Use ServerGroupsAndResourcesWithContext.ServerResourcesForGroupVersionWithContext instead. ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) // ServerGroupsAndResources returns the supported groups and resources for all groups and versions. // // The returned group and resource lists might be non-nil with partial results even in the // case of non-nil error. + // + // ServerGroupsAndResourcesWithContext.ServerGroupsAndResourcesWithContext is a better alternative because it supports contextual logging and cancellation. + // + // Contextual logging: Use ServerGroupsAndResourcesWithContext.ServerGroupsAndResourcesWithContext instead. ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) // ServerPreferredResources returns the supported resources with the version preferred by the // server. // // The returned group and resource lists might be non-nil with partial results even in the // case of non-nil error. + // + // ServerResourcesInterfaceWithContext.ServerPreferredResourcesWithContext is a better alternative because it supports contextual logging and cancellation. + // + // Contextual logging: Use ServerResourcesInterfaceWithContext.ServerPreferredResourcesWithContext instead. ServerPreferredResources() ([]*metav1.APIResourceList, error) // ServerPreferredNamespacedResources returns the supported namespaced resources with the // version preferred by the server. // // The returned resource list might be non-nil with partial results even in the case of // non-nil error. + // + // ServerResourcesInterfaceWithContext.ServerPreferredNamespacedResourcesWithContext is a better alternative because it supports contextual logging and cancellation. + // + // Contextual logging: Use ServerResourcesInterfaceWithContext.ServerPreferredNamespacedResourcesWithContext instead. ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) } +// ServerResourcesInterfaceWithContext has methods for obtaining supported resources on the API server +type ServerResourcesInterfaceWithContext interface { + // ServerResourcesForGroupVersionWithContext returns the supported resources for a group and version. + ServerResourcesForGroupVersionWithContext(ctx context.Context, groupVersion string) (*metav1.APIResourceList, error) + // ServerGroupsAndResourcesWithContext returns the supported groups and resources for all groups and versions. + // + // The returned group and resource lists might be non-nil with partial results even in the + // case of non-nil error. + ServerGroupsAndResourcesWithContext(ctx context.Context) ([]*metav1.APIGroup, []*metav1.APIResourceList, error) + // ServerPreferredResourcesWithContext returns the supported resources with the version preferred by the + // server. + // + // The returned group and resource lists might be non-nil with partial results even in the + // case of non-nil error. + ServerPreferredResourcesWithContext(ctx context.Context) ([]*metav1.APIResourceList, error) + // ServerPreferredNamespacedResourcesWithContext returns the supported namespaced resources with the + // version preferred by the server. + // + // The returned resource list might be non-nil with partial results even in the case of + // non-nil error. + ServerPreferredNamespacedResourcesWithContext(ctx context.Context) ([]*metav1.APIResourceList, error) +} + +func ToServerResourcesInterfaceWithContext(i ServerResourcesInterface) ServerResourcesInterfaceWithContext { + if i == nil { + return nil + } + if i, ok := i.(ServerResourcesInterfaceWithContext); ok { + return i + } + return &serverResourcesInterfaceWrapper{ + delegate: i, + } +} + +type serverResourcesInterfaceWrapper struct { + delegate ServerResourcesInterface +} + +func (i *serverResourcesInterfaceWrapper) ServerResourcesForGroupVersionWithContext(ctx context.Context, groupVersion string) (*metav1.APIResourceList, error) { + return i.delegate.ServerResourcesForGroupVersion(groupVersion) +} + +func (i *serverResourcesInterfaceWrapper) ServerGroupsAndResourcesWithContext(ctx context.Context) ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { + return i.delegate.ServerGroupsAndResources() +} + +func (i *serverResourcesInterfaceWrapper) ServerPreferredResourcesWithContext(ctx context.Context) ([]*metav1.APIResourceList, error) { + return i.delegate.ServerPreferredResources() +} + +func (i *serverResourcesInterfaceWrapper) ServerPreferredNamespacedResourcesWithContext(ctx context.Context) ([]*metav1.APIResourceList, error) { + return i.delegate.ServerPreferredNamespacedResources() +} + // ServerVersionInterface has a method for retrieving the server's version. +// +// ServerVersionInterfaceWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerVersionInterfaceWithContext instead. type ServerVersionInterface interface { // ServerVersion retrieves and parses the server's version (git version). + // + // ServerVersionInterfaceWithContext.ServerVersionWithContext is a better alternative because it supports contextual logging and cancellation. + // + // Contextual logging: Use ServerVersionInterfaceWithContext.ServerVersionWithContext instead. ServerVersion() (*version.Info, error) } +// ServerVersionInterface has a method for retrieving the server's version. +type ServerVersionInterfaceWithContext interface { + // ServerVersion retrieves and parses the server's version (git version). + ServerVersionWithContext(ctx context.Context) (*version.Info, error) +} + +func ToServerVersionInterfaceWithContext(i ServerVersionInterface) ServerVersionInterfaceWithContext { + if i == nil { + return nil + } + if i, ok := i.(ServerVersionInterfaceWithContext); ok { + return i + } + return &serverVersionInterfaceWrapper{ + delegate: i, + } +} + +type serverVersionInterfaceWrapper struct { + delegate ServerVersionInterface +} + +func (i *serverVersionInterfaceWrapper) ServerVersionWithContext(ctx context.Context) (*version.Info, error) { + return i.delegate.ServerVersion() +} + // OpenAPISchemaInterface has a method to retrieve the open API schema. +// +// OpenAPISchemaInterfaceWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use OpenAPISchemaInterfaceWithContext instead. type OpenAPISchemaInterface interface { // OpenAPISchema retrieves and parses the swagger API schema the server supports. + // + // OpenAPISchemaInterfaceWithContext.OpenAPISchemaWithContext is a better alternative because it supports contextual logging and cancellation. + // + // Contextual logging: Use OpenAPISchemaInterfaceWithContext.OpenAPISchemaWithContext instead. OpenAPISchema() (*openapi_v2.Document, error) } +// OpenAPISchemaInterfaceWithContext has a method to retrieve the open API schema. +type OpenAPISchemaInterfaceWithContext interface { + // OpenAPISchemaWithContext retrieves and parses the swagger API schema the server supports. + OpenAPISchemaWithContext(ctx context.Context) (*openapi_v2.Document, error) +} + +func ToOpenAPISchemaInterfaceWithContext(i OpenAPISchemaInterface) OpenAPISchemaInterfaceWithContext { + if i == nil { + return nil + } + if i, ok := i.(OpenAPISchemaInterfaceWithContext); ok { + return i + } + return &openAPISchemaInterfaceWrapper{ + delegate: i, + } +} + +type openAPISchemaInterfaceWrapper struct { + delegate OpenAPISchemaInterface +} + +func (i *openAPISchemaInterfaceWrapper) OpenAPISchemaWithContext(ctx context.Context) (*openapi_v2.Document, error) { + return i.delegate.OpenAPISchema() +} + +// OpenAPIV3SchemaInterfaceWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use OpenAPIV3SchemaInterfaceWithContext instead. type OpenAPIV3SchemaInterface interface { + // OpenAPIV3SchemaInterfaceWithContext.OpenAPIV3WithContext is a better alternative because it supports contextual logging and cancellation. + // + // Contextual logging: Use OpenAPIV3SchemaInterfaceWithContext.OpenAPIV3WithContext instead. OpenAPIV3() openapi.Client } +type OpenAPIV3SchemaInterfaceWithContext interface { + OpenAPIV3WithContext(ctx context.Context) openapi.ClientWithContext +} + +func OpenAPIV3ToSchemaInterfaceWithContext(i OpenAPIV3SchemaInterface) OpenAPIV3SchemaInterfaceWithContext { + if i == nil { + return nil + } + if i, ok := i.(OpenAPIV3SchemaInterfaceWithContext); ok { + return i + } + return &openAPIV3SchemaInterfaceWrapper{ + delegate: i, + } +} + +type openAPIV3SchemaInterfaceWrapper struct { + delegate OpenAPIV3SchemaInterface +} + +func (i *openAPIV3SchemaInterfaceWrapper) OpenAPIV3WithContext(ctx context.Context) openapi.ClientWithContext { + return ToOpenAPIClientWithContext(i.delegate.OpenAPIV3()) +} + +func ToOpenAPIClientWithContext(i openapi.Client) openapi.ClientWithContext { //nolint:staticcheck // Intentionally using the old interface here. + if i == nil { + return nil + } + if i, ok := i.(openapi.ClientWithContext); ok { + return i + } + return &openAPIClientWrapper{ + delegate: i, + } +} + +type openAPIClientWrapper struct { + //nolint:staticcheck // Intentionally using the old interface here. + delegate openapi.Client +} + +func (i *openAPIClientWrapper) PathsWithContext(ctx context.Context) (map[string]openapi.GroupVersionWithContext, error) { + resultWithoutContext, err := i.delegate.Paths() + result := make(map[string]openapi.GroupVersionWithContext, len(resultWithoutContext)) + for key, entry := range resultWithoutContext { + result[key] = openapi.ToGroupVersionWithContext(entry) + } + return result, err +} + // DiscoveryClient implements the functions that discover server-supported API groups, // versions and resources. type DiscoveryClient struct { @@ -202,19 +589,42 @@ func apiVersionsToAPIGroup(apiVersions *metav1.APIVersions) (apiGroup metav1.API // as aggregated discovery format or legacy format. For safety, resources will only // be returned if both endpoints returned resources. Returned "failedGVs" can be // empty, but will only be nil in the case an error is returned. +// +// GroupsAndMaybeResourcesWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use GroupsAndMaybeResourcesWithContext instead. func (d *DiscoveryClient) GroupsAndMaybeResources() ( *metav1.APIGroupList, map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error, error) { + return d.GroupsAndMaybeResourcesWithContext(context.Background()) +} + +// GroupsAndMaybeResources returns the discovery groups, and (if new aggregated +// discovery format) the resources keyed by group/version. Merges discovery groups +// and resources from /api and /apis (either aggregated or not). Legacy groups +// must be ordered first. The server will either return both endpoints (/api, /apis) +// as aggregated discovery format or legacy format. For safety, resources will only +// be returned if both endpoints returned resources. Returned "failedGVs" can be +// empty, but will only be nil in the case an error is returned. +func (d *DiscoveryClient) GroupsAndMaybeResourcesWithContext(ctx context.Context) ( + *metav1.APIGroupList, + map[schema.GroupVersion]*metav1.APIResourceList, + map[schema.GroupVersion]error, + error) { + if err := ctx.Err(); err != nil { + return nil, nil, nil, err + } + // Legacy group ordered first (there is only one -- core/v1 group). Returned groups must // be non-nil, but it could be empty. Returned resources, apiResources map could be nil. - groups, resources, failedGVs, err := d.downloadLegacy() + groups, resources, failedGVs, err := d.downloadLegacy(ctx) if err != nil { return nil, nil, nil, err } // Discovery groups and (possibly) resources downloaded from /apis. - apiGroups, apiResources, failedApisGVs, aerr := d.downloadAPIs() + apiGroups, apiResources, failedApisGVs, aerr := d.downloadAPIs(ctx) if aerr != nil { return nil, nil, nil, aerr } @@ -242,7 +652,7 @@ func (d *DiscoveryClient) GroupsAndMaybeResources() ( // possible for the resource map to be nil if the server returned // the unaggregated discovery. Returned "failedGVs" can be empty, but // will only be nil in the case of a returned error. -func (d *DiscoveryClient) downloadLegacy() ( +func (d *DiscoveryClient) downloadLegacy(ctx context.Context) ( *metav1.APIGroupList, map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error, @@ -252,7 +662,7 @@ func (d *DiscoveryClient) downloadLegacy() ( body, err := d.restClient.Get(). AbsPath("/api"). SetHeader("Accept", accept). - Do(context.TODO()). + Do(ctx). ContentType(&responseContentType). Raw() apiGroupList := &metav1.APIGroupList{} @@ -277,13 +687,6 @@ func (d *DiscoveryClient) downloadLegacy() ( return nil, nil, nil, err } apiGroupList, resourcesByGV, failedGVs = SplitGroupsAndResources(aggregatedDiscovery) - } else if isGVK, _ := ContentTypeIsGVK(responseContentType, v2Beta1GVK); isGVK { - var aggregatedDiscovery apidiscoveryv2beta1.APIGroupDiscoveryList - err = json.Unmarshal(body, &aggregatedDiscovery) - if err != nil { - return nil, nil, nil, err - } - apiGroupList, resourcesByGV, failedGVs = SplitGroupsAndResourcesV2Beta1(aggregatedDiscovery) } else { // Default is unaggregated discovery v1. var v metav1.APIVersions @@ -305,7 +708,7 @@ func (d *DiscoveryClient) downloadLegacy() ( // discovery resources. The returned groups will always exist, but the // resources map may be nil. Returned "failedGVs" can be empty, but will // only be nil in the case of a returned error. -func (d *DiscoveryClient) downloadAPIs() ( +func (d *DiscoveryClient) downloadAPIs(ctx context.Context) ( *metav1.APIGroupList, map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error, @@ -315,7 +718,7 @@ func (d *DiscoveryClient) downloadAPIs() ( body, err := d.restClient.Get(). AbsPath("/apis"). SetHeader("Accept", accept). - Do(context.TODO()). + Do(ctx). ContentType(&responseContentType). Raw() if err != nil { @@ -333,13 +736,6 @@ func (d *DiscoveryClient) downloadAPIs() ( return nil, nil, nil, err } apiGroupList, resourcesByGV, failedGVs = SplitGroupsAndResources(aggregatedDiscovery) - } else if isGVK, _ := ContentTypeIsGVK(responseContentType, v2Beta1GVK); isGVK { - var aggregatedDiscovery apidiscoveryv2beta1.APIGroupDiscoveryList - err = json.Unmarshal(body, &aggregatedDiscovery) - if err != nil { - return nil, nil, nil, err - } - apiGroupList, resourcesByGV, failedGVs = SplitGroupsAndResourcesV2Beta1(aggregatedDiscovery) } else { // Default is unaggregated discovery v1. err = json.Unmarshal(body, apiGroupList) @@ -368,9 +764,9 @@ func selectDiscoveryAcceptHeader(useLegacy, nopeer bool) string { // content-type parameters, as well as parameters added by // intermediaries such as proxies or gateways. Examples: // -// ("application/json; g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList", {apidiscovery.k8s.io, v2beta1, APIGroupDiscoveryList}) = (true, nil) -// ("application/json; as=APIGroupDiscoveryList;v=v2beta1;g=apidiscovery.k8s.io", {apidiscovery.k8s.io, v2beta1, APIGroupDiscoveryList}) = (true, nil) -// ("application/json; as=APIGroupDiscoveryList;v=v2beta1;g=apidiscovery.k8s.io;charset=utf-8", {apidiscovery.k8s.io, v2beta1, APIGroupDiscoveryList}) = (true, nil) +// ("application/json; g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList", {apidiscovery.k8s.io, v2, APIGroupDiscoveryList}) = (true, nil) +// ("application/json; as=APIGroupDiscoveryList;v=v2;g=apidiscovery.k8s.io", {apidiscovery.k8s.io, v2, APIGroupDiscoveryList}) = (true, nil) +// ("application/json; as=APIGroupDiscoveryList;v=v2;g=apidiscovery.k8s.io;charset=utf-8", {apidiscovery.k8s.io, v2, APIGroupDiscoveryList}) = (true, nil) // ("application/json", any GVK) = (false, nil) // ("application/json; charset=UTF-8", any GVK) = (false, nil) // ("malformed content type string", any GVK) = (false, error) @@ -388,8 +784,18 @@ func ContentTypeIsGVK(contentType string, gvk schema.GroupVersionKind) (bool, er // ServerGroups returns the supported groups, with information like supported versions and the // preferred version. +// +// ServerGroupsWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerGroupsWithContext instead. func (d *DiscoveryClient) ServerGroups() (*metav1.APIGroupList, error) { - groups, _, _, err := d.GroupsAndMaybeResources() + return d.ServerGroupsWithContext(context.Background()) +} + +// ServerGroupsWithContext returns the supported groups, with information like supported versions and the +// preferred version. +func (d *DiscoveryClient) ServerGroupsWithContext(ctx context.Context) (*metav1.APIGroupList, error) { + groups, _, _, err := d.GroupsAndMaybeResourcesWithContext(ctx) if err != nil { return nil, err } @@ -397,7 +803,16 @@ func (d *DiscoveryClient) ServerGroups() (*metav1.APIGroupList, error) { } // ServerResourcesForGroupVersion returns the supported resources for a group and version. +// +// ServerResourcesForGroupVersionWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerResourcesForGroupVersionWithContext instead. func (d *DiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (resources *metav1.APIResourceList, err error) { + return d.ServerResourcesForGroupVersionWithContext(context.Background(), groupVersion) +} + +// ServerResourcesForGroupVersionWithContext returns the supported resources for a group and version. +func (d *DiscoveryClient) ServerResourcesForGroupVersionWithContext(ctx context.Context, groupVersion string) (resources *metav1.APIResourceList, err error) { url := url.URL{} if len(groupVersion) == 0 { return nil, fmt.Errorf("groupVersion shouldn't be empty") @@ -410,7 +825,7 @@ func (d *DiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (r resources = &metav1.APIResourceList{ GroupVersion: groupVersion, } - err = d.restClient.Get().AbsPath(url.String()).Do(context.TODO()).Into(resources) + err = d.restClient.Get().AbsPath(url.String()).Do(ctx).Into(resources) if err != nil { // Tolerate core/v1 not found response by returning empty resource list; // this probably should not happen. But we should verify all callers are @@ -425,8 +840,13 @@ func (d *DiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (r // ServerGroupsAndResources returns the supported resources for all groups and versions. func (d *DiscoveryClient) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { - return withRetries(defaultRetries, func() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { - return ServerGroupsAndResources(d) + return d.ServerGroupsAndResourcesWithContext(context.Background()) +} + +// ServerGroupsAndResourcesWithContext returns the supported resources for all groups and versions. +func (d *DiscoveryClient) ServerGroupsAndResourcesWithContext(ctx context.Context) ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { + return withRetries(ctx, defaultRetries, func() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { + return ServerGroupsAndResourcesWithContext(ctx, d) }) } @@ -469,7 +889,18 @@ func GroupDiscoveryFailedErrorGroups(err error) (map[schema.GroupVersion]error, return nil, false } +// ServerGroupsAndResourcesWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerGroupsAndResourcesWithContext instead. func ServerGroupsAndResources(d DiscoveryInterface) ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { + return ServerGroupsAndResourcesWithContext(context.Background(), ToDiscoveryInterfaceWithContext(d)) +} + +func ServerGroupsAndResourcesWithContext(ctx context.Context, d DiscoveryInterfaceWithContext) ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { + if err := ctx.Err(); err != nil { + return nil, nil, err + } + var sgs *metav1.APIGroupList var resources []*metav1.APIResourceList var failedGVs map[schema.GroupVersion]error @@ -477,14 +908,21 @@ func ServerGroupsAndResources(d DiscoveryInterface) ([]*metav1.APIGroup, []*meta // If the passed discovery object implements the wider AggregatedDiscoveryInterface, // then attempt to retrieve aggregated discovery with both groups and the resources. - if ad, ok := d.(AggregatedDiscoveryInterface); ok { + ad, ok := d.(AggregatedDiscoveryInterfaceWithContext) + if !ok { + if ad2, ok2 := d.(AggregatedDiscoveryInterface); ok2 { + ad = ToAggregatedDiscoveryInterfaceWithContext(ad2) + ok = true + } + } + if ok { var resourcesByGV map[schema.GroupVersion]*metav1.APIResourceList - sgs, resourcesByGV, failedGVs, err = ad.GroupsAndMaybeResources() + sgs, resourcesByGV, failedGVs, err = ad.GroupsAndMaybeResourcesWithContext(ctx) for _, resourceList := range resourcesByGV { resources = append(resources, resourceList) } } else { - sgs, err = d.ServerGroups() + sgs, err = d.ServerGroupsWithContext(ctx) } if sgs == nil { @@ -505,7 +943,7 @@ func ServerGroupsAndResources(d DiscoveryInterface) ([]*metav1.APIGroup, []*meta return resultGroups, resources, ferr } - groupVersionResources, failedGroups := fetchGroupVersionResources(d, sgs) + groupVersionResources, failedGroups := fetchGroupVersionResources(ctx, d, sgs) // order results by group/version discovery order result := []*metav1.APIResourceList{} @@ -526,7 +964,20 @@ func ServerGroupsAndResources(d DiscoveryInterface) ([]*metav1.APIGroup, []*meta } // ServerPreferredResources uses the provided discovery interface to look up preferred resources +// +// ServerPreferredResourcesWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerPreferredResourcesWithContext instead. func ServerPreferredResources(d DiscoveryInterface) ([]*metav1.APIResourceList, error) { + return ServerPreferredResourcesWithContext(context.Background(), ToDiscoveryInterfaceWithContext(d)) +} + +// ServerPreferredResourcesWithContext uses the provided discovery interface to look up preferred resources +func ServerPreferredResourcesWithContext(ctx context.Context, d DiscoveryInterfaceWithContext) ([]*metav1.APIResourceList, error) { + if err := ctx.Err(); err != nil { + return nil, err + } + var serverGroupList *metav1.APIGroupList var failedGroups map[schema.GroupVersion]error var groupVersionResources map[schema.GroupVersion]*metav1.APIResourceList @@ -535,18 +986,24 @@ func ServerPreferredResources(d DiscoveryInterface) ([]*metav1.APIResourceList, // If the passed discovery object implements the wider AggregatedDiscoveryInterface, // then it is attempt to retrieve both the groups and the resources. "failedGroups" // are Group/Versions returned as stale in AggregatedDiscovery format. - ad, ok := d.(AggregatedDiscoveryInterface) + ad, ok := d.(AggregatedDiscoveryInterfaceWithContext) + if !ok { + if ad2, ok2 := d.(AggregatedDiscoveryInterface); ok2 { + ad = ToAggregatedDiscoveryInterfaceWithContext(ad2) + ok = true + } + } if ok { - serverGroupList, groupVersionResources, failedGroups, err = ad.GroupsAndMaybeResources() + serverGroupList, groupVersionResources, failedGroups, err = ad.GroupsAndMaybeResourcesWithContext(ctx) } else { - serverGroupList, err = d.ServerGroups() + serverGroupList, err = d.ServerGroupsWithContext(ctx) } if err != nil { return nil, err } // Non-aggregated discovery must fetch resources from Groups. if groupVersionResources == nil { - groupVersionResources, failedGroups = fetchGroupVersionResources(d, serverGroupList) + groupVersionResources, failedGroups = fetchGroupVersionResources(ctx, d, serverGroupList) } result := []*metav1.APIResourceList{} @@ -602,7 +1059,7 @@ func ServerPreferredResources(d DiscoveryInterface) ([]*metav1.APIResourceList, } // fetchServerResourcesForGroupVersions uses the discovery client to fetch the resources for the specified groups in parallel. -func fetchGroupVersionResources(d DiscoveryInterface, apiGroups *metav1.APIGroupList) (map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error) { +func fetchGroupVersionResources(ctx context.Context, d DiscoveryInterfaceWithContext, apiGroups *metav1.APIGroupList) (map[schema.GroupVersion]*metav1.APIResourceList, map[schema.GroupVersion]error) { groupVersionResources := make(map[schema.GroupVersion]*metav1.APIResourceList) failedGroups := make(map[schema.GroupVersion]error) @@ -614,9 +1071,9 @@ func fetchGroupVersionResources(d DiscoveryInterface, apiGroups *metav1.APIGroup wg.Add(1) go func() { defer wg.Done() - defer utilruntime.HandleCrash() + defer utilruntime.HandleCrashWithContext(ctx) - apiResourceList, err := d.ServerResourcesForGroupVersion(groupVersion.String()) + apiResourceList, err := d.ServerResourcesForGroupVersionWithContext(ctx, groupVersion.String()) // lock to record results resultLock.Lock() @@ -640,23 +1097,56 @@ func fetchGroupVersionResources(d DiscoveryInterface, apiGroups *metav1.APIGroup // ServerPreferredResources returns the supported resources with the version preferred by the // server. +// +// ServerPreferredResourcesWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerPreferredResourcesWithContext instead. func (d *DiscoveryClient) ServerPreferredResources() ([]*metav1.APIResourceList, error) { - _, rs, err := withRetries(defaultRetries, func() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { + _, rs, err := withRetries(context.Background(), defaultRetries, func() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { rs, err := ServerPreferredResources(d) return nil, rs, err }) return rs, err } +// ServerPreferredResourcesWithContext returns the supported resources with the version preferred by the +// server. +func (d *DiscoveryClient) ServerPreferredResourcesWithContext(ctx context.Context) ([]*metav1.APIResourceList, error) { + _, rs, err := withRetries(ctx, defaultRetries, func() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { + rs, err := ServerPreferredResourcesWithContext(ctx, d) + return nil, rs, err + }) + return rs, err +} + // ServerPreferredNamespacedResources returns the supported namespaced resources with the // version preferred by the server. +// +// ServerPreferredNamespacedResourcesWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerPreferredNamespacedResourcesWithContext instead. func (d *DiscoveryClient) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) { return ServerPreferredNamespacedResources(d) } +// ServerPreferredNamespacedResources returns the supported namespaced resources with the +// version preferred by the server. +func (d *DiscoveryClient) ServerPreferredNamespacedResourcesWithContext(ctx context.Context) ([]*metav1.APIResourceList, error) { + return ServerPreferredNamespacedResourcesWithContext(ctx, d) +} + // ServerPreferredNamespacedResources uses the provided discovery interface to look up preferred namespaced resources +// +// ServerPreferredNamespacedResourcesWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerPreferredNamespacedResourcesWithContext instead. func ServerPreferredNamespacedResources(d DiscoveryInterface) ([]*metav1.APIResourceList, error) { - all, err := ServerPreferredResources(d) + return ServerPreferredNamespacedResourcesWithContext(context.Background(), ToDiscoveryInterfaceWithContext(d)) +} + +// ServerPreferredNamespacedResourcesWithContext uses the provided discovery interface to look up preferred namespaced resources +func ServerPreferredNamespacedResourcesWithContext(ctx context.Context, d DiscoveryInterfaceWithContext) ([]*metav1.APIResourceList, error) { + all, err := ServerPreferredResourcesWithContext(ctx, d) return FilteredBy(ResourcePredicateFunc(func(groupVersion string, r *metav1.APIResource) bool { return r.Namespaced }), all), err @@ -664,7 +1154,12 @@ func ServerPreferredNamespacedResources(d DiscoveryInterface) ([]*metav1.APIReso // ServerVersion retrieves and parses the server's version (git version). func (d *DiscoveryClient) ServerVersion() (*version.Info, error) { - body, err := d.restClient.Get().AbsPath("/version").Do(context.TODO()).Raw() + return d.ServerVersionWithContext(context.Background()) +} + +// ServerVersionWithContext retrieves and parses the server's version (git version). +func (d *DiscoveryClient) ServerVersionWithContext(ctx context.Context) (*version.Info, error) { + body, err := d.restClient.Get().AbsPath("/version").Do(ctx).Raw() if err != nil { return nil, err } @@ -678,7 +1173,12 @@ func (d *DiscoveryClient) ServerVersion() (*version.Info, error) { // OpenAPISchema fetches the open api v2 schema using a rest client and parses the proto. func (d *DiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) { - data, err := d.restClient.Get().AbsPath("/openapi/v2").SetHeader("Accept", openAPIV2mimePb).Do(context.TODO()).Raw() + return d.OpenAPISchemaWithContext(context.Background()) +} + +// OpenAPISchemaWithContext fetches the open api v2 schema using a rest client and parses the proto. +func (d *DiscoveryClient) OpenAPISchemaWithContext(ctx context.Context) (*openapi_v2.Document, error) { + data, err := d.restClient.Get().AbsPath("/openapi/v2").SetHeader("Accept", openAPIV2mimePb).Do(ctx).Raw() if err != nil { return nil, err } @@ -690,20 +1190,40 @@ func (d *DiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) { return document, nil } +// OpenAPIV3WithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use OpenAPIV3WithContext instead. func (d *DiscoveryClient) OpenAPIV3() openapi.Client { return openapi.NewClient(d.restClient) } +func (d *DiscoveryClient) OpenAPIV3WithContext(ctx context.Context) openapi.ClientWithContext { + return openapi.NewClientWithContext(d.restClient) +} + // WithLegacy returns copy of current discovery client that will only // receive the legacy discovery format. +// +// WithLegacyWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use WithLegacyWithContext instead. func (d *DiscoveryClient) WithLegacy() DiscoveryInterface { client := *d client.UseLegacyDiscovery = true return &client } +// WithLegacyWithContext returns copy of current discovery client that will only +// receive the legacy discovery format. +func (d *DiscoveryClient) WithLegacyWithContext(ctx context.Context) DiscoveryInterfaceWithContext { + client := *d + client.UseLegacyDiscovery = true + return &client +} + // withRetries retries the given recovery function in case the groups supported by the server change after ServerGroup() returns. -func withRetries(maxRetries int, f func() ([]*metav1.APIGroup, []*metav1.APIResourceList, error)) ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { +// It retries only if the context isn't canceled. +func withRetries(ctx context.Context, maxRetries int, f func() ([]*metav1.APIGroup, []*metav1.APIResourceList, error)) ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { var result []*metav1.APIResourceList var resultGroups []*metav1.APIGroup var err error @@ -715,6 +1235,10 @@ func withRetries(maxRetries int, f func() ([]*metav1.APIGroup, []*metav1.APIReso if _, ok := err.(*ErrGroupDiscoveryFailed); !ok { return nil, nil, err } + if ctx.Err() != nil { + // Give up retrying because of context cancellation and propagate the error returned by f. + return nil, nil, err + } } return resultGroups, result, err } diff --git a/vendor/k8s.io/client-go/discovery/fake/discovery.go b/vendor/k8s.io/client-go/discovery/fake/discovery.go index e5d9e7f800..02b2416e1f 100644 --- a/vendor/k8s.io/client-go/discovery/fake/discovery.go +++ b/vendor/k8s.io/client-go/discovery/fake/discovery.go @@ -17,6 +17,7 @@ limitations under the License. package fake import ( + "context" "fmt" "net/http" @@ -33,16 +34,33 @@ import ( "k8s.io/client-go/testing" ) -// FakeDiscovery implements discovery.DiscoveryInterface and sometimes calls testing.Fake.Invoke with an action, +// FakeDiscovery implements discovery.DiscoveryInterface and discovery.DiscoveryInterfaceWithContext. +// It sometimes calls testing.Fake.Invoke with an action, // but doesn't respect the return value if any. There is a way to fake static values like ServerVersion by using the Faked... fields on the struct. type FakeDiscovery struct { *testing.Fake FakedServerVersion *version.Info } +var ( + //nolint:staticcheck // Intentionally using the old interface here. + _ discovery.DiscoveryInterface = &FakeDiscovery{} + _ discovery.DiscoveryInterfaceWithContext = &FakeDiscovery{} +) + // ServerResourcesForGroupVersion returns the supported resources for a group // and version. +// +// ServerResourcesForGroupVersionWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerResourcesForGroupVersionWithContext instead. func (c *FakeDiscovery) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) { + return c.ServerResourcesForGroupVersionWithContext(context.Background(), groupVersion) +} + +// ServerResourcesForGroupVersionWithContext returns the supported resources for a group +// and version. +func (c *FakeDiscovery) ServerResourcesForGroupVersionWithContext(ctx context.Context, groupVersion string) (*metav1.APIResourceList, error) { action := testing.ActionImpl{ Verb: "get", Resource: schema.GroupVersionResource{Resource: "resource"}, @@ -65,8 +83,17 @@ func (c *FakeDiscovery) ServerResourcesForGroupVersion(groupVersion string) (*me } // ServerGroupsAndResources returns the supported groups and resources for all groups and versions. +// +// ServerGroupsAndResourcesWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerGroupsAndResourcesWithContext instead. func (c *FakeDiscovery) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { - sgs, err := c.ServerGroups() + return c.ServerGroupsAndResourcesWithContext(context.Background()) +} + +// ServerGroupsAndResourcesWithContext returns the supported groups and resources for all groups and versions. +func (c *FakeDiscovery) ServerGroupsAndResourcesWithContext(ctx context.Context) ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { + sgs, err := c.ServerGroupsWithContext(ctx) if err != nil { return nil, nil, err } @@ -87,19 +114,49 @@ func (c *FakeDiscovery) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav // ServerPreferredResources returns the supported resources with the version // preferred by the server. +// +// ServerPreferredResourcesWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerPreferredResourcesWithContext instead. func (c *FakeDiscovery) ServerPreferredResources() ([]*metav1.APIResourceList, error) { + return c.ServerPreferredResourcesWithContext(context.Background()) +} + +// ServerPreferredResourcesWithContext returns the supported resources with the version +// preferred by the server. +func (c *FakeDiscovery) ServerPreferredResourcesWithContext(ctx context.Context) ([]*metav1.APIResourceList, error) { return nil, nil } // ServerPreferredNamespacedResources returns the supported namespaced resources // with the version preferred by the server. +// +// ServerPreferredNamespacedResourcesWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerPreferredNamespacedResourcesWithContext instead. func (c *FakeDiscovery) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) { + return c.ServerPreferredNamespacedResourcesWithContext(context.Background()) +} + +// ServerPreferredNamespacedResourcesWithContext returns the supported namespaced resources +// with the version preferred by the server. +func (c *FakeDiscovery) ServerPreferredNamespacedResourcesWithContext(ctx context.Context) ([]*metav1.APIResourceList, error) { return nil, nil } // ServerGroups returns the supported groups, with information like supported // versions and the preferred version. +// +// ServerGroupsWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerGroupsWithContext instead. func (c *FakeDiscovery) ServerGroups() (*metav1.APIGroupList, error) { + return c.ServerGroupsWithContext(context.Background()) +} + +// ServerGroupsWithContext returns the supported groups, with information like supported +// versions and the preferred version. +func (c *FakeDiscovery) ServerGroupsWithContext(ctx context.Context) (*metav1.APIGroupList, error) { action := testing.ActionImpl{ Verb: "get", Resource: schema.GroupVersionResource{Resource: "group"}, @@ -143,7 +200,16 @@ func (c *FakeDiscovery) ServerGroups() (*metav1.APIGroupList, error) { } // ServerVersion retrieves and parses the server's version. +// +// ServerVersionWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ServerVersionWithContext instead. func (c *FakeDiscovery) ServerVersion() (*version.Info, error) { + return c.ServerVersionWithContext(context.Background()) +} + +// ServerVersionWithContext retrieves and parses the server's version. +func (c *FakeDiscovery) ServerVersionWithContext(ctx context.Context) (*version.Info, error) { action := testing.ActionImpl{} action.Verb = "get" action.Resource = schema.GroupVersionResource{Resource: "version"} @@ -161,20 +227,43 @@ func (c *FakeDiscovery) ServerVersion() (*version.Info, error) { } // OpenAPISchema retrieves and parses the swagger API schema the server supports. +// +// OpenAPISchemaWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use OpenAPISchemaWithContext instead. func (c *FakeDiscovery) OpenAPISchema() (*openapi_v2.Document, error) { + return c.OpenAPISchemaWithContext(context.Background()) +} + +// OpenAPISchemaWithContext retrieves and parses the swagger API schema the server supports. +func (c *FakeDiscovery) OpenAPISchemaWithContext(ctx context.Context) (*openapi_v2.Document, error) { return &openapi_v2.Document{}, nil } +// OpenAPIV3WithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use OpenAPIV3WithContext instead. func (c *FakeDiscovery) OpenAPIV3() openapi.Client { panic("unimplemented") } +func (c *FakeDiscovery) OpenAPIV3WithContext(ctx context.Context) openapi.ClientWithContext { + panic("unimplemented") +} + // RESTClient returns a RESTClient that is used to communicate with API server // by this client implementation. func (c *FakeDiscovery) RESTClient() restclient.Interface { return nil } +// WithLegacyWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use WithLegacyWithContext instead. func (c *FakeDiscovery) WithLegacy() discovery.DiscoveryInterface { panic("unimplemented") } + +func (c *FakeDiscovery) WithLegacyWithContext(ctx context.Context) discovery.DiscoveryInterfaceWithContext { + panic("unimplemented") +} diff --git a/vendor/k8s.io/client-go/discovery/helper.go b/vendor/k8s.io/client-go/discovery/helper.go index e79f073b03..a58bae284a 100644 --- a/vendor/k8s.io/client-go/discovery/helper.go +++ b/vendor/k8s.io/client-go/discovery/helper.go @@ -71,7 +71,7 @@ func ServerSupportsVersion(client DiscoveryInterface, requiredGV schema.GroupVer return err } versions := metav1.ExtractGroupVersions(groups) - serverVersions := sets.String{} + serverVersions := sets.Set[string]{} for _, v := range versions { serverVersions.Insert(v) } diff --git a/vendor/k8s.io/client-go/dynamic/simple.go b/vendor/k8s.io/client-go/dynamic/simple.go index 2532329d05..add5b13777 100644 --- a/vendor/k8s.io/client-go/dynamic/simple.go +++ b/vendor/k8s.io/client-go/dynamic/simple.go @@ -19,6 +19,8 @@ package dynamic import ( "context" "fmt" + "net/http" + "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -28,7 +30,6 @@ import ( "k8s.io/client-go/features" "k8s.io/client-go/rest" "k8s.io/client-go/util/apply" - "net/http" ) type DynamicClient struct { diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1/interface.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1/interface.go index 4bfe9c4c6e..8e643aa185 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1/interface.go @@ -25,17 +25,17 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // MutatingAdmissionPolicies returns a MutatingAdmissionPolicyInformer. - MutatingAdmissionPolicies() MutatingAdmissionPolicyInformer + MutatingAdmissionPolicies() TypedMutatingAdmissionPolicyInformer // MutatingAdmissionPolicyBindings returns a MutatingAdmissionPolicyBindingInformer. - MutatingAdmissionPolicyBindings() MutatingAdmissionPolicyBindingInformer + MutatingAdmissionPolicyBindings() TypedMutatingAdmissionPolicyBindingInformer // MutatingWebhookConfigurations returns a MutatingWebhookConfigurationInformer. - MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer + MutatingWebhookConfigurations() TypedMutatingWebhookConfigurationInformer // ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyInformer. - ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInformer + ValidatingAdmissionPolicies() TypedValidatingAdmissionPolicyInformer // ValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindingInformer. - ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInformer + ValidatingAdmissionPolicyBindings() TypedValidatingAdmissionPolicyBindingInformer // ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer. - ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer + ValidatingWebhookConfigurations() TypedValidatingWebhookConfigurationInformer } type version struct { @@ -49,32 +49,32 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// MutatingAdmissionPolicies returns a MutatingAdmissionPolicyInformer. -func (v *version) MutatingAdmissionPolicies() MutatingAdmissionPolicyInformer { +// MutatingAdmissionPolicies returns a TypedMutatingAdmissionPolicyInformer. +func (v *version) MutatingAdmissionPolicies() TypedMutatingAdmissionPolicyInformer { return &mutatingAdmissionPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// MutatingAdmissionPolicyBindings returns a MutatingAdmissionPolicyBindingInformer. -func (v *version) MutatingAdmissionPolicyBindings() MutatingAdmissionPolicyBindingInformer { +// MutatingAdmissionPolicyBindings returns a TypedMutatingAdmissionPolicyBindingInformer. +func (v *version) MutatingAdmissionPolicyBindings() TypedMutatingAdmissionPolicyBindingInformer { return &mutatingAdmissionPolicyBindingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// MutatingWebhookConfigurations returns a MutatingWebhookConfigurationInformer. -func (v *version) MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer { +// MutatingWebhookConfigurations returns a TypedMutatingWebhookConfigurationInformer. +func (v *version) MutatingWebhookConfigurations() TypedMutatingWebhookConfigurationInformer { return &mutatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyInformer. -func (v *version) ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInformer { +// ValidatingAdmissionPolicies returns a TypedValidatingAdmissionPolicyInformer. +func (v *version) ValidatingAdmissionPolicies() TypedValidatingAdmissionPolicyInformer { return &validatingAdmissionPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindingInformer. -func (v *version) ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInformer { +// ValidatingAdmissionPolicyBindings returns a TypedValidatingAdmissionPolicyBindingInformer. +func (v *version) ValidatingAdmissionPolicyBindings() TypedValidatingAdmissionPolicyBindingInformer { return &validatingAdmissionPolicyBindingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer. -func (v *version) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer { +// ValidatingWebhookConfigurations returns a TypedValidatingWebhookConfigurationInformer. +func (v *version) ValidatingWebhookConfigurations() TypedValidatingWebhookConfigurationInformer { return &validatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingadmissionpolicy.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingadmissionpolicy.go index 65df1905a5..8dbb9e8e44 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingadmissionpolicy.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingadmissionpolicy.go @@ -34,12 +34,40 @@ import ( ) // MutatingAdmissionPolicyInformer provides access to a shared informer and lister for -// MutatingAdmissionPolicies. +// MutatingAdmissionPolicies. Prefer using the type-safe variant (see [TypedMutatingAdmissionPolicyInformer]). type MutatingAdmissionPolicyInformer interface { Informer() cache.SharedIndexInformer Lister() admissionregistrationv1.MutatingAdmissionPolicyLister } +// TypedMutatingAdmissionPolicyInformer provides access to a shared informer and lister for +// MutatingAdmissionPolicies, including the type-safe TypedInformer variant. +// It is a superset of MutatingAdmissionPolicyInformer. +type TypedMutatingAdmissionPolicyInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() MutatingAdmissionPolicyIndexInformer + Lister() admissionregistrationv1.MutatingAdmissionPolicyLister +} + +// MutatingAdmissionPolicyIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type MutatingAdmissionPolicyIndexInformer cache.TypedSharedIndexInformer[*apiadmissionregistrationv1.MutatingAdmissionPolicy] + +// MutatingAdmissionPolicyHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for MutatingAdmissionPolicy. +type MutatingAdmissionPolicyHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiadmissionregistrationv1.MutatingAdmissionPolicy] + +// MutatingAdmissionPolicyDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for MutatingAdmissionPolicy. +type MutatingAdmissionPolicyDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiadmissionregistrationv1.MutatingAdmissionPolicy] + +// MutatingAdmissionPolicyFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for MutatingAdmissionPolicy. +type MutatingAdmissionPolicyFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiadmissionregistrationv1.MutatingAdmissionPolicy] + +// MutatingAdmissionPolicyIndexers is a specialization of [cache.TypedIndexers] for MutatingAdmissionPolicy. +type MutatingAdmissionPolicyIndexers = cache.TypedIndexers[*apiadmissionregistrationv1.MutatingAdmissionPolicy] + +// DeletedMutatingAdmissionPolicy is a specialization of [cache.DeletedObject] for MutatingAdmissionPolicy. +type DeletedMutatingAdmissionPolicy = cache.DeletedObject[*apiadmissionregistrationv1.MutatingAdmissionPolicy] + type mutatingAdmissionPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type mutatingAdmissionPolicyInformer struct { // NewMutatingAdmissionPolicyInformer constructs a new informer for MutatingAdmissionPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedMutatingAdmissionPolicyInformer]). func NewMutatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedMutatingAdmissionPolicyInformer constructs a new informer for MutatingAdmissionPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedMutatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers MutatingAdmissionPolicyIndexers) MutatingAdmissionPolicyIndexInformer { + return NewTypedMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredMutatingAdmissionPolicyInformer constructs a new informer for MutatingAdmissionPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredMutatingAdmissionPolicyInformer]). func NewFilteredMutatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredMutatingAdmissionPolicyInformer constructs a new informer for MutatingAdmissionPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredMutatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers MutatingAdmissionPolicyIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) MutatingAdmissionPolicyIndexInformer { + return NewTypedMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewMutatingAdmissionPolicyInformerWithOptions constructs a new informer for MutatingAdmissionPolicy type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedMutatingAdmissionPolicyInformerWithOptions]). func NewMutatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedMutatingAdmissionPolicyInformerWithOptions(client, options) +} + +// NewTypedMutatingAdmissionPolicyInformerWithOptions constructs a new informer for MutatingAdmissionPolicy type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedMutatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) MutatingAdmissionPolicyIndexInformer { gvr := schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1", Resource: "mutatingadmissionpolicys"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.MutatingAdmissionPolicy](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewMutatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface, Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *mutatingAdmissionPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *mutatingAdmissionPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiadmissionregistrationv1.MutatingAdmissionPolicy{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *mutatingAdmissionPolicyInformer) TypedInformer() MutatingAdmissionPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.MutatingAdmissionPolicy](f.factory.InformerFor(&apiadmissionregistrationv1.MutatingAdmissionPolicy{}, f.defaultInformer)) } func (f *mutatingAdmissionPolicyInformer) Lister() admissionregistrationv1.MutatingAdmissionPolicyLister { return admissionregistrationv1.NewMutatingAdmissionPolicyLister(f.Informer().GetIndexer()) } + +// ToTypedMutatingAdmissionPolicyInformer converts an untyped informer into a TypedMutatingAdmissionPolicyInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *MutatingAdmissionPolicy. If that is not the case, calling type-safe methods of the returned +// TypedMutatingAdmissionPolicyInformer leads to runtime panics. A safer alternative is to pass +// around a TypedMutatingAdmissionPolicyInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedMutatingAdmissionPolicyInformer(informer MutatingAdmissionPolicyInformer) TypedMutatingAdmissionPolicyInformer { + if informer, ok := informer.(TypedMutatingAdmissionPolicyInformer); ok { + return informer + } + return &mutatingAdmissionPolicyTypedInformerAdapter{informer} +} + +type mutatingAdmissionPolicyTypedInformerAdapter struct { + MutatingAdmissionPolicyInformer +} + +func (a *mutatingAdmissionPolicyTypedInformerAdapter) TypedInformer() MutatingAdmissionPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.MutatingAdmissionPolicy](a.Informer()) +} + +// ToMutatingAdmissionPolicyIndexInformer converts an untyped informer into a MutatingAdmissionPolicyIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *MutatingAdmissionPolicy. If that is not the case, calling type-safe methods of the returned +// MutatingAdmissionPolicyIndexInformer leads to runtime panics. A safer alternative is to pass +// around a MutatingAdmissionPolicyIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToMutatingAdmissionPolicyIndexInformer(informer cache.SharedIndexInformer) MutatingAdmissionPolicyIndexInformer { + if informer, ok := informer.(MutatingAdmissionPolicyIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.MutatingAdmissionPolicy](informer) +} diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingadmissionpolicybinding.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingadmissionpolicybinding.go index d06ca0b4e1..11da9c840c 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingadmissionpolicybinding.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingadmissionpolicybinding.go @@ -34,12 +34,40 @@ import ( ) // MutatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for -// MutatingAdmissionPolicyBindings. +// MutatingAdmissionPolicyBindings. Prefer using the type-safe variant (see [TypedMutatingAdmissionPolicyBindingInformer]). type MutatingAdmissionPolicyBindingInformer interface { Informer() cache.SharedIndexInformer Lister() admissionregistrationv1.MutatingAdmissionPolicyBindingLister } +// TypedMutatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for +// MutatingAdmissionPolicyBindings, including the type-safe TypedInformer variant. +// It is a superset of MutatingAdmissionPolicyBindingInformer. +type TypedMutatingAdmissionPolicyBindingInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() MutatingAdmissionPolicyBindingIndexInformer + Lister() admissionregistrationv1.MutatingAdmissionPolicyBindingLister +} + +// MutatingAdmissionPolicyBindingIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type MutatingAdmissionPolicyBindingIndexInformer cache.TypedSharedIndexInformer[*apiadmissionregistrationv1.MutatingAdmissionPolicyBinding] + +// MutatingAdmissionPolicyBindingHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for MutatingAdmissionPolicyBinding. +type MutatingAdmissionPolicyBindingHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiadmissionregistrationv1.MutatingAdmissionPolicyBinding] + +// MutatingAdmissionPolicyBindingDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for MutatingAdmissionPolicyBinding. +type MutatingAdmissionPolicyBindingDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiadmissionregistrationv1.MutatingAdmissionPolicyBinding] + +// MutatingAdmissionPolicyBindingFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for MutatingAdmissionPolicyBinding. +type MutatingAdmissionPolicyBindingFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiadmissionregistrationv1.MutatingAdmissionPolicyBinding] + +// MutatingAdmissionPolicyBindingIndexers is a specialization of [cache.TypedIndexers] for MutatingAdmissionPolicyBinding. +type MutatingAdmissionPolicyBindingIndexers = cache.TypedIndexers[*apiadmissionregistrationv1.MutatingAdmissionPolicyBinding] + +// DeletedMutatingAdmissionPolicyBinding is a specialization of [cache.DeletedObject] for MutatingAdmissionPolicyBinding. +type DeletedMutatingAdmissionPolicyBinding = cache.DeletedObject[*apiadmissionregistrationv1.MutatingAdmissionPolicyBinding] + type mutatingAdmissionPolicyBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type mutatingAdmissionPolicyBindingInformer struct { // NewMutatingAdmissionPolicyBindingInformer constructs a new informer for MutatingAdmissionPolicyBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedMutatingAdmissionPolicyBindingInformer]). func NewMutatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedMutatingAdmissionPolicyBindingInformer constructs a new informer for MutatingAdmissionPolicyBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedMutatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers MutatingAdmissionPolicyBindingIndexers) MutatingAdmissionPolicyBindingIndexInformer { + return NewTypedMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredMutatingAdmissionPolicyBindingInformer constructs a new informer for MutatingAdmissionPolicyBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredMutatingAdmissionPolicyBindingInformer]). func NewFilteredMutatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredMutatingAdmissionPolicyBindingInformer constructs a new informer for MutatingAdmissionPolicyBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredMutatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers MutatingAdmissionPolicyBindingIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) MutatingAdmissionPolicyBindingIndexInformer { + return NewTypedMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewMutatingAdmissionPolicyBindingInformerWithOptions constructs a new informer for MutatingAdmissionPolicyBinding type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedMutatingAdmissionPolicyBindingInformerWithOptions]). func NewMutatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedMutatingAdmissionPolicyBindingInformerWithOptions(client, options) +} + +// NewTypedMutatingAdmissionPolicyBindingInformerWithOptions constructs a new informer for MutatingAdmissionPolicyBinding type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedMutatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) MutatingAdmissionPolicyBindingIndexInformer { gvr := schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1", Resource: "mutatingadmissionpolicybindings"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.MutatingAdmissionPolicyBinding](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewMutatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.Inte Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *mutatingAdmissionPolicyBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *mutatingAdmissionPolicyBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiadmissionregistrationv1.MutatingAdmissionPolicyBinding{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *mutatingAdmissionPolicyBindingInformer) TypedInformer() MutatingAdmissionPolicyBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.MutatingAdmissionPolicyBinding](f.factory.InformerFor(&apiadmissionregistrationv1.MutatingAdmissionPolicyBinding{}, f.defaultInformer)) } func (f *mutatingAdmissionPolicyBindingInformer) Lister() admissionregistrationv1.MutatingAdmissionPolicyBindingLister { return admissionregistrationv1.NewMutatingAdmissionPolicyBindingLister(f.Informer().GetIndexer()) } + +// ToTypedMutatingAdmissionPolicyBindingInformer converts an untyped informer into a TypedMutatingAdmissionPolicyBindingInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *MutatingAdmissionPolicyBinding. If that is not the case, calling type-safe methods of the returned +// TypedMutatingAdmissionPolicyBindingInformer leads to runtime panics. A safer alternative is to pass +// around a TypedMutatingAdmissionPolicyBindingInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedMutatingAdmissionPolicyBindingInformer(informer MutatingAdmissionPolicyBindingInformer) TypedMutatingAdmissionPolicyBindingInformer { + if informer, ok := informer.(TypedMutatingAdmissionPolicyBindingInformer); ok { + return informer + } + return &mutatingAdmissionPolicyBindingTypedInformerAdapter{informer} +} + +type mutatingAdmissionPolicyBindingTypedInformerAdapter struct { + MutatingAdmissionPolicyBindingInformer +} + +func (a *mutatingAdmissionPolicyBindingTypedInformerAdapter) TypedInformer() MutatingAdmissionPolicyBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.MutatingAdmissionPolicyBinding](a.Informer()) +} + +// ToMutatingAdmissionPolicyBindingIndexInformer converts an untyped informer into a MutatingAdmissionPolicyBindingIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *MutatingAdmissionPolicyBinding. If that is not the case, calling type-safe methods of the returned +// MutatingAdmissionPolicyBindingIndexInformer leads to runtime panics. A safer alternative is to pass +// around a MutatingAdmissionPolicyBindingIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToMutatingAdmissionPolicyBindingIndexInformer(informer cache.SharedIndexInformer) MutatingAdmissionPolicyBindingIndexInformer { + if informer, ok := informer.(MutatingAdmissionPolicyBindingIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.MutatingAdmissionPolicyBinding](informer) +} diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingwebhookconfiguration.go index d7c48e78a6..32f005c250 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingwebhookconfiguration.go @@ -34,12 +34,40 @@ import ( ) // MutatingWebhookConfigurationInformer provides access to a shared informer and lister for -// MutatingWebhookConfigurations. +// MutatingWebhookConfigurations. Prefer using the type-safe variant (see [TypedMutatingWebhookConfigurationInformer]). type MutatingWebhookConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() admissionregistrationv1.MutatingWebhookConfigurationLister } +// TypedMutatingWebhookConfigurationInformer provides access to a shared informer and lister for +// MutatingWebhookConfigurations, including the type-safe TypedInformer variant. +// It is a superset of MutatingWebhookConfigurationInformer. +type TypedMutatingWebhookConfigurationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() MutatingWebhookConfigurationIndexInformer + Lister() admissionregistrationv1.MutatingWebhookConfigurationLister +} + +// MutatingWebhookConfigurationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type MutatingWebhookConfigurationIndexInformer cache.TypedSharedIndexInformer[*apiadmissionregistrationv1.MutatingWebhookConfiguration] + +// MutatingWebhookConfigurationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for MutatingWebhookConfiguration. +type MutatingWebhookConfigurationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiadmissionregistrationv1.MutatingWebhookConfiguration] + +// MutatingWebhookConfigurationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for MutatingWebhookConfiguration. +type MutatingWebhookConfigurationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiadmissionregistrationv1.MutatingWebhookConfiguration] + +// MutatingWebhookConfigurationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for MutatingWebhookConfiguration. +type MutatingWebhookConfigurationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiadmissionregistrationv1.MutatingWebhookConfiguration] + +// MutatingWebhookConfigurationIndexers is a specialization of [cache.TypedIndexers] for MutatingWebhookConfiguration. +type MutatingWebhookConfigurationIndexers = cache.TypedIndexers[*apiadmissionregistrationv1.MutatingWebhookConfiguration] + +// DeletedMutatingWebhookConfiguration is a specialization of [cache.DeletedObject] for MutatingWebhookConfiguration. +type DeletedMutatingWebhookConfiguration = cache.DeletedObject[*apiadmissionregistrationv1.MutatingWebhookConfiguration] + type mutatingWebhookConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type mutatingWebhookConfigurationInformer struct { // NewMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedMutatingWebhookConfigurationInformer]). func NewMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewMutatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers MutatingWebhookConfigurationIndexers) MutatingWebhookConfigurationIndexInformer { + return NewTypedMutatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredMutatingWebhookConfigurationInformer]). func NewFilteredMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewMutatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedMutatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers MutatingWebhookConfigurationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) MutatingWebhookConfigurationIndexInformer { + return NewTypedMutatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewMutatingWebhookConfigurationInformerWithOptions constructs a new informer for MutatingWebhookConfiguration type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedMutatingWebhookConfigurationInformerWithOptions]). func NewMutatingWebhookConfigurationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedMutatingWebhookConfigurationInformerWithOptions(client, options) +} + +// NewTypedMutatingWebhookConfigurationInformerWithOptions constructs a new informer for MutatingWebhookConfiguration type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedMutatingWebhookConfigurationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) MutatingWebhookConfigurationIndexInformer { gvr := schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1", Resource: "mutatingwebhookconfigurations"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.MutatingWebhookConfiguration](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewMutatingWebhookConfigurationInformerWithOptions(client kubernetes.Interf Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *mutatingWebhookConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewMutatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedMutatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *mutatingWebhookConfigurationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiadmissionregistrationv1.MutatingWebhookConfiguration{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *mutatingWebhookConfigurationInformer) TypedInformer() MutatingWebhookConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.MutatingWebhookConfiguration](f.factory.InformerFor(&apiadmissionregistrationv1.MutatingWebhookConfiguration{}, f.defaultInformer)) } func (f *mutatingWebhookConfigurationInformer) Lister() admissionregistrationv1.MutatingWebhookConfigurationLister { return admissionregistrationv1.NewMutatingWebhookConfigurationLister(f.Informer().GetIndexer()) } + +// ToTypedMutatingWebhookConfigurationInformer converts an untyped informer into a TypedMutatingWebhookConfigurationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *MutatingWebhookConfiguration. If that is not the case, calling type-safe methods of the returned +// TypedMutatingWebhookConfigurationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedMutatingWebhookConfigurationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedMutatingWebhookConfigurationInformer(informer MutatingWebhookConfigurationInformer) TypedMutatingWebhookConfigurationInformer { + if informer, ok := informer.(TypedMutatingWebhookConfigurationInformer); ok { + return informer + } + return &mutatingWebhookConfigurationTypedInformerAdapter{informer} +} + +type mutatingWebhookConfigurationTypedInformerAdapter struct { + MutatingWebhookConfigurationInformer +} + +func (a *mutatingWebhookConfigurationTypedInformerAdapter) TypedInformer() MutatingWebhookConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.MutatingWebhookConfiguration](a.Informer()) +} + +// ToMutatingWebhookConfigurationIndexInformer converts an untyped informer into a MutatingWebhookConfigurationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *MutatingWebhookConfiguration. If that is not the case, calling type-safe methods of the returned +// MutatingWebhookConfigurationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a MutatingWebhookConfigurationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToMutatingWebhookConfigurationIndexInformer(informer cache.SharedIndexInformer) MutatingWebhookConfigurationIndexInformer { + if informer, ok := informer.(MutatingWebhookConfigurationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.MutatingWebhookConfiguration](informer) +} diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicy.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicy.go index bdc5c0b28a..84017947a7 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicy.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicy.go @@ -34,12 +34,40 @@ import ( ) // ValidatingAdmissionPolicyInformer provides access to a shared informer and lister for -// ValidatingAdmissionPolicies. +// ValidatingAdmissionPolicies. Prefer using the type-safe variant (see [TypedValidatingAdmissionPolicyInformer]). type ValidatingAdmissionPolicyInformer interface { Informer() cache.SharedIndexInformer Lister() admissionregistrationv1.ValidatingAdmissionPolicyLister } +// TypedValidatingAdmissionPolicyInformer provides access to a shared informer and lister for +// ValidatingAdmissionPolicies, including the type-safe TypedInformer variant. +// It is a superset of ValidatingAdmissionPolicyInformer. +type TypedValidatingAdmissionPolicyInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ValidatingAdmissionPolicyIndexInformer + Lister() admissionregistrationv1.ValidatingAdmissionPolicyLister +} + +// ValidatingAdmissionPolicyIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ValidatingAdmissionPolicyIndexInformer cache.TypedSharedIndexInformer[*apiadmissionregistrationv1.ValidatingAdmissionPolicy] + +// ValidatingAdmissionPolicyHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ValidatingAdmissionPolicy. +type ValidatingAdmissionPolicyHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiadmissionregistrationv1.ValidatingAdmissionPolicy] + +// ValidatingAdmissionPolicyDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ValidatingAdmissionPolicy. +type ValidatingAdmissionPolicyDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiadmissionregistrationv1.ValidatingAdmissionPolicy] + +// ValidatingAdmissionPolicyFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ValidatingAdmissionPolicy. +type ValidatingAdmissionPolicyFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiadmissionregistrationv1.ValidatingAdmissionPolicy] + +// ValidatingAdmissionPolicyIndexers is a specialization of [cache.TypedIndexers] for ValidatingAdmissionPolicy. +type ValidatingAdmissionPolicyIndexers = cache.TypedIndexers[*apiadmissionregistrationv1.ValidatingAdmissionPolicy] + +// DeletedValidatingAdmissionPolicy is a specialization of [cache.DeletedObject] for ValidatingAdmissionPolicy. +type DeletedValidatingAdmissionPolicy = cache.DeletedObject[*apiadmissionregistrationv1.ValidatingAdmissionPolicy] + type validatingAdmissionPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type validatingAdmissionPolicyInformer struct { // NewValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedValidatingAdmissionPolicyInformer]). func NewValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ValidatingAdmissionPolicyIndexers) ValidatingAdmissionPolicyIndexInformer { + return NewTypedValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredValidatingAdmissionPolicyInformer]). func NewFilteredValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ValidatingAdmissionPolicyIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ValidatingAdmissionPolicyIndexInformer { + return NewTypedValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewValidatingAdmissionPolicyInformerWithOptions constructs a new informer for ValidatingAdmissionPolicy type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedValidatingAdmissionPolicyInformerWithOptions]). func NewValidatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedValidatingAdmissionPolicyInformerWithOptions(client, options) +} + +// NewTypedValidatingAdmissionPolicyInformerWithOptions constructs a new informer for ValidatingAdmissionPolicy type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedValidatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ValidatingAdmissionPolicyIndexInformer { gvr := schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1", Resource: "validatingadmissionpolicys"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.ValidatingAdmissionPolicy](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewValidatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *validatingAdmissionPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *validatingAdmissionPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiadmissionregistrationv1.ValidatingAdmissionPolicy{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *validatingAdmissionPolicyInformer) TypedInformer() ValidatingAdmissionPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.ValidatingAdmissionPolicy](f.factory.InformerFor(&apiadmissionregistrationv1.ValidatingAdmissionPolicy{}, f.defaultInformer)) } func (f *validatingAdmissionPolicyInformer) Lister() admissionregistrationv1.ValidatingAdmissionPolicyLister { return admissionregistrationv1.NewValidatingAdmissionPolicyLister(f.Informer().GetIndexer()) } + +// ToTypedValidatingAdmissionPolicyInformer converts an untyped informer into a TypedValidatingAdmissionPolicyInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ValidatingAdmissionPolicy. If that is not the case, calling type-safe methods of the returned +// TypedValidatingAdmissionPolicyInformer leads to runtime panics. A safer alternative is to pass +// around a TypedValidatingAdmissionPolicyInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedValidatingAdmissionPolicyInformer(informer ValidatingAdmissionPolicyInformer) TypedValidatingAdmissionPolicyInformer { + if informer, ok := informer.(TypedValidatingAdmissionPolicyInformer); ok { + return informer + } + return &validatingAdmissionPolicyTypedInformerAdapter{informer} +} + +type validatingAdmissionPolicyTypedInformerAdapter struct { + ValidatingAdmissionPolicyInformer +} + +func (a *validatingAdmissionPolicyTypedInformerAdapter) TypedInformer() ValidatingAdmissionPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.ValidatingAdmissionPolicy](a.Informer()) +} + +// ToValidatingAdmissionPolicyIndexInformer converts an untyped informer into a ValidatingAdmissionPolicyIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ValidatingAdmissionPolicy. If that is not the case, calling type-safe methods of the returned +// ValidatingAdmissionPolicyIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ValidatingAdmissionPolicyIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToValidatingAdmissionPolicyIndexInformer(informer cache.SharedIndexInformer) ValidatingAdmissionPolicyIndexInformer { + if informer, ok := informer.(ValidatingAdmissionPolicyIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.ValidatingAdmissionPolicy](informer) +} diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicybinding.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicybinding.go index 1ecf9703a9..d79eaf5411 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicybinding.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingadmissionpolicybinding.go @@ -34,12 +34,40 @@ import ( ) // ValidatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for -// ValidatingAdmissionPolicyBindings. +// ValidatingAdmissionPolicyBindings. Prefer using the type-safe variant (see [TypedValidatingAdmissionPolicyBindingInformer]). type ValidatingAdmissionPolicyBindingInformer interface { Informer() cache.SharedIndexInformer Lister() admissionregistrationv1.ValidatingAdmissionPolicyBindingLister } +// TypedValidatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for +// ValidatingAdmissionPolicyBindings, including the type-safe TypedInformer variant. +// It is a superset of ValidatingAdmissionPolicyBindingInformer. +type TypedValidatingAdmissionPolicyBindingInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ValidatingAdmissionPolicyBindingIndexInformer + Lister() admissionregistrationv1.ValidatingAdmissionPolicyBindingLister +} + +// ValidatingAdmissionPolicyBindingIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ValidatingAdmissionPolicyBindingIndexInformer cache.TypedSharedIndexInformer[*apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding] + +// ValidatingAdmissionPolicyBindingHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ValidatingAdmissionPolicyBinding. +type ValidatingAdmissionPolicyBindingHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding] + +// ValidatingAdmissionPolicyBindingDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ValidatingAdmissionPolicyBinding. +type ValidatingAdmissionPolicyBindingDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding] + +// ValidatingAdmissionPolicyBindingFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ValidatingAdmissionPolicyBinding. +type ValidatingAdmissionPolicyBindingFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding] + +// ValidatingAdmissionPolicyBindingIndexers is a specialization of [cache.TypedIndexers] for ValidatingAdmissionPolicyBinding. +type ValidatingAdmissionPolicyBindingIndexers = cache.TypedIndexers[*apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding] + +// DeletedValidatingAdmissionPolicyBinding is a specialization of [cache.DeletedObject] for ValidatingAdmissionPolicyBinding. +type DeletedValidatingAdmissionPolicyBinding = cache.DeletedObject[*apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding] + type validatingAdmissionPolicyBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type validatingAdmissionPolicyBindingInformer struct { // NewValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedValidatingAdmissionPolicyBindingInformer]). func NewValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ValidatingAdmissionPolicyBindingIndexers) ValidatingAdmissionPolicyBindingIndexInformer { + return NewTypedValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredValidatingAdmissionPolicyBindingInformer]). func NewFilteredValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ValidatingAdmissionPolicyBindingIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ValidatingAdmissionPolicyBindingIndexInformer { + return NewTypedValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewValidatingAdmissionPolicyBindingInformerWithOptions constructs a new informer for ValidatingAdmissionPolicyBinding type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedValidatingAdmissionPolicyBindingInformerWithOptions]). func NewValidatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedValidatingAdmissionPolicyBindingInformerWithOptions(client, options) +} + +// NewTypedValidatingAdmissionPolicyBindingInformerWithOptions constructs a new informer for ValidatingAdmissionPolicyBinding type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedValidatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ValidatingAdmissionPolicyBindingIndexInformer { gvr := schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1", Resource: "validatingadmissionpolicybindings"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewValidatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.In Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *validatingAdmissionPolicyBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *validatingAdmissionPolicyBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *validatingAdmissionPolicyBindingInformer) TypedInformer() ValidatingAdmissionPolicyBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding](f.factory.InformerFor(&apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding{}, f.defaultInformer)) } func (f *validatingAdmissionPolicyBindingInformer) Lister() admissionregistrationv1.ValidatingAdmissionPolicyBindingLister { return admissionregistrationv1.NewValidatingAdmissionPolicyBindingLister(f.Informer().GetIndexer()) } + +// ToTypedValidatingAdmissionPolicyBindingInformer converts an untyped informer into a TypedValidatingAdmissionPolicyBindingInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ValidatingAdmissionPolicyBinding. If that is not the case, calling type-safe methods of the returned +// TypedValidatingAdmissionPolicyBindingInformer leads to runtime panics. A safer alternative is to pass +// around a TypedValidatingAdmissionPolicyBindingInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedValidatingAdmissionPolicyBindingInformer(informer ValidatingAdmissionPolicyBindingInformer) TypedValidatingAdmissionPolicyBindingInformer { + if informer, ok := informer.(TypedValidatingAdmissionPolicyBindingInformer); ok { + return informer + } + return &validatingAdmissionPolicyBindingTypedInformerAdapter{informer} +} + +type validatingAdmissionPolicyBindingTypedInformerAdapter struct { + ValidatingAdmissionPolicyBindingInformer +} + +func (a *validatingAdmissionPolicyBindingTypedInformerAdapter) TypedInformer() ValidatingAdmissionPolicyBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding](a.Informer()) +} + +// ToValidatingAdmissionPolicyBindingIndexInformer converts an untyped informer into a ValidatingAdmissionPolicyBindingIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ValidatingAdmissionPolicyBinding. If that is not the case, calling type-safe methods of the returned +// ValidatingAdmissionPolicyBindingIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ValidatingAdmissionPolicyBindingIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToValidatingAdmissionPolicyBindingIndexInformer(informer cache.SharedIndexInformer) ValidatingAdmissionPolicyBindingIndexInformer { + if informer, ok := informer.(ValidatingAdmissionPolicyBindingIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding](informer) +} diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingwebhookconfiguration.go index 07653c35ce..98ba6e012a 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingwebhookconfiguration.go @@ -34,12 +34,40 @@ import ( ) // ValidatingWebhookConfigurationInformer provides access to a shared informer and lister for -// ValidatingWebhookConfigurations. +// ValidatingWebhookConfigurations. Prefer using the type-safe variant (see [TypedValidatingWebhookConfigurationInformer]). type ValidatingWebhookConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() admissionregistrationv1.ValidatingWebhookConfigurationLister } +// TypedValidatingWebhookConfigurationInformer provides access to a shared informer and lister for +// ValidatingWebhookConfigurations, including the type-safe TypedInformer variant. +// It is a superset of ValidatingWebhookConfigurationInformer. +type TypedValidatingWebhookConfigurationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ValidatingWebhookConfigurationIndexInformer + Lister() admissionregistrationv1.ValidatingWebhookConfigurationLister +} + +// ValidatingWebhookConfigurationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ValidatingWebhookConfigurationIndexInformer cache.TypedSharedIndexInformer[*apiadmissionregistrationv1.ValidatingWebhookConfiguration] + +// ValidatingWebhookConfigurationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ValidatingWebhookConfiguration. +type ValidatingWebhookConfigurationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiadmissionregistrationv1.ValidatingWebhookConfiguration] + +// ValidatingWebhookConfigurationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ValidatingWebhookConfiguration. +type ValidatingWebhookConfigurationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiadmissionregistrationv1.ValidatingWebhookConfiguration] + +// ValidatingWebhookConfigurationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ValidatingWebhookConfiguration. +type ValidatingWebhookConfigurationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiadmissionregistrationv1.ValidatingWebhookConfiguration] + +// ValidatingWebhookConfigurationIndexers is a specialization of [cache.TypedIndexers] for ValidatingWebhookConfiguration. +type ValidatingWebhookConfigurationIndexers = cache.TypedIndexers[*apiadmissionregistrationv1.ValidatingWebhookConfiguration] + +// DeletedValidatingWebhookConfiguration is a specialization of [cache.DeletedObject] for ValidatingWebhookConfiguration. +type DeletedValidatingWebhookConfiguration = cache.DeletedObject[*apiadmissionregistrationv1.ValidatingWebhookConfiguration] + type validatingWebhookConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type validatingWebhookConfigurationInformer struct { // NewValidatingWebhookConfigurationInformer constructs a new informer for ValidatingWebhookConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedValidatingWebhookConfigurationInformer]). func NewValidatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewValidatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedValidatingWebhookConfigurationInformer constructs a new informer for ValidatingWebhookConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedValidatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ValidatingWebhookConfigurationIndexers) ValidatingWebhookConfigurationIndexInformer { + return NewTypedValidatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredValidatingWebhookConfigurationInformer constructs a new informer for ValidatingWebhookConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredValidatingWebhookConfigurationInformer]). func NewFilteredValidatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewValidatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedValidatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredValidatingWebhookConfigurationInformer constructs a new informer for ValidatingWebhookConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredValidatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ValidatingWebhookConfigurationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ValidatingWebhookConfigurationIndexInformer { + return NewTypedValidatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewValidatingWebhookConfigurationInformerWithOptions constructs a new informer for ValidatingWebhookConfiguration type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedValidatingWebhookConfigurationInformerWithOptions]). func NewValidatingWebhookConfigurationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedValidatingWebhookConfigurationInformerWithOptions(client, options) +} + +// NewTypedValidatingWebhookConfigurationInformerWithOptions constructs a new informer for ValidatingWebhookConfiguration type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedValidatingWebhookConfigurationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ValidatingWebhookConfigurationIndexInformer { gvr := schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1", Resource: "validatingwebhookconfigurations"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.ValidatingWebhookConfiguration](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewValidatingWebhookConfigurationInformerWithOptions(client kubernetes.Inte Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *validatingWebhookConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewValidatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedValidatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *validatingWebhookConfigurationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiadmissionregistrationv1.ValidatingWebhookConfiguration{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *validatingWebhookConfigurationInformer) TypedInformer() ValidatingWebhookConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.ValidatingWebhookConfiguration](f.factory.InformerFor(&apiadmissionregistrationv1.ValidatingWebhookConfiguration{}, f.defaultInformer)) } func (f *validatingWebhookConfigurationInformer) Lister() admissionregistrationv1.ValidatingWebhookConfigurationLister { return admissionregistrationv1.NewValidatingWebhookConfigurationLister(f.Informer().GetIndexer()) } + +// ToTypedValidatingWebhookConfigurationInformer converts an untyped informer into a TypedValidatingWebhookConfigurationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ValidatingWebhookConfiguration. If that is not the case, calling type-safe methods of the returned +// TypedValidatingWebhookConfigurationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedValidatingWebhookConfigurationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedValidatingWebhookConfigurationInformer(informer ValidatingWebhookConfigurationInformer) TypedValidatingWebhookConfigurationInformer { + if informer, ok := informer.(TypedValidatingWebhookConfigurationInformer); ok { + return informer + } + return &validatingWebhookConfigurationTypedInformerAdapter{informer} +} + +type validatingWebhookConfigurationTypedInformerAdapter struct { + ValidatingWebhookConfigurationInformer +} + +func (a *validatingWebhookConfigurationTypedInformerAdapter) TypedInformer() ValidatingWebhookConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.ValidatingWebhookConfiguration](a.Informer()) +} + +// ToValidatingWebhookConfigurationIndexInformer converts an untyped informer into a ValidatingWebhookConfigurationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ValidatingWebhookConfiguration. If that is not the case, calling type-safe methods of the returned +// ValidatingWebhookConfigurationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ValidatingWebhookConfigurationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToValidatingWebhookConfigurationIndexInformer(informer cache.SharedIndexInformer) ValidatingWebhookConfigurationIndexInformer { + if informer, ok := informer.(ValidatingWebhookConfigurationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1.ValidatingWebhookConfiguration](informer) +} diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/interface.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/interface.go index 68ae4e25cb..43702bde93 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/interface.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/interface.go @@ -25,13 +25,13 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // MutatingAdmissionPolicies returns a MutatingAdmissionPolicyInformer. - MutatingAdmissionPolicies() MutatingAdmissionPolicyInformer + MutatingAdmissionPolicies() TypedMutatingAdmissionPolicyInformer // MutatingAdmissionPolicyBindings returns a MutatingAdmissionPolicyBindingInformer. - MutatingAdmissionPolicyBindings() MutatingAdmissionPolicyBindingInformer + MutatingAdmissionPolicyBindings() TypedMutatingAdmissionPolicyBindingInformer // ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyInformer. - ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInformer + ValidatingAdmissionPolicies() TypedValidatingAdmissionPolicyInformer // ValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindingInformer. - ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInformer + ValidatingAdmissionPolicyBindings() TypedValidatingAdmissionPolicyBindingInformer } type version struct { @@ -45,22 +45,22 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// MutatingAdmissionPolicies returns a MutatingAdmissionPolicyInformer. -func (v *version) MutatingAdmissionPolicies() MutatingAdmissionPolicyInformer { +// MutatingAdmissionPolicies returns a TypedMutatingAdmissionPolicyInformer. +func (v *version) MutatingAdmissionPolicies() TypedMutatingAdmissionPolicyInformer { return &mutatingAdmissionPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// MutatingAdmissionPolicyBindings returns a MutatingAdmissionPolicyBindingInformer. -func (v *version) MutatingAdmissionPolicyBindings() MutatingAdmissionPolicyBindingInformer { +// MutatingAdmissionPolicyBindings returns a TypedMutatingAdmissionPolicyBindingInformer. +func (v *version) MutatingAdmissionPolicyBindings() TypedMutatingAdmissionPolicyBindingInformer { return &mutatingAdmissionPolicyBindingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyInformer. -func (v *version) ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInformer { +// ValidatingAdmissionPolicies returns a TypedValidatingAdmissionPolicyInformer. +func (v *version) ValidatingAdmissionPolicies() TypedValidatingAdmissionPolicyInformer { return &validatingAdmissionPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindingInformer. -func (v *version) ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInformer { +// ValidatingAdmissionPolicyBindings returns a TypedValidatingAdmissionPolicyBindingInformer. +func (v *version) ValidatingAdmissionPolicyBindings() TypedValidatingAdmissionPolicyBindingInformer { return &validatingAdmissionPolicyBindingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/mutatingadmissionpolicy.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/mutatingadmissionpolicy.go index 3441d6df44..387e8c9046 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/mutatingadmissionpolicy.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/mutatingadmissionpolicy.go @@ -34,12 +34,40 @@ import ( ) // MutatingAdmissionPolicyInformer provides access to a shared informer and lister for -// MutatingAdmissionPolicies. +// MutatingAdmissionPolicies. Prefer using the type-safe variant (see [TypedMutatingAdmissionPolicyInformer]). type MutatingAdmissionPolicyInformer interface { Informer() cache.SharedIndexInformer Lister() admissionregistrationv1alpha1.MutatingAdmissionPolicyLister } +// TypedMutatingAdmissionPolicyInformer provides access to a shared informer and lister for +// MutatingAdmissionPolicies, including the type-safe TypedInformer variant. +// It is a superset of MutatingAdmissionPolicyInformer. +type TypedMutatingAdmissionPolicyInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() MutatingAdmissionPolicyIndexInformer + Lister() admissionregistrationv1alpha1.MutatingAdmissionPolicyLister +} + +// MutatingAdmissionPolicyIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type MutatingAdmissionPolicyIndexInformer cache.TypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicy] + +// MutatingAdmissionPolicyHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for MutatingAdmissionPolicy. +type MutatingAdmissionPolicyHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicy] + +// MutatingAdmissionPolicyDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for MutatingAdmissionPolicy. +type MutatingAdmissionPolicyDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicy] + +// MutatingAdmissionPolicyFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for MutatingAdmissionPolicy. +type MutatingAdmissionPolicyFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicy] + +// MutatingAdmissionPolicyIndexers is a specialization of [cache.TypedIndexers] for MutatingAdmissionPolicy. +type MutatingAdmissionPolicyIndexers = cache.TypedIndexers[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicy] + +// DeletedMutatingAdmissionPolicy is a specialization of [cache.DeletedObject] for MutatingAdmissionPolicy. +type DeletedMutatingAdmissionPolicy = cache.DeletedObject[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicy] + type mutatingAdmissionPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type mutatingAdmissionPolicyInformer struct { // NewMutatingAdmissionPolicyInformer constructs a new informer for MutatingAdmissionPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedMutatingAdmissionPolicyInformer]). func NewMutatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedMutatingAdmissionPolicyInformer constructs a new informer for MutatingAdmissionPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedMutatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers MutatingAdmissionPolicyIndexers) MutatingAdmissionPolicyIndexInformer { + return NewTypedMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredMutatingAdmissionPolicyInformer constructs a new informer for MutatingAdmissionPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredMutatingAdmissionPolicyInformer]). func NewFilteredMutatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredMutatingAdmissionPolicyInformer constructs a new informer for MutatingAdmissionPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredMutatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers MutatingAdmissionPolicyIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) MutatingAdmissionPolicyIndexInformer { + return NewTypedMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewMutatingAdmissionPolicyInformerWithOptions constructs a new informer for MutatingAdmissionPolicy type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedMutatingAdmissionPolicyInformerWithOptions]). func NewMutatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedMutatingAdmissionPolicyInformerWithOptions(client, options) +} + +// NewTypedMutatingAdmissionPolicyInformerWithOptions constructs a new informer for MutatingAdmissionPolicy type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedMutatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) MutatingAdmissionPolicyIndexInformer { gvr := schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1alpha1", Resource: "mutatingadmissionpolicys"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicy](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewMutatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface, Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *mutatingAdmissionPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *mutatingAdmissionPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiadmissionregistrationv1alpha1.MutatingAdmissionPolicy{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *mutatingAdmissionPolicyInformer) TypedInformer() MutatingAdmissionPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicy](f.factory.InformerFor(&apiadmissionregistrationv1alpha1.MutatingAdmissionPolicy{}, f.defaultInformer)) } func (f *mutatingAdmissionPolicyInformer) Lister() admissionregistrationv1alpha1.MutatingAdmissionPolicyLister { return admissionregistrationv1alpha1.NewMutatingAdmissionPolicyLister(f.Informer().GetIndexer()) } + +// ToTypedMutatingAdmissionPolicyInformer converts an untyped informer into a TypedMutatingAdmissionPolicyInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *MutatingAdmissionPolicy. If that is not the case, calling type-safe methods of the returned +// TypedMutatingAdmissionPolicyInformer leads to runtime panics. A safer alternative is to pass +// around a TypedMutatingAdmissionPolicyInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedMutatingAdmissionPolicyInformer(informer MutatingAdmissionPolicyInformer) TypedMutatingAdmissionPolicyInformer { + if informer, ok := informer.(TypedMutatingAdmissionPolicyInformer); ok { + return informer + } + return &mutatingAdmissionPolicyTypedInformerAdapter{informer} +} + +type mutatingAdmissionPolicyTypedInformerAdapter struct { + MutatingAdmissionPolicyInformer +} + +func (a *mutatingAdmissionPolicyTypedInformerAdapter) TypedInformer() MutatingAdmissionPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicy](a.Informer()) +} + +// ToMutatingAdmissionPolicyIndexInformer converts an untyped informer into a MutatingAdmissionPolicyIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *MutatingAdmissionPolicy. If that is not the case, calling type-safe methods of the returned +// MutatingAdmissionPolicyIndexInformer leads to runtime panics. A safer alternative is to pass +// around a MutatingAdmissionPolicyIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToMutatingAdmissionPolicyIndexInformer(informer cache.SharedIndexInformer) MutatingAdmissionPolicyIndexInformer { + if informer, ok := informer.(MutatingAdmissionPolicyIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicy](informer) +} diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/mutatingadmissionpolicybinding.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/mutatingadmissionpolicybinding.go index 568c911159..b831a8d7a4 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/mutatingadmissionpolicybinding.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/mutatingadmissionpolicybinding.go @@ -34,12 +34,40 @@ import ( ) // MutatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for -// MutatingAdmissionPolicyBindings. +// MutatingAdmissionPolicyBindings. Prefer using the type-safe variant (see [TypedMutatingAdmissionPolicyBindingInformer]). type MutatingAdmissionPolicyBindingInformer interface { Informer() cache.SharedIndexInformer Lister() admissionregistrationv1alpha1.MutatingAdmissionPolicyBindingLister } +// TypedMutatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for +// MutatingAdmissionPolicyBindings, including the type-safe TypedInformer variant. +// It is a superset of MutatingAdmissionPolicyBindingInformer. +type TypedMutatingAdmissionPolicyBindingInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() MutatingAdmissionPolicyBindingIndexInformer + Lister() admissionregistrationv1alpha1.MutatingAdmissionPolicyBindingLister +} + +// MutatingAdmissionPolicyBindingIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type MutatingAdmissionPolicyBindingIndexInformer cache.TypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicyBinding] + +// MutatingAdmissionPolicyBindingHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for MutatingAdmissionPolicyBinding. +type MutatingAdmissionPolicyBindingHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicyBinding] + +// MutatingAdmissionPolicyBindingDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for MutatingAdmissionPolicyBinding. +type MutatingAdmissionPolicyBindingDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicyBinding] + +// MutatingAdmissionPolicyBindingFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for MutatingAdmissionPolicyBinding. +type MutatingAdmissionPolicyBindingFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicyBinding] + +// MutatingAdmissionPolicyBindingIndexers is a specialization of [cache.TypedIndexers] for MutatingAdmissionPolicyBinding. +type MutatingAdmissionPolicyBindingIndexers = cache.TypedIndexers[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicyBinding] + +// DeletedMutatingAdmissionPolicyBinding is a specialization of [cache.DeletedObject] for MutatingAdmissionPolicyBinding. +type DeletedMutatingAdmissionPolicyBinding = cache.DeletedObject[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicyBinding] + type mutatingAdmissionPolicyBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type mutatingAdmissionPolicyBindingInformer struct { // NewMutatingAdmissionPolicyBindingInformer constructs a new informer for MutatingAdmissionPolicyBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedMutatingAdmissionPolicyBindingInformer]). func NewMutatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedMutatingAdmissionPolicyBindingInformer constructs a new informer for MutatingAdmissionPolicyBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedMutatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers MutatingAdmissionPolicyBindingIndexers) MutatingAdmissionPolicyBindingIndexInformer { + return NewTypedMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredMutatingAdmissionPolicyBindingInformer constructs a new informer for MutatingAdmissionPolicyBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredMutatingAdmissionPolicyBindingInformer]). func NewFilteredMutatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredMutatingAdmissionPolicyBindingInformer constructs a new informer for MutatingAdmissionPolicyBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredMutatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers MutatingAdmissionPolicyBindingIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) MutatingAdmissionPolicyBindingIndexInformer { + return NewTypedMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewMutatingAdmissionPolicyBindingInformerWithOptions constructs a new informer for MutatingAdmissionPolicyBinding type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedMutatingAdmissionPolicyBindingInformerWithOptions]). func NewMutatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedMutatingAdmissionPolicyBindingInformerWithOptions(client, options) +} + +// NewTypedMutatingAdmissionPolicyBindingInformerWithOptions constructs a new informer for MutatingAdmissionPolicyBinding type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedMutatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) MutatingAdmissionPolicyBindingIndexInformer { gvr := schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1alpha1", Resource: "mutatingadmissionpolicybindings"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicyBinding](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewMutatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.Inte Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *mutatingAdmissionPolicyBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *mutatingAdmissionPolicyBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiadmissionregistrationv1alpha1.MutatingAdmissionPolicyBinding{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *mutatingAdmissionPolicyBindingInformer) TypedInformer() MutatingAdmissionPolicyBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicyBinding](f.factory.InformerFor(&apiadmissionregistrationv1alpha1.MutatingAdmissionPolicyBinding{}, f.defaultInformer)) } func (f *mutatingAdmissionPolicyBindingInformer) Lister() admissionregistrationv1alpha1.MutatingAdmissionPolicyBindingLister { return admissionregistrationv1alpha1.NewMutatingAdmissionPolicyBindingLister(f.Informer().GetIndexer()) } + +// ToTypedMutatingAdmissionPolicyBindingInformer converts an untyped informer into a TypedMutatingAdmissionPolicyBindingInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *MutatingAdmissionPolicyBinding. If that is not the case, calling type-safe methods of the returned +// TypedMutatingAdmissionPolicyBindingInformer leads to runtime panics. A safer alternative is to pass +// around a TypedMutatingAdmissionPolicyBindingInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedMutatingAdmissionPolicyBindingInformer(informer MutatingAdmissionPolicyBindingInformer) TypedMutatingAdmissionPolicyBindingInformer { + if informer, ok := informer.(TypedMutatingAdmissionPolicyBindingInformer); ok { + return informer + } + return &mutatingAdmissionPolicyBindingTypedInformerAdapter{informer} +} + +type mutatingAdmissionPolicyBindingTypedInformerAdapter struct { + MutatingAdmissionPolicyBindingInformer +} + +func (a *mutatingAdmissionPolicyBindingTypedInformerAdapter) TypedInformer() MutatingAdmissionPolicyBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicyBinding](a.Informer()) +} + +// ToMutatingAdmissionPolicyBindingIndexInformer converts an untyped informer into a MutatingAdmissionPolicyBindingIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *MutatingAdmissionPolicyBinding. If that is not the case, calling type-safe methods of the returned +// MutatingAdmissionPolicyBindingIndexInformer leads to runtime panics. A safer alternative is to pass +// around a MutatingAdmissionPolicyBindingIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToMutatingAdmissionPolicyBindingIndexInformer(informer cache.SharedIndexInformer) MutatingAdmissionPolicyBindingIndexInformer { + if informer, ok := informer.(MutatingAdmissionPolicyBindingIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.MutatingAdmissionPolicyBinding](informer) +} diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicy.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicy.go index c86ca6da62..db8efca26a 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicy.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicy.go @@ -34,12 +34,40 @@ import ( ) // ValidatingAdmissionPolicyInformer provides access to a shared informer and lister for -// ValidatingAdmissionPolicies. +// ValidatingAdmissionPolicies. Prefer using the type-safe variant (see [TypedValidatingAdmissionPolicyInformer]). type ValidatingAdmissionPolicyInformer interface { Informer() cache.SharedIndexInformer Lister() admissionregistrationv1alpha1.ValidatingAdmissionPolicyLister } +// TypedValidatingAdmissionPolicyInformer provides access to a shared informer and lister for +// ValidatingAdmissionPolicies, including the type-safe TypedInformer variant. +// It is a superset of ValidatingAdmissionPolicyInformer. +type TypedValidatingAdmissionPolicyInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ValidatingAdmissionPolicyIndexInformer + Lister() admissionregistrationv1alpha1.ValidatingAdmissionPolicyLister +} + +// ValidatingAdmissionPolicyIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ValidatingAdmissionPolicyIndexInformer cache.TypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicy] + +// ValidatingAdmissionPolicyHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ValidatingAdmissionPolicy. +type ValidatingAdmissionPolicyHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicy] + +// ValidatingAdmissionPolicyDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ValidatingAdmissionPolicy. +type ValidatingAdmissionPolicyDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicy] + +// ValidatingAdmissionPolicyFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ValidatingAdmissionPolicy. +type ValidatingAdmissionPolicyFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicy] + +// ValidatingAdmissionPolicyIndexers is a specialization of [cache.TypedIndexers] for ValidatingAdmissionPolicy. +type ValidatingAdmissionPolicyIndexers = cache.TypedIndexers[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicy] + +// DeletedValidatingAdmissionPolicy is a specialization of [cache.DeletedObject] for ValidatingAdmissionPolicy. +type DeletedValidatingAdmissionPolicy = cache.DeletedObject[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicy] + type validatingAdmissionPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type validatingAdmissionPolicyInformer struct { // NewValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedValidatingAdmissionPolicyInformer]). func NewValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ValidatingAdmissionPolicyIndexers) ValidatingAdmissionPolicyIndexInformer { + return NewTypedValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredValidatingAdmissionPolicyInformer]). func NewFilteredValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ValidatingAdmissionPolicyIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ValidatingAdmissionPolicyIndexInformer { + return NewTypedValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewValidatingAdmissionPolicyInformerWithOptions constructs a new informer for ValidatingAdmissionPolicy type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedValidatingAdmissionPolicyInformerWithOptions]). func NewValidatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedValidatingAdmissionPolicyInformerWithOptions(client, options) +} + +// NewTypedValidatingAdmissionPolicyInformerWithOptions constructs a new informer for ValidatingAdmissionPolicy type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedValidatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ValidatingAdmissionPolicyIndexInformer { gvr := schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1alpha1", Resource: "validatingadmissionpolicys"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicy](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewValidatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *validatingAdmissionPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *validatingAdmissionPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicy{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *validatingAdmissionPolicyInformer) TypedInformer() ValidatingAdmissionPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicy](f.factory.InformerFor(&apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicy{}, f.defaultInformer)) } func (f *validatingAdmissionPolicyInformer) Lister() admissionregistrationv1alpha1.ValidatingAdmissionPolicyLister { return admissionregistrationv1alpha1.NewValidatingAdmissionPolicyLister(f.Informer().GetIndexer()) } + +// ToTypedValidatingAdmissionPolicyInformer converts an untyped informer into a TypedValidatingAdmissionPolicyInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ValidatingAdmissionPolicy. If that is not the case, calling type-safe methods of the returned +// TypedValidatingAdmissionPolicyInformer leads to runtime panics. A safer alternative is to pass +// around a TypedValidatingAdmissionPolicyInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedValidatingAdmissionPolicyInformer(informer ValidatingAdmissionPolicyInformer) TypedValidatingAdmissionPolicyInformer { + if informer, ok := informer.(TypedValidatingAdmissionPolicyInformer); ok { + return informer + } + return &validatingAdmissionPolicyTypedInformerAdapter{informer} +} + +type validatingAdmissionPolicyTypedInformerAdapter struct { + ValidatingAdmissionPolicyInformer +} + +func (a *validatingAdmissionPolicyTypedInformerAdapter) TypedInformer() ValidatingAdmissionPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicy](a.Informer()) +} + +// ToValidatingAdmissionPolicyIndexInformer converts an untyped informer into a ValidatingAdmissionPolicyIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ValidatingAdmissionPolicy. If that is not the case, calling type-safe methods of the returned +// ValidatingAdmissionPolicyIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ValidatingAdmissionPolicyIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToValidatingAdmissionPolicyIndexInformer(informer cache.SharedIndexInformer) ValidatingAdmissionPolicyIndexInformer { + if informer, ok := informer.(ValidatingAdmissionPolicyIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicy](informer) +} diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go index 224049a254..5e1c4accaa 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go @@ -34,12 +34,40 @@ import ( ) // ValidatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for -// ValidatingAdmissionPolicyBindings. +// ValidatingAdmissionPolicyBindings. Prefer using the type-safe variant (see [TypedValidatingAdmissionPolicyBindingInformer]). type ValidatingAdmissionPolicyBindingInformer interface { Informer() cache.SharedIndexInformer Lister() admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingLister } +// TypedValidatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for +// ValidatingAdmissionPolicyBindings, including the type-safe TypedInformer variant. +// It is a superset of ValidatingAdmissionPolicyBindingInformer. +type TypedValidatingAdmissionPolicyBindingInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ValidatingAdmissionPolicyBindingIndexInformer + Lister() admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingLister +} + +// ValidatingAdmissionPolicyBindingIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ValidatingAdmissionPolicyBindingIndexInformer cache.TypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding] + +// ValidatingAdmissionPolicyBindingHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ValidatingAdmissionPolicyBinding. +type ValidatingAdmissionPolicyBindingHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding] + +// ValidatingAdmissionPolicyBindingDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ValidatingAdmissionPolicyBinding. +type ValidatingAdmissionPolicyBindingDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding] + +// ValidatingAdmissionPolicyBindingFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ValidatingAdmissionPolicyBinding. +type ValidatingAdmissionPolicyBindingFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding] + +// ValidatingAdmissionPolicyBindingIndexers is a specialization of [cache.TypedIndexers] for ValidatingAdmissionPolicyBinding. +type ValidatingAdmissionPolicyBindingIndexers = cache.TypedIndexers[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding] + +// DeletedValidatingAdmissionPolicyBinding is a specialization of [cache.DeletedObject] for ValidatingAdmissionPolicyBinding. +type DeletedValidatingAdmissionPolicyBinding = cache.DeletedObject[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding] + type validatingAdmissionPolicyBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type validatingAdmissionPolicyBindingInformer struct { // NewValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedValidatingAdmissionPolicyBindingInformer]). func NewValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ValidatingAdmissionPolicyBindingIndexers) ValidatingAdmissionPolicyBindingIndexInformer { + return NewTypedValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredValidatingAdmissionPolicyBindingInformer]). func NewFilteredValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ValidatingAdmissionPolicyBindingIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ValidatingAdmissionPolicyBindingIndexInformer { + return NewTypedValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewValidatingAdmissionPolicyBindingInformerWithOptions constructs a new informer for ValidatingAdmissionPolicyBinding type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedValidatingAdmissionPolicyBindingInformerWithOptions]). func NewValidatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedValidatingAdmissionPolicyBindingInformerWithOptions(client, options) +} + +// NewTypedValidatingAdmissionPolicyBindingInformerWithOptions constructs a new informer for ValidatingAdmissionPolicyBinding type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedValidatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ValidatingAdmissionPolicyBindingIndexInformer { gvr := schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1alpha1", Resource: "validatingadmissionpolicybindings"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewValidatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.In Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *validatingAdmissionPolicyBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *validatingAdmissionPolicyBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *validatingAdmissionPolicyBindingInformer) TypedInformer() ValidatingAdmissionPolicyBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding](f.factory.InformerFor(&apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding{}, f.defaultInformer)) } func (f *validatingAdmissionPolicyBindingInformer) Lister() admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingLister { return admissionregistrationv1alpha1.NewValidatingAdmissionPolicyBindingLister(f.Informer().GetIndexer()) } + +// ToTypedValidatingAdmissionPolicyBindingInformer converts an untyped informer into a TypedValidatingAdmissionPolicyBindingInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ValidatingAdmissionPolicyBinding. If that is not the case, calling type-safe methods of the returned +// TypedValidatingAdmissionPolicyBindingInformer leads to runtime panics. A safer alternative is to pass +// around a TypedValidatingAdmissionPolicyBindingInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedValidatingAdmissionPolicyBindingInformer(informer ValidatingAdmissionPolicyBindingInformer) TypedValidatingAdmissionPolicyBindingInformer { + if informer, ok := informer.(TypedValidatingAdmissionPolicyBindingInformer); ok { + return informer + } + return &validatingAdmissionPolicyBindingTypedInformerAdapter{informer} +} + +type validatingAdmissionPolicyBindingTypedInformerAdapter struct { + ValidatingAdmissionPolicyBindingInformer +} + +func (a *validatingAdmissionPolicyBindingTypedInformerAdapter) TypedInformer() ValidatingAdmissionPolicyBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding](a.Informer()) +} + +// ToValidatingAdmissionPolicyBindingIndexInformer converts an untyped informer into a ValidatingAdmissionPolicyBindingIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ValidatingAdmissionPolicyBinding. If that is not the case, calling type-safe methods of the returned +// ValidatingAdmissionPolicyBindingIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ValidatingAdmissionPolicyBindingIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToValidatingAdmissionPolicyBindingIndexInformer(informer cache.SharedIndexInformer) ValidatingAdmissionPolicyBindingIndexInformer { + if informer, ok := informer.(ValidatingAdmissionPolicyBindingIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding](informer) +} diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/interface.go index 9174fd1c72..fa0818f41b 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/interface.go @@ -25,17 +25,17 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // MutatingAdmissionPolicies returns a MutatingAdmissionPolicyInformer. - MutatingAdmissionPolicies() MutatingAdmissionPolicyInformer + MutatingAdmissionPolicies() TypedMutatingAdmissionPolicyInformer // MutatingAdmissionPolicyBindings returns a MutatingAdmissionPolicyBindingInformer. - MutatingAdmissionPolicyBindings() MutatingAdmissionPolicyBindingInformer + MutatingAdmissionPolicyBindings() TypedMutatingAdmissionPolicyBindingInformer // MutatingWebhookConfigurations returns a MutatingWebhookConfigurationInformer. - MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer + MutatingWebhookConfigurations() TypedMutatingWebhookConfigurationInformer // ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyInformer. - ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInformer + ValidatingAdmissionPolicies() TypedValidatingAdmissionPolicyInformer // ValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindingInformer. - ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInformer + ValidatingAdmissionPolicyBindings() TypedValidatingAdmissionPolicyBindingInformer // ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer. - ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer + ValidatingWebhookConfigurations() TypedValidatingWebhookConfigurationInformer } type version struct { @@ -49,32 +49,32 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// MutatingAdmissionPolicies returns a MutatingAdmissionPolicyInformer. -func (v *version) MutatingAdmissionPolicies() MutatingAdmissionPolicyInformer { +// MutatingAdmissionPolicies returns a TypedMutatingAdmissionPolicyInformer. +func (v *version) MutatingAdmissionPolicies() TypedMutatingAdmissionPolicyInformer { return &mutatingAdmissionPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// MutatingAdmissionPolicyBindings returns a MutatingAdmissionPolicyBindingInformer. -func (v *version) MutatingAdmissionPolicyBindings() MutatingAdmissionPolicyBindingInformer { +// MutatingAdmissionPolicyBindings returns a TypedMutatingAdmissionPolicyBindingInformer. +func (v *version) MutatingAdmissionPolicyBindings() TypedMutatingAdmissionPolicyBindingInformer { return &mutatingAdmissionPolicyBindingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// MutatingWebhookConfigurations returns a MutatingWebhookConfigurationInformer. -func (v *version) MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer { +// MutatingWebhookConfigurations returns a TypedMutatingWebhookConfigurationInformer. +func (v *version) MutatingWebhookConfigurations() TypedMutatingWebhookConfigurationInformer { return &mutatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyInformer. -func (v *version) ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInformer { +// ValidatingAdmissionPolicies returns a TypedValidatingAdmissionPolicyInformer. +func (v *version) ValidatingAdmissionPolicies() TypedValidatingAdmissionPolicyInformer { return &validatingAdmissionPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindingInformer. -func (v *version) ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInformer { +// ValidatingAdmissionPolicyBindings returns a TypedValidatingAdmissionPolicyBindingInformer. +func (v *version) ValidatingAdmissionPolicyBindings() TypedValidatingAdmissionPolicyBindingInformer { return &validatingAdmissionPolicyBindingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer. -func (v *version) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer { +// ValidatingWebhookConfigurations returns a TypedValidatingWebhookConfigurationInformer. +func (v *version) ValidatingWebhookConfigurations() TypedValidatingWebhookConfigurationInformer { return &validatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingadmissionpolicy.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingadmissionpolicy.go index edfe94417b..5eaff99898 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingadmissionpolicy.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingadmissionpolicy.go @@ -34,12 +34,40 @@ import ( ) // MutatingAdmissionPolicyInformer provides access to a shared informer and lister for -// MutatingAdmissionPolicies. +// MutatingAdmissionPolicies. Prefer using the type-safe variant (see [TypedMutatingAdmissionPolicyInformer]). type MutatingAdmissionPolicyInformer interface { Informer() cache.SharedIndexInformer Lister() admissionregistrationv1beta1.MutatingAdmissionPolicyLister } +// TypedMutatingAdmissionPolicyInformer provides access to a shared informer and lister for +// MutatingAdmissionPolicies, including the type-safe TypedInformer variant. +// It is a superset of MutatingAdmissionPolicyInformer. +type TypedMutatingAdmissionPolicyInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() MutatingAdmissionPolicyIndexInformer + Lister() admissionregistrationv1beta1.MutatingAdmissionPolicyLister +} + +// MutatingAdmissionPolicyIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type MutatingAdmissionPolicyIndexInformer cache.TypedSharedIndexInformer[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicy] + +// MutatingAdmissionPolicyHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for MutatingAdmissionPolicy. +type MutatingAdmissionPolicyHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicy] + +// MutatingAdmissionPolicyDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for MutatingAdmissionPolicy. +type MutatingAdmissionPolicyDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicy] + +// MutatingAdmissionPolicyFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for MutatingAdmissionPolicy. +type MutatingAdmissionPolicyFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicy] + +// MutatingAdmissionPolicyIndexers is a specialization of [cache.TypedIndexers] for MutatingAdmissionPolicy. +type MutatingAdmissionPolicyIndexers = cache.TypedIndexers[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicy] + +// DeletedMutatingAdmissionPolicy is a specialization of [cache.DeletedObject] for MutatingAdmissionPolicy. +type DeletedMutatingAdmissionPolicy = cache.DeletedObject[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicy] + type mutatingAdmissionPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type mutatingAdmissionPolicyInformer struct { // NewMutatingAdmissionPolicyInformer constructs a new informer for MutatingAdmissionPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedMutatingAdmissionPolicyInformer]). func NewMutatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedMutatingAdmissionPolicyInformer constructs a new informer for MutatingAdmissionPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedMutatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers MutatingAdmissionPolicyIndexers) MutatingAdmissionPolicyIndexInformer { + return NewTypedMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredMutatingAdmissionPolicyInformer constructs a new informer for MutatingAdmissionPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredMutatingAdmissionPolicyInformer]). func NewFilteredMutatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredMutatingAdmissionPolicyInformer constructs a new informer for MutatingAdmissionPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredMutatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers MutatingAdmissionPolicyIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) MutatingAdmissionPolicyIndexInformer { + return NewTypedMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewMutatingAdmissionPolicyInformerWithOptions constructs a new informer for MutatingAdmissionPolicy type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedMutatingAdmissionPolicyInformerWithOptions]). func NewMutatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedMutatingAdmissionPolicyInformerWithOptions(client, options) +} + +// NewTypedMutatingAdmissionPolicyInformerWithOptions constructs a new informer for MutatingAdmissionPolicy type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedMutatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) MutatingAdmissionPolicyIndexInformer { gvr := schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1beta1", Resource: "mutatingadmissionpolicys"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicy](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewMutatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface, Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *mutatingAdmissionPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *mutatingAdmissionPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiadmissionregistrationv1beta1.MutatingAdmissionPolicy{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *mutatingAdmissionPolicyInformer) TypedInformer() MutatingAdmissionPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicy](f.factory.InformerFor(&apiadmissionregistrationv1beta1.MutatingAdmissionPolicy{}, f.defaultInformer)) } func (f *mutatingAdmissionPolicyInformer) Lister() admissionregistrationv1beta1.MutatingAdmissionPolicyLister { return admissionregistrationv1beta1.NewMutatingAdmissionPolicyLister(f.Informer().GetIndexer()) } + +// ToTypedMutatingAdmissionPolicyInformer converts an untyped informer into a TypedMutatingAdmissionPolicyInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *MutatingAdmissionPolicy. If that is not the case, calling type-safe methods of the returned +// TypedMutatingAdmissionPolicyInformer leads to runtime panics. A safer alternative is to pass +// around a TypedMutatingAdmissionPolicyInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedMutatingAdmissionPolicyInformer(informer MutatingAdmissionPolicyInformer) TypedMutatingAdmissionPolicyInformer { + if informer, ok := informer.(TypedMutatingAdmissionPolicyInformer); ok { + return informer + } + return &mutatingAdmissionPolicyTypedInformerAdapter{informer} +} + +type mutatingAdmissionPolicyTypedInformerAdapter struct { + MutatingAdmissionPolicyInformer +} + +func (a *mutatingAdmissionPolicyTypedInformerAdapter) TypedInformer() MutatingAdmissionPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicy](a.Informer()) +} + +// ToMutatingAdmissionPolicyIndexInformer converts an untyped informer into a MutatingAdmissionPolicyIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *MutatingAdmissionPolicy. If that is not the case, calling type-safe methods of the returned +// MutatingAdmissionPolicyIndexInformer leads to runtime panics. A safer alternative is to pass +// around a MutatingAdmissionPolicyIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToMutatingAdmissionPolicyIndexInformer(informer cache.SharedIndexInformer) MutatingAdmissionPolicyIndexInformer { + if informer, ok := informer.(MutatingAdmissionPolicyIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicy](informer) +} diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingadmissionpolicybinding.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingadmissionpolicybinding.go index bb833f4447..6422d2f7fe 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingadmissionpolicybinding.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingadmissionpolicybinding.go @@ -34,12 +34,40 @@ import ( ) // MutatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for -// MutatingAdmissionPolicyBindings. +// MutatingAdmissionPolicyBindings. Prefer using the type-safe variant (see [TypedMutatingAdmissionPolicyBindingInformer]). type MutatingAdmissionPolicyBindingInformer interface { Informer() cache.SharedIndexInformer Lister() admissionregistrationv1beta1.MutatingAdmissionPolicyBindingLister } +// TypedMutatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for +// MutatingAdmissionPolicyBindings, including the type-safe TypedInformer variant. +// It is a superset of MutatingAdmissionPolicyBindingInformer. +type TypedMutatingAdmissionPolicyBindingInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() MutatingAdmissionPolicyBindingIndexInformer + Lister() admissionregistrationv1beta1.MutatingAdmissionPolicyBindingLister +} + +// MutatingAdmissionPolicyBindingIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type MutatingAdmissionPolicyBindingIndexInformer cache.TypedSharedIndexInformer[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicyBinding] + +// MutatingAdmissionPolicyBindingHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for MutatingAdmissionPolicyBinding. +type MutatingAdmissionPolicyBindingHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicyBinding] + +// MutatingAdmissionPolicyBindingDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for MutatingAdmissionPolicyBinding. +type MutatingAdmissionPolicyBindingDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicyBinding] + +// MutatingAdmissionPolicyBindingFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for MutatingAdmissionPolicyBinding. +type MutatingAdmissionPolicyBindingFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicyBinding] + +// MutatingAdmissionPolicyBindingIndexers is a specialization of [cache.TypedIndexers] for MutatingAdmissionPolicyBinding. +type MutatingAdmissionPolicyBindingIndexers = cache.TypedIndexers[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicyBinding] + +// DeletedMutatingAdmissionPolicyBinding is a specialization of [cache.DeletedObject] for MutatingAdmissionPolicyBinding. +type DeletedMutatingAdmissionPolicyBinding = cache.DeletedObject[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicyBinding] + type mutatingAdmissionPolicyBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type mutatingAdmissionPolicyBindingInformer struct { // NewMutatingAdmissionPolicyBindingInformer constructs a new informer for MutatingAdmissionPolicyBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedMutatingAdmissionPolicyBindingInformer]). func NewMutatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedMutatingAdmissionPolicyBindingInformer constructs a new informer for MutatingAdmissionPolicyBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedMutatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers MutatingAdmissionPolicyBindingIndexers) MutatingAdmissionPolicyBindingIndexInformer { + return NewTypedMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredMutatingAdmissionPolicyBindingInformer constructs a new informer for MutatingAdmissionPolicyBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredMutatingAdmissionPolicyBindingInformer]). func NewFilteredMutatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredMutatingAdmissionPolicyBindingInformer constructs a new informer for MutatingAdmissionPolicyBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredMutatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers MutatingAdmissionPolicyBindingIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) MutatingAdmissionPolicyBindingIndexInformer { + return NewTypedMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewMutatingAdmissionPolicyBindingInformerWithOptions constructs a new informer for MutatingAdmissionPolicyBinding type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedMutatingAdmissionPolicyBindingInformerWithOptions]). func NewMutatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedMutatingAdmissionPolicyBindingInformerWithOptions(client, options) +} + +// NewTypedMutatingAdmissionPolicyBindingInformerWithOptions constructs a new informer for MutatingAdmissionPolicyBinding type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedMutatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) MutatingAdmissionPolicyBindingIndexInformer { gvr := schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1beta1", Resource: "mutatingadmissionpolicybindings"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicyBinding](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewMutatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.Inte Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *mutatingAdmissionPolicyBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *mutatingAdmissionPolicyBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiadmissionregistrationv1beta1.MutatingAdmissionPolicyBinding{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *mutatingAdmissionPolicyBindingInformer) TypedInformer() MutatingAdmissionPolicyBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicyBinding](f.factory.InformerFor(&apiadmissionregistrationv1beta1.MutatingAdmissionPolicyBinding{}, f.defaultInformer)) } func (f *mutatingAdmissionPolicyBindingInformer) Lister() admissionregistrationv1beta1.MutatingAdmissionPolicyBindingLister { return admissionregistrationv1beta1.NewMutatingAdmissionPolicyBindingLister(f.Informer().GetIndexer()) } + +// ToTypedMutatingAdmissionPolicyBindingInformer converts an untyped informer into a TypedMutatingAdmissionPolicyBindingInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *MutatingAdmissionPolicyBinding. If that is not the case, calling type-safe methods of the returned +// TypedMutatingAdmissionPolicyBindingInformer leads to runtime panics. A safer alternative is to pass +// around a TypedMutatingAdmissionPolicyBindingInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedMutatingAdmissionPolicyBindingInformer(informer MutatingAdmissionPolicyBindingInformer) TypedMutatingAdmissionPolicyBindingInformer { + if informer, ok := informer.(TypedMutatingAdmissionPolicyBindingInformer); ok { + return informer + } + return &mutatingAdmissionPolicyBindingTypedInformerAdapter{informer} +} + +type mutatingAdmissionPolicyBindingTypedInformerAdapter struct { + MutatingAdmissionPolicyBindingInformer +} + +func (a *mutatingAdmissionPolicyBindingTypedInformerAdapter) TypedInformer() MutatingAdmissionPolicyBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicyBinding](a.Informer()) +} + +// ToMutatingAdmissionPolicyBindingIndexInformer converts an untyped informer into a MutatingAdmissionPolicyBindingIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *MutatingAdmissionPolicyBinding. If that is not the case, calling type-safe methods of the returned +// MutatingAdmissionPolicyBindingIndexInformer leads to runtime panics. A safer alternative is to pass +// around a MutatingAdmissionPolicyBindingIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToMutatingAdmissionPolicyBindingIndexInformer(informer cache.SharedIndexInformer) MutatingAdmissionPolicyBindingIndexInformer { + if informer, ok := informer.(MutatingAdmissionPolicyBindingIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.MutatingAdmissionPolicyBinding](informer) +} diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index bb077a1746..2aef3f2961 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -34,12 +34,40 @@ import ( ) // MutatingWebhookConfigurationInformer provides access to a shared informer and lister for -// MutatingWebhookConfigurations. +// MutatingWebhookConfigurations. Prefer using the type-safe variant (see [TypedMutatingWebhookConfigurationInformer]). type MutatingWebhookConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() admissionregistrationv1beta1.MutatingWebhookConfigurationLister } +// TypedMutatingWebhookConfigurationInformer provides access to a shared informer and lister for +// MutatingWebhookConfigurations, including the type-safe TypedInformer variant. +// It is a superset of MutatingWebhookConfigurationInformer. +type TypedMutatingWebhookConfigurationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() MutatingWebhookConfigurationIndexInformer + Lister() admissionregistrationv1beta1.MutatingWebhookConfigurationLister +} + +// MutatingWebhookConfigurationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type MutatingWebhookConfigurationIndexInformer cache.TypedSharedIndexInformer[*apiadmissionregistrationv1beta1.MutatingWebhookConfiguration] + +// MutatingWebhookConfigurationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for MutatingWebhookConfiguration. +type MutatingWebhookConfigurationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiadmissionregistrationv1beta1.MutatingWebhookConfiguration] + +// MutatingWebhookConfigurationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for MutatingWebhookConfiguration. +type MutatingWebhookConfigurationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiadmissionregistrationv1beta1.MutatingWebhookConfiguration] + +// MutatingWebhookConfigurationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for MutatingWebhookConfiguration. +type MutatingWebhookConfigurationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiadmissionregistrationv1beta1.MutatingWebhookConfiguration] + +// MutatingWebhookConfigurationIndexers is a specialization of [cache.TypedIndexers] for MutatingWebhookConfiguration. +type MutatingWebhookConfigurationIndexers = cache.TypedIndexers[*apiadmissionregistrationv1beta1.MutatingWebhookConfiguration] + +// DeletedMutatingWebhookConfiguration is a specialization of [cache.DeletedObject] for MutatingWebhookConfiguration. +type DeletedMutatingWebhookConfiguration = cache.DeletedObject[*apiadmissionregistrationv1beta1.MutatingWebhookConfiguration] + type mutatingWebhookConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type mutatingWebhookConfigurationInformer struct { // NewMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedMutatingWebhookConfigurationInformer]). func NewMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewMutatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers MutatingWebhookConfigurationIndexers) MutatingWebhookConfigurationIndexInformer { + return NewTypedMutatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredMutatingWebhookConfigurationInformer]). func NewFilteredMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewMutatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedMutatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers MutatingWebhookConfigurationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) MutatingWebhookConfigurationIndexInformer { + return NewTypedMutatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewMutatingWebhookConfigurationInformerWithOptions constructs a new informer for MutatingWebhookConfiguration type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedMutatingWebhookConfigurationInformerWithOptions]). func NewMutatingWebhookConfigurationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedMutatingWebhookConfigurationInformerWithOptions(client, options) +} + +// NewTypedMutatingWebhookConfigurationInformerWithOptions constructs a new informer for MutatingWebhookConfiguration type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedMutatingWebhookConfigurationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) MutatingWebhookConfigurationIndexInformer { gvr := schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1beta1", Resource: "mutatingwebhookconfigurations"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.MutatingWebhookConfiguration](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewMutatingWebhookConfigurationInformerWithOptions(client kubernetes.Interf Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *mutatingWebhookConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewMutatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedMutatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *mutatingWebhookConfigurationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiadmissionregistrationv1beta1.MutatingWebhookConfiguration{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *mutatingWebhookConfigurationInformer) TypedInformer() MutatingWebhookConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.MutatingWebhookConfiguration](f.factory.InformerFor(&apiadmissionregistrationv1beta1.MutatingWebhookConfiguration{}, f.defaultInformer)) } func (f *mutatingWebhookConfigurationInformer) Lister() admissionregistrationv1beta1.MutatingWebhookConfigurationLister { return admissionregistrationv1beta1.NewMutatingWebhookConfigurationLister(f.Informer().GetIndexer()) } + +// ToTypedMutatingWebhookConfigurationInformer converts an untyped informer into a TypedMutatingWebhookConfigurationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *MutatingWebhookConfiguration. If that is not the case, calling type-safe methods of the returned +// TypedMutatingWebhookConfigurationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedMutatingWebhookConfigurationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedMutatingWebhookConfigurationInformer(informer MutatingWebhookConfigurationInformer) TypedMutatingWebhookConfigurationInformer { + if informer, ok := informer.(TypedMutatingWebhookConfigurationInformer); ok { + return informer + } + return &mutatingWebhookConfigurationTypedInformerAdapter{informer} +} + +type mutatingWebhookConfigurationTypedInformerAdapter struct { + MutatingWebhookConfigurationInformer +} + +func (a *mutatingWebhookConfigurationTypedInformerAdapter) TypedInformer() MutatingWebhookConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.MutatingWebhookConfiguration](a.Informer()) +} + +// ToMutatingWebhookConfigurationIndexInformer converts an untyped informer into a MutatingWebhookConfigurationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *MutatingWebhookConfiguration. If that is not the case, calling type-safe methods of the returned +// MutatingWebhookConfigurationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a MutatingWebhookConfigurationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToMutatingWebhookConfigurationIndexInformer(informer cache.SharedIndexInformer) MutatingWebhookConfigurationIndexInformer { + if informer, ok := informer.(MutatingWebhookConfigurationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.MutatingWebhookConfiguration](informer) +} diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicy.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicy.go index a88a254d6f..2a4f9ad128 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicy.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicy.go @@ -34,12 +34,40 @@ import ( ) // ValidatingAdmissionPolicyInformer provides access to a shared informer and lister for -// ValidatingAdmissionPolicies. +// ValidatingAdmissionPolicies. Prefer using the type-safe variant (see [TypedValidatingAdmissionPolicyInformer]). type ValidatingAdmissionPolicyInformer interface { Informer() cache.SharedIndexInformer Lister() admissionregistrationv1beta1.ValidatingAdmissionPolicyLister } +// TypedValidatingAdmissionPolicyInformer provides access to a shared informer and lister for +// ValidatingAdmissionPolicies, including the type-safe TypedInformer variant. +// It is a superset of ValidatingAdmissionPolicyInformer. +type TypedValidatingAdmissionPolicyInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ValidatingAdmissionPolicyIndexInformer + Lister() admissionregistrationv1beta1.ValidatingAdmissionPolicyLister +} + +// ValidatingAdmissionPolicyIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ValidatingAdmissionPolicyIndexInformer cache.TypedSharedIndexInformer[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicy] + +// ValidatingAdmissionPolicyHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ValidatingAdmissionPolicy. +type ValidatingAdmissionPolicyHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicy] + +// ValidatingAdmissionPolicyDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ValidatingAdmissionPolicy. +type ValidatingAdmissionPolicyDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicy] + +// ValidatingAdmissionPolicyFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ValidatingAdmissionPolicy. +type ValidatingAdmissionPolicyFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicy] + +// ValidatingAdmissionPolicyIndexers is a specialization of [cache.TypedIndexers] for ValidatingAdmissionPolicy. +type ValidatingAdmissionPolicyIndexers = cache.TypedIndexers[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicy] + +// DeletedValidatingAdmissionPolicy is a specialization of [cache.DeletedObject] for ValidatingAdmissionPolicy. +type DeletedValidatingAdmissionPolicy = cache.DeletedObject[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicy] + type validatingAdmissionPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type validatingAdmissionPolicyInformer struct { // NewValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedValidatingAdmissionPolicyInformer]). func NewValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ValidatingAdmissionPolicyIndexers) ValidatingAdmissionPolicyIndexInformer { + return NewTypedValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredValidatingAdmissionPolicyInformer]). func NewFilteredValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ValidatingAdmissionPolicyIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ValidatingAdmissionPolicyIndexInformer { + return NewTypedValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewValidatingAdmissionPolicyInformerWithOptions constructs a new informer for ValidatingAdmissionPolicy type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedValidatingAdmissionPolicyInformerWithOptions]). func NewValidatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedValidatingAdmissionPolicyInformerWithOptions(client, options) +} + +// NewTypedValidatingAdmissionPolicyInformerWithOptions constructs a new informer for ValidatingAdmissionPolicy type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedValidatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ValidatingAdmissionPolicyIndexInformer { gvr := schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1beta1", Resource: "validatingadmissionpolicys"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicy](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewValidatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *validatingAdmissionPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedValidatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *validatingAdmissionPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiadmissionregistrationv1beta1.ValidatingAdmissionPolicy{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *validatingAdmissionPolicyInformer) TypedInformer() ValidatingAdmissionPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicy](f.factory.InformerFor(&apiadmissionregistrationv1beta1.ValidatingAdmissionPolicy{}, f.defaultInformer)) } func (f *validatingAdmissionPolicyInformer) Lister() admissionregistrationv1beta1.ValidatingAdmissionPolicyLister { return admissionregistrationv1beta1.NewValidatingAdmissionPolicyLister(f.Informer().GetIndexer()) } + +// ToTypedValidatingAdmissionPolicyInformer converts an untyped informer into a TypedValidatingAdmissionPolicyInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ValidatingAdmissionPolicy. If that is not the case, calling type-safe methods of the returned +// TypedValidatingAdmissionPolicyInformer leads to runtime panics. A safer alternative is to pass +// around a TypedValidatingAdmissionPolicyInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedValidatingAdmissionPolicyInformer(informer ValidatingAdmissionPolicyInformer) TypedValidatingAdmissionPolicyInformer { + if informer, ok := informer.(TypedValidatingAdmissionPolicyInformer); ok { + return informer + } + return &validatingAdmissionPolicyTypedInformerAdapter{informer} +} + +type validatingAdmissionPolicyTypedInformerAdapter struct { + ValidatingAdmissionPolicyInformer +} + +func (a *validatingAdmissionPolicyTypedInformerAdapter) TypedInformer() ValidatingAdmissionPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicy](a.Informer()) +} + +// ToValidatingAdmissionPolicyIndexInformer converts an untyped informer into a ValidatingAdmissionPolicyIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ValidatingAdmissionPolicy. If that is not the case, calling type-safe methods of the returned +// ValidatingAdmissionPolicyIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ValidatingAdmissionPolicyIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToValidatingAdmissionPolicyIndexInformer(informer cache.SharedIndexInformer) ValidatingAdmissionPolicyIndexInformer { + if informer, ok := informer.(ValidatingAdmissionPolicyIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicy](informer) +} diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go index d1df5a3f2f..2cbc29ac5a 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go @@ -34,12 +34,40 @@ import ( ) // ValidatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for -// ValidatingAdmissionPolicyBindings. +// ValidatingAdmissionPolicyBindings. Prefer using the type-safe variant (see [TypedValidatingAdmissionPolicyBindingInformer]). type ValidatingAdmissionPolicyBindingInformer interface { Informer() cache.SharedIndexInformer Lister() admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingLister } +// TypedValidatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for +// ValidatingAdmissionPolicyBindings, including the type-safe TypedInformer variant. +// It is a superset of ValidatingAdmissionPolicyBindingInformer. +type TypedValidatingAdmissionPolicyBindingInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ValidatingAdmissionPolicyBindingIndexInformer + Lister() admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingLister +} + +// ValidatingAdmissionPolicyBindingIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ValidatingAdmissionPolicyBindingIndexInformer cache.TypedSharedIndexInformer[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicyBinding] + +// ValidatingAdmissionPolicyBindingHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ValidatingAdmissionPolicyBinding. +type ValidatingAdmissionPolicyBindingHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicyBinding] + +// ValidatingAdmissionPolicyBindingDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ValidatingAdmissionPolicyBinding. +type ValidatingAdmissionPolicyBindingDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicyBinding] + +// ValidatingAdmissionPolicyBindingFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ValidatingAdmissionPolicyBinding. +type ValidatingAdmissionPolicyBindingFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicyBinding] + +// ValidatingAdmissionPolicyBindingIndexers is a specialization of [cache.TypedIndexers] for ValidatingAdmissionPolicyBinding. +type ValidatingAdmissionPolicyBindingIndexers = cache.TypedIndexers[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicyBinding] + +// DeletedValidatingAdmissionPolicyBinding is a specialization of [cache.DeletedObject] for ValidatingAdmissionPolicyBinding. +type DeletedValidatingAdmissionPolicyBinding = cache.DeletedObject[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicyBinding] + type validatingAdmissionPolicyBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type validatingAdmissionPolicyBindingInformer struct { // NewValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedValidatingAdmissionPolicyBindingInformer]). func NewValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ValidatingAdmissionPolicyBindingIndexers) ValidatingAdmissionPolicyBindingIndexInformer { + return NewTypedValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredValidatingAdmissionPolicyBindingInformer]). func NewFilteredValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ValidatingAdmissionPolicyBindingIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ValidatingAdmissionPolicyBindingIndexInformer { + return NewTypedValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewValidatingAdmissionPolicyBindingInformerWithOptions constructs a new informer for ValidatingAdmissionPolicyBinding type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedValidatingAdmissionPolicyBindingInformerWithOptions]). func NewValidatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedValidatingAdmissionPolicyBindingInformerWithOptions(client, options) +} + +// NewTypedValidatingAdmissionPolicyBindingInformerWithOptions constructs a new informer for ValidatingAdmissionPolicyBinding type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedValidatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ValidatingAdmissionPolicyBindingIndexInformer { gvr := schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1beta1", Resource: "validatingadmissionpolicybindings"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicyBinding](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewValidatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.In Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *validatingAdmissionPolicyBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedValidatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *validatingAdmissionPolicyBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiadmissionregistrationv1beta1.ValidatingAdmissionPolicyBinding{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *validatingAdmissionPolicyBindingInformer) TypedInformer() ValidatingAdmissionPolicyBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicyBinding](f.factory.InformerFor(&apiadmissionregistrationv1beta1.ValidatingAdmissionPolicyBinding{}, f.defaultInformer)) } func (f *validatingAdmissionPolicyBindingInformer) Lister() admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingLister { return admissionregistrationv1beta1.NewValidatingAdmissionPolicyBindingLister(f.Informer().GetIndexer()) } + +// ToTypedValidatingAdmissionPolicyBindingInformer converts an untyped informer into a TypedValidatingAdmissionPolicyBindingInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ValidatingAdmissionPolicyBinding. If that is not the case, calling type-safe methods of the returned +// TypedValidatingAdmissionPolicyBindingInformer leads to runtime panics. A safer alternative is to pass +// around a TypedValidatingAdmissionPolicyBindingInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedValidatingAdmissionPolicyBindingInformer(informer ValidatingAdmissionPolicyBindingInformer) TypedValidatingAdmissionPolicyBindingInformer { + if informer, ok := informer.(TypedValidatingAdmissionPolicyBindingInformer); ok { + return informer + } + return &validatingAdmissionPolicyBindingTypedInformerAdapter{informer} +} + +type validatingAdmissionPolicyBindingTypedInformerAdapter struct { + ValidatingAdmissionPolicyBindingInformer +} + +func (a *validatingAdmissionPolicyBindingTypedInformerAdapter) TypedInformer() ValidatingAdmissionPolicyBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicyBinding](a.Informer()) +} + +// ToValidatingAdmissionPolicyBindingIndexInformer converts an untyped informer into a ValidatingAdmissionPolicyBindingIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ValidatingAdmissionPolicyBinding. If that is not the case, calling type-safe methods of the returned +// ValidatingAdmissionPolicyBindingIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ValidatingAdmissionPolicyBindingIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToValidatingAdmissionPolicyBindingIndexInformer(informer cache.SharedIndexInformer) ValidatingAdmissionPolicyBindingIndexInformer { + if informer, ok := informer.(ValidatingAdmissionPolicyBindingIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.ValidatingAdmissionPolicyBinding](informer) +} diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go index 41852cb03d..b7497aacab 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -34,12 +34,40 @@ import ( ) // ValidatingWebhookConfigurationInformer provides access to a shared informer and lister for -// ValidatingWebhookConfigurations. +// ValidatingWebhookConfigurations. Prefer using the type-safe variant (see [TypedValidatingWebhookConfigurationInformer]). type ValidatingWebhookConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() admissionregistrationv1beta1.ValidatingWebhookConfigurationLister } +// TypedValidatingWebhookConfigurationInformer provides access to a shared informer and lister for +// ValidatingWebhookConfigurations, including the type-safe TypedInformer variant. +// It is a superset of ValidatingWebhookConfigurationInformer. +type TypedValidatingWebhookConfigurationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ValidatingWebhookConfigurationIndexInformer + Lister() admissionregistrationv1beta1.ValidatingWebhookConfigurationLister +} + +// ValidatingWebhookConfigurationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ValidatingWebhookConfigurationIndexInformer cache.TypedSharedIndexInformer[*apiadmissionregistrationv1beta1.ValidatingWebhookConfiguration] + +// ValidatingWebhookConfigurationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ValidatingWebhookConfiguration. +type ValidatingWebhookConfigurationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiadmissionregistrationv1beta1.ValidatingWebhookConfiguration] + +// ValidatingWebhookConfigurationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ValidatingWebhookConfiguration. +type ValidatingWebhookConfigurationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiadmissionregistrationv1beta1.ValidatingWebhookConfiguration] + +// ValidatingWebhookConfigurationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ValidatingWebhookConfiguration. +type ValidatingWebhookConfigurationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiadmissionregistrationv1beta1.ValidatingWebhookConfiguration] + +// ValidatingWebhookConfigurationIndexers is a specialization of [cache.TypedIndexers] for ValidatingWebhookConfiguration. +type ValidatingWebhookConfigurationIndexers = cache.TypedIndexers[*apiadmissionregistrationv1beta1.ValidatingWebhookConfiguration] + +// DeletedValidatingWebhookConfiguration is a specialization of [cache.DeletedObject] for ValidatingWebhookConfiguration. +type DeletedValidatingWebhookConfiguration = cache.DeletedObject[*apiadmissionregistrationv1beta1.ValidatingWebhookConfiguration] + type validatingWebhookConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type validatingWebhookConfigurationInformer struct { // NewValidatingWebhookConfigurationInformer constructs a new informer for ValidatingWebhookConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedValidatingWebhookConfigurationInformer]). func NewValidatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewValidatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedValidatingWebhookConfigurationInformer constructs a new informer for ValidatingWebhookConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedValidatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ValidatingWebhookConfigurationIndexers) ValidatingWebhookConfigurationIndexInformer { + return NewTypedValidatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredValidatingWebhookConfigurationInformer constructs a new informer for ValidatingWebhookConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredValidatingWebhookConfigurationInformer]). func NewFilteredValidatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewValidatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedValidatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredValidatingWebhookConfigurationInformer constructs a new informer for ValidatingWebhookConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredValidatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ValidatingWebhookConfigurationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ValidatingWebhookConfigurationIndexInformer { + return NewTypedValidatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewValidatingWebhookConfigurationInformerWithOptions constructs a new informer for ValidatingWebhookConfiguration type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedValidatingWebhookConfigurationInformerWithOptions]). func NewValidatingWebhookConfigurationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedValidatingWebhookConfigurationInformerWithOptions(client, options) +} + +// NewTypedValidatingWebhookConfigurationInformerWithOptions constructs a new informer for ValidatingWebhookConfiguration type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedValidatingWebhookConfigurationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ValidatingWebhookConfigurationIndexInformer { gvr := schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1beta1", Resource: "validatingwebhookconfigurations"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.ValidatingWebhookConfiguration](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewValidatingWebhookConfigurationInformerWithOptions(client kubernetes.Inte Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *validatingWebhookConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewValidatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedValidatingWebhookConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *validatingWebhookConfigurationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiadmissionregistrationv1beta1.ValidatingWebhookConfiguration{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *validatingWebhookConfigurationInformer) TypedInformer() ValidatingWebhookConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.ValidatingWebhookConfiguration](f.factory.InformerFor(&apiadmissionregistrationv1beta1.ValidatingWebhookConfiguration{}, f.defaultInformer)) } func (f *validatingWebhookConfigurationInformer) Lister() admissionregistrationv1beta1.ValidatingWebhookConfigurationLister { return admissionregistrationv1beta1.NewValidatingWebhookConfigurationLister(f.Informer().GetIndexer()) } + +// ToTypedValidatingWebhookConfigurationInformer converts an untyped informer into a TypedValidatingWebhookConfigurationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ValidatingWebhookConfiguration. If that is not the case, calling type-safe methods of the returned +// TypedValidatingWebhookConfigurationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedValidatingWebhookConfigurationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedValidatingWebhookConfigurationInformer(informer ValidatingWebhookConfigurationInformer) TypedValidatingWebhookConfigurationInformer { + if informer, ok := informer.(TypedValidatingWebhookConfigurationInformer); ok { + return informer + } + return &validatingWebhookConfigurationTypedInformerAdapter{informer} +} + +type validatingWebhookConfigurationTypedInformerAdapter struct { + ValidatingWebhookConfigurationInformer +} + +func (a *validatingWebhookConfigurationTypedInformerAdapter) TypedInformer() ValidatingWebhookConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.ValidatingWebhookConfiguration](a.Informer()) +} + +// ToValidatingWebhookConfigurationIndexInformer converts an untyped informer into a ValidatingWebhookConfigurationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ValidatingWebhookConfiguration. If that is not the case, calling type-safe methods of the returned +// ValidatingWebhookConfigurationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ValidatingWebhookConfigurationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToValidatingWebhookConfigurationIndexInformer(informer cache.SharedIndexInformer) ValidatingWebhookConfigurationIndexInformer { + if informer, ok := informer.(ValidatingWebhookConfigurationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiadmissionregistrationv1beta1.ValidatingWebhookConfiguration](informer) +} diff --git a/vendor/k8s.io/client-go/informers/apiserverinternal/v1alpha1/interface.go b/vendor/k8s.io/client-go/informers/apiserverinternal/v1alpha1/interface.go index 9778325c65..5b6f5eafc6 100644 --- a/vendor/k8s.io/client-go/informers/apiserverinternal/v1alpha1/interface.go +++ b/vendor/k8s.io/client-go/informers/apiserverinternal/v1alpha1/interface.go @@ -25,7 +25,7 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // StorageVersions returns a StorageVersionInformer. - StorageVersions() StorageVersionInformer + StorageVersions() TypedStorageVersionInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// StorageVersions returns a StorageVersionInformer. -func (v *version) StorageVersions() StorageVersionInformer { +// StorageVersions returns a TypedStorageVersionInformer. +func (v *version) StorageVersions() TypedStorageVersionInformer { return &storageVersionInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/apiserverinternal/v1alpha1/storageversion.go b/vendor/k8s.io/client-go/informers/apiserverinternal/v1alpha1/storageversion.go index 6d164a317c..c4ce84fb2a 100644 --- a/vendor/k8s.io/client-go/informers/apiserverinternal/v1alpha1/storageversion.go +++ b/vendor/k8s.io/client-go/informers/apiserverinternal/v1alpha1/storageversion.go @@ -34,12 +34,40 @@ import ( ) // StorageVersionInformer provides access to a shared informer and lister for -// StorageVersions. +// StorageVersions. Prefer using the type-safe variant (see [TypedStorageVersionInformer]). type StorageVersionInformer interface { Informer() cache.SharedIndexInformer Lister() apiserverinternalv1alpha1.StorageVersionLister } +// TypedStorageVersionInformer provides access to a shared informer and lister for +// StorageVersions, including the type-safe TypedInformer variant. +// It is a superset of StorageVersionInformer. +type TypedStorageVersionInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() StorageVersionIndexInformer + Lister() apiserverinternalv1alpha1.StorageVersionLister +} + +// StorageVersionIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type StorageVersionIndexInformer cache.TypedSharedIndexInformer[*apiapiserverinternalv1alpha1.StorageVersion] + +// StorageVersionHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for StorageVersion. +type StorageVersionHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiapiserverinternalv1alpha1.StorageVersion] + +// StorageVersionDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for StorageVersion. +type StorageVersionDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiapiserverinternalv1alpha1.StorageVersion] + +// StorageVersionFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for StorageVersion. +type StorageVersionFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiapiserverinternalv1alpha1.StorageVersion] + +// StorageVersionIndexers is a specialization of [cache.TypedIndexers] for StorageVersion. +type StorageVersionIndexers = cache.TypedIndexers[*apiapiserverinternalv1alpha1.StorageVersion] + +// DeletedStorageVersion is a specialization of [cache.DeletedObject] for StorageVersion. +type DeletedStorageVersion = cache.DeletedObject[*apiapiserverinternalv1alpha1.StorageVersion] + type storageVersionInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type storageVersionInformer struct { // NewStorageVersionInformer constructs a new informer for StorageVersion type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStorageVersionInformer]). func NewStorageVersionInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewStorageVersionInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedStorageVersionInformer constructs a new informer for StorageVersion type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStorageVersionInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers StorageVersionIndexers) StorageVersionIndexInformer { + return NewTypedStorageVersionInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredStorageVersionInformer constructs a new informer for StorageVersion type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredStorageVersionInformer]). func NewFilteredStorageVersionInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewStorageVersionInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedStorageVersionInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredStorageVersionInformer constructs a new informer for StorageVersion type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredStorageVersionInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers StorageVersionIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) StorageVersionIndexInformer { + return NewTypedStorageVersionInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewStorageVersionInformerWithOptions constructs a new informer for StorageVersion type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStorageVersionInformerWithOptions]). func NewStorageVersionInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedStorageVersionInformerWithOptions(client, options) +} + +// NewTypedStorageVersionInformerWithOptions constructs a new informer for StorageVersion type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStorageVersionInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) StorageVersionIndexInformer { gvr := schema.GroupVersionResource{Group: "internal.apiserver.k8s.io", Version: "v1alpha1", Resource: "storageversions"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiapiserverinternalv1alpha1.StorageVersion](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewStorageVersionInformerWithOptions(client kubernetes.Interface, options i Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *storageVersionInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewStorageVersionInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedStorageVersionInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *storageVersionInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiapiserverinternalv1alpha1.StorageVersion{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *storageVersionInformer) TypedInformer() StorageVersionIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiapiserverinternalv1alpha1.StorageVersion](f.factory.InformerFor(&apiapiserverinternalv1alpha1.StorageVersion{}, f.defaultInformer)) } func (f *storageVersionInformer) Lister() apiserverinternalv1alpha1.StorageVersionLister { return apiserverinternalv1alpha1.NewStorageVersionLister(f.Informer().GetIndexer()) } + +// ToTypedStorageVersionInformer converts an untyped informer into a TypedStorageVersionInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StorageVersion. If that is not the case, calling type-safe methods of the returned +// TypedStorageVersionInformer leads to runtime panics. A safer alternative is to pass +// around a TypedStorageVersionInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedStorageVersionInformer(informer StorageVersionInformer) TypedStorageVersionInformer { + if informer, ok := informer.(TypedStorageVersionInformer); ok { + return informer + } + return &storageVersionTypedInformerAdapter{informer} +} + +type storageVersionTypedInformerAdapter struct { + StorageVersionInformer +} + +func (a *storageVersionTypedInformerAdapter) TypedInformer() StorageVersionIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiapiserverinternalv1alpha1.StorageVersion](a.Informer()) +} + +// ToStorageVersionIndexInformer converts an untyped informer into a StorageVersionIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StorageVersion. If that is not the case, calling type-safe methods of the returned +// StorageVersionIndexInformer leads to runtime panics. A safer alternative is to pass +// around a StorageVersionIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToStorageVersionIndexInformer(informer cache.SharedIndexInformer) StorageVersionIndexInformer { + if informer, ok := informer.(StorageVersionIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiapiserverinternalv1alpha1.StorageVersion](informer) +} diff --git a/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go b/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go index f58da53f18..86a7796c8d 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go @@ -34,12 +34,40 @@ import ( ) // ControllerRevisionInformer provides access to a shared informer and lister for -// ControllerRevisions. +// ControllerRevisions. Prefer using the type-safe variant (see [TypedControllerRevisionInformer]). type ControllerRevisionInformer interface { Informer() cache.SharedIndexInformer Lister() appsv1.ControllerRevisionLister } +// TypedControllerRevisionInformer provides access to a shared informer and lister for +// ControllerRevisions, including the type-safe TypedInformer variant. +// It is a superset of ControllerRevisionInformer. +type TypedControllerRevisionInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ControllerRevisionIndexInformer + Lister() appsv1.ControllerRevisionLister +} + +// ControllerRevisionIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ControllerRevisionIndexInformer cache.TypedSharedIndexInformer[*apiappsv1.ControllerRevision] + +// ControllerRevisionHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ControllerRevision. +type ControllerRevisionHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiappsv1.ControllerRevision] + +// ControllerRevisionDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ControllerRevision. +type ControllerRevisionDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiappsv1.ControllerRevision] + +// ControllerRevisionFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ControllerRevision. +type ControllerRevisionFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiappsv1.ControllerRevision] + +// ControllerRevisionIndexers is a specialization of [cache.TypedIndexers] for ControllerRevision. +type ControllerRevisionIndexers = cache.TypedIndexers[*apiappsv1.ControllerRevision] + +// DeletedControllerRevision is a specialization of [cache.DeletedObject] for ControllerRevision. +type DeletedControllerRevision = cache.DeletedObject[*apiappsv1.ControllerRevision] + type controllerRevisionInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type controllerRevisionInformer struct { // NewControllerRevisionInformer constructs a new informer for ControllerRevision type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedControllerRevisionInformer]). func NewControllerRevisionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewControllerRevisionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedControllerRevisionInformer constructs a new informer for ControllerRevision type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedControllerRevisionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ControllerRevisionIndexers) ControllerRevisionIndexInformer { + return NewTypedControllerRevisionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredControllerRevisionInformer constructs a new informer for ControllerRevision type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredControllerRevisionInformer]). func NewFilteredControllerRevisionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewControllerRevisionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedControllerRevisionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredControllerRevisionInformer constructs a new informer for ControllerRevision type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredControllerRevisionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ControllerRevisionIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ControllerRevisionIndexInformer { + return NewTypedControllerRevisionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewControllerRevisionInformerWithOptions constructs a new informer for ControllerRevision type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedControllerRevisionInformerWithOptions]). func NewControllerRevisionInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedControllerRevisionInformerWithOptions(client, namespace, options) +} + +// NewTypedControllerRevisionInformerWithOptions constructs a new informer for ControllerRevision type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedControllerRevisionInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) ControllerRevisionIndexInformer { gvr := schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "controllerrevisions"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiappsv1.ControllerRevision](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewControllerRevisionInformerWithOptions(client kubernetes.Interface, names Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *controllerRevisionInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewControllerRevisionInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedControllerRevisionInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *controllerRevisionInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiappsv1.ControllerRevision{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *controllerRevisionInformer) TypedInformer() ControllerRevisionIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1.ControllerRevision](f.factory.InformerFor(&apiappsv1.ControllerRevision{}, f.defaultInformer)) } func (f *controllerRevisionInformer) Lister() appsv1.ControllerRevisionLister { return appsv1.NewControllerRevisionLister(f.Informer().GetIndexer()) } + +// ToTypedControllerRevisionInformer converts an untyped informer into a TypedControllerRevisionInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ControllerRevision. If that is not the case, calling type-safe methods of the returned +// TypedControllerRevisionInformer leads to runtime panics. A safer alternative is to pass +// around a TypedControllerRevisionInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedControllerRevisionInformer(informer ControllerRevisionInformer) TypedControllerRevisionInformer { + if informer, ok := informer.(TypedControllerRevisionInformer); ok { + return informer + } + return &controllerRevisionTypedInformerAdapter{informer} +} + +type controllerRevisionTypedInformerAdapter struct { + ControllerRevisionInformer +} + +func (a *controllerRevisionTypedInformerAdapter) TypedInformer() ControllerRevisionIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1.ControllerRevision](a.Informer()) +} + +// ToControllerRevisionIndexInformer converts an untyped informer into a ControllerRevisionIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ControllerRevision. If that is not the case, calling type-safe methods of the returned +// ControllerRevisionIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ControllerRevisionIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToControllerRevisionIndexInformer(informer cache.SharedIndexInformer) ControllerRevisionIndexInformer { + if informer, ok := informer.(ControllerRevisionIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiappsv1.ControllerRevision](informer) +} diff --git a/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go b/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go index dbdc401242..110fbdbcc5 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go @@ -34,12 +34,40 @@ import ( ) // DaemonSetInformer provides access to a shared informer and lister for -// DaemonSets. +// DaemonSets. Prefer using the type-safe variant (see [TypedDaemonSetInformer]). type DaemonSetInformer interface { Informer() cache.SharedIndexInformer Lister() appsv1.DaemonSetLister } +// TypedDaemonSetInformer provides access to a shared informer and lister for +// DaemonSets, including the type-safe TypedInformer variant. +// It is a superset of DaemonSetInformer. +type TypedDaemonSetInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() DaemonSetIndexInformer + Lister() appsv1.DaemonSetLister +} + +// DaemonSetIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type DaemonSetIndexInformer cache.TypedSharedIndexInformer[*apiappsv1.DaemonSet] + +// DaemonSetHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for DaemonSet. +type DaemonSetHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiappsv1.DaemonSet] + +// DaemonSetDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for DaemonSet. +type DaemonSetDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiappsv1.DaemonSet] + +// DaemonSetFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for DaemonSet. +type DaemonSetFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiappsv1.DaemonSet] + +// DaemonSetIndexers is a specialization of [cache.TypedIndexers] for DaemonSet. +type DaemonSetIndexers = cache.TypedIndexers[*apiappsv1.DaemonSet] + +// DeletedDaemonSet is a specialization of [cache.DeletedObject] for DaemonSet. +type DeletedDaemonSet = cache.DeletedObject[*apiappsv1.DaemonSet] + type daemonSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type daemonSetInformer struct { // NewDaemonSetInformer constructs a new informer for DaemonSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDaemonSetInformer]). func NewDaemonSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewDaemonSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedDaemonSetInformer constructs a new informer for DaemonSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDaemonSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers DaemonSetIndexers) DaemonSetIndexInformer { + return NewTypedDaemonSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredDaemonSetInformer constructs a new informer for DaemonSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredDaemonSetInformer]). func NewFilteredDaemonSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewDaemonSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedDaemonSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredDaemonSetInformer constructs a new informer for DaemonSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredDaemonSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers DaemonSetIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) DaemonSetIndexInformer { + return NewTypedDaemonSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewDaemonSetInformerWithOptions constructs a new informer for DaemonSet type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDaemonSetInformerWithOptions]). func NewDaemonSetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedDaemonSetInformerWithOptions(client, namespace, options) +} + +// NewTypedDaemonSetInformerWithOptions constructs a new informer for DaemonSet type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDaemonSetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) DaemonSetIndexInformer { gvr := schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "daemonsets"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiappsv1.DaemonSet](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewDaemonSetInformerWithOptions(client kubernetes.Interface, namespace stri Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *daemonSetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewDaemonSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedDaemonSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *daemonSetInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiappsv1.DaemonSet{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *daemonSetInformer) TypedInformer() DaemonSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1.DaemonSet](f.factory.InformerFor(&apiappsv1.DaemonSet{}, f.defaultInformer)) } func (f *daemonSetInformer) Lister() appsv1.DaemonSetLister { return appsv1.NewDaemonSetLister(f.Informer().GetIndexer()) } + +// ToTypedDaemonSetInformer converts an untyped informer into a TypedDaemonSetInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *DaemonSet. If that is not the case, calling type-safe methods of the returned +// TypedDaemonSetInformer leads to runtime panics. A safer alternative is to pass +// around a TypedDaemonSetInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedDaemonSetInformer(informer DaemonSetInformer) TypedDaemonSetInformer { + if informer, ok := informer.(TypedDaemonSetInformer); ok { + return informer + } + return &daemonSetTypedInformerAdapter{informer} +} + +type daemonSetTypedInformerAdapter struct { + DaemonSetInformer +} + +func (a *daemonSetTypedInformerAdapter) TypedInformer() DaemonSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1.DaemonSet](a.Informer()) +} + +// ToDaemonSetIndexInformer converts an untyped informer into a DaemonSetIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *DaemonSet. If that is not the case, calling type-safe methods of the returned +// DaemonSetIndexInformer leads to runtime panics. A safer alternative is to pass +// around a DaemonSetIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToDaemonSetIndexInformer(informer cache.SharedIndexInformer) DaemonSetIndexInformer { + if informer, ok := informer.(DaemonSetIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiappsv1.DaemonSet](informer) +} diff --git a/vendor/k8s.io/client-go/informers/apps/v1/deployment.go b/vendor/k8s.io/client-go/informers/apps/v1/deployment.go index dbf4df6a88..1079bc190b 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/deployment.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/deployment.go @@ -34,12 +34,40 @@ import ( ) // DeploymentInformer provides access to a shared informer and lister for -// Deployments. +// Deployments. Prefer using the type-safe variant (see [TypedDeploymentInformer]). type DeploymentInformer interface { Informer() cache.SharedIndexInformer Lister() appsv1.DeploymentLister } +// TypedDeploymentInformer provides access to a shared informer and lister for +// Deployments, including the type-safe TypedInformer variant. +// It is a superset of DeploymentInformer. +type TypedDeploymentInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() DeploymentIndexInformer + Lister() appsv1.DeploymentLister +} + +// DeploymentIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type DeploymentIndexInformer cache.TypedSharedIndexInformer[*apiappsv1.Deployment] + +// DeploymentHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Deployment. +type DeploymentHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiappsv1.Deployment] + +// DeploymentDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Deployment. +type DeploymentDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiappsv1.Deployment] + +// DeploymentFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Deployment. +type DeploymentFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiappsv1.Deployment] + +// DeploymentIndexers is a specialization of [cache.TypedIndexers] for Deployment. +type DeploymentIndexers = cache.TypedIndexers[*apiappsv1.Deployment] + +// DeletedDeployment is a specialization of [cache.DeletedObject] for Deployment. +type DeletedDeployment = cache.DeletedObject[*apiappsv1.Deployment] + type deploymentInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type deploymentInformer struct { // NewDeploymentInformer constructs a new informer for Deployment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeploymentInformer]). func NewDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedDeploymentInformer constructs a new informer for Deployment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers DeploymentIndexers) DeploymentIndexInformer { + return NewTypedDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredDeploymentInformer constructs a new informer for Deployment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredDeploymentInformer]). func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredDeploymentInformer constructs a new informer for Deployment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers DeploymentIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) DeploymentIndexInformer { + return NewTypedDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewDeploymentInformerWithOptions constructs a new informer for Deployment type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeploymentInformerWithOptions]). func NewDeploymentInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedDeploymentInformerWithOptions(client, namespace, options) +} + +// NewTypedDeploymentInformerWithOptions constructs a new informer for Deployment type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeploymentInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) DeploymentIndexInformer { gvr := schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deployments"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiappsv1.Deployment](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewDeploymentInformerWithOptions(client kubernetes.Interface, namespace str Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *deploymentInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewDeploymentInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedDeploymentInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *deploymentInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiappsv1.Deployment{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *deploymentInformer) TypedInformer() DeploymentIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1.Deployment](f.factory.InformerFor(&apiappsv1.Deployment{}, f.defaultInformer)) } func (f *deploymentInformer) Lister() appsv1.DeploymentLister { return appsv1.NewDeploymentLister(f.Informer().GetIndexer()) } + +// ToTypedDeploymentInformer converts an untyped informer into a TypedDeploymentInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Deployment. If that is not the case, calling type-safe methods of the returned +// TypedDeploymentInformer leads to runtime panics. A safer alternative is to pass +// around a TypedDeploymentInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedDeploymentInformer(informer DeploymentInformer) TypedDeploymentInformer { + if informer, ok := informer.(TypedDeploymentInformer); ok { + return informer + } + return &deploymentTypedInformerAdapter{informer} +} + +type deploymentTypedInformerAdapter struct { + DeploymentInformer +} + +func (a *deploymentTypedInformerAdapter) TypedInformer() DeploymentIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1.Deployment](a.Informer()) +} + +// ToDeploymentIndexInformer converts an untyped informer into a DeploymentIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Deployment. If that is not the case, calling type-safe methods of the returned +// DeploymentIndexInformer leads to runtime panics. A safer alternative is to pass +// around a DeploymentIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToDeploymentIndexInformer(informer cache.SharedIndexInformer) DeploymentIndexInformer { + if informer, ok := informer.(DeploymentIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiappsv1.Deployment](informer) +} diff --git a/vendor/k8s.io/client-go/informers/apps/v1/interface.go b/vendor/k8s.io/client-go/informers/apps/v1/interface.go index fab1e76bd9..d8e4e3bf17 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/interface.go @@ -25,15 +25,15 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // ControllerRevisions returns a ControllerRevisionInformer. - ControllerRevisions() ControllerRevisionInformer + ControllerRevisions() TypedControllerRevisionInformer // DaemonSets returns a DaemonSetInformer. - DaemonSets() DaemonSetInformer + DaemonSets() TypedDaemonSetInformer // Deployments returns a DeploymentInformer. - Deployments() DeploymentInformer + Deployments() TypedDeploymentInformer // ReplicaSets returns a ReplicaSetInformer. - ReplicaSets() ReplicaSetInformer + ReplicaSets() TypedReplicaSetInformer // StatefulSets returns a StatefulSetInformer. - StatefulSets() StatefulSetInformer + StatefulSets() TypedStatefulSetInformer } type version struct { @@ -47,27 +47,27 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// ControllerRevisions returns a ControllerRevisionInformer. -func (v *version) ControllerRevisions() ControllerRevisionInformer { +// ControllerRevisions returns a TypedControllerRevisionInformer. +func (v *version) ControllerRevisions() TypedControllerRevisionInformer { return &controllerRevisionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// DaemonSets returns a DaemonSetInformer. -func (v *version) DaemonSets() DaemonSetInformer { +// DaemonSets returns a TypedDaemonSetInformer. +func (v *version) DaemonSets() TypedDaemonSetInformer { return &daemonSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Deployments returns a DeploymentInformer. -func (v *version) Deployments() DeploymentInformer { +// Deployments returns a TypedDeploymentInformer. +func (v *version) Deployments() TypedDeploymentInformer { return &deploymentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ReplicaSets returns a ReplicaSetInformer. -func (v *version) ReplicaSets() ReplicaSetInformer { +// ReplicaSets returns a TypedReplicaSetInformer. +func (v *version) ReplicaSets() TypedReplicaSetInformer { return &replicaSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// StatefulSets returns a StatefulSetInformer. -func (v *version) StatefulSets() StatefulSetInformer { +// StatefulSets returns a TypedStatefulSetInformer. +func (v *version) StatefulSets() TypedStatefulSetInformer { return &statefulSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go b/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go index 1115e5adcc..13983f2a7d 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go @@ -34,12 +34,40 @@ import ( ) // ReplicaSetInformer provides access to a shared informer and lister for -// ReplicaSets. +// ReplicaSets. Prefer using the type-safe variant (see [TypedReplicaSetInformer]). type ReplicaSetInformer interface { Informer() cache.SharedIndexInformer Lister() appsv1.ReplicaSetLister } +// TypedReplicaSetInformer provides access to a shared informer and lister for +// ReplicaSets, including the type-safe TypedInformer variant. +// It is a superset of ReplicaSetInformer. +type TypedReplicaSetInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ReplicaSetIndexInformer + Lister() appsv1.ReplicaSetLister +} + +// ReplicaSetIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ReplicaSetIndexInformer cache.TypedSharedIndexInformer[*apiappsv1.ReplicaSet] + +// ReplicaSetHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ReplicaSet. +type ReplicaSetHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiappsv1.ReplicaSet] + +// ReplicaSetDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ReplicaSet. +type ReplicaSetDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiappsv1.ReplicaSet] + +// ReplicaSetFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ReplicaSet. +type ReplicaSetFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiappsv1.ReplicaSet] + +// ReplicaSetIndexers is a specialization of [cache.TypedIndexers] for ReplicaSet. +type ReplicaSetIndexers = cache.TypedIndexers[*apiappsv1.ReplicaSet] + +// DeletedReplicaSet is a specialization of [cache.DeletedObject] for ReplicaSet. +type DeletedReplicaSet = cache.DeletedObject[*apiappsv1.ReplicaSet] + type replicaSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type replicaSetInformer struct { // NewReplicaSetInformer constructs a new informer for ReplicaSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedReplicaSetInformer]). func NewReplicaSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewReplicaSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedReplicaSetInformer constructs a new informer for ReplicaSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedReplicaSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ReplicaSetIndexers) ReplicaSetIndexInformer { + return NewTypedReplicaSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredReplicaSetInformer constructs a new informer for ReplicaSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredReplicaSetInformer]). func NewFilteredReplicaSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewReplicaSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedReplicaSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredReplicaSetInformer constructs a new informer for ReplicaSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredReplicaSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ReplicaSetIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ReplicaSetIndexInformer { + return NewTypedReplicaSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewReplicaSetInformerWithOptions constructs a new informer for ReplicaSet type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedReplicaSetInformerWithOptions]). func NewReplicaSetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedReplicaSetInformerWithOptions(client, namespace, options) +} + +// NewTypedReplicaSetInformerWithOptions constructs a new informer for ReplicaSet type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedReplicaSetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) ReplicaSetIndexInformer { gvr := schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "replicasets"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiappsv1.ReplicaSet](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewReplicaSetInformerWithOptions(client kubernetes.Interface, namespace str Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *replicaSetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewReplicaSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedReplicaSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *replicaSetInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiappsv1.ReplicaSet{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *replicaSetInformer) TypedInformer() ReplicaSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1.ReplicaSet](f.factory.InformerFor(&apiappsv1.ReplicaSet{}, f.defaultInformer)) } func (f *replicaSetInformer) Lister() appsv1.ReplicaSetLister { return appsv1.NewReplicaSetLister(f.Informer().GetIndexer()) } + +// ToTypedReplicaSetInformer converts an untyped informer into a TypedReplicaSetInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ReplicaSet. If that is not the case, calling type-safe methods of the returned +// TypedReplicaSetInformer leads to runtime panics. A safer alternative is to pass +// around a TypedReplicaSetInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedReplicaSetInformer(informer ReplicaSetInformer) TypedReplicaSetInformer { + if informer, ok := informer.(TypedReplicaSetInformer); ok { + return informer + } + return &replicaSetTypedInformerAdapter{informer} +} + +type replicaSetTypedInformerAdapter struct { + ReplicaSetInformer +} + +func (a *replicaSetTypedInformerAdapter) TypedInformer() ReplicaSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1.ReplicaSet](a.Informer()) +} + +// ToReplicaSetIndexInformer converts an untyped informer into a ReplicaSetIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ReplicaSet. If that is not the case, calling type-safe methods of the returned +// ReplicaSetIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ReplicaSetIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToReplicaSetIndexInformer(informer cache.SharedIndexInformer) ReplicaSetIndexInformer { + if informer, ok := informer.(ReplicaSetIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiappsv1.ReplicaSet](informer) +} diff --git a/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go b/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go index 998251edee..64c766e153 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go @@ -34,12 +34,40 @@ import ( ) // StatefulSetInformer provides access to a shared informer and lister for -// StatefulSets. +// StatefulSets. Prefer using the type-safe variant (see [TypedStatefulSetInformer]). type StatefulSetInformer interface { Informer() cache.SharedIndexInformer Lister() appsv1.StatefulSetLister } +// TypedStatefulSetInformer provides access to a shared informer and lister for +// StatefulSets, including the type-safe TypedInformer variant. +// It is a superset of StatefulSetInformer. +type TypedStatefulSetInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() StatefulSetIndexInformer + Lister() appsv1.StatefulSetLister +} + +// StatefulSetIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type StatefulSetIndexInformer cache.TypedSharedIndexInformer[*apiappsv1.StatefulSet] + +// StatefulSetHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for StatefulSet. +type StatefulSetHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiappsv1.StatefulSet] + +// StatefulSetDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for StatefulSet. +type StatefulSetDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiappsv1.StatefulSet] + +// StatefulSetFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for StatefulSet. +type StatefulSetFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiappsv1.StatefulSet] + +// StatefulSetIndexers is a specialization of [cache.TypedIndexers] for StatefulSet. +type StatefulSetIndexers = cache.TypedIndexers[*apiappsv1.StatefulSet] + +// DeletedStatefulSet is a specialization of [cache.DeletedObject] for StatefulSet. +type DeletedStatefulSet = cache.DeletedObject[*apiappsv1.StatefulSet] + type statefulSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type statefulSetInformer struct { // NewStatefulSetInformer constructs a new informer for StatefulSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStatefulSetInformer]). func NewStatefulSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewStatefulSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedStatefulSetInformer constructs a new informer for StatefulSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStatefulSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers StatefulSetIndexers) StatefulSetIndexInformer { + return NewTypedStatefulSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredStatefulSetInformer constructs a new informer for StatefulSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredStatefulSetInformer]). func NewFilteredStatefulSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewStatefulSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedStatefulSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredStatefulSetInformer constructs a new informer for StatefulSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredStatefulSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers StatefulSetIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) StatefulSetIndexInformer { + return NewTypedStatefulSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewStatefulSetInformerWithOptions constructs a new informer for StatefulSet type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStatefulSetInformerWithOptions]). func NewStatefulSetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedStatefulSetInformerWithOptions(client, namespace, options) +} + +// NewTypedStatefulSetInformerWithOptions constructs a new informer for StatefulSet type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStatefulSetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) StatefulSetIndexInformer { gvr := schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "statefulsets"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiappsv1.StatefulSet](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewStatefulSetInformerWithOptions(client kubernetes.Interface, namespace st Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *statefulSetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewStatefulSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedStatefulSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *statefulSetInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiappsv1.StatefulSet{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *statefulSetInformer) TypedInformer() StatefulSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1.StatefulSet](f.factory.InformerFor(&apiappsv1.StatefulSet{}, f.defaultInformer)) } func (f *statefulSetInformer) Lister() appsv1.StatefulSetLister { return appsv1.NewStatefulSetLister(f.Informer().GetIndexer()) } + +// ToTypedStatefulSetInformer converts an untyped informer into a TypedStatefulSetInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StatefulSet. If that is not the case, calling type-safe methods of the returned +// TypedStatefulSetInformer leads to runtime panics. A safer alternative is to pass +// around a TypedStatefulSetInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedStatefulSetInformer(informer StatefulSetInformer) TypedStatefulSetInformer { + if informer, ok := informer.(TypedStatefulSetInformer); ok { + return informer + } + return &statefulSetTypedInformerAdapter{informer} +} + +type statefulSetTypedInformerAdapter struct { + StatefulSetInformer +} + +func (a *statefulSetTypedInformerAdapter) TypedInformer() StatefulSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1.StatefulSet](a.Informer()) +} + +// ToStatefulSetIndexInformer converts an untyped informer into a StatefulSetIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StatefulSet. If that is not the case, calling type-safe methods of the returned +// StatefulSetIndexInformer leads to runtime panics. A safer alternative is to pass +// around a StatefulSetIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToStatefulSetIndexInformer(informer cache.SharedIndexInformer) StatefulSetIndexInformer { + if informer, ok := informer.(StatefulSetIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiappsv1.StatefulSet](informer) +} diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go b/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go index ee3b156e02..02215f9004 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go @@ -34,12 +34,40 @@ import ( ) // ControllerRevisionInformer provides access to a shared informer and lister for -// ControllerRevisions. +// ControllerRevisions. Prefer using the type-safe variant (see [TypedControllerRevisionInformer]). type ControllerRevisionInformer interface { Informer() cache.SharedIndexInformer Lister() appsv1beta1.ControllerRevisionLister } +// TypedControllerRevisionInformer provides access to a shared informer and lister for +// ControllerRevisions, including the type-safe TypedInformer variant. +// It is a superset of ControllerRevisionInformer. +type TypedControllerRevisionInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ControllerRevisionIndexInformer + Lister() appsv1beta1.ControllerRevisionLister +} + +// ControllerRevisionIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ControllerRevisionIndexInformer cache.TypedSharedIndexInformer[*apiappsv1beta1.ControllerRevision] + +// ControllerRevisionHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ControllerRevision. +type ControllerRevisionHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiappsv1beta1.ControllerRevision] + +// ControllerRevisionDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ControllerRevision. +type ControllerRevisionDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiappsv1beta1.ControllerRevision] + +// ControllerRevisionFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ControllerRevision. +type ControllerRevisionFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiappsv1beta1.ControllerRevision] + +// ControllerRevisionIndexers is a specialization of [cache.TypedIndexers] for ControllerRevision. +type ControllerRevisionIndexers = cache.TypedIndexers[*apiappsv1beta1.ControllerRevision] + +// DeletedControllerRevision is a specialization of [cache.DeletedObject] for ControllerRevision. +type DeletedControllerRevision = cache.DeletedObject[*apiappsv1beta1.ControllerRevision] + type controllerRevisionInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type controllerRevisionInformer struct { // NewControllerRevisionInformer constructs a new informer for ControllerRevision type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedControllerRevisionInformer]). func NewControllerRevisionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewControllerRevisionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedControllerRevisionInformer constructs a new informer for ControllerRevision type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedControllerRevisionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ControllerRevisionIndexers) ControllerRevisionIndexInformer { + return NewTypedControllerRevisionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredControllerRevisionInformer constructs a new informer for ControllerRevision type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredControllerRevisionInformer]). func NewFilteredControllerRevisionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewControllerRevisionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedControllerRevisionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredControllerRevisionInformer constructs a new informer for ControllerRevision type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredControllerRevisionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ControllerRevisionIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ControllerRevisionIndexInformer { + return NewTypedControllerRevisionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewControllerRevisionInformerWithOptions constructs a new informer for ControllerRevision type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedControllerRevisionInformerWithOptions]). func NewControllerRevisionInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedControllerRevisionInformerWithOptions(client, namespace, options) +} + +// NewTypedControllerRevisionInformerWithOptions constructs a new informer for ControllerRevision type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedControllerRevisionInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) ControllerRevisionIndexInformer { gvr := schema.GroupVersionResource{Group: "apps", Version: "v1beta1", Resource: "controllerrevisions"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiappsv1beta1.ControllerRevision](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewControllerRevisionInformerWithOptions(client kubernetes.Interface, names Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *controllerRevisionInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewControllerRevisionInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedControllerRevisionInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *controllerRevisionInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiappsv1beta1.ControllerRevision{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *controllerRevisionInformer) TypedInformer() ControllerRevisionIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1beta1.ControllerRevision](f.factory.InformerFor(&apiappsv1beta1.ControllerRevision{}, f.defaultInformer)) } func (f *controllerRevisionInformer) Lister() appsv1beta1.ControllerRevisionLister { return appsv1beta1.NewControllerRevisionLister(f.Informer().GetIndexer()) } + +// ToTypedControllerRevisionInformer converts an untyped informer into a TypedControllerRevisionInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ControllerRevision. If that is not the case, calling type-safe methods of the returned +// TypedControllerRevisionInformer leads to runtime panics. A safer alternative is to pass +// around a TypedControllerRevisionInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedControllerRevisionInformer(informer ControllerRevisionInformer) TypedControllerRevisionInformer { + if informer, ok := informer.(TypedControllerRevisionInformer); ok { + return informer + } + return &controllerRevisionTypedInformerAdapter{informer} +} + +type controllerRevisionTypedInformerAdapter struct { + ControllerRevisionInformer +} + +func (a *controllerRevisionTypedInformerAdapter) TypedInformer() ControllerRevisionIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1beta1.ControllerRevision](a.Informer()) +} + +// ToControllerRevisionIndexInformer converts an untyped informer into a ControllerRevisionIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ControllerRevision. If that is not the case, calling type-safe methods of the returned +// ControllerRevisionIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ControllerRevisionIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToControllerRevisionIndexInformer(informer cache.SharedIndexInformer) ControllerRevisionIndexInformer { + if informer, ok := informer.(ControllerRevisionIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiappsv1beta1.ControllerRevision](informer) +} diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go b/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go index 699375e3e1..c29a3b39b6 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go @@ -34,12 +34,40 @@ import ( ) // DeploymentInformer provides access to a shared informer and lister for -// Deployments. +// Deployments. Prefer using the type-safe variant (see [TypedDeploymentInformer]). type DeploymentInformer interface { Informer() cache.SharedIndexInformer Lister() appsv1beta1.DeploymentLister } +// TypedDeploymentInformer provides access to a shared informer and lister for +// Deployments, including the type-safe TypedInformer variant. +// It is a superset of DeploymentInformer. +type TypedDeploymentInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() DeploymentIndexInformer + Lister() appsv1beta1.DeploymentLister +} + +// DeploymentIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type DeploymentIndexInformer cache.TypedSharedIndexInformer[*apiappsv1beta1.Deployment] + +// DeploymentHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Deployment. +type DeploymentHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiappsv1beta1.Deployment] + +// DeploymentDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Deployment. +type DeploymentDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiappsv1beta1.Deployment] + +// DeploymentFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Deployment. +type DeploymentFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiappsv1beta1.Deployment] + +// DeploymentIndexers is a specialization of [cache.TypedIndexers] for Deployment. +type DeploymentIndexers = cache.TypedIndexers[*apiappsv1beta1.Deployment] + +// DeletedDeployment is a specialization of [cache.DeletedObject] for Deployment. +type DeletedDeployment = cache.DeletedObject[*apiappsv1beta1.Deployment] + type deploymentInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type deploymentInformer struct { // NewDeploymentInformer constructs a new informer for Deployment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeploymentInformer]). func NewDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedDeploymentInformer constructs a new informer for Deployment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers DeploymentIndexers) DeploymentIndexInformer { + return NewTypedDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredDeploymentInformer constructs a new informer for Deployment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredDeploymentInformer]). func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredDeploymentInformer constructs a new informer for Deployment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers DeploymentIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) DeploymentIndexInformer { + return NewTypedDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewDeploymentInformerWithOptions constructs a new informer for Deployment type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeploymentInformerWithOptions]). func NewDeploymentInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedDeploymentInformerWithOptions(client, namespace, options) +} + +// NewTypedDeploymentInformerWithOptions constructs a new informer for Deployment type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeploymentInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) DeploymentIndexInformer { gvr := schema.GroupVersionResource{Group: "apps", Version: "v1beta1", Resource: "deployments"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiappsv1beta1.Deployment](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewDeploymentInformerWithOptions(client kubernetes.Interface, namespace str Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *deploymentInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewDeploymentInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedDeploymentInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *deploymentInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiappsv1beta1.Deployment{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *deploymentInformer) TypedInformer() DeploymentIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1beta1.Deployment](f.factory.InformerFor(&apiappsv1beta1.Deployment{}, f.defaultInformer)) } func (f *deploymentInformer) Lister() appsv1beta1.DeploymentLister { return appsv1beta1.NewDeploymentLister(f.Informer().GetIndexer()) } + +// ToTypedDeploymentInformer converts an untyped informer into a TypedDeploymentInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Deployment. If that is not the case, calling type-safe methods of the returned +// TypedDeploymentInformer leads to runtime panics. A safer alternative is to pass +// around a TypedDeploymentInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedDeploymentInformer(informer DeploymentInformer) TypedDeploymentInformer { + if informer, ok := informer.(TypedDeploymentInformer); ok { + return informer + } + return &deploymentTypedInformerAdapter{informer} +} + +type deploymentTypedInformerAdapter struct { + DeploymentInformer +} + +func (a *deploymentTypedInformerAdapter) TypedInformer() DeploymentIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1beta1.Deployment](a.Informer()) +} + +// ToDeploymentIndexInformer converts an untyped informer into a DeploymentIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Deployment. If that is not the case, calling type-safe methods of the returned +// DeploymentIndexInformer leads to runtime panics. A safer alternative is to pass +// around a DeploymentIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToDeploymentIndexInformer(informer cache.SharedIndexInformer) DeploymentIndexInformer { + if informer, ok := informer.(DeploymentIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiappsv1beta1.Deployment](informer) +} diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/apps/v1beta1/interface.go index 326939cd12..4a4d87e930 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta1/interface.go @@ -25,11 +25,11 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // ControllerRevisions returns a ControllerRevisionInformer. - ControllerRevisions() ControllerRevisionInformer + ControllerRevisions() TypedControllerRevisionInformer // Deployments returns a DeploymentInformer. - Deployments() DeploymentInformer + Deployments() TypedDeploymentInformer // StatefulSets returns a StatefulSetInformer. - StatefulSets() StatefulSetInformer + StatefulSets() TypedStatefulSetInformer } type version struct { @@ -43,17 +43,17 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// ControllerRevisions returns a ControllerRevisionInformer. -func (v *version) ControllerRevisions() ControllerRevisionInformer { +// ControllerRevisions returns a TypedControllerRevisionInformer. +func (v *version) ControllerRevisions() TypedControllerRevisionInformer { return &controllerRevisionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Deployments returns a DeploymentInformer. -func (v *version) Deployments() DeploymentInformer { +// Deployments returns a TypedDeploymentInformer. +func (v *version) Deployments() TypedDeploymentInformer { return &deploymentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// StatefulSets returns a StatefulSetInformer. -func (v *version) StatefulSets() StatefulSetInformer { +// StatefulSets returns a TypedStatefulSetInformer. +func (v *version) StatefulSets() TypedStatefulSetInformer { return &statefulSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go b/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go index 480e68f9d1..ad9dc2d3bd 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go @@ -34,12 +34,40 @@ import ( ) // StatefulSetInformer provides access to a shared informer and lister for -// StatefulSets. +// StatefulSets. Prefer using the type-safe variant (see [TypedStatefulSetInformer]). type StatefulSetInformer interface { Informer() cache.SharedIndexInformer Lister() appsv1beta1.StatefulSetLister } +// TypedStatefulSetInformer provides access to a shared informer and lister for +// StatefulSets, including the type-safe TypedInformer variant. +// It is a superset of StatefulSetInformer. +type TypedStatefulSetInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() StatefulSetIndexInformer + Lister() appsv1beta1.StatefulSetLister +} + +// StatefulSetIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type StatefulSetIndexInformer cache.TypedSharedIndexInformer[*apiappsv1beta1.StatefulSet] + +// StatefulSetHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for StatefulSet. +type StatefulSetHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiappsv1beta1.StatefulSet] + +// StatefulSetDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for StatefulSet. +type StatefulSetDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiappsv1beta1.StatefulSet] + +// StatefulSetFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for StatefulSet. +type StatefulSetFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiappsv1beta1.StatefulSet] + +// StatefulSetIndexers is a specialization of [cache.TypedIndexers] for StatefulSet. +type StatefulSetIndexers = cache.TypedIndexers[*apiappsv1beta1.StatefulSet] + +// DeletedStatefulSet is a specialization of [cache.DeletedObject] for StatefulSet. +type DeletedStatefulSet = cache.DeletedObject[*apiappsv1beta1.StatefulSet] + type statefulSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type statefulSetInformer struct { // NewStatefulSetInformer constructs a new informer for StatefulSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStatefulSetInformer]). func NewStatefulSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewStatefulSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedStatefulSetInformer constructs a new informer for StatefulSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStatefulSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers StatefulSetIndexers) StatefulSetIndexInformer { + return NewTypedStatefulSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredStatefulSetInformer constructs a new informer for StatefulSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredStatefulSetInformer]). func NewFilteredStatefulSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewStatefulSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedStatefulSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredStatefulSetInformer constructs a new informer for StatefulSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredStatefulSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers StatefulSetIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) StatefulSetIndexInformer { + return NewTypedStatefulSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewStatefulSetInformerWithOptions constructs a new informer for StatefulSet type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStatefulSetInformerWithOptions]). func NewStatefulSetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedStatefulSetInformerWithOptions(client, namespace, options) +} + +// NewTypedStatefulSetInformerWithOptions constructs a new informer for StatefulSet type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStatefulSetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) StatefulSetIndexInformer { gvr := schema.GroupVersionResource{Group: "apps", Version: "v1beta1", Resource: "statefulsets"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiappsv1beta1.StatefulSet](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewStatefulSetInformerWithOptions(client kubernetes.Interface, namespace st Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *statefulSetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewStatefulSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedStatefulSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *statefulSetInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiappsv1beta1.StatefulSet{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *statefulSetInformer) TypedInformer() StatefulSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1beta1.StatefulSet](f.factory.InformerFor(&apiappsv1beta1.StatefulSet{}, f.defaultInformer)) } func (f *statefulSetInformer) Lister() appsv1beta1.StatefulSetLister { return appsv1beta1.NewStatefulSetLister(f.Informer().GetIndexer()) } + +// ToTypedStatefulSetInformer converts an untyped informer into a TypedStatefulSetInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StatefulSet. If that is not the case, calling type-safe methods of the returned +// TypedStatefulSetInformer leads to runtime panics. A safer alternative is to pass +// around a TypedStatefulSetInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedStatefulSetInformer(informer StatefulSetInformer) TypedStatefulSetInformer { + if informer, ok := informer.(TypedStatefulSetInformer); ok { + return informer + } + return &statefulSetTypedInformerAdapter{informer} +} + +type statefulSetTypedInformerAdapter struct { + StatefulSetInformer +} + +func (a *statefulSetTypedInformerAdapter) TypedInformer() StatefulSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1beta1.StatefulSet](a.Informer()) +} + +// ToStatefulSetIndexInformer converts an untyped informer into a StatefulSetIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StatefulSet. If that is not the case, calling type-safe methods of the returned +// StatefulSetIndexInformer leads to runtime panics. A safer alternative is to pass +// around a StatefulSetIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToStatefulSetIndexInformer(informer cache.SharedIndexInformer) StatefulSetIndexInformer { + if informer, ok := informer.(StatefulSetIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiappsv1beta1.StatefulSet](informer) +} diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go index 41e3bf1563..0d686ae442 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go @@ -34,12 +34,40 @@ import ( ) // ControllerRevisionInformer provides access to a shared informer and lister for -// ControllerRevisions. +// ControllerRevisions. Prefer using the type-safe variant (see [TypedControllerRevisionInformer]). type ControllerRevisionInformer interface { Informer() cache.SharedIndexInformer Lister() appsv1beta2.ControllerRevisionLister } +// TypedControllerRevisionInformer provides access to a shared informer and lister for +// ControllerRevisions, including the type-safe TypedInformer variant. +// It is a superset of ControllerRevisionInformer. +type TypedControllerRevisionInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ControllerRevisionIndexInformer + Lister() appsv1beta2.ControllerRevisionLister +} + +// ControllerRevisionIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ControllerRevisionIndexInformer cache.TypedSharedIndexInformer[*apiappsv1beta2.ControllerRevision] + +// ControllerRevisionHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ControllerRevision. +type ControllerRevisionHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiappsv1beta2.ControllerRevision] + +// ControllerRevisionDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ControllerRevision. +type ControllerRevisionDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiappsv1beta2.ControllerRevision] + +// ControllerRevisionFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ControllerRevision. +type ControllerRevisionFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiappsv1beta2.ControllerRevision] + +// ControllerRevisionIndexers is a specialization of [cache.TypedIndexers] for ControllerRevision. +type ControllerRevisionIndexers = cache.TypedIndexers[*apiappsv1beta2.ControllerRevision] + +// DeletedControllerRevision is a specialization of [cache.DeletedObject] for ControllerRevision. +type DeletedControllerRevision = cache.DeletedObject[*apiappsv1beta2.ControllerRevision] + type controllerRevisionInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type controllerRevisionInformer struct { // NewControllerRevisionInformer constructs a new informer for ControllerRevision type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedControllerRevisionInformer]). func NewControllerRevisionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewControllerRevisionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedControllerRevisionInformer constructs a new informer for ControllerRevision type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedControllerRevisionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ControllerRevisionIndexers) ControllerRevisionIndexInformer { + return NewTypedControllerRevisionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredControllerRevisionInformer constructs a new informer for ControllerRevision type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredControllerRevisionInformer]). func NewFilteredControllerRevisionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewControllerRevisionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedControllerRevisionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredControllerRevisionInformer constructs a new informer for ControllerRevision type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredControllerRevisionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ControllerRevisionIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ControllerRevisionIndexInformer { + return NewTypedControllerRevisionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewControllerRevisionInformerWithOptions constructs a new informer for ControllerRevision type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedControllerRevisionInformerWithOptions]). func NewControllerRevisionInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedControllerRevisionInformerWithOptions(client, namespace, options) +} + +// NewTypedControllerRevisionInformerWithOptions constructs a new informer for ControllerRevision type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedControllerRevisionInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) ControllerRevisionIndexInformer { gvr := schema.GroupVersionResource{Group: "apps", Version: "v1beta2", Resource: "controllerrevisions"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.ControllerRevision](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewControllerRevisionInformerWithOptions(client kubernetes.Interface, names Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *controllerRevisionInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewControllerRevisionInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedControllerRevisionInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *controllerRevisionInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiappsv1beta2.ControllerRevision{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *controllerRevisionInformer) TypedInformer() ControllerRevisionIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.ControllerRevision](f.factory.InformerFor(&apiappsv1beta2.ControllerRevision{}, f.defaultInformer)) } func (f *controllerRevisionInformer) Lister() appsv1beta2.ControllerRevisionLister { return appsv1beta2.NewControllerRevisionLister(f.Informer().GetIndexer()) } + +// ToTypedControllerRevisionInformer converts an untyped informer into a TypedControllerRevisionInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ControllerRevision. If that is not the case, calling type-safe methods of the returned +// TypedControllerRevisionInformer leads to runtime panics. A safer alternative is to pass +// around a TypedControllerRevisionInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedControllerRevisionInformer(informer ControllerRevisionInformer) TypedControllerRevisionInformer { + if informer, ok := informer.(TypedControllerRevisionInformer); ok { + return informer + } + return &controllerRevisionTypedInformerAdapter{informer} +} + +type controllerRevisionTypedInformerAdapter struct { + ControllerRevisionInformer +} + +func (a *controllerRevisionTypedInformerAdapter) TypedInformer() ControllerRevisionIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.ControllerRevision](a.Informer()) +} + +// ToControllerRevisionIndexInformer converts an untyped informer into a ControllerRevisionIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ControllerRevision. If that is not the case, calling type-safe methods of the returned +// ControllerRevisionIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ControllerRevisionIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToControllerRevisionIndexInformer(informer cache.SharedIndexInformer) ControllerRevisionIndexInformer { + if informer, ok := informer.(ControllerRevisionIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.ControllerRevision](informer) +} diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go index 5c339a78a0..16c73e28fc 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go @@ -34,12 +34,40 @@ import ( ) // DaemonSetInformer provides access to a shared informer and lister for -// DaemonSets. +// DaemonSets. Prefer using the type-safe variant (see [TypedDaemonSetInformer]). type DaemonSetInformer interface { Informer() cache.SharedIndexInformer Lister() appsv1beta2.DaemonSetLister } +// TypedDaemonSetInformer provides access to a shared informer and lister for +// DaemonSets, including the type-safe TypedInformer variant. +// It is a superset of DaemonSetInformer. +type TypedDaemonSetInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() DaemonSetIndexInformer + Lister() appsv1beta2.DaemonSetLister +} + +// DaemonSetIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type DaemonSetIndexInformer cache.TypedSharedIndexInformer[*apiappsv1beta2.DaemonSet] + +// DaemonSetHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for DaemonSet. +type DaemonSetHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiappsv1beta2.DaemonSet] + +// DaemonSetDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for DaemonSet. +type DaemonSetDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiappsv1beta2.DaemonSet] + +// DaemonSetFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for DaemonSet. +type DaemonSetFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiappsv1beta2.DaemonSet] + +// DaemonSetIndexers is a specialization of [cache.TypedIndexers] for DaemonSet. +type DaemonSetIndexers = cache.TypedIndexers[*apiappsv1beta2.DaemonSet] + +// DeletedDaemonSet is a specialization of [cache.DeletedObject] for DaemonSet. +type DeletedDaemonSet = cache.DeletedObject[*apiappsv1beta2.DaemonSet] + type daemonSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type daemonSetInformer struct { // NewDaemonSetInformer constructs a new informer for DaemonSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDaemonSetInformer]). func NewDaemonSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewDaemonSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedDaemonSetInformer constructs a new informer for DaemonSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDaemonSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers DaemonSetIndexers) DaemonSetIndexInformer { + return NewTypedDaemonSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredDaemonSetInformer constructs a new informer for DaemonSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredDaemonSetInformer]). func NewFilteredDaemonSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewDaemonSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedDaemonSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredDaemonSetInformer constructs a new informer for DaemonSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredDaemonSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers DaemonSetIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) DaemonSetIndexInformer { + return NewTypedDaemonSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewDaemonSetInformerWithOptions constructs a new informer for DaemonSet type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDaemonSetInformerWithOptions]). func NewDaemonSetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedDaemonSetInformerWithOptions(client, namespace, options) +} + +// NewTypedDaemonSetInformerWithOptions constructs a new informer for DaemonSet type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDaemonSetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) DaemonSetIndexInformer { gvr := schema.GroupVersionResource{Group: "apps", Version: "v1beta2", Resource: "daemonsets"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.DaemonSet](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewDaemonSetInformerWithOptions(client kubernetes.Interface, namespace stri Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *daemonSetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewDaemonSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedDaemonSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *daemonSetInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiappsv1beta2.DaemonSet{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *daemonSetInformer) TypedInformer() DaemonSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.DaemonSet](f.factory.InformerFor(&apiappsv1beta2.DaemonSet{}, f.defaultInformer)) } func (f *daemonSetInformer) Lister() appsv1beta2.DaemonSetLister { return appsv1beta2.NewDaemonSetLister(f.Informer().GetIndexer()) } + +// ToTypedDaemonSetInformer converts an untyped informer into a TypedDaemonSetInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *DaemonSet. If that is not the case, calling type-safe methods of the returned +// TypedDaemonSetInformer leads to runtime panics. A safer alternative is to pass +// around a TypedDaemonSetInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedDaemonSetInformer(informer DaemonSetInformer) TypedDaemonSetInformer { + if informer, ok := informer.(TypedDaemonSetInformer); ok { + return informer + } + return &daemonSetTypedInformerAdapter{informer} +} + +type daemonSetTypedInformerAdapter struct { + DaemonSetInformer +} + +func (a *daemonSetTypedInformerAdapter) TypedInformer() DaemonSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.DaemonSet](a.Informer()) +} + +// ToDaemonSetIndexInformer converts an untyped informer into a DaemonSetIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *DaemonSet. If that is not the case, calling type-safe methods of the returned +// DaemonSetIndexInformer leads to runtime panics. A safer alternative is to pass +// around a DaemonSetIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToDaemonSetIndexInformer(informer cache.SharedIndexInformer) DaemonSetIndexInformer { + if informer, ok := informer.(DaemonSetIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.DaemonSet](informer) +} diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go index 1e0b64cb28..04743e3276 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go @@ -34,12 +34,40 @@ import ( ) // DeploymentInformer provides access to a shared informer and lister for -// Deployments. +// Deployments. Prefer using the type-safe variant (see [TypedDeploymentInformer]). type DeploymentInformer interface { Informer() cache.SharedIndexInformer Lister() appsv1beta2.DeploymentLister } +// TypedDeploymentInformer provides access to a shared informer and lister for +// Deployments, including the type-safe TypedInformer variant. +// It is a superset of DeploymentInformer. +type TypedDeploymentInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() DeploymentIndexInformer + Lister() appsv1beta2.DeploymentLister +} + +// DeploymentIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type DeploymentIndexInformer cache.TypedSharedIndexInformer[*apiappsv1beta2.Deployment] + +// DeploymentHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Deployment. +type DeploymentHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiappsv1beta2.Deployment] + +// DeploymentDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Deployment. +type DeploymentDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiappsv1beta2.Deployment] + +// DeploymentFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Deployment. +type DeploymentFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiappsv1beta2.Deployment] + +// DeploymentIndexers is a specialization of [cache.TypedIndexers] for Deployment. +type DeploymentIndexers = cache.TypedIndexers[*apiappsv1beta2.Deployment] + +// DeletedDeployment is a specialization of [cache.DeletedObject] for Deployment. +type DeletedDeployment = cache.DeletedObject[*apiappsv1beta2.Deployment] + type deploymentInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type deploymentInformer struct { // NewDeploymentInformer constructs a new informer for Deployment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeploymentInformer]). func NewDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedDeploymentInformer constructs a new informer for Deployment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers DeploymentIndexers) DeploymentIndexInformer { + return NewTypedDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredDeploymentInformer constructs a new informer for Deployment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredDeploymentInformer]). func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredDeploymentInformer constructs a new informer for Deployment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers DeploymentIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) DeploymentIndexInformer { + return NewTypedDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewDeploymentInformerWithOptions constructs a new informer for Deployment type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeploymentInformerWithOptions]). func NewDeploymentInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedDeploymentInformerWithOptions(client, namespace, options) +} + +// NewTypedDeploymentInformerWithOptions constructs a new informer for Deployment type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeploymentInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) DeploymentIndexInformer { gvr := schema.GroupVersionResource{Group: "apps", Version: "v1beta2", Resource: "deployments"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.Deployment](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewDeploymentInformerWithOptions(client kubernetes.Interface, namespace str Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *deploymentInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewDeploymentInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedDeploymentInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *deploymentInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiappsv1beta2.Deployment{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *deploymentInformer) TypedInformer() DeploymentIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.Deployment](f.factory.InformerFor(&apiappsv1beta2.Deployment{}, f.defaultInformer)) } func (f *deploymentInformer) Lister() appsv1beta2.DeploymentLister { return appsv1beta2.NewDeploymentLister(f.Informer().GetIndexer()) } + +// ToTypedDeploymentInformer converts an untyped informer into a TypedDeploymentInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Deployment. If that is not the case, calling type-safe methods of the returned +// TypedDeploymentInformer leads to runtime panics. A safer alternative is to pass +// around a TypedDeploymentInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedDeploymentInformer(informer DeploymentInformer) TypedDeploymentInformer { + if informer, ok := informer.(TypedDeploymentInformer); ok { + return informer + } + return &deploymentTypedInformerAdapter{informer} +} + +type deploymentTypedInformerAdapter struct { + DeploymentInformer +} + +func (a *deploymentTypedInformerAdapter) TypedInformer() DeploymentIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.Deployment](a.Informer()) +} + +// ToDeploymentIndexInformer converts an untyped informer into a DeploymentIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Deployment. If that is not the case, calling type-safe methods of the returned +// DeploymentIndexInformer leads to runtime panics. A safer alternative is to pass +// around a DeploymentIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToDeploymentIndexInformer(informer cache.SharedIndexInformer) DeploymentIndexInformer { + if informer, ok := informer.(DeploymentIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.Deployment](informer) +} diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/interface.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/interface.go index ded89bd5be..b00e797b9a 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/interface.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/interface.go @@ -25,15 +25,15 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // ControllerRevisions returns a ControllerRevisionInformer. - ControllerRevisions() ControllerRevisionInformer + ControllerRevisions() TypedControllerRevisionInformer // DaemonSets returns a DaemonSetInformer. - DaemonSets() DaemonSetInformer + DaemonSets() TypedDaemonSetInformer // Deployments returns a DeploymentInformer. - Deployments() DeploymentInformer + Deployments() TypedDeploymentInformer // ReplicaSets returns a ReplicaSetInformer. - ReplicaSets() ReplicaSetInformer + ReplicaSets() TypedReplicaSetInformer // StatefulSets returns a StatefulSetInformer. - StatefulSets() StatefulSetInformer + StatefulSets() TypedStatefulSetInformer } type version struct { @@ -47,27 +47,27 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// ControllerRevisions returns a ControllerRevisionInformer. -func (v *version) ControllerRevisions() ControllerRevisionInformer { +// ControllerRevisions returns a TypedControllerRevisionInformer. +func (v *version) ControllerRevisions() TypedControllerRevisionInformer { return &controllerRevisionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// DaemonSets returns a DaemonSetInformer. -func (v *version) DaemonSets() DaemonSetInformer { +// DaemonSets returns a TypedDaemonSetInformer. +func (v *version) DaemonSets() TypedDaemonSetInformer { return &daemonSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Deployments returns a DeploymentInformer. -func (v *version) Deployments() DeploymentInformer { +// Deployments returns a TypedDeploymentInformer. +func (v *version) Deployments() TypedDeploymentInformer { return &deploymentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ReplicaSets returns a ReplicaSetInformer. -func (v *version) ReplicaSets() ReplicaSetInformer { +// ReplicaSets returns a TypedReplicaSetInformer. +func (v *version) ReplicaSets() TypedReplicaSetInformer { return &replicaSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// StatefulSets returns a StatefulSetInformer. -func (v *version) StatefulSets() StatefulSetInformer { +// StatefulSets returns a TypedStatefulSetInformer. +func (v *version) StatefulSets() TypedStatefulSetInformer { return &statefulSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go index 425ad55333..3ee75c1621 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go @@ -34,12 +34,40 @@ import ( ) // ReplicaSetInformer provides access to a shared informer and lister for -// ReplicaSets. +// ReplicaSets. Prefer using the type-safe variant (see [TypedReplicaSetInformer]). type ReplicaSetInformer interface { Informer() cache.SharedIndexInformer Lister() appsv1beta2.ReplicaSetLister } +// TypedReplicaSetInformer provides access to a shared informer and lister for +// ReplicaSets, including the type-safe TypedInformer variant. +// It is a superset of ReplicaSetInformer. +type TypedReplicaSetInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ReplicaSetIndexInformer + Lister() appsv1beta2.ReplicaSetLister +} + +// ReplicaSetIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ReplicaSetIndexInformer cache.TypedSharedIndexInformer[*apiappsv1beta2.ReplicaSet] + +// ReplicaSetHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ReplicaSet. +type ReplicaSetHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiappsv1beta2.ReplicaSet] + +// ReplicaSetDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ReplicaSet. +type ReplicaSetDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiappsv1beta2.ReplicaSet] + +// ReplicaSetFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ReplicaSet. +type ReplicaSetFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiappsv1beta2.ReplicaSet] + +// ReplicaSetIndexers is a specialization of [cache.TypedIndexers] for ReplicaSet. +type ReplicaSetIndexers = cache.TypedIndexers[*apiappsv1beta2.ReplicaSet] + +// DeletedReplicaSet is a specialization of [cache.DeletedObject] for ReplicaSet. +type DeletedReplicaSet = cache.DeletedObject[*apiappsv1beta2.ReplicaSet] + type replicaSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type replicaSetInformer struct { // NewReplicaSetInformer constructs a new informer for ReplicaSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedReplicaSetInformer]). func NewReplicaSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewReplicaSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedReplicaSetInformer constructs a new informer for ReplicaSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedReplicaSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ReplicaSetIndexers) ReplicaSetIndexInformer { + return NewTypedReplicaSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredReplicaSetInformer constructs a new informer for ReplicaSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredReplicaSetInformer]). func NewFilteredReplicaSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewReplicaSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedReplicaSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredReplicaSetInformer constructs a new informer for ReplicaSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredReplicaSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ReplicaSetIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ReplicaSetIndexInformer { + return NewTypedReplicaSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewReplicaSetInformerWithOptions constructs a new informer for ReplicaSet type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedReplicaSetInformerWithOptions]). func NewReplicaSetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedReplicaSetInformerWithOptions(client, namespace, options) +} + +// NewTypedReplicaSetInformerWithOptions constructs a new informer for ReplicaSet type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedReplicaSetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) ReplicaSetIndexInformer { gvr := schema.GroupVersionResource{Group: "apps", Version: "v1beta2", Resource: "replicasets"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.ReplicaSet](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewReplicaSetInformerWithOptions(client kubernetes.Interface, namespace str Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *replicaSetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewReplicaSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedReplicaSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *replicaSetInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiappsv1beta2.ReplicaSet{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *replicaSetInformer) TypedInformer() ReplicaSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.ReplicaSet](f.factory.InformerFor(&apiappsv1beta2.ReplicaSet{}, f.defaultInformer)) } func (f *replicaSetInformer) Lister() appsv1beta2.ReplicaSetLister { return appsv1beta2.NewReplicaSetLister(f.Informer().GetIndexer()) } + +// ToTypedReplicaSetInformer converts an untyped informer into a TypedReplicaSetInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ReplicaSet. If that is not the case, calling type-safe methods of the returned +// TypedReplicaSetInformer leads to runtime panics. A safer alternative is to pass +// around a TypedReplicaSetInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedReplicaSetInformer(informer ReplicaSetInformer) TypedReplicaSetInformer { + if informer, ok := informer.(TypedReplicaSetInformer); ok { + return informer + } + return &replicaSetTypedInformerAdapter{informer} +} + +type replicaSetTypedInformerAdapter struct { + ReplicaSetInformer +} + +func (a *replicaSetTypedInformerAdapter) TypedInformer() ReplicaSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.ReplicaSet](a.Informer()) +} + +// ToReplicaSetIndexInformer converts an untyped informer into a ReplicaSetIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ReplicaSet. If that is not the case, calling type-safe methods of the returned +// ReplicaSetIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ReplicaSetIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToReplicaSetIndexInformer(informer cache.SharedIndexInformer) ReplicaSetIndexInformer { + if informer, ok := informer.(ReplicaSetIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.ReplicaSet](informer) +} diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go index 0fb22661cf..4b449a9c32 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go @@ -34,12 +34,40 @@ import ( ) // StatefulSetInformer provides access to a shared informer and lister for -// StatefulSets. +// StatefulSets. Prefer using the type-safe variant (see [TypedStatefulSetInformer]). type StatefulSetInformer interface { Informer() cache.SharedIndexInformer Lister() appsv1beta2.StatefulSetLister } +// TypedStatefulSetInformer provides access to a shared informer and lister for +// StatefulSets, including the type-safe TypedInformer variant. +// It is a superset of StatefulSetInformer. +type TypedStatefulSetInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() StatefulSetIndexInformer + Lister() appsv1beta2.StatefulSetLister +} + +// StatefulSetIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type StatefulSetIndexInformer cache.TypedSharedIndexInformer[*apiappsv1beta2.StatefulSet] + +// StatefulSetHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for StatefulSet. +type StatefulSetHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiappsv1beta2.StatefulSet] + +// StatefulSetDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for StatefulSet. +type StatefulSetDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiappsv1beta2.StatefulSet] + +// StatefulSetFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for StatefulSet. +type StatefulSetFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiappsv1beta2.StatefulSet] + +// StatefulSetIndexers is a specialization of [cache.TypedIndexers] for StatefulSet. +type StatefulSetIndexers = cache.TypedIndexers[*apiappsv1beta2.StatefulSet] + +// DeletedStatefulSet is a specialization of [cache.DeletedObject] for StatefulSet. +type DeletedStatefulSet = cache.DeletedObject[*apiappsv1beta2.StatefulSet] + type statefulSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type statefulSetInformer struct { // NewStatefulSetInformer constructs a new informer for StatefulSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStatefulSetInformer]). func NewStatefulSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewStatefulSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedStatefulSetInformer constructs a new informer for StatefulSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStatefulSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers StatefulSetIndexers) StatefulSetIndexInformer { + return NewTypedStatefulSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredStatefulSetInformer constructs a new informer for StatefulSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredStatefulSetInformer]). func NewFilteredStatefulSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewStatefulSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedStatefulSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredStatefulSetInformer constructs a new informer for StatefulSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredStatefulSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers StatefulSetIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) StatefulSetIndexInformer { + return NewTypedStatefulSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewStatefulSetInformerWithOptions constructs a new informer for StatefulSet type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStatefulSetInformerWithOptions]). func NewStatefulSetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedStatefulSetInformerWithOptions(client, namespace, options) +} + +// NewTypedStatefulSetInformerWithOptions constructs a new informer for StatefulSet type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStatefulSetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) StatefulSetIndexInformer { gvr := schema.GroupVersionResource{Group: "apps", Version: "v1beta2", Resource: "statefulsets"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.StatefulSet](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewStatefulSetInformerWithOptions(client kubernetes.Interface, namespace st Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *statefulSetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewStatefulSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedStatefulSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *statefulSetInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiappsv1beta2.StatefulSet{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *statefulSetInformer) TypedInformer() StatefulSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.StatefulSet](f.factory.InformerFor(&apiappsv1beta2.StatefulSet{}, f.defaultInformer)) } func (f *statefulSetInformer) Lister() appsv1beta2.StatefulSetLister { return appsv1beta2.NewStatefulSetLister(f.Informer().GetIndexer()) } + +// ToTypedStatefulSetInformer converts an untyped informer into a TypedStatefulSetInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StatefulSet. If that is not the case, calling type-safe methods of the returned +// TypedStatefulSetInformer leads to runtime panics. A safer alternative is to pass +// around a TypedStatefulSetInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedStatefulSetInformer(informer StatefulSetInformer) TypedStatefulSetInformer { + if informer, ok := informer.(TypedStatefulSetInformer); ok { + return informer + } + return &statefulSetTypedInformerAdapter{informer} +} + +type statefulSetTypedInformerAdapter struct { + StatefulSetInformer +} + +func (a *statefulSetTypedInformerAdapter) TypedInformer() StatefulSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.StatefulSet](a.Informer()) +} + +// ToStatefulSetIndexInformer converts an untyped informer into a StatefulSetIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StatefulSet. If that is not the case, calling type-safe methods of the returned +// StatefulSetIndexInformer leads to runtime panics. A safer alternative is to pass +// around a StatefulSetIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToStatefulSetIndexInformer(informer cache.SharedIndexInformer) StatefulSetIndexInformer { + if informer, ok := informer.(StatefulSetIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiappsv1beta2.StatefulSet](informer) +} diff --git a/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go index e49b035242..e8b5eb54f7 100644 --- a/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go @@ -34,12 +34,40 @@ import ( ) // HorizontalPodAutoscalerInformer provides access to a shared informer and lister for -// HorizontalPodAutoscalers. +// HorizontalPodAutoscalers. Prefer using the type-safe variant (see [TypedHorizontalPodAutoscalerInformer]). type HorizontalPodAutoscalerInformer interface { Informer() cache.SharedIndexInformer Lister() autoscalingv1.HorizontalPodAutoscalerLister } +// TypedHorizontalPodAutoscalerInformer provides access to a shared informer and lister for +// HorizontalPodAutoscalers, including the type-safe TypedInformer variant. +// It is a superset of HorizontalPodAutoscalerInformer. +type TypedHorizontalPodAutoscalerInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() HorizontalPodAutoscalerIndexInformer + Lister() autoscalingv1.HorizontalPodAutoscalerLister +} + +// HorizontalPodAutoscalerIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type HorizontalPodAutoscalerIndexInformer cache.TypedSharedIndexInformer[*apiautoscalingv1.HorizontalPodAutoscaler] + +// HorizontalPodAutoscalerHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for HorizontalPodAutoscaler. +type HorizontalPodAutoscalerHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiautoscalingv1.HorizontalPodAutoscaler] + +// HorizontalPodAutoscalerDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for HorizontalPodAutoscaler. +type HorizontalPodAutoscalerDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiautoscalingv1.HorizontalPodAutoscaler] + +// HorizontalPodAutoscalerFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for HorizontalPodAutoscaler. +type HorizontalPodAutoscalerFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiautoscalingv1.HorizontalPodAutoscaler] + +// HorizontalPodAutoscalerIndexers is a specialization of [cache.TypedIndexers] for HorizontalPodAutoscaler. +type HorizontalPodAutoscalerIndexers = cache.TypedIndexers[*apiautoscalingv1.HorizontalPodAutoscaler] + +// DeletedHorizontalPodAutoscaler is a specialization of [cache.DeletedObject] for HorizontalPodAutoscaler. +type DeletedHorizontalPodAutoscaler = cache.DeletedObject[*apiautoscalingv1.HorizontalPodAutoscaler] + type horizontalPodAutoscalerInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type horizontalPodAutoscalerInformer struct { // NewHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedHorizontalPodAutoscalerInformer]). func NewHorizontalPodAutoscalerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewHorizontalPodAutoscalerInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedHorizontalPodAutoscalerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers HorizontalPodAutoscalerIndexers) HorizontalPodAutoscalerIndexInformer { + return NewTypedHorizontalPodAutoscalerInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredHorizontalPodAutoscalerInformer]). func NewFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewHorizontalPodAutoscalerInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedHorizontalPodAutoscalerInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers HorizontalPodAutoscalerIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) HorizontalPodAutoscalerIndexInformer { + return NewTypedHorizontalPodAutoscalerInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewHorizontalPodAutoscalerInformerWithOptions constructs a new informer for HorizontalPodAutoscaler type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedHorizontalPodAutoscalerInformerWithOptions]). func NewHorizontalPodAutoscalerInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedHorizontalPodAutoscalerInformerWithOptions(client, namespace, options) +} + +// NewTypedHorizontalPodAutoscalerInformerWithOptions constructs a new informer for HorizontalPodAutoscaler type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedHorizontalPodAutoscalerInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) HorizontalPodAutoscalerIndexInformer { gvr := schema.GroupVersionResource{Group: "autoscaling", Version: "v1", Resource: "horizontalpodautoscalers"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiautoscalingv1.HorizontalPodAutoscaler](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewHorizontalPodAutoscalerInformerWithOptions(client kubernetes.Interface, Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *horizontalPodAutoscalerInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewHorizontalPodAutoscalerInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedHorizontalPodAutoscalerInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *horizontalPodAutoscalerInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiautoscalingv1.HorizontalPodAutoscaler{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *horizontalPodAutoscalerInformer) TypedInformer() HorizontalPodAutoscalerIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiautoscalingv1.HorizontalPodAutoscaler](f.factory.InformerFor(&apiautoscalingv1.HorizontalPodAutoscaler{}, f.defaultInformer)) } func (f *horizontalPodAutoscalerInformer) Lister() autoscalingv1.HorizontalPodAutoscalerLister { return autoscalingv1.NewHorizontalPodAutoscalerLister(f.Informer().GetIndexer()) } + +// ToTypedHorizontalPodAutoscalerInformer converts an untyped informer into a TypedHorizontalPodAutoscalerInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *HorizontalPodAutoscaler. If that is not the case, calling type-safe methods of the returned +// TypedHorizontalPodAutoscalerInformer leads to runtime panics. A safer alternative is to pass +// around a TypedHorizontalPodAutoscalerInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedHorizontalPodAutoscalerInformer(informer HorizontalPodAutoscalerInformer) TypedHorizontalPodAutoscalerInformer { + if informer, ok := informer.(TypedHorizontalPodAutoscalerInformer); ok { + return informer + } + return &horizontalPodAutoscalerTypedInformerAdapter{informer} +} + +type horizontalPodAutoscalerTypedInformerAdapter struct { + HorizontalPodAutoscalerInformer +} + +func (a *horizontalPodAutoscalerTypedInformerAdapter) TypedInformer() HorizontalPodAutoscalerIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiautoscalingv1.HorizontalPodAutoscaler](a.Informer()) +} + +// ToHorizontalPodAutoscalerIndexInformer converts an untyped informer into a HorizontalPodAutoscalerIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *HorizontalPodAutoscaler. If that is not the case, calling type-safe methods of the returned +// HorizontalPodAutoscalerIndexInformer leads to runtime panics. A safer alternative is to pass +// around a HorizontalPodAutoscalerIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToHorizontalPodAutoscalerIndexInformer(informer cache.SharedIndexInformer) HorizontalPodAutoscalerIndexInformer { + if informer, ok := informer.(HorizontalPodAutoscalerIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiautoscalingv1.HorizontalPodAutoscaler](informer) +} diff --git a/vendor/k8s.io/client-go/informers/autoscaling/v1/interface.go b/vendor/k8s.io/client-go/informers/autoscaling/v1/interface.go index 601d0f77f1..730ca89c2a 100644 --- a/vendor/k8s.io/client-go/informers/autoscaling/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/autoscaling/v1/interface.go @@ -25,7 +25,7 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // HorizontalPodAutoscalers returns a HorizontalPodAutoscalerInformer. - HorizontalPodAutoscalers() HorizontalPodAutoscalerInformer + HorizontalPodAutoscalers() TypedHorizontalPodAutoscalerInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// HorizontalPodAutoscalers returns a HorizontalPodAutoscalerInformer. -func (v *version) HorizontalPodAutoscalers() HorizontalPodAutoscalerInformer { +// HorizontalPodAutoscalers returns a TypedHorizontalPodAutoscalerInformer. +func (v *version) HorizontalPodAutoscalers() TypedHorizontalPodAutoscalerInformer { return &horizontalPodAutoscalerInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/autoscaling/v2/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/informers/autoscaling/v2/horizontalpodautoscaler.go index 3605718d08..dbdac3f6d4 100644 --- a/vendor/k8s.io/client-go/informers/autoscaling/v2/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/informers/autoscaling/v2/horizontalpodautoscaler.go @@ -34,12 +34,40 @@ import ( ) // HorizontalPodAutoscalerInformer provides access to a shared informer and lister for -// HorizontalPodAutoscalers. +// HorizontalPodAutoscalers. Prefer using the type-safe variant (see [TypedHorizontalPodAutoscalerInformer]). type HorizontalPodAutoscalerInformer interface { Informer() cache.SharedIndexInformer Lister() autoscalingv2.HorizontalPodAutoscalerLister } +// TypedHorizontalPodAutoscalerInformer provides access to a shared informer and lister for +// HorizontalPodAutoscalers, including the type-safe TypedInformer variant. +// It is a superset of HorizontalPodAutoscalerInformer. +type TypedHorizontalPodAutoscalerInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() HorizontalPodAutoscalerIndexInformer + Lister() autoscalingv2.HorizontalPodAutoscalerLister +} + +// HorizontalPodAutoscalerIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type HorizontalPodAutoscalerIndexInformer cache.TypedSharedIndexInformer[*apiautoscalingv2.HorizontalPodAutoscaler] + +// HorizontalPodAutoscalerHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for HorizontalPodAutoscaler. +type HorizontalPodAutoscalerHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiautoscalingv2.HorizontalPodAutoscaler] + +// HorizontalPodAutoscalerDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for HorizontalPodAutoscaler. +type HorizontalPodAutoscalerDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiautoscalingv2.HorizontalPodAutoscaler] + +// HorizontalPodAutoscalerFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for HorizontalPodAutoscaler. +type HorizontalPodAutoscalerFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiautoscalingv2.HorizontalPodAutoscaler] + +// HorizontalPodAutoscalerIndexers is a specialization of [cache.TypedIndexers] for HorizontalPodAutoscaler. +type HorizontalPodAutoscalerIndexers = cache.TypedIndexers[*apiautoscalingv2.HorizontalPodAutoscaler] + +// DeletedHorizontalPodAutoscaler is a specialization of [cache.DeletedObject] for HorizontalPodAutoscaler. +type DeletedHorizontalPodAutoscaler = cache.DeletedObject[*apiautoscalingv2.HorizontalPodAutoscaler] + type horizontalPodAutoscalerInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type horizontalPodAutoscalerInformer struct { // NewHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedHorizontalPodAutoscalerInformer]). func NewHorizontalPodAutoscalerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewHorizontalPodAutoscalerInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedHorizontalPodAutoscalerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers HorizontalPodAutoscalerIndexers) HorizontalPodAutoscalerIndexInformer { + return NewTypedHorizontalPodAutoscalerInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredHorizontalPodAutoscalerInformer]). func NewFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewHorizontalPodAutoscalerInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedHorizontalPodAutoscalerInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers HorizontalPodAutoscalerIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) HorizontalPodAutoscalerIndexInformer { + return NewTypedHorizontalPodAutoscalerInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewHorizontalPodAutoscalerInformerWithOptions constructs a new informer for HorizontalPodAutoscaler type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedHorizontalPodAutoscalerInformerWithOptions]). func NewHorizontalPodAutoscalerInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedHorizontalPodAutoscalerInformerWithOptions(client, namespace, options) +} + +// NewTypedHorizontalPodAutoscalerInformerWithOptions constructs a new informer for HorizontalPodAutoscaler type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedHorizontalPodAutoscalerInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) HorizontalPodAutoscalerIndexInformer { gvr := schema.GroupVersionResource{Group: "autoscaling", Version: "v2", Resource: "horizontalpodautoscalers"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiautoscalingv2.HorizontalPodAutoscaler](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewHorizontalPodAutoscalerInformerWithOptions(client kubernetes.Interface, Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *horizontalPodAutoscalerInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewHorizontalPodAutoscalerInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedHorizontalPodAutoscalerInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *horizontalPodAutoscalerInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiautoscalingv2.HorizontalPodAutoscaler{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *horizontalPodAutoscalerInformer) TypedInformer() HorizontalPodAutoscalerIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiautoscalingv2.HorizontalPodAutoscaler](f.factory.InformerFor(&apiautoscalingv2.HorizontalPodAutoscaler{}, f.defaultInformer)) } func (f *horizontalPodAutoscalerInformer) Lister() autoscalingv2.HorizontalPodAutoscalerLister { return autoscalingv2.NewHorizontalPodAutoscalerLister(f.Informer().GetIndexer()) } + +// ToTypedHorizontalPodAutoscalerInformer converts an untyped informer into a TypedHorizontalPodAutoscalerInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *HorizontalPodAutoscaler. If that is not the case, calling type-safe methods of the returned +// TypedHorizontalPodAutoscalerInformer leads to runtime panics. A safer alternative is to pass +// around a TypedHorizontalPodAutoscalerInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedHorizontalPodAutoscalerInformer(informer HorizontalPodAutoscalerInformer) TypedHorizontalPodAutoscalerInformer { + if informer, ok := informer.(TypedHorizontalPodAutoscalerInformer); ok { + return informer + } + return &horizontalPodAutoscalerTypedInformerAdapter{informer} +} + +type horizontalPodAutoscalerTypedInformerAdapter struct { + HorizontalPodAutoscalerInformer +} + +func (a *horizontalPodAutoscalerTypedInformerAdapter) TypedInformer() HorizontalPodAutoscalerIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiautoscalingv2.HorizontalPodAutoscaler](a.Informer()) +} + +// ToHorizontalPodAutoscalerIndexInformer converts an untyped informer into a HorizontalPodAutoscalerIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *HorizontalPodAutoscaler. If that is not the case, calling type-safe methods of the returned +// HorizontalPodAutoscalerIndexInformer leads to runtime panics. A safer alternative is to pass +// around a HorizontalPodAutoscalerIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToHorizontalPodAutoscalerIndexInformer(informer cache.SharedIndexInformer) HorizontalPodAutoscalerIndexInformer { + if informer, ok := informer.(HorizontalPodAutoscalerIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiautoscalingv2.HorizontalPodAutoscaler](informer) +} diff --git a/vendor/k8s.io/client-go/informers/autoscaling/v2/interface.go b/vendor/k8s.io/client-go/informers/autoscaling/v2/interface.go index 2c71908e40..e8b2d14934 100644 --- a/vendor/k8s.io/client-go/informers/autoscaling/v2/interface.go +++ b/vendor/k8s.io/client-go/informers/autoscaling/v2/interface.go @@ -25,7 +25,7 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // HorizontalPodAutoscalers returns a HorizontalPodAutoscalerInformer. - HorizontalPodAutoscalers() HorizontalPodAutoscalerInformer + HorizontalPodAutoscalers() TypedHorizontalPodAutoscalerInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// HorizontalPodAutoscalers returns a HorizontalPodAutoscalerInformer. -func (v *version) HorizontalPodAutoscalers() HorizontalPodAutoscalerInformer { +// HorizontalPodAutoscalers returns a TypedHorizontalPodAutoscalerInformer. +func (v *version) HorizontalPodAutoscalers() TypedHorizontalPodAutoscalerInformer { return &horizontalPodAutoscalerInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/batch/v1/cronjob.go b/vendor/k8s.io/client-go/informers/batch/v1/cronjob.go index 022710011b..bbd8ebf642 100644 --- a/vendor/k8s.io/client-go/informers/batch/v1/cronjob.go +++ b/vendor/k8s.io/client-go/informers/batch/v1/cronjob.go @@ -34,12 +34,40 @@ import ( ) // CronJobInformer provides access to a shared informer and lister for -// CronJobs. +// CronJobs. Prefer using the type-safe variant (see [TypedCronJobInformer]). type CronJobInformer interface { Informer() cache.SharedIndexInformer Lister() batchv1.CronJobLister } +// TypedCronJobInformer provides access to a shared informer and lister for +// CronJobs, including the type-safe TypedInformer variant. +// It is a superset of CronJobInformer. +type TypedCronJobInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CronJobIndexInformer + Lister() batchv1.CronJobLister +} + +// CronJobIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CronJobIndexInformer cache.TypedSharedIndexInformer[*apibatchv1.CronJob] + +// CronJobHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CronJob. +type CronJobHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apibatchv1.CronJob] + +// CronJobDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CronJob. +type CronJobDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apibatchv1.CronJob] + +// CronJobFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CronJob. +type CronJobFilteringHandler = cache.TypedFilteringResourceEventHandler[*apibatchv1.CronJob] + +// CronJobIndexers is a specialization of [cache.TypedIndexers] for CronJob. +type CronJobIndexers = cache.TypedIndexers[*apibatchv1.CronJob] + +// DeletedCronJob is a specialization of [cache.DeletedObject] for CronJob. +type DeletedCronJob = cache.DeletedObject[*apibatchv1.CronJob] + type cronJobInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type cronJobInformer struct { // NewCronJobInformer constructs a new informer for CronJob type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCronJobInformer]). func NewCronJobInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewCronJobInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedCronJobInformer constructs a new informer for CronJob type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCronJobInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers CronJobIndexers) CronJobIndexInformer { + return NewTypedCronJobInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredCronJobInformer constructs a new informer for CronJob type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCronJobInformer]). func NewFilteredCronJobInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewCronJobInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedCronJobInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCronJobInformer constructs a new informer for CronJob type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredCronJobInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers CronJobIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CronJobIndexInformer { + return NewTypedCronJobInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewCronJobInformerWithOptions constructs a new informer for CronJob type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCronJobInformerWithOptions]). func NewCronJobInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCronJobInformerWithOptions(client, namespace, options) +} + +// NewTypedCronJobInformerWithOptions constructs a new informer for CronJob type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCronJobInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) CronJobIndexInformer { gvr := schema.GroupVersionResource{Group: "batch", Version: "v1", Resource: "cronjobs"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apibatchv1.CronJob](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewCronJobInformerWithOptions(client kubernetes.Interface, namespace string Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *cronJobInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewCronJobInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedCronJobInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *cronJobInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apibatchv1.CronJob{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *cronJobInformer) TypedInformer() CronJobIndexInformer { + return cache.NewTypedSharedIndexInformer[*apibatchv1.CronJob](f.factory.InformerFor(&apibatchv1.CronJob{}, f.defaultInformer)) } func (f *cronJobInformer) Lister() batchv1.CronJobLister { return batchv1.NewCronJobLister(f.Informer().GetIndexer()) } + +// ToTypedCronJobInformer converts an untyped informer into a TypedCronJobInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CronJob. If that is not the case, calling type-safe methods of the returned +// TypedCronJobInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCronJobInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCronJobInformer(informer CronJobInformer) TypedCronJobInformer { + if informer, ok := informer.(TypedCronJobInformer); ok { + return informer + } + return &cronJobTypedInformerAdapter{informer} +} + +type cronJobTypedInformerAdapter struct { + CronJobInformer +} + +func (a *cronJobTypedInformerAdapter) TypedInformer() CronJobIndexInformer { + return cache.NewTypedSharedIndexInformer[*apibatchv1.CronJob](a.Informer()) +} + +// ToCronJobIndexInformer converts an untyped informer into a CronJobIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CronJob. If that is not the case, calling type-safe methods of the returned +// CronJobIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CronJobIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCronJobIndexInformer(informer cache.SharedIndexInformer) CronJobIndexInformer { + if informer, ok := informer.(CronJobIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apibatchv1.CronJob](informer) +} diff --git a/vendor/k8s.io/client-go/informers/batch/v1/interface.go b/vendor/k8s.io/client-go/informers/batch/v1/interface.go index 84567fb592..4308f08cb2 100644 --- a/vendor/k8s.io/client-go/informers/batch/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/batch/v1/interface.go @@ -25,9 +25,9 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // CronJobs returns a CronJobInformer. - CronJobs() CronJobInformer + CronJobs() TypedCronJobInformer // Jobs returns a JobInformer. - Jobs() JobInformer + Jobs() TypedJobInformer } type version struct { @@ -41,12 +41,12 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// CronJobs returns a CronJobInformer. -func (v *version) CronJobs() CronJobInformer { +// CronJobs returns a TypedCronJobInformer. +func (v *version) CronJobs() TypedCronJobInformer { return &cronJobInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Jobs returns a JobInformer. -func (v *version) Jobs() JobInformer { +// Jobs returns a TypedJobInformer. +func (v *version) Jobs() TypedJobInformer { return &jobInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/batch/v1/job.go b/vendor/k8s.io/client-go/informers/batch/v1/job.go index 97e88927bf..31d9244c1a 100644 --- a/vendor/k8s.io/client-go/informers/batch/v1/job.go +++ b/vendor/k8s.io/client-go/informers/batch/v1/job.go @@ -34,12 +34,40 @@ import ( ) // JobInformer provides access to a shared informer and lister for -// Jobs. +// Jobs. Prefer using the type-safe variant (see [TypedJobInformer]). type JobInformer interface { Informer() cache.SharedIndexInformer Lister() batchv1.JobLister } +// TypedJobInformer provides access to a shared informer and lister for +// Jobs, including the type-safe TypedInformer variant. +// It is a superset of JobInformer. +type TypedJobInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() JobIndexInformer + Lister() batchv1.JobLister +} + +// JobIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type JobIndexInformer cache.TypedSharedIndexInformer[*apibatchv1.Job] + +// JobHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Job. +type JobHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apibatchv1.Job] + +// JobDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Job. +type JobDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apibatchv1.Job] + +// JobFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Job. +type JobFilteringHandler = cache.TypedFilteringResourceEventHandler[*apibatchv1.Job] + +// JobIndexers is a specialization of [cache.TypedIndexers] for Job. +type JobIndexers = cache.TypedIndexers[*apibatchv1.Job] + +// DeletedJob is a specialization of [cache.DeletedObject] for Job. +type DeletedJob = cache.DeletedObject[*apibatchv1.Job] + type jobInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type jobInformer struct { // NewJobInformer constructs a new informer for Job type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedJobInformer]). func NewJobInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewJobInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedJobInformer constructs a new informer for Job type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedJobInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers JobIndexers) JobIndexInformer { + return NewTypedJobInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredJobInformer constructs a new informer for Job type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredJobInformer]). func NewFilteredJobInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewJobInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedJobInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredJobInformer constructs a new informer for Job type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredJobInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers JobIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) JobIndexInformer { + return NewTypedJobInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewJobInformerWithOptions constructs a new informer for Job type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedJobInformerWithOptions]). func NewJobInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedJobInformerWithOptions(client, namespace, options) +} + +// NewTypedJobInformerWithOptions constructs a new informer for Job type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedJobInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) JobIndexInformer { gvr := schema.GroupVersionResource{Group: "batch", Version: "v1", Resource: "jobs"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apibatchv1.Job](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewJobInformerWithOptions(client kubernetes.Interface, namespace string, op Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *jobInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewJobInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedJobInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *jobInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apibatchv1.Job{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *jobInformer) TypedInformer() JobIndexInformer { + return cache.NewTypedSharedIndexInformer[*apibatchv1.Job](f.factory.InformerFor(&apibatchv1.Job{}, f.defaultInformer)) } func (f *jobInformer) Lister() batchv1.JobLister { return batchv1.NewJobLister(f.Informer().GetIndexer()) } + +// ToTypedJobInformer converts an untyped informer into a TypedJobInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Job. If that is not the case, calling type-safe methods of the returned +// TypedJobInformer leads to runtime panics. A safer alternative is to pass +// around a TypedJobInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedJobInformer(informer JobInformer) TypedJobInformer { + if informer, ok := informer.(TypedJobInformer); ok { + return informer + } + return &jobTypedInformerAdapter{informer} +} + +type jobTypedInformerAdapter struct { + JobInformer +} + +func (a *jobTypedInformerAdapter) TypedInformer() JobIndexInformer { + return cache.NewTypedSharedIndexInformer[*apibatchv1.Job](a.Informer()) +} + +// ToJobIndexInformer converts an untyped informer into a JobIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Job. If that is not the case, calling type-safe methods of the returned +// JobIndexInformer leads to runtime panics. A safer alternative is to pass +// around a JobIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToJobIndexInformer(informer cache.SharedIndexInformer) JobIndexInformer { + if informer, ok := informer.(JobIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apibatchv1.Job](informer) +} diff --git a/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go b/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go index 5d2129323b..9043856ab0 100644 --- a/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go +++ b/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go @@ -34,12 +34,40 @@ import ( ) // CronJobInformer provides access to a shared informer and lister for -// CronJobs. +// CronJobs. Prefer using the type-safe variant (see [TypedCronJobInformer]). type CronJobInformer interface { Informer() cache.SharedIndexInformer Lister() batchv1beta1.CronJobLister } +// TypedCronJobInformer provides access to a shared informer and lister for +// CronJobs, including the type-safe TypedInformer variant. +// It is a superset of CronJobInformer. +type TypedCronJobInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CronJobIndexInformer + Lister() batchv1beta1.CronJobLister +} + +// CronJobIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CronJobIndexInformer cache.TypedSharedIndexInformer[*apibatchv1beta1.CronJob] + +// CronJobHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CronJob. +type CronJobHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apibatchv1beta1.CronJob] + +// CronJobDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CronJob. +type CronJobDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apibatchv1beta1.CronJob] + +// CronJobFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CronJob. +type CronJobFilteringHandler = cache.TypedFilteringResourceEventHandler[*apibatchv1beta1.CronJob] + +// CronJobIndexers is a specialization of [cache.TypedIndexers] for CronJob. +type CronJobIndexers = cache.TypedIndexers[*apibatchv1beta1.CronJob] + +// DeletedCronJob is a specialization of [cache.DeletedObject] for CronJob. +type DeletedCronJob = cache.DeletedObject[*apibatchv1beta1.CronJob] + type cronJobInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type cronJobInformer struct { // NewCronJobInformer constructs a new informer for CronJob type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCronJobInformer]). func NewCronJobInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewCronJobInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedCronJobInformer constructs a new informer for CronJob type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCronJobInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers CronJobIndexers) CronJobIndexInformer { + return NewTypedCronJobInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredCronJobInformer constructs a new informer for CronJob type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCronJobInformer]). func NewFilteredCronJobInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewCronJobInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedCronJobInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCronJobInformer constructs a new informer for CronJob type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredCronJobInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers CronJobIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CronJobIndexInformer { + return NewTypedCronJobInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewCronJobInformerWithOptions constructs a new informer for CronJob type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCronJobInformerWithOptions]). func NewCronJobInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCronJobInformerWithOptions(client, namespace, options) +} + +// NewTypedCronJobInformerWithOptions constructs a new informer for CronJob type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCronJobInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) CronJobIndexInformer { gvr := schema.GroupVersionResource{Group: "batch", Version: "v1beta1", Resource: "cronjobs"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apibatchv1beta1.CronJob](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewCronJobInformerWithOptions(client kubernetes.Interface, namespace string Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *cronJobInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewCronJobInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedCronJobInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *cronJobInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apibatchv1beta1.CronJob{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *cronJobInformer) TypedInformer() CronJobIndexInformer { + return cache.NewTypedSharedIndexInformer[*apibatchv1beta1.CronJob](f.factory.InformerFor(&apibatchv1beta1.CronJob{}, f.defaultInformer)) } func (f *cronJobInformer) Lister() batchv1beta1.CronJobLister { return batchv1beta1.NewCronJobLister(f.Informer().GetIndexer()) } + +// ToTypedCronJobInformer converts an untyped informer into a TypedCronJobInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CronJob. If that is not the case, calling type-safe methods of the returned +// TypedCronJobInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCronJobInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCronJobInformer(informer CronJobInformer) TypedCronJobInformer { + if informer, ok := informer.(TypedCronJobInformer); ok { + return informer + } + return &cronJobTypedInformerAdapter{informer} +} + +type cronJobTypedInformerAdapter struct { + CronJobInformer +} + +func (a *cronJobTypedInformerAdapter) TypedInformer() CronJobIndexInformer { + return cache.NewTypedSharedIndexInformer[*apibatchv1beta1.CronJob](a.Informer()) +} + +// ToCronJobIndexInformer converts an untyped informer into a CronJobIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CronJob. If that is not the case, calling type-safe methods of the returned +// CronJobIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CronJobIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCronJobIndexInformer(informer cache.SharedIndexInformer) CronJobIndexInformer { + if informer, ok := informer.(CronJobIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apibatchv1beta1.CronJob](informer) +} diff --git a/vendor/k8s.io/client-go/informers/batch/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/batch/v1beta1/interface.go index 76cae22d68..bfe75d8a1c 100644 --- a/vendor/k8s.io/client-go/informers/batch/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/batch/v1beta1/interface.go @@ -25,7 +25,7 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // CronJobs returns a CronJobInformer. - CronJobs() CronJobInformer + CronJobs() TypedCronJobInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// CronJobs returns a CronJobInformer. -func (v *version) CronJobs() CronJobInformer { +// CronJobs returns a TypedCronJobInformer. +func (v *version) CronJobs() TypedCronJobInformer { return &cronJobInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/certificates/v1/certificatesigningrequest.go b/vendor/k8s.io/client-go/informers/certificates/v1/certificatesigningrequest.go index 0e0706893c..4aa2b549e5 100644 --- a/vendor/k8s.io/client-go/informers/certificates/v1/certificatesigningrequest.go +++ b/vendor/k8s.io/client-go/informers/certificates/v1/certificatesigningrequest.go @@ -34,12 +34,40 @@ import ( ) // CertificateSigningRequestInformer provides access to a shared informer and lister for -// CertificateSigningRequests. +// CertificateSigningRequests. Prefer using the type-safe variant (see [TypedCertificateSigningRequestInformer]). type CertificateSigningRequestInformer interface { Informer() cache.SharedIndexInformer Lister() certificatesv1.CertificateSigningRequestLister } +// TypedCertificateSigningRequestInformer provides access to a shared informer and lister for +// CertificateSigningRequests, including the type-safe TypedInformer variant. +// It is a superset of CertificateSigningRequestInformer. +type TypedCertificateSigningRequestInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CertificateSigningRequestIndexInformer + Lister() certificatesv1.CertificateSigningRequestLister +} + +// CertificateSigningRequestIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CertificateSigningRequestIndexInformer cache.TypedSharedIndexInformer[*apicertificatesv1.CertificateSigningRequest] + +// CertificateSigningRequestHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CertificateSigningRequest. +type CertificateSigningRequestHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicertificatesv1.CertificateSigningRequest] + +// CertificateSigningRequestDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CertificateSigningRequest. +type CertificateSigningRequestDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicertificatesv1.CertificateSigningRequest] + +// CertificateSigningRequestFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CertificateSigningRequest. +type CertificateSigningRequestFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicertificatesv1.CertificateSigningRequest] + +// CertificateSigningRequestIndexers is a specialization of [cache.TypedIndexers] for CertificateSigningRequest. +type CertificateSigningRequestIndexers = cache.TypedIndexers[*apicertificatesv1.CertificateSigningRequest] + +// DeletedCertificateSigningRequest is a specialization of [cache.DeletedObject] for CertificateSigningRequest. +type DeletedCertificateSigningRequest = cache.DeletedObject[*apicertificatesv1.CertificateSigningRequest] + type certificateSigningRequestInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type certificateSigningRequestInformer struct { // NewCertificateSigningRequestInformer constructs a new informer for CertificateSigningRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCertificateSigningRequestInformer]). func NewCertificateSigningRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewCertificateSigningRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedCertificateSigningRequestInformer constructs a new informer for CertificateSigningRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCertificateSigningRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers CertificateSigningRequestIndexers) CertificateSigningRequestIndexInformer { + return NewTypedCertificateSigningRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredCertificateSigningRequestInformer constructs a new informer for CertificateSigningRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCertificateSigningRequestInformer]). func NewFilteredCertificateSigningRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewCertificateSigningRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedCertificateSigningRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCertificateSigningRequestInformer constructs a new informer for CertificateSigningRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredCertificateSigningRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers CertificateSigningRequestIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CertificateSigningRequestIndexInformer { + return NewTypedCertificateSigningRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewCertificateSigningRequestInformerWithOptions constructs a new informer for CertificateSigningRequest type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCertificateSigningRequestInformerWithOptions]). func NewCertificateSigningRequestInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCertificateSigningRequestInformerWithOptions(client, options) +} + +// NewTypedCertificateSigningRequestInformerWithOptions constructs a new informer for CertificateSigningRequest type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCertificateSigningRequestInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) CertificateSigningRequestIndexInformer { gvr := schema.GroupVersionResource{Group: "certificates.k8s.io", Version: "v1", Resource: "certificatesigningrequests"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicertificatesv1.CertificateSigningRequest](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewCertificateSigningRequestInformerWithOptions(client kubernetes.Interface Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *certificateSigningRequestInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewCertificateSigningRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedCertificateSigningRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *certificateSigningRequestInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicertificatesv1.CertificateSigningRequest{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *certificateSigningRequestInformer) TypedInformer() CertificateSigningRequestIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicertificatesv1.CertificateSigningRequest](f.factory.InformerFor(&apicertificatesv1.CertificateSigningRequest{}, f.defaultInformer)) } func (f *certificateSigningRequestInformer) Lister() certificatesv1.CertificateSigningRequestLister { return certificatesv1.NewCertificateSigningRequestLister(f.Informer().GetIndexer()) } + +// ToTypedCertificateSigningRequestInformer converts an untyped informer into a TypedCertificateSigningRequestInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CertificateSigningRequest. If that is not the case, calling type-safe methods of the returned +// TypedCertificateSigningRequestInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCertificateSigningRequestInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCertificateSigningRequestInformer(informer CertificateSigningRequestInformer) TypedCertificateSigningRequestInformer { + if informer, ok := informer.(TypedCertificateSigningRequestInformer); ok { + return informer + } + return &certificateSigningRequestTypedInformerAdapter{informer} +} + +type certificateSigningRequestTypedInformerAdapter struct { + CertificateSigningRequestInformer +} + +func (a *certificateSigningRequestTypedInformerAdapter) TypedInformer() CertificateSigningRequestIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicertificatesv1.CertificateSigningRequest](a.Informer()) +} + +// ToCertificateSigningRequestIndexInformer converts an untyped informer into a CertificateSigningRequestIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CertificateSigningRequest. If that is not the case, calling type-safe methods of the returned +// CertificateSigningRequestIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CertificateSigningRequestIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCertificateSigningRequestIndexInformer(informer cache.SharedIndexInformer) CertificateSigningRequestIndexInformer { + if informer, ok := informer.(CertificateSigningRequestIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicertificatesv1.CertificateSigningRequest](informer) +} diff --git a/vendor/k8s.io/client-go/informers/certificates/v1/clustertrustbundle.go b/vendor/k8s.io/client-go/informers/certificates/v1/clustertrustbundle.go new file mode 100644 index 0000000000..e24a1aed5d --- /dev/null +++ b/vendor/k8s.io/client-go/informers/certificates/v1/clustertrustbundle.go @@ -0,0 +1,207 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + time "time" + + apicertificatesv1 "k8s.io/api/certificates/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + certificatesv1 "k8s.io/client-go/listers/certificates/v1" + cache "k8s.io/client-go/tools/cache" +) + +// ClusterTrustBundleInformer provides access to a shared informer and lister for +// ClusterTrustBundles. Prefer using the type-safe variant (see [TypedClusterTrustBundleInformer]). +type ClusterTrustBundleInformer interface { + Informer() cache.SharedIndexInformer + Lister() certificatesv1.ClusterTrustBundleLister +} + +// TypedClusterTrustBundleInformer provides access to a shared informer and lister for +// ClusterTrustBundles, including the type-safe TypedInformer variant. +// It is a superset of ClusterTrustBundleInformer. +type TypedClusterTrustBundleInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ClusterTrustBundleIndexInformer + Lister() certificatesv1.ClusterTrustBundleLister +} + +// ClusterTrustBundleIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ClusterTrustBundleIndexInformer cache.TypedSharedIndexInformer[*apicertificatesv1.ClusterTrustBundle] + +// ClusterTrustBundleHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ClusterTrustBundle. +type ClusterTrustBundleHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicertificatesv1.ClusterTrustBundle] + +// ClusterTrustBundleDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ClusterTrustBundle. +type ClusterTrustBundleDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicertificatesv1.ClusterTrustBundle] + +// ClusterTrustBundleFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ClusterTrustBundle. +type ClusterTrustBundleFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicertificatesv1.ClusterTrustBundle] + +// ClusterTrustBundleIndexers is a specialization of [cache.TypedIndexers] for ClusterTrustBundle. +type ClusterTrustBundleIndexers = cache.TypedIndexers[*apicertificatesv1.ClusterTrustBundle] + +// DeletedClusterTrustBundle is a specialization of [cache.DeletedObject] for ClusterTrustBundle. +type DeletedClusterTrustBundle = cache.DeletedObject[*apicertificatesv1.ClusterTrustBundle] + +type clusterTrustBundleInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewClusterTrustBundleInformer constructs a new informer for ClusterTrustBundle type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterTrustBundleInformer]). +func NewClusterTrustBundleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewTypedClusterTrustBundleInformer constructs a new informer for ClusterTrustBundle type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterTrustBundleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ClusterTrustBundleIndexers) ClusterTrustBundleIndexInformer { + return NewTypedClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + +// NewFilteredClusterTrustBundleInformer constructs a new informer for ClusterTrustBundle type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredClusterTrustBundleInformer]). +func NewFilteredClusterTrustBundleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewTypedClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredClusterTrustBundleInformer constructs a new informer for ClusterTrustBundle type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredClusterTrustBundleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ClusterTrustBundleIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ClusterTrustBundleIndexInformer { + return NewTypedClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) +} + +// NewClusterTrustBundleInformerWithOptions constructs a new informer for ClusterTrustBundle type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterTrustBundleInformerWithOptions]). +func NewClusterTrustBundleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedClusterTrustBundleInformerWithOptions(client, options) +} + +// NewTypedClusterTrustBundleInformerWithOptions constructs a new informer for ClusterTrustBundle type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterTrustBundleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ClusterTrustBundleIndexInformer { + gvr := schema.GroupVersionResource{Group: "certificates.k8s.io", Version: "v1", Resource: "clustertrustbundles"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewTypedSharedIndexInformer[*apicertificatesv1.ClusterTrustBundle](cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.CertificatesV1().ClusterTrustBundles().List(context.Background(), opts) + }, + WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.CertificatesV1().ClusterTrustBundles().Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.CertificatesV1().ClusterTrustBundles().List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.CertificatesV1().ClusterTrustBundles().Watch(ctx, opts) + }, + }, client), + &apicertificatesv1.ClusterTrustBundle{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + )) +} + +func (f *clusterTrustBundleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewTypedClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *clusterTrustBundleInformer) Informer() cache.SharedIndexInformer { + return f.TypedInformer() +} + +func (f *clusterTrustBundleInformer) TypedInformer() ClusterTrustBundleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicertificatesv1.ClusterTrustBundle](f.factory.InformerFor(&apicertificatesv1.ClusterTrustBundle{}, f.defaultInformer)) +} + +func (f *clusterTrustBundleInformer) Lister() certificatesv1.ClusterTrustBundleLister { + return certificatesv1.NewClusterTrustBundleLister(f.Informer().GetIndexer()) +} + +// ToTypedClusterTrustBundleInformer converts an untyped informer into a TypedClusterTrustBundleInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterTrustBundle. If that is not the case, calling type-safe methods of the returned +// TypedClusterTrustBundleInformer leads to runtime panics. A safer alternative is to pass +// around a TypedClusterTrustBundleInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedClusterTrustBundleInformer(informer ClusterTrustBundleInformer) TypedClusterTrustBundleInformer { + if informer, ok := informer.(TypedClusterTrustBundleInformer); ok { + return informer + } + return &clusterTrustBundleTypedInformerAdapter{informer} +} + +type clusterTrustBundleTypedInformerAdapter struct { + ClusterTrustBundleInformer +} + +func (a *clusterTrustBundleTypedInformerAdapter) TypedInformer() ClusterTrustBundleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicertificatesv1.ClusterTrustBundle](a.Informer()) +} + +// ToClusterTrustBundleIndexInformer converts an untyped informer into a ClusterTrustBundleIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterTrustBundle. If that is not the case, calling type-safe methods of the returned +// ClusterTrustBundleIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ClusterTrustBundleIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToClusterTrustBundleIndexInformer(informer cache.SharedIndexInformer) ClusterTrustBundleIndexInformer { + if informer, ok := informer.(ClusterTrustBundleIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicertificatesv1.ClusterTrustBundle](informer) +} diff --git a/vendor/k8s.io/client-go/informers/certificates/v1/interface.go b/vendor/k8s.io/client-go/informers/certificates/v1/interface.go index 91ccfb715d..b0e1ecc608 100644 --- a/vendor/k8s.io/client-go/informers/certificates/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/certificates/v1/interface.go @@ -25,7 +25,11 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // CertificateSigningRequests returns a CertificateSigningRequestInformer. - CertificateSigningRequests() CertificateSigningRequestInformer + CertificateSigningRequests() TypedCertificateSigningRequestInformer + // ClusterTrustBundles returns a ClusterTrustBundleInformer. + ClusterTrustBundles() TypedClusterTrustBundleInformer + // PodCertificateRequests returns a PodCertificateRequestInformer. + PodCertificateRequests() TypedPodCertificateRequestInformer } type version struct { @@ -39,7 +43,17 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// CertificateSigningRequests returns a CertificateSigningRequestInformer. -func (v *version) CertificateSigningRequests() CertificateSigningRequestInformer { +// CertificateSigningRequests returns a TypedCertificateSigningRequestInformer. +func (v *version) CertificateSigningRequests() TypedCertificateSigningRequestInformer { return &certificateSigningRequestInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } + +// ClusterTrustBundles returns a TypedClusterTrustBundleInformer. +func (v *version) ClusterTrustBundles() TypedClusterTrustBundleInformer { + return &clusterTrustBundleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// PodCertificateRequests returns a TypedPodCertificateRequestInformer. +func (v *version) PodCertificateRequests() TypedPodCertificateRequestInformer { + return &podCertificateRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/k8s.io/client-go/informers/certificates/v1/podcertificaterequest.go b/vendor/k8s.io/client-go/informers/certificates/v1/podcertificaterequest.go new file mode 100644 index 0000000000..364740b0db --- /dev/null +++ b/vendor/k8s.io/client-go/informers/certificates/v1/podcertificaterequest.go @@ -0,0 +1,208 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + time "time" + + apicertificatesv1 "k8s.io/api/certificates/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + certificatesv1 "k8s.io/client-go/listers/certificates/v1" + cache "k8s.io/client-go/tools/cache" +) + +// PodCertificateRequestInformer provides access to a shared informer and lister for +// PodCertificateRequests. Prefer using the type-safe variant (see [TypedPodCertificateRequestInformer]). +type PodCertificateRequestInformer interface { + Informer() cache.SharedIndexInformer + Lister() certificatesv1.PodCertificateRequestLister +} + +// TypedPodCertificateRequestInformer provides access to a shared informer and lister for +// PodCertificateRequests, including the type-safe TypedInformer variant. +// It is a superset of PodCertificateRequestInformer. +type TypedPodCertificateRequestInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() PodCertificateRequestIndexInformer + Lister() certificatesv1.PodCertificateRequestLister +} + +// PodCertificateRequestIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type PodCertificateRequestIndexInformer cache.TypedSharedIndexInformer[*apicertificatesv1.PodCertificateRequest] + +// PodCertificateRequestHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for PodCertificateRequest. +type PodCertificateRequestHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicertificatesv1.PodCertificateRequest] + +// PodCertificateRequestDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for PodCertificateRequest. +type PodCertificateRequestDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicertificatesv1.PodCertificateRequest] + +// PodCertificateRequestFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for PodCertificateRequest. +type PodCertificateRequestFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicertificatesv1.PodCertificateRequest] + +// PodCertificateRequestIndexers is a specialization of [cache.TypedIndexers] for PodCertificateRequest. +type PodCertificateRequestIndexers = cache.TypedIndexers[*apicertificatesv1.PodCertificateRequest] + +// DeletedPodCertificateRequest is a specialization of [cache.DeletedObject] for PodCertificateRequest. +type DeletedPodCertificateRequest = cache.DeletedObject[*apicertificatesv1.PodCertificateRequest] + +type podCertificateRequestInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewPodCertificateRequestInformer constructs a new informer for PodCertificateRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPodCertificateRequestInformer]). +func NewPodCertificateRequestInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewPodCertificateRequestInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewTypedPodCertificateRequestInformer constructs a new informer for PodCertificateRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPodCertificateRequestInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers PodCertificateRequestIndexers) PodCertificateRequestIndexInformer { + return NewTypedPodCertificateRequestInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + +// NewFilteredPodCertificateRequestInformer constructs a new informer for PodCertificateRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredPodCertificateRequestInformer]). +func NewFilteredPodCertificateRequestInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewTypedPodCertificateRequestInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredPodCertificateRequestInformer constructs a new informer for PodCertificateRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredPodCertificateRequestInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers PodCertificateRequestIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) PodCertificateRequestIndexInformer { + return NewTypedPodCertificateRequestInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) +} + +// NewPodCertificateRequestInformerWithOptions constructs a new informer for PodCertificateRequest type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPodCertificateRequestInformerWithOptions]). +func NewPodCertificateRequestInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedPodCertificateRequestInformerWithOptions(client, namespace, options) +} + +// NewTypedPodCertificateRequestInformerWithOptions constructs a new informer for PodCertificateRequest type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPodCertificateRequestInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) PodCertificateRequestIndexInformer { + gvr := schema.GroupVersionResource{Group: "certificates.k8s.io", Version: "v1", Resource: "podcertificaterequests"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewTypedSharedIndexInformer[*apicertificatesv1.PodCertificateRequest](cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.CertificatesV1().PodCertificateRequests(namespace).List(context.Background(), opts) + }, + WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.CertificatesV1().PodCertificateRequests(namespace).Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.CertificatesV1().PodCertificateRequests(namespace).List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.CertificatesV1().PodCertificateRequests(namespace).Watch(ctx, opts) + }, + }, client), + &apicertificatesv1.PodCertificateRequest{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + )) +} + +func (f *podCertificateRequestInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewTypedPodCertificateRequestInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *podCertificateRequestInformer) Informer() cache.SharedIndexInformer { + return f.TypedInformer() +} + +func (f *podCertificateRequestInformer) TypedInformer() PodCertificateRequestIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicertificatesv1.PodCertificateRequest](f.factory.InformerFor(&apicertificatesv1.PodCertificateRequest{}, f.defaultInformer)) +} + +func (f *podCertificateRequestInformer) Lister() certificatesv1.PodCertificateRequestLister { + return certificatesv1.NewPodCertificateRequestLister(f.Informer().GetIndexer()) +} + +// ToTypedPodCertificateRequestInformer converts an untyped informer into a TypedPodCertificateRequestInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PodCertificateRequest. If that is not the case, calling type-safe methods of the returned +// TypedPodCertificateRequestInformer leads to runtime panics. A safer alternative is to pass +// around a TypedPodCertificateRequestInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedPodCertificateRequestInformer(informer PodCertificateRequestInformer) TypedPodCertificateRequestInformer { + if informer, ok := informer.(TypedPodCertificateRequestInformer); ok { + return informer + } + return &podCertificateRequestTypedInformerAdapter{informer} +} + +type podCertificateRequestTypedInformerAdapter struct { + PodCertificateRequestInformer +} + +func (a *podCertificateRequestTypedInformerAdapter) TypedInformer() PodCertificateRequestIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicertificatesv1.PodCertificateRequest](a.Informer()) +} + +// ToPodCertificateRequestIndexInformer converts an untyped informer into a PodCertificateRequestIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PodCertificateRequest. If that is not the case, calling type-safe methods of the returned +// PodCertificateRequestIndexInformer leads to runtime panics. A safer alternative is to pass +// around a PodCertificateRequestIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToPodCertificateRequestIndexInformer(informer cache.SharedIndexInformer) PodCertificateRequestIndexInformer { + if informer, ok := informer.(PodCertificateRequestIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicertificatesv1.PodCertificateRequest](informer) +} diff --git a/vendor/k8s.io/client-go/informers/certificates/v1alpha1/clustertrustbundle.go b/vendor/k8s.io/client-go/informers/certificates/v1alpha1/clustertrustbundle.go index 637cfd71da..da71ca3ba0 100644 --- a/vendor/k8s.io/client-go/informers/certificates/v1alpha1/clustertrustbundle.go +++ b/vendor/k8s.io/client-go/informers/certificates/v1alpha1/clustertrustbundle.go @@ -34,12 +34,40 @@ import ( ) // ClusterTrustBundleInformer provides access to a shared informer and lister for -// ClusterTrustBundles. +// ClusterTrustBundles. Prefer using the type-safe variant (see [TypedClusterTrustBundleInformer]). type ClusterTrustBundleInformer interface { Informer() cache.SharedIndexInformer Lister() certificatesv1alpha1.ClusterTrustBundleLister } +// TypedClusterTrustBundleInformer provides access to a shared informer and lister for +// ClusterTrustBundles, including the type-safe TypedInformer variant. +// It is a superset of ClusterTrustBundleInformer. +type TypedClusterTrustBundleInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ClusterTrustBundleIndexInformer + Lister() certificatesv1alpha1.ClusterTrustBundleLister +} + +// ClusterTrustBundleIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ClusterTrustBundleIndexInformer cache.TypedSharedIndexInformer[*apicertificatesv1alpha1.ClusterTrustBundle] + +// ClusterTrustBundleHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ClusterTrustBundle. +type ClusterTrustBundleHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicertificatesv1alpha1.ClusterTrustBundle] + +// ClusterTrustBundleDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ClusterTrustBundle. +type ClusterTrustBundleDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicertificatesv1alpha1.ClusterTrustBundle] + +// ClusterTrustBundleFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ClusterTrustBundle. +type ClusterTrustBundleFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicertificatesv1alpha1.ClusterTrustBundle] + +// ClusterTrustBundleIndexers is a specialization of [cache.TypedIndexers] for ClusterTrustBundle. +type ClusterTrustBundleIndexers = cache.TypedIndexers[*apicertificatesv1alpha1.ClusterTrustBundle] + +// DeletedClusterTrustBundle is a specialization of [cache.DeletedObject] for ClusterTrustBundle. +type DeletedClusterTrustBundle = cache.DeletedObject[*apicertificatesv1alpha1.ClusterTrustBundle] + type clusterTrustBundleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type clusterTrustBundleInformer struct { // NewClusterTrustBundleInformer constructs a new informer for ClusterTrustBundle type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterTrustBundleInformer]). func NewClusterTrustBundleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedClusterTrustBundleInformer constructs a new informer for ClusterTrustBundle type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterTrustBundleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ClusterTrustBundleIndexers) ClusterTrustBundleIndexInformer { + return NewTypedClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredClusterTrustBundleInformer constructs a new informer for ClusterTrustBundle type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredClusterTrustBundleInformer]). func NewFilteredClusterTrustBundleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredClusterTrustBundleInformer constructs a new informer for ClusterTrustBundle type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredClusterTrustBundleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ClusterTrustBundleIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ClusterTrustBundleIndexInformer { + return NewTypedClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewClusterTrustBundleInformerWithOptions constructs a new informer for ClusterTrustBundle type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterTrustBundleInformerWithOptions]). func NewClusterTrustBundleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedClusterTrustBundleInformerWithOptions(client, options) +} + +// NewTypedClusterTrustBundleInformerWithOptions constructs a new informer for ClusterTrustBundle type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterTrustBundleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ClusterTrustBundleIndexInformer { gvr := schema.GroupVersionResource{Group: "certificates.k8s.io", Version: "v1alpha1", Resource: "clustertrustbundles"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicertificatesv1alpha1.ClusterTrustBundle](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewClusterTrustBundleInformerWithOptions(client kubernetes.Interface, optio Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *clusterTrustBundleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *clusterTrustBundleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicertificatesv1alpha1.ClusterTrustBundle{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *clusterTrustBundleInformer) TypedInformer() ClusterTrustBundleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicertificatesv1alpha1.ClusterTrustBundle](f.factory.InformerFor(&apicertificatesv1alpha1.ClusterTrustBundle{}, f.defaultInformer)) } func (f *clusterTrustBundleInformer) Lister() certificatesv1alpha1.ClusterTrustBundleLister { return certificatesv1alpha1.NewClusterTrustBundleLister(f.Informer().GetIndexer()) } + +// ToTypedClusterTrustBundleInformer converts an untyped informer into a TypedClusterTrustBundleInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterTrustBundle. If that is not the case, calling type-safe methods of the returned +// TypedClusterTrustBundleInformer leads to runtime panics. A safer alternative is to pass +// around a TypedClusterTrustBundleInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedClusterTrustBundleInformer(informer ClusterTrustBundleInformer) TypedClusterTrustBundleInformer { + if informer, ok := informer.(TypedClusterTrustBundleInformer); ok { + return informer + } + return &clusterTrustBundleTypedInformerAdapter{informer} +} + +type clusterTrustBundleTypedInformerAdapter struct { + ClusterTrustBundleInformer +} + +func (a *clusterTrustBundleTypedInformerAdapter) TypedInformer() ClusterTrustBundleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicertificatesv1alpha1.ClusterTrustBundle](a.Informer()) +} + +// ToClusterTrustBundleIndexInformer converts an untyped informer into a ClusterTrustBundleIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterTrustBundle. If that is not the case, calling type-safe methods of the returned +// ClusterTrustBundleIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ClusterTrustBundleIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToClusterTrustBundleIndexInformer(informer cache.SharedIndexInformer) ClusterTrustBundleIndexInformer { + if informer, ok := informer.(ClusterTrustBundleIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicertificatesv1alpha1.ClusterTrustBundle](informer) +} diff --git a/vendor/k8s.io/client-go/informers/certificates/v1alpha1/interface.go b/vendor/k8s.io/client-go/informers/certificates/v1alpha1/interface.go index 40ce8f42db..8741155be8 100644 --- a/vendor/k8s.io/client-go/informers/certificates/v1alpha1/interface.go +++ b/vendor/k8s.io/client-go/informers/certificates/v1alpha1/interface.go @@ -25,7 +25,7 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // ClusterTrustBundles returns a ClusterTrustBundleInformer. - ClusterTrustBundles() ClusterTrustBundleInformer + ClusterTrustBundles() TypedClusterTrustBundleInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// ClusterTrustBundles returns a ClusterTrustBundleInformer. -func (v *version) ClusterTrustBundles() ClusterTrustBundleInformer { +// ClusterTrustBundles returns a TypedClusterTrustBundleInformer. +func (v *version) ClusterTrustBundles() TypedClusterTrustBundleInformer { return &clusterTrustBundleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go b/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go index 4d4408d906..bac26740ba 100644 --- a/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go +++ b/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go @@ -34,12 +34,40 @@ import ( ) // CertificateSigningRequestInformer provides access to a shared informer and lister for -// CertificateSigningRequests. +// CertificateSigningRequests. Prefer using the type-safe variant (see [TypedCertificateSigningRequestInformer]). type CertificateSigningRequestInformer interface { Informer() cache.SharedIndexInformer Lister() certificatesv1beta1.CertificateSigningRequestLister } +// TypedCertificateSigningRequestInformer provides access to a shared informer and lister for +// CertificateSigningRequests, including the type-safe TypedInformer variant. +// It is a superset of CertificateSigningRequestInformer. +type TypedCertificateSigningRequestInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CertificateSigningRequestIndexInformer + Lister() certificatesv1beta1.CertificateSigningRequestLister +} + +// CertificateSigningRequestIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CertificateSigningRequestIndexInformer cache.TypedSharedIndexInformer[*apicertificatesv1beta1.CertificateSigningRequest] + +// CertificateSigningRequestHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CertificateSigningRequest. +type CertificateSigningRequestHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicertificatesv1beta1.CertificateSigningRequest] + +// CertificateSigningRequestDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CertificateSigningRequest. +type CertificateSigningRequestDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicertificatesv1beta1.CertificateSigningRequest] + +// CertificateSigningRequestFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CertificateSigningRequest. +type CertificateSigningRequestFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicertificatesv1beta1.CertificateSigningRequest] + +// CertificateSigningRequestIndexers is a specialization of [cache.TypedIndexers] for CertificateSigningRequest. +type CertificateSigningRequestIndexers = cache.TypedIndexers[*apicertificatesv1beta1.CertificateSigningRequest] + +// DeletedCertificateSigningRequest is a specialization of [cache.DeletedObject] for CertificateSigningRequest. +type DeletedCertificateSigningRequest = cache.DeletedObject[*apicertificatesv1beta1.CertificateSigningRequest] + type certificateSigningRequestInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type certificateSigningRequestInformer struct { // NewCertificateSigningRequestInformer constructs a new informer for CertificateSigningRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCertificateSigningRequestInformer]). func NewCertificateSigningRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewCertificateSigningRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedCertificateSigningRequestInformer constructs a new informer for CertificateSigningRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCertificateSigningRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers CertificateSigningRequestIndexers) CertificateSigningRequestIndexInformer { + return NewTypedCertificateSigningRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredCertificateSigningRequestInformer constructs a new informer for CertificateSigningRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCertificateSigningRequestInformer]). func NewFilteredCertificateSigningRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewCertificateSigningRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedCertificateSigningRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCertificateSigningRequestInformer constructs a new informer for CertificateSigningRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredCertificateSigningRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers CertificateSigningRequestIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CertificateSigningRequestIndexInformer { + return NewTypedCertificateSigningRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewCertificateSigningRequestInformerWithOptions constructs a new informer for CertificateSigningRequest type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCertificateSigningRequestInformerWithOptions]). func NewCertificateSigningRequestInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCertificateSigningRequestInformerWithOptions(client, options) +} + +// NewTypedCertificateSigningRequestInformerWithOptions constructs a new informer for CertificateSigningRequest type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCertificateSigningRequestInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) CertificateSigningRequestIndexInformer { gvr := schema.GroupVersionResource{Group: "certificates.k8s.io", Version: "v1beta1", Resource: "certificatesigningrequests"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicertificatesv1beta1.CertificateSigningRequest](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewCertificateSigningRequestInformerWithOptions(client kubernetes.Interface Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *certificateSigningRequestInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewCertificateSigningRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedCertificateSigningRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *certificateSigningRequestInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicertificatesv1beta1.CertificateSigningRequest{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *certificateSigningRequestInformer) TypedInformer() CertificateSigningRequestIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicertificatesv1beta1.CertificateSigningRequest](f.factory.InformerFor(&apicertificatesv1beta1.CertificateSigningRequest{}, f.defaultInformer)) } func (f *certificateSigningRequestInformer) Lister() certificatesv1beta1.CertificateSigningRequestLister { return certificatesv1beta1.NewCertificateSigningRequestLister(f.Informer().GetIndexer()) } + +// ToTypedCertificateSigningRequestInformer converts an untyped informer into a TypedCertificateSigningRequestInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CertificateSigningRequest. If that is not the case, calling type-safe methods of the returned +// TypedCertificateSigningRequestInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCertificateSigningRequestInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCertificateSigningRequestInformer(informer CertificateSigningRequestInformer) TypedCertificateSigningRequestInformer { + if informer, ok := informer.(TypedCertificateSigningRequestInformer); ok { + return informer + } + return &certificateSigningRequestTypedInformerAdapter{informer} +} + +type certificateSigningRequestTypedInformerAdapter struct { + CertificateSigningRequestInformer +} + +func (a *certificateSigningRequestTypedInformerAdapter) TypedInformer() CertificateSigningRequestIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicertificatesv1beta1.CertificateSigningRequest](a.Informer()) +} + +// ToCertificateSigningRequestIndexInformer converts an untyped informer into a CertificateSigningRequestIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CertificateSigningRequest. If that is not the case, calling type-safe methods of the returned +// CertificateSigningRequestIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CertificateSigningRequestIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCertificateSigningRequestIndexInformer(informer cache.SharedIndexInformer) CertificateSigningRequestIndexInformer { + if informer, ok := informer.(CertificateSigningRequestIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicertificatesv1beta1.CertificateSigningRequest](informer) +} diff --git a/vendor/k8s.io/client-go/informers/certificates/v1beta1/clustertrustbundle.go b/vendor/k8s.io/client-go/informers/certificates/v1beta1/clustertrustbundle.go index f665d0b739..4415e589a2 100644 --- a/vendor/k8s.io/client-go/informers/certificates/v1beta1/clustertrustbundle.go +++ b/vendor/k8s.io/client-go/informers/certificates/v1beta1/clustertrustbundle.go @@ -34,12 +34,40 @@ import ( ) // ClusterTrustBundleInformer provides access to a shared informer and lister for -// ClusterTrustBundles. +// ClusterTrustBundles. Prefer using the type-safe variant (see [TypedClusterTrustBundleInformer]). type ClusterTrustBundleInformer interface { Informer() cache.SharedIndexInformer Lister() certificatesv1beta1.ClusterTrustBundleLister } +// TypedClusterTrustBundleInformer provides access to a shared informer and lister for +// ClusterTrustBundles, including the type-safe TypedInformer variant. +// It is a superset of ClusterTrustBundleInformer. +type TypedClusterTrustBundleInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ClusterTrustBundleIndexInformer + Lister() certificatesv1beta1.ClusterTrustBundleLister +} + +// ClusterTrustBundleIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ClusterTrustBundleIndexInformer cache.TypedSharedIndexInformer[*apicertificatesv1beta1.ClusterTrustBundle] + +// ClusterTrustBundleHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ClusterTrustBundle. +type ClusterTrustBundleHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicertificatesv1beta1.ClusterTrustBundle] + +// ClusterTrustBundleDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ClusterTrustBundle. +type ClusterTrustBundleDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicertificatesv1beta1.ClusterTrustBundle] + +// ClusterTrustBundleFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ClusterTrustBundle. +type ClusterTrustBundleFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicertificatesv1beta1.ClusterTrustBundle] + +// ClusterTrustBundleIndexers is a specialization of [cache.TypedIndexers] for ClusterTrustBundle. +type ClusterTrustBundleIndexers = cache.TypedIndexers[*apicertificatesv1beta1.ClusterTrustBundle] + +// DeletedClusterTrustBundle is a specialization of [cache.DeletedObject] for ClusterTrustBundle. +type DeletedClusterTrustBundle = cache.DeletedObject[*apicertificatesv1beta1.ClusterTrustBundle] + type clusterTrustBundleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type clusterTrustBundleInformer struct { // NewClusterTrustBundleInformer constructs a new informer for ClusterTrustBundle type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterTrustBundleInformer]). func NewClusterTrustBundleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedClusterTrustBundleInformer constructs a new informer for ClusterTrustBundle type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterTrustBundleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ClusterTrustBundleIndexers) ClusterTrustBundleIndexInformer { + return NewTypedClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredClusterTrustBundleInformer constructs a new informer for ClusterTrustBundle type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredClusterTrustBundleInformer]). func NewFilteredClusterTrustBundleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredClusterTrustBundleInformer constructs a new informer for ClusterTrustBundle type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredClusterTrustBundleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ClusterTrustBundleIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ClusterTrustBundleIndexInformer { + return NewTypedClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewClusterTrustBundleInformerWithOptions constructs a new informer for ClusterTrustBundle type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterTrustBundleInformerWithOptions]). func NewClusterTrustBundleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedClusterTrustBundleInformerWithOptions(client, options) +} + +// NewTypedClusterTrustBundleInformerWithOptions constructs a new informer for ClusterTrustBundle type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterTrustBundleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ClusterTrustBundleIndexInformer { gvr := schema.GroupVersionResource{Group: "certificates.k8s.io", Version: "v1beta1", Resource: "clustertrustbundles"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicertificatesv1beta1.ClusterTrustBundle](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewClusterTrustBundleInformerWithOptions(client kubernetes.Interface, optio Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *clusterTrustBundleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedClusterTrustBundleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *clusterTrustBundleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicertificatesv1beta1.ClusterTrustBundle{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *clusterTrustBundleInformer) TypedInformer() ClusterTrustBundleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicertificatesv1beta1.ClusterTrustBundle](f.factory.InformerFor(&apicertificatesv1beta1.ClusterTrustBundle{}, f.defaultInformer)) } func (f *clusterTrustBundleInformer) Lister() certificatesv1beta1.ClusterTrustBundleLister { return certificatesv1beta1.NewClusterTrustBundleLister(f.Informer().GetIndexer()) } + +// ToTypedClusterTrustBundleInformer converts an untyped informer into a TypedClusterTrustBundleInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterTrustBundle. If that is not the case, calling type-safe methods of the returned +// TypedClusterTrustBundleInformer leads to runtime panics. A safer alternative is to pass +// around a TypedClusterTrustBundleInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedClusterTrustBundleInformer(informer ClusterTrustBundleInformer) TypedClusterTrustBundleInformer { + if informer, ok := informer.(TypedClusterTrustBundleInformer); ok { + return informer + } + return &clusterTrustBundleTypedInformerAdapter{informer} +} + +type clusterTrustBundleTypedInformerAdapter struct { + ClusterTrustBundleInformer +} + +func (a *clusterTrustBundleTypedInformerAdapter) TypedInformer() ClusterTrustBundleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicertificatesv1beta1.ClusterTrustBundle](a.Informer()) +} + +// ToClusterTrustBundleIndexInformer converts an untyped informer into a ClusterTrustBundleIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterTrustBundle. If that is not the case, calling type-safe methods of the returned +// ClusterTrustBundleIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ClusterTrustBundleIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToClusterTrustBundleIndexInformer(informer cache.SharedIndexInformer) ClusterTrustBundleIndexInformer { + if informer, ok := informer.(ClusterTrustBundleIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicertificatesv1beta1.ClusterTrustBundle](informer) +} diff --git a/vendor/k8s.io/client-go/informers/certificates/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/certificates/v1beta1/interface.go index b2d39e2068..95bce3fa3b 100644 --- a/vendor/k8s.io/client-go/informers/certificates/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/certificates/v1beta1/interface.go @@ -25,11 +25,11 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // CertificateSigningRequests returns a CertificateSigningRequestInformer. - CertificateSigningRequests() CertificateSigningRequestInformer + CertificateSigningRequests() TypedCertificateSigningRequestInformer // ClusterTrustBundles returns a ClusterTrustBundleInformer. - ClusterTrustBundles() ClusterTrustBundleInformer + ClusterTrustBundles() TypedClusterTrustBundleInformer // PodCertificateRequests returns a PodCertificateRequestInformer. - PodCertificateRequests() PodCertificateRequestInformer + PodCertificateRequests() TypedPodCertificateRequestInformer } type version struct { @@ -43,17 +43,17 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// CertificateSigningRequests returns a CertificateSigningRequestInformer. -func (v *version) CertificateSigningRequests() CertificateSigningRequestInformer { +// CertificateSigningRequests returns a TypedCertificateSigningRequestInformer. +func (v *version) CertificateSigningRequests() TypedCertificateSigningRequestInformer { return &certificateSigningRequestInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ClusterTrustBundles returns a ClusterTrustBundleInformer. -func (v *version) ClusterTrustBundles() ClusterTrustBundleInformer { +// ClusterTrustBundles returns a TypedClusterTrustBundleInformer. +func (v *version) ClusterTrustBundles() TypedClusterTrustBundleInformer { return &clusterTrustBundleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// PodCertificateRequests returns a PodCertificateRequestInformer. -func (v *version) PodCertificateRequests() PodCertificateRequestInformer { +// PodCertificateRequests returns a TypedPodCertificateRequestInformer. +func (v *version) PodCertificateRequests() TypedPodCertificateRequestInformer { return &podCertificateRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/certificates/v1beta1/podcertificaterequest.go b/vendor/k8s.io/client-go/informers/certificates/v1beta1/podcertificaterequest.go index 03f7816cfd..546a8a3eae 100644 --- a/vendor/k8s.io/client-go/informers/certificates/v1beta1/podcertificaterequest.go +++ b/vendor/k8s.io/client-go/informers/certificates/v1beta1/podcertificaterequest.go @@ -34,12 +34,40 @@ import ( ) // PodCertificateRequestInformer provides access to a shared informer and lister for -// PodCertificateRequests. +// PodCertificateRequests. Prefer using the type-safe variant (see [TypedPodCertificateRequestInformer]). type PodCertificateRequestInformer interface { Informer() cache.SharedIndexInformer Lister() certificatesv1beta1.PodCertificateRequestLister } +// TypedPodCertificateRequestInformer provides access to a shared informer and lister for +// PodCertificateRequests, including the type-safe TypedInformer variant. +// It is a superset of PodCertificateRequestInformer. +type TypedPodCertificateRequestInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() PodCertificateRequestIndexInformer + Lister() certificatesv1beta1.PodCertificateRequestLister +} + +// PodCertificateRequestIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type PodCertificateRequestIndexInformer cache.TypedSharedIndexInformer[*apicertificatesv1beta1.PodCertificateRequest] + +// PodCertificateRequestHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for PodCertificateRequest. +type PodCertificateRequestHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicertificatesv1beta1.PodCertificateRequest] + +// PodCertificateRequestDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for PodCertificateRequest. +type PodCertificateRequestDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicertificatesv1beta1.PodCertificateRequest] + +// PodCertificateRequestFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for PodCertificateRequest. +type PodCertificateRequestFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicertificatesv1beta1.PodCertificateRequest] + +// PodCertificateRequestIndexers is a specialization of [cache.TypedIndexers] for PodCertificateRequest. +type PodCertificateRequestIndexers = cache.TypedIndexers[*apicertificatesv1beta1.PodCertificateRequest] + +// DeletedPodCertificateRequest is a specialization of [cache.DeletedObject] for PodCertificateRequest. +type DeletedPodCertificateRequest = cache.DeletedObject[*apicertificatesv1beta1.PodCertificateRequest] + type podCertificateRequestInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type podCertificateRequestInformer struct { // NewPodCertificateRequestInformer constructs a new informer for PodCertificateRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPodCertificateRequestInformer]). func NewPodCertificateRequestInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewPodCertificateRequestInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedPodCertificateRequestInformer constructs a new informer for PodCertificateRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPodCertificateRequestInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers PodCertificateRequestIndexers) PodCertificateRequestIndexInformer { + return NewTypedPodCertificateRequestInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredPodCertificateRequestInformer constructs a new informer for PodCertificateRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredPodCertificateRequestInformer]). func NewFilteredPodCertificateRequestInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewPodCertificateRequestInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedPodCertificateRequestInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredPodCertificateRequestInformer constructs a new informer for PodCertificateRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredPodCertificateRequestInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers PodCertificateRequestIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) PodCertificateRequestIndexInformer { + return NewTypedPodCertificateRequestInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewPodCertificateRequestInformerWithOptions constructs a new informer for PodCertificateRequest type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPodCertificateRequestInformerWithOptions]). func NewPodCertificateRequestInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedPodCertificateRequestInformerWithOptions(client, namespace, options) +} + +// NewTypedPodCertificateRequestInformerWithOptions constructs a new informer for PodCertificateRequest type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPodCertificateRequestInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) PodCertificateRequestIndexInformer { gvr := schema.GroupVersionResource{Group: "certificates.k8s.io", Version: "v1beta1", Resource: "podcertificaterequests"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicertificatesv1beta1.PodCertificateRequest](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewPodCertificateRequestInformerWithOptions(client kubernetes.Interface, na Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *podCertificateRequestInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewPodCertificateRequestInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedPodCertificateRequestInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *podCertificateRequestInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicertificatesv1beta1.PodCertificateRequest{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *podCertificateRequestInformer) TypedInformer() PodCertificateRequestIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicertificatesv1beta1.PodCertificateRequest](f.factory.InformerFor(&apicertificatesv1beta1.PodCertificateRequest{}, f.defaultInformer)) } func (f *podCertificateRequestInformer) Lister() certificatesv1beta1.PodCertificateRequestLister { return certificatesv1beta1.NewPodCertificateRequestLister(f.Informer().GetIndexer()) } + +// ToTypedPodCertificateRequestInformer converts an untyped informer into a TypedPodCertificateRequestInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PodCertificateRequest. If that is not the case, calling type-safe methods of the returned +// TypedPodCertificateRequestInformer leads to runtime panics. A safer alternative is to pass +// around a TypedPodCertificateRequestInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedPodCertificateRequestInformer(informer PodCertificateRequestInformer) TypedPodCertificateRequestInformer { + if informer, ok := informer.(TypedPodCertificateRequestInformer); ok { + return informer + } + return &podCertificateRequestTypedInformerAdapter{informer} +} + +type podCertificateRequestTypedInformerAdapter struct { + PodCertificateRequestInformer +} + +func (a *podCertificateRequestTypedInformerAdapter) TypedInformer() PodCertificateRequestIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicertificatesv1beta1.PodCertificateRequest](a.Informer()) +} + +// ToPodCertificateRequestIndexInformer converts an untyped informer into a PodCertificateRequestIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PodCertificateRequest. If that is not the case, calling type-safe methods of the returned +// PodCertificateRequestIndexInformer leads to runtime panics. A safer alternative is to pass +// around a PodCertificateRequestIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToPodCertificateRequestIndexInformer(informer cache.SharedIndexInformer) PodCertificateRequestIndexInformer { + if informer, ok := informer.(PodCertificateRequestIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicertificatesv1beta1.PodCertificateRequest](informer) +} diff --git a/vendor/k8s.io/client-go/informers/coordination/v1/interface.go b/vendor/k8s.io/client-go/informers/coordination/v1/interface.go index 05c4acbef8..9451e71256 100644 --- a/vendor/k8s.io/client-go/informers/coordination/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/coordination/v1/interface.go @@ -25,7 +25,7 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // Leases returns a LeaseInformer. - Leases() LeaseInformer + Leases() TypedLeaseInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// Leases returns a LeaseInformer. -func (v *version) Leases() LeaseInformer { +// Leases returns a TypedLeaseInformer. +func (v *version) Leases() TypedLeaseInformer { return &leaseInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/coordination/v1/lease.go b/vendor/k8s.io/client-go/informers/coordination/v1/lease.go index cce8ab4d13..feec290441 100644 --- a/vendor/k8s.io/client-go/informers/coordination/v1/lease.go +++ b/vendor/k8s.io/client-go/informers/coordination/v1/lease.go @@ -34,12 +34,40 @@ import ( ) // LeaseInformer provides access to a shared informer and lister for -// Leases. +// Leases. Prefer using the type-safe variant (see [TypedLeaseInformer]). type LeaseInformer interface { Informer() cache.SharedIndexInformer Lister() coordinationv1.LeaseLister } +// TypedLeaseInformer provides access to a shared informer and lister for +// Leases, including the type-safe TypedInformer variant. +// It is a superset of LeaseInformer. +type TypedLeaseInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() LeaseIndexInformer + Lister() coordinationv1.LeaseLister +} + +// LeaseIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type LeaseIndexInformer cache.TypedSharedIndexInformer[*apicoordinationv1.Lease] + +// LeaseHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Lease. +type LeaseHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicoordinationv1.Lease] + +// LeaseDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Lease. +type LeaseDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicoordinationv1.Lease] + +// LeaseFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Lease. +type LeaseFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicoordinationv1.Lease] + +// LeaseIndexers is a specialization of [cache.TypedIndexers] for Lease. +type LeaseIndexers = cache.TypedIndexers[*apicoordinationv1.Lease] + +// DeletedLease is a specialization of [cache.DeletedObject] for Lease. +type DeletedLease = cache.DeletedObject[*apicoordinationv1.Lease] + type leaseInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type leaseInformer struct { // NewLeaseInformer constructs a new informer for Lease type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedLeaseInformer]). func NewLeaseInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewLeaseInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedLeaseInformer constructs a new informer for Lease type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedLeaseInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers LeaseIndexers) LeaseIndexInformer { + return NewTypedLeaseInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredLeaseInformer constructs a new informer for Lease type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredLeaseInformer]). func NewFilteredLeaseInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewLeaseInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedLeaseInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredLeaseInformer constructs a new informer for Lease type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredLeaseInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers LeaseIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) LeaseIndexInformer { + return NewTypedLeaseInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewLeaseInformerWithOptions constructs a new informer for Lease type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedLeaseInformerWithOptions]). func NewLeaseInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedLeaseInformerWithOptions(client, namespace, options) +} + +// NewTypedLeaseInformerWithOptions constructs a new informer for Lease type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedLeaseInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) LeaseIndexInformer { gvr := schema.GroupVersionResource{Group: "coordination.k8s.io", Version: "v1", Resource: "leases"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicoordinationv1.Lease](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewLeaseInformerWithOptions(client kubernetes.Interface, namespace string, Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *leaseInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewLeaseInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedLeaseInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *leaseInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicoordinationv1.Lease{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *leaseInformer) TypedInformer() LeaseIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicoordinationv1.Lease](f.factory.InformerFor(&apicoordinationv1.Lease{}, f.defaultInformer)) } func (f *leaseInformer) Lister() coordinationv1.LeaseLister { return coordinationv1.NewLeaseLister(f.Informer().GetIndexer()) } + +// ToTypedLeaseInformer converts an untyped informer into a TypedLeaseInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Lease. If that is not the case, calling type-safe methods of the returned +// TypedLeaseInformer leads to runtime panics. A safer alternative is to pass +// around a TypedLeaseInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedLeaseInformer(informer LeaseInformer) TypedLeaseInformer { + if informer, ok := informer.(TypedLeaseInformer); ok { + return informer + } + return &leaseTypedInformerAdapter{informer} +} + +type leaseTypedInformerAdapter struct { + LeaseInformer +} + +func (a *leaseTypedInformerAdapter) TypedInformer() LeaseIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicoordinationv1.Lease](a.Informer()) +} + +// ToLeaseIndexInformer converts an untyped informer into a LeaseIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Lease. If that is not the case, calling type-safe methods of the returned +// LeaseIndexInformer leads to runtime panics. A safer alternative is to pass +// around a LeaseIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToLeaseIndexInformer(informer cache.SharedIndexInformer) LeaseIndexInformer { + if informer, ok := informer.(LeaseIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicoordinationv1.Lease](informer) +} diff --git a/vendor/k8s.io/client-go/informers/coordination/v1alpha2/interface.go b/vendor/k8s.io/client-go/informers/coordination/v1alpha2/interface.go index ba83768ade..13aea61e78 100644 --- a/vendor/k8s.io/client-go/informers/coordination/v1alpha2/interface.go +++ b/vendor/k8s.io/client-go/informers/coordination/v1alpha2/interface.go @@ -25,7 +25,7 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // LeaseCandidates returns a LeaseCandidateInformer. - LeaseCandidates() LeaseCandidateInformer + LeaseCandidates() TypedLeaseCandidateInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// LeaseCandidates returns a LeaseCandidateInformer. -func (v *version) LeaseCandidates() LeaseCandidateInformer { +// LeaseCandidates returns a TypedLeaseCandidateInformer. +func (v *version) LeaseCandidates() TypedLeaseCandidateInformer { return &leaseCandidateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/coordination/v1alpha2/leasecandidate.go b/vendor/k8s.io/client-go/informers/coordination/v1alpha2/leasecandidate.go index 5aa0ff3ae2..55071de0f8 100644 --- a/vendor/k8s.io/client-go/informers/coordination/v1alpha2/leasecandidate.go +++ b/vendor/k8s.io/client-go/informers/coordination/v1alpha2/leasecandidate.go @@ -34,12 +34,40 @@ import ( ) // LeaseCandidateInformer provides access to a shared informer and lister for -// LeaseCandidates. +// LeaseCandidates. Prefer using the type-safe variant (see [TypedLeaseCandidateInformer]). type LeaseCandidateInformer interface { Informer() cache.SharedIndexInformer Lister() coordinationv1alpha2.LeaseCandidateLister } +// TypedLeaseCandidateInformer provides access to a shared informer and lister for +// LeaseCandidates, including the type-safe TypedInformer variant. +// It is a superset of LeaseCandidateInformer. +type TypedLeaseCandidateInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() LeaseCandidateIndexInformer + Lister() coordinationv1alpha2.LeaseCandidateLister +} + +// LeaseCandidateIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type LeaseCandidateIndexInformer cache.TypedSharedIndexInformer[*apicoordinationv1alpha2.LeaseCandidate] + +// LeaseCandidateHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for LeaseCandidate. +type LeaseCandidateHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicoordinationv1alpha2.LeaseCandidate] + +// LeaseCandidateDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for LeaseCandidate. +type LeaseCandidateDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicoordinationv1alpha2.LeaseCandidate] + +// LeaseCandidateFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for LeaseCandidate. +type LeaseCandidateFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicoordinationv1alpha2.LeaseCandidate] + +// LeaseCandidateIndexers is a specialization of [cache.TypedIndexers] for LeaseCandidate. +type LeaseCandidateIndexers = cache.TypedIndexers[*apicoordinationv1alpha2.LeaseCandidate] + +// DeletedLeaseCandidate is a specialization of [cache.DeletedObject] for LeaseCandidate. +type DeletedLeaseCandidate = cache.DeletedObject[*apicoordinationv1alpha2.LeaseCandidate] + type leaseCandidateInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type leaseCandidateInformer struct { // NewLeaseCandidateInformer constructs a new informer for LeaseCandidate type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedLeaseCandidateInformer]). func NewLeaseCandidateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewLeaseCandidateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedLeaseCandidateInformer constructs a new informer for LeaseCandidate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedLeaseCandidateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers LeaseCandidateIndexers) LeaseCandidateIndexInformer { + return NewTypedLeaseCandidateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredLeaseCandidateInformer constructs a new informer for LeaseCandidate type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredLeaseCandidateInformer]). func NewFilteredLeaseCandidateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewLeaseCandidateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedLeaseCandidateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredLeaseCandidateInformer constructs a new informer for LeaseCandidate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredLeaseCandidateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers LeaseCandidateIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) LeaseCandidateIndexInformer { + return NewTypedLeaseCandidateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewLeaseCandidateInformerWithOptions constructs a new informer for LeaseCandidate type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedLeaseCandidateInformerWithOptions]). func NewLeaseCandidateInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedLeaseCandidateInformerWithOptions(client, namespace, options) +} + +// NewTypedLeaseCandidateInformerWithOptions constructs a new informer for LeaseCandidate type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedLeaseCandidateInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) LeaseCandidateIndexInformer { gvr := schema.GroupVersionResource{Group: "coordination.k8s.io", Version: "v1alpha2", Resource: "leasecandidates"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicoordinationv1alpha2.LeaseCandidate](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewLeaseCandidateInformerWithOptions(client kubernetes.Interface, namespace Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *leaseCandidateInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewLeaseCandidateInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedLeaseCandidateInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *leaseCandidateInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicoordinationv1alpha2.LeaseCandidate{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *leaseCandidateInformer) TypedInformer() LeaseCandidateIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicoordinationv1alpha2.LeaseCandidate](f.factory.InformerFor(&apicoordinationv1alpha2.LeaseCandidate{}, f.defaultInformer)) } func (f *leaseCandidateInformer) Lister() coordinationv1alpha2.LeaseCandidateLister { return coordinationv1alpha2.NewLeaseCandidateLister(f.Informer().GetIndexer()) } + +// ToTypedLeaseCandidateInformer converts an untyped informer into a TypedLeaseCandidateInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *LeaseCandidate. If that is not the case, calling type-safe methods of the returned +// TypedLeaseCandidateInformer leads to runtime panics. A safer alternative is to pass +// around a TypedLeaseCandidateInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedLeaseCandidateInformer(informer LeaseCandidateInformer) TypedLeaseCandidateInformer { + if informer, ok := informer.(TypedLeaseCandidateInformer); ok { + return informer + } + return &leaseCandidateTypedInformerAdapter{informer} +} + +type leaseCandidateTypedInformerAdapter struct { + LeaseCandidateInformer +} + +func (a *leaseCandidateTypedInformerAdapter) TypedInformer() LeaseCandidateIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicoordinationv1alpha2.LeaseCandidate](a.Informer()) +} + +// ToLeaseCandidateIndexInformer converts an untyped informer into a LeaseCandidateIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *LeaseCandidate. If that is not the case, calling type-safe methods of the returned +// LeaseCandidateIndexInformer leads to runtime panics. A safer alternative is to pass +// around a LeaseCandidateIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToLeaseCandidateIndexInformer(informer cache.SharedIndexInformer) LeaseCandidateIndexInformer { + if informer, ok := informer.(LeaseCandidateIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicoordinationv1alpha2.LeaseCandidate](informer) +} diff --git a/vendor/k8s.io/client-go/informers/coordination/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/coordination/v1beta1/interface.go index 707e510869..41af125913 100644 --- a/vendor/k8s.io/client-go/informers/coordination/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/coordination/v1beta1/interface.go @@ -25,9 +25,9 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // Leases returns a LeaseInformer. - Leases() LeaseInformer + Leases() TypedLeaseInformer // LeaseCandidates returns a LeaseCandidateInformer. - LeaseCandidates() LeaseCandidateInformer + LeaseCandidates() TypedLeaseCandidateInformer } type version struct { @@ -41,12 +41,12 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// Leases returns a LeaseInformer. -func (v *version) Leases() LeaseInformer { +// Leases returns a TypedLeaseInformer. +func (v *version) Leases() TypedLeaseInformer { return &leaseInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// LeaseCandidates returns a LeaseCandidateInformer. -func (v *version) LeaseCandidates() LeaseCandidateInformer { +// LeaseCandidates returns a TypedLeaseCandidateInformer. +func (v *version) LeaseCandidates() TypedLeaseCandidateInformer { return &leaseCandidateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/coordination/v1beta1/lease.go b/vendor/k8s.io/client-go/informers/coordination/v1beta1/lease.go index 66802fd949..458e2ce48d 100644 --- a/vendor/k8s.io/client-go/informers/coordination/v1beta1/lease.go +++ b/vendor/k8s.io/client-go/informers/coordination/v1beta1/lease.go @@ -34,12 +34,40 @@ import ( ) // LeaseInformer provides access to a shared informer and lister for -// Leases. +// Leases. Prefer using the type-safe variant (see [TypedLeaseInformer]). type LeaseInformer interface { Informer() cache.SharedIndexInformer Lister() coordinationv1beta1.LeaseLister } +// TypedLeaseInformer provides access to a shared informer and lister for +// Leases, including the type-safe TypedInformer variant. +// It is a superset of LeaseInformer. +type TypedLeaseInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() LeaseIndexInformer + Lister() coordinationv1beta1.LeaseLister +} + +// LeaseIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type LeaseIndexInformer cache.TypedSharedIndexInformer[*apicoordinationv1beta1.Lease] + +// LeaseHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Lease. +type LeaseHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicoordinationv1beta1.Lease] + +// LeaseDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Lease. +type LeaseDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicoordinationv1beta1.Lease] + +// LeaseFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Lease. +type LeaseFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicoordinationv1beta1.Lease] + +// LeaseIndexers is a specialization of [cache.TypedIndexers] for Lease. +type LeaseIndexers = cache.TypedIndexers[*apicoordinationv1beta1.Lease] + +// DeletedLease is a specialization of [cache.DeletedObject] for Lease. +type DeletedLease = cache.DeletedObject[*apicoordinationv1beta1.Lease] + type leaseInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type leaseInformer struct { // NewLeaseInformer constructs a new informer for Lease type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedLeaseInformer]). func NewLeaseInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewLeaseInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedLeaseInformer constructs a new informer for Lease type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedLeaseInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers LeaseIndexers) LeaseIndexInformer { + return NewTypedLeaseInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredLeaseInformer constructs a new informer for Lease type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredLeaseInformer]). func NewFilteredLeaseInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewLeaseInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedLeaseInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredLeaseInformer constructs a new informer for Lease type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredLeaseInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers LeaseIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) LeaseIndexInformer { + return NewTypedLeaseInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewLeaseInformerWithOptions constructs a new informer for Lease type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedLeaseInformerWithOptions]). func NewLeaseInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedLeaseInformerWithOptions(client, namespace, options) +} + +// NewTypedLeaseInformerWithOptions constructs a new informer for Lease type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedLeaseInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) LeaseIndexInformer { gvr := schema.GroupVersionResource{Group: "coordination.k8s.io", Version: "v1beta1", Resource: "leases"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicoordinationv1beta1.Lease](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewLeaseInformerWithOptions(client kubernetes.Interface, namespace string, Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *leaseInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewLeaseInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedLeaseInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *leaseInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicoordinationv1beta1.Lease{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *leaseInformer) TypedInformer() LeaseIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicoordinationv1beta1.Lease](f.factory.InformerFor(&apicoordinationv1beta1.Lease{}, f.defaultInformer)) } func (f *leaseInformer) Lister() coordinationv1beta1.LeaseLister { return coordinationv1beta1.NewLeaseLister(f.Informer().GetIndexer()) } + +// ToTypedLeaseInformer converts an untyped informer into a TypedLeaseInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Lease. If that is not the case, calling type-safe methods of the returned +// TypedLeaseInformer leads to runtime panics. A safer alternative is to pass +// around a TypedLeaseInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedLeaseInformer(informer LeaseInformer) TypedLeaseInformer { + if informer, ok := informer.(TypedLeaseInformer); ok { + return informer + } + return &leaseTypedInformerAdapter{informer} +} + +type leaseTypedInformerAdapter struct { + LeaseInformer +} + +func (a *leaseTypedInformerAdapter) TypedInformer() LeaseIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicoordinationv1beta1.Lease](a.Informer()) +} + +// ToLeaseIndexInformer converts an untyped informer into a LeaseIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Lease. If that is not the case, calling type-safe methods of the returned +// LeaseIndexInformer leads to runtime panics. A safer alternative is to pass +// around a LeaseIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToLeaseIndexInformer(informer cache.SharedIndexInformer) LeaseIndexInformer { + if informer, ok := informer.(LeaseIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicoordinationv1beta1.Lease](informer) +} diff --git a/vendor/k8s.io/client-go/informers/coordination/v1beta1/leasecandidate.go b/vendor/k8s.io/client-go/informers/coordination/v1beta1/leasecandidate.go index ee83397f4c..05cdf9a82f 100644 --- a/vendor/k8s.io/client-go/informers/coordination/v1beta1/leasecandidate.go +++ b/vendor/k8s.io/client-go/informers/coordination/v1beta1/leasecandidate.go @@ -34,12 +34,40 @@ import ( ) // LeaseCandidateInformer provides access to a shared informer and lister for -// LeaseCandidates. +// LeaseCandidates. Prefer using the type-safe variant (see [TypedLeaseCandidateInformer]). type LeaseCandidateInformer interface { Informer() cache.SharedIndexInformer Lister() coordinationv1beta1.LeaseCandidateLister } +// TypedLeaseCandidateInformer provides access to a shared informer and lister for +// LeaseCandidates, including the type-safe TypedInformer variant. +// It is a superset of LeaseCandidateInformer. +type TypedLeaseCandidateInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() LeaseCandidateIndexInformer + Lister() coordinationv1beta1.LeaseCandidateLister +} + +// LeaseCandidateIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type LeaseCandidateIndexInformer cache.TypedSharedIndexInformer[*apicoordinationv1beta1.LeaseCandidate] + +// LeaseCandidateHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for LeaseCandidate. +type LeaseCandidateHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicoordinationv1beta1.LeaseCandidate] + +// LeaseCandidateDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for LeaseCandidate. +type LeaseCandidateDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicoordinationv1beta1.LeaseCandidate] + +// LeaseCandidateFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for LeaseCandidate. +type LeaseCandidateFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicoordinationv1beta1.LeaseCandidate] + +// LeaseCandidateIndexers is a specialization of [cache.TypedIndexers] for LeaseCandidate. +type LeaseCandidateIndexers = cache.TypedIndexers[*apicoordinationv1beta1.LeaseCandidate] + +// DeletedLeaseCandidate is a specialization of [cache.DeletedObject] for LeaseCandidate. +type DeletedLeaseCandidate = cache.DeletedObject[*apicoordinationv1beta1.LeaseCandidate] + type leaseCandidateInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type leaseCandidateInformer struct { // NewLeaseCandidateInformer constructs a new informer for LeaseCandidate type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedLeaseCandidateInformer]). func NewLeaseCandidateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewLeaseCandidateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedLeaseCandidateInformer constructs a new informer for LeaseCandidate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedLeaseCandidateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers LeaseCandidateIndexers) LeaseCandidateIndexInformer { + return NewTypedLeaseCandidateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredLeaseCandidateInformer constructs a new informer for LeaseCandidate type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredLeaseCandidateInformer]). func NewFilteredLeaseCandidateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewLeaseCandidateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedLeaseCandidateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredLeaseCandidateInformer constructs a new informer for LeaseCandidate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredLeaseCandidateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers LeaseCandidateIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) LeaseCandidateIndexInformer { + return NewTypedLeaseCandidateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewLeaseCandidateInformerWithOptions constructs a new informer for LeaseCandidate type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedLeaseCandidateInformerWithOptions]). func NewLeaseCandidateInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedLeaseCandidateInformerWithOptions(client, namespace, options) +} + +// NewTypedLeaseCandidateInformerWithOptions constructs a new informer for LeaseCandidate type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedLeaseCandidateInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) LeaseCandidateIndexInformer { gvr := schema.GroupVersionResource{Group: "coordination.k8s.io", Version: "v1beta1", Resource: "leasecandidates"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicoordinationv1beta1.LeaseCandidate](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewLeaseCandidateInformerWithOptions(client kubernetes.Interface, namespace Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *leaseCandidateInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewLeaseCandidateInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedLeaseCandidateInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *leaseCandidateInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicoordinationv1beta1.LeaseCandidate{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *leaseCandidateInformer) TypedInformer() LeaseCandidateIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicoordinationv1beta1.LeaseCandidate](f.factory.InformerFor(&apicoordinationv1beta1.LeaseCandidate{}, f.defaultInformer)) } func (f *leaseCandidateInformer) Lister() coordinationv1beta1.LeaseCandidateLister { return coordinationv1beta1.NewLeaseCandidateLister(f.Informer().GetIndexer()) } + +// ToTypedLeaseCandidateInformer converts an untyped informer into a TypedLeaseCandidateInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *LeaseCandidate. If that is not the case, calling type-safe methods of the returned +// TypedLeaseCandidateInformer leads to runtime panics. A safer alternative is to pass +// around a TypedLeaseCandidateInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedLeaseCandidateInformer(informer LeaseCandidateInformer) TypedLeaseCandidateInformer { + if informer, ok := informer.(TypedLeaseCandidateInformer); ok { + return informer + } + return &leaseCandidateTypedInformerAdapter{informer} +} + +type leaseCandidateTypedInformerAdapter struct { + LeaseCandidateInformer +} + +func (a *leaseCandidateTypedInformerAdapter) TypedInformer() LeaseCandidateIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicoordinationv1beta1.LeaseCandidate](a.Informer()) +} + +// ToLeaseCandidateIndexInformer converts an untyped informer into a LeaseCandidateIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *LeaseCandidate. If that is not the case, calling type-safe methods of the returned +// LeaseCandidateIndexInformer leads to runtime panics. A safer alternative is to pass +// around a LeaseCandidateIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToLeaseCandidateIndexInformer(informer cache.SharedIndexInformer) LeaseCandidateIndexInformer { + if informer, ok := informer.(LeaseCandidateIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicoordinationv1beta1.LeaseCandidate](informer) +} diff --git a/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go b/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go index 5b6f6556c3..97dbda2b43 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go +++ b/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go @@ -34,12 +34,40 @@ import ( ) // ComponentStatusInformer provides access to a shared informer and lister for -// ComponentStatuses. +// ComponentStatuses. Prefer using the type-safe variant (see [TypedComponentStatusInformer]). type ComponentStatusInformer interface { Informer() cache.SharedIndexInformer Lister() corev1.ComponentStatusLister } +// TypedComponentStatusInformer provides access to a shared informer and lister for +// ComponentStatuses, including the type-safe TypedInformer variant. +// It is a superset of ComponentStatusInformer. +type TypedComponentStatusInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ComponentStatusIndexInformer + Lister() corev1.ComponentStatusLister +} + +// ComponentStatusIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ComponentStatusIndexInformer cache.TypedSharedIndexInformer[*apicorev1.ComponentStatus] + +// ComponentStatusHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ComponentStatus. +type ComponentStatusHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicorev1.ComponentStatus] + +// ComponentStatusDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ComponentStatus. +type ComponentStatusDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicorev1.ComponentStatus] + +// ComponentStatusFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ComponentStatus. +type ComponentStatusFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicorev1.ComponentStatus] + +// ComponentStatusIndexers is a specialization of [cache.TypedIndexers] for ComponentStatus. +type ComponentStatusIndexers = cache.TypedIndexers[*apicorev1.ComponentStatus] + +// DeletedComponentStatus is a specialization of [cache.DeletedObject] for ComponentStatus. +type DeletedComponentStatus = cache.DeletedObject[*apicorev1.ComponentStatus] + type componentStatusInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type componentStatusInformer struct { // NewComponentStatusInformer constructs a new informer for ComponentStatus type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedComponentStatusInformer]). func NewComponentStatusInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewComponentStatusInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedComponentStatusInformer constructs a new informer for ComponentStatus type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedComponentStatusInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ComponentStatusIndexers) ComponentStatusIndexInformer { + return NewTypedComponentStatusInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredComponentStatusInformer constructs a new informer for ComponentStatus type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredComponentStatusInformer]). func NewFilteredComponentStatusInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewComponentStatusInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedComponentStatusInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredComponentStatusInformer constructs a new informer for ComponentStatus type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredComponentStatusInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ComponentStatusIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ComponentStatusIndexInformer { + return NewTypedComponentStatusInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewComponentStatusInformerWithOptions constructs a new informer for ComponentStatus type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedComponentStatusInformerWithOptions]). func NewComponentStatusInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedComponentStatusInformerWithOptions(client, options) +} + +// NewTypedComponentStatusInformerWithOptions constructs a new informer for ComponentStatus type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedComponentStatusInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ComponentStatusIndexInformer { gvr := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "componentstatuss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicorev1.ComponentStatus](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewComponentStatusInformerWithOptions(client kubernetes.Interface, options Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *componentStatusInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewComponentStatusInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedComponentStatusInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *componentStatusInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicorev1.ComponentStatus{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *componentStatusInformer) TypedInformer() ComponentStatusIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.ComponentStatus](f.factory.InformerFor(&apicorev1.ComponentStatus{}, f.defaultInformer)) } func (f *componentStatusInformer) Lister() corev1.ComponentStatusLister { return corev1.NewComponentStatusLister(f.Informer().GetIndexer()) } + +// ToTypedComponentStatusInformer converts an untyped informer into a TypedComponentStatusInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ComponentStatus. If that is not the case, calling type-safe methods of the returned +// TypedComponentStatusInformer leads to runtime panics. A safer alternative is to pass +// around a TypedComponentStatusInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedComponentStatusInformer(informer ComponentStatusInformer) TypedComponentStatusInformer { + if informer, ok := informer.(TypedComponentStatusInformer); ok { + return informer + } + return &componentStatusTypedInformerAdapter{informer} +} + +type componentStatusTypedInformerAdapter struct { + ComponentStatusInformer +} + +func (a *componentStatusTypedInformerAdapter) TypedInformer() ComponentStatusIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.ComponentStatus](a.Informer()) +} + +// ToComponentStatusIndexInformer converts an untyped informer into a ComponentStatusIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ComponentStatus. If that is not the case, calling type-safe methods of the returned +// ComponentStatusIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ComponentStatusIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToComponentStatusIndexInformer(informer cache.SharedIndexInformer) ComponentStatusIndexInformer { + if informer, ok := informer.(ComponentStatusIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicorev1.ComponentStatus](informer) +} diff --git a/vendor/k8s.io/client-go/informers/core/v1/configmap.go b/vendor/k8s.io/client-go/informers/core/v1/configmap.go index 5b6389884b..db84d29736 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/configmap.go +++ b/vendor/k8s.io/client-go/informers/core/v1/configmap.go @@ -34,12 +34,40 @@ import ( ) // ConfigMapInformer provides access to a shared informer and lister for -// ConfigMaps. +// ConfigMaps. Prefer using the type-safe variant (see [TypedConfigMapInformer]). type ConfigMapInformer interface { Informer() cache.SharedIndexInformer Lister() corev1.ConfigMapLister } +// TypedConfigMapInformer provides access to a shared informer and lister for +// ConfigMaps, including the type-safe TypedInformer variant. +// It is a superset of ConfigMapInformer. +type TypedConfigMapInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ConfigMapIndexInformer + Lister() corev1.ConfigMapLister +} + +// ConfigMapIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ConfigMapIndexInformer cache.TypedSharedIndexInformer[*apicorev1.ConfigMap] + +// ConfigMapHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ConfigMap. +type ConfigMapHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicorev1.ConfigMap] + +// ConfigMapDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ConfigMap. +type ConfigMapDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicorev1.ConfigMap] + +// ConfigMapFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ConfigMap. +type ConfigMapFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicorev1.ConfigMap] + +// ConfigMapIndexers is a specialization of [cache.TypedIndexers] for ConfigMap. +type ConfigMapIndexers = cache.TypedIndexers[*apicorev1.ConfigMap] + +// DeletedConfigMap is a specialization of [cache.DeletedObject] for ConfigMap. +type DeletedConfigMap = cache.DeletedObject[*apicorev1.ConfigMap] + type configMapInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type configMapInformer struct { // NewConfigMapInformer constructs a new informer for ConfigMap type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedConfigMapInformer]). func NewConfigMapInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewConfigMapInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedConfigMapInformer constructs a new informer for ConfigMap type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedConfigMapInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ConfigMapIndexers) ConfigMapIndexInformer { + return NewTypedConfigMapInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredConfigMapInformer constructs a new informer for ConfigMap type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredConfigMapInformer]). func NewFilteredConfigMapInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewConfigMapInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedConfigMapInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredConfigMapInformer constructs a new informer for ConfigMap type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredConfigMapInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ConfigMapIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ConfigMapIndexInformer { + return NewTypedConfigMapInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewConfigMapInformerWithOptions constructs a new informer for ConfigMap type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedConfigMapInformerWithOptions]). func NewConfigMapInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedConfigMapInformerWithOptions(client, namespace, options) +} + +// NewTypedConfigMapInformerWithOptions constructs a new informer for ConfigMap type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedConfigMapInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) ConfigMapIndexInformer { gvr := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "configmaps"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicorev1.ConfigMap](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewConfigMapInformerWithOptions(client kubernetes.Interface, namespace stri Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *configMapInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewConfigMapInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedConfigMapInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *configMapInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicorev1.ConfigMap{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *configMapInformer) TypedInformer() ConfigMapIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.ConfigMap](f.factory.InformerFor(&apicorev1.ConfigMap{}, f.defaultInformer)) } func (f *configMapInformer) Lister() corev1.ConfigMapLister { return corev1.NewConfigMapLister(f.Informer().GetIndexer()) } + +// ToTypedConfigMapInformer converts an untyped informer into a TypedConfigMapInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ConfigMap. If that is not the case, calling type-safe methods of the returned +// TypedConfigMapInformer leads to runtime panics. A safer alternative is to pass +// around a TypedConfigMapInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedConfigMapInformer(informer ConfigMapInformer) TypedConfigMapInformer { + if informer, ok := informer.(TypedConfigMapInformer); ok { + return informer + } + return &configMapTypedInformerAdapter{informer} +} + +type configMapTypedInformerAdapter struct { + ConfigMapInformer +} + +func (a *configMapTypedInformerAdapter) TypedInformer() ConfigMapIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.ConfigMap](a.Informer()) +} + +// ToConfigMapIndexInformer converts an untyped informer into a ConfigMapIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ConfigMap. If that is not the case, calling type-safe methods of the returned +// ConfigMapIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ConfigMapIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToConfigMapIndexInformer(informer cache.SharedIndexInformer) ConfigMapIndexInformer { + if informer, ok := informer.(ConfigMapIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicorev1.ConfigMap](informer) +} diff --git a/vendor/k8s.io/client-go/informers/core/v1/endpoints.go b/vendor/k8s.io/client-go/informers/core/v1/endpoints.go index 1609ce7f7e..240967c3e4 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/endpoints.go +++ b/vendor/k8s.io/client-go/informers/core/v1/endpoints.go @@ -34,12 +34,40 @@ import ( ) // EndpointsInformer provides access to a shared informer and lister for -// Endpoints. +// Endpoints. Prefer using the type-safe variant (see [TypedEndpointsInformer]). type EndpointsInformer interface { Informer() cache.SharedIndexInformer Lister() corev1.EndpointsLister } +// TypedEndpointsInformer provides access to a shared informer and lister for +// Endpoints, including the type-safe TypedInformer variant. +// It is a superset of EndpointsInformer. +type TypedEndpointsInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() EndpointsIndexInformer + Lister() corev1.EndpointsLister +} + +// EndpointsIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type EndpointsIndexInformer cache.TypedSharedIndexInformer[*apicorev1.Endpoints] + +// EndpointsHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Endpoints. +type EndpointsHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicorev1.Endpoints] + +// EndpointsDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Endpoints. +type EndpointsDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicorev1.Endpoints] + +// EndpointsFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Endpoints. +type EndpointsFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicorev1.Endpoints] + +// EndpointsIndexers is a specialization of [cache.TypedIndexers] for Endpoints. +type EndpointsIndexers = cache.TypedIndexers[*apicorev1.Endpoints] + +// DeletedEndpoints is a specialization of [cache.DeletedObject] for Endpoints. +type DeletedEndpoints = cache.DeletedObject[*apicorev1.Endpoints] + type endpointsInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type endpointsInformer struct { // NewEndpointsInformer constructs a new informer for Endpoints type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedEndpointsInformer]). func NewEndpointsInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewEndpointsInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedEndpointsInformer constructs a new informer for Endpoints type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedEndpointsInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers EndpointsIndexers) EndpointsIndexInformer { + return NewTypedEndpointsInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredEndpointsInformer constructs a new informer for Endpoints type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredEndpointsInformer]). func NewFilteredEndpointsInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewEndpointsInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedEndpointsInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredEndpointsInformer constructs a new informer for Endpoints type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredEndpointsInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers EndpointsIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) EndpointsIndexInformer { + return NewTypedEndpointsInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewEndpointsInformerWithOptions constructs a new informer for Endpoints type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedEndpointsInformerWithOptions]). func NewEndpointsInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedEndpointsInformerWithOptions(client, namespace, options) +} + +// NewTypedEndpointsInformerWithOptions constructs a new informer for Endpoints type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedEndpointsInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) EndpointsIndexInformer { gvr := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "endpointss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicorev1.Endpoints](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewEndpointsInformerWithOptions(client kubernetes.Interface, namespace stri Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *endpointsInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewEndpointsInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedEndpointsInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *endpointsInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicorev1.Endpoints{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *endpointsInformer) TypedInformer() EndpointsIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.Endpoints](f.factory.InformerFor(&apicorev1.Endpoints{}, f.defaultInformer)) } func (f *endpointsInformer) Lister() corev1.EndpointsLister { return corev1.NewEndpointsLister(f.Informer().GetIndexer()) } + +// ToTypedEndpointsInformer converts an untyped informer into a TypedEndpointsInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Endpoints. If that is not the case, calling type-safe methods of the returned +// TypedEndpointsInformer leads to runtime panics. A safer alternative is to pass +// around a TypedEndpointsInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedEndpointsInformer(informer EndpointsInformer) TypedEndpointsInformer { + if informer, ok := informer.(TypedEndpointsInformer); ok { + return informer + } + return &endpointsTypedInformerAdapter{informer} +} + +type endpointsTypedInformerAdapter struct { + EndpointsInformer +} + +func (a *endpointsTypedInformerAdapter) TypedInformer() EndpointsIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.Endpoints](a.Informer()) +} + +// ToEndpointsIndexInformer converts an untyped informer into a EndpointsIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Endpoints. If that is not the case, calling type-safe methods of the returned +// EndpointsIndexInformer leads to runtime panics. A safer alternative is to pass +// around a EndpointsIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToEndpointsIndexInformer(informer cache.SharedIndexInformer) EndpointsIndexInformer { + if informer, ok := informer.(EndpointsIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicorev1.Endpoints](informer) +} diff --git a/vendor/k8s.io/client-go/informers/core/v1/event.go b/vendor/k8s.io/client-go/informers/core/v1/event.go index ff9c3c5847..65c078565a 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/event.go +++ b/vendor/k8s.io/client-go/informers/core/v1/event.go @@ -34,12 +34,40 @@ import ( ) // EventInformer provides access to a shared informer and lister for -// Events. +// Events. Prefer using the type-safe variant (see [TypedEventInformer]). type EventInformer interface { Informer() cache.SharedIndexInformer Lister() corev1.EventLister } +// TypedEventInformer provides access to a shared informer and lister for +// Events, including the type-safe TypedInformer variant. +// It is a superset of EventInformer. +type TypedEventInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() EventIndexInformer + Lister() corev1.EventLister +} + +// EventIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type EventIndexInformer cache.TypedSharedIndexInformer[*apicorev1.Event] + +// EventHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Event. +type EventHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicorev1.Event] + +// EventDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Event. +type EventDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicorev1.Event] + +// EventFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Event. +type EventFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicorev1.Event] + +// EventIndexers is a specialization of [cache.TypedIndexers] for Event. +type EventIndexers = cache.TypedIndexers[*apicorev1.Event] + +// DeletedEvent is a specialization of [cache.DeletedObject] for Event. +type DeletedEvent = cache.DeletedObject[*apicorev1.Event] + type eventInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type eventInformer struct { // NewEventInformer constructs a new informer for Event type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedEventInformer]). func NewEventInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewEventInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedEventInformer constructs a new informer for Event type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedEventInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers EventIndexers) EventIndexInformer { + return NewTypedEventInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredEventInformer constructs a new informer for Event type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredEventInformer]). func NewFilteredEventInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewEventInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedEventInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredEventInformer constructs a new informer for Event type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredEventInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers EventIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) EventIndexInformer { + return NewTypedEventInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewEventInformerWithOptions constructs a new informer for Event type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedEventInformerWithOptions]). func NewEventInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedEventInformerWithOptions(client, namespace, options) +} + +// NewTypedEventInformerWithOptions constructs a new informer for Event type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedEventInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) EventIndexInformer { gvr := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "events"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicorev1.Event](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewEventInformerWithOptions(client kubernetes.Interface, namespace string, Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *eventInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewEventInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedEventInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *eventInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicorev1.Event{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *eventInformer) TypedInformer() EventIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.Event](f.factory.InformerFor(&apicorev1.Event{}, f.defaultInformer)) } func (f *eventInformer) Lister() corev1.EventLister { return corev1.NewEventLister(f.Informer().GetIndexer()) } + +// ToTypedEventInformer converts an untyped informer into a TypedEventInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Event. If that is not the case, calling type-safe methods of the returned +// TypedEventInformer leads to runtime panics. A safer alternative is to pass +// around a TypedEventInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedEventInformer(informer EventInformer) TypedEventInformer { + if informer, ok := informer.(TypedEventInformer); ok { + return informer + } + return &eventTypedInformerAdapter{informer} +} + +type eventTypedInformerAdapter struct { + EventInformer +} + +func (a *eventTypedInformerAdapter) TypedInformer() EventIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.Event](a.Informer()) +} + +// ToEventIndexInformer converts an untyped informer into a EventIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Event. If that is not the case, calling type-safe methods of the returned +// EventIndexInformer leads to runtime panics. A safer alternative is to pass +// around a EventIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToEventIndexInformer(informer cache.SharedIndexInformer) EventIndexInformer { + if informer, ok := informer.(EventIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicorev1.Event](informer) +} diff --git a/vendor/k8s.io/client-go/informers/core/v1/interface.go b/vendor/k8s.io/client-go/informers/core/v1/interface.go index b2216a05c8..a951b30bd1 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/core/v1/interface.go @@ -25,37 +25,37 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // ComponentStatuses returns a ComponentStatusInformer. - ComponentStatuses() ComponentStatusInformer + ComponentStatuses() TypedComponentStatusInformer // ConfigMaps returns a ConfigMapInformer. - ConfigMaps() ConfigMapInformer + ConfigMaps() TypedConfigMapInformer // Endpoints returns a EndpointsInformer. - Endpoints() EndpointsInformer + Endpoints() TypedEndpointsInformer // Events returns a EventInformer. - Events() EventInformer + Events() TypedEventInformer // LimitRanges returns a LimitRangeInformer. - LimitRanges() LimitRangeInformer + LimitRanges() TypedLimitRangeInformer // Namespaces returns a NamespaceInformer. - Namespaces() NamespaceInformer + Namespaces() TypedNamespaceInformer // Nodes returns a NodeInformer. - Nodes() NodeInformer + Nodes() TypedNodeInformer // PersistentVolumes returns a PersistentVolumeInformer. - PersistentVolumes() PersistentVolumeInformer + PersistentVolumes() TypedPersistentVolumeInformer // PersistentVolumeClaims returns a PersistentVolumeClaimInformer. - PersistentVolumeClaims() PersistentVolumeClaimInformer + PersistentVolumeClaims() TypedPersistentVolumeClaimInformer // Pods returns a PodInformer. - Pods() PodInformer + Pods() TypedPodInformer // PodTemplates returns a PodTemplateInformer. - PodTemplates() PodTemplateInformer + PodTemplates() TypedPodTemplateInformer // ReplicationControllers returns a ReplicationControllerInformer. - ReplicationControllers() ReplicationControllerInformer + ReplicationControllers() TypedReplicationControllerInformer // ResourceQuotas returns a ResourceQuotaInformer. - ResourceQuotas() ResourceQuotaInformer + ResourceQuotas() TypedResourceQuotaInformer // Secrets returns a SecretInformer. - Secrets() SecretInformer + Secrets() TypedSecretInformer // Services returns a ServiceInformer. - Services() ServiceInformer + Services() TypedServiceInformer // ServiceAccounts returns a ServiceAccountInformer. - ServiceAccounts() ServiceAccountInformer + ServiceAccounts() TypedServiceAccountInformer } type version struct { @@ -69,82 +69,82 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// ComponentStatuses returns a ComponentStatusInformer. -func (v *version) ComponentStatuses() ComponentStatusInformer { +// ComponentStatuses returns a TypedComponentStatusInformer. +func (v *version) ComponentStatuses() TypedComponentStatusInformer { return &componentStatusInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ConfigMaps returns a ConfigMapInformer. -func (v *version) ConfigMaps() ConfigMapInformer { +// ConfigMaps returns a TypedConfigMapInformer. +func (v *version) ConfigMaps() TypedConfigMapInformer { return &configMapInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Endpoints returns a EndpointsInformer. -func (v *version) Endpoints() EndpointsInformer { +// Endpoints returns a TypedEndpointsInformer. +func (v *version) Endpoints() TypedEndpointsInformer { return &endpointsInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Events returns a EventInformer. -func (v *version) Events() EventInformer { +// Events returns a TypedEventInformer. +func (v *version) Events() TypedEventInformer { return &eventInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// LimitRanges returns a LimitRangeInformer. -func (v *version) LimitRanges() LimitRangeInformer { +// LimitRanges returns a TypedLimitRangeInformer. +func (v *version) LimitRanges() TypedLimitRangeInformer { return &limitRangeInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Namespaces returns a NamespaceInformer. -func (v *version) Namespaces() NamespaceInformer { +// Namespaces returns a TypedNamespaceInformer. +func (v *version) Namespaces() TypedNamespaceInformer { return &namespaceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// Nodes returns a NodeInformer. -func (v *version) Nodes() NodeInformer { +// Nodes returns a TypedNodeInformer. +func (v *version) Nodes() TypedNodeInformer { return &nodeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// PersistentVolumes returns a PersistentVolumeInformer. -func (v *version) PersistentVolumes() PersistentVolumeInformer { +// PersistentVolumes returns a TypedPersistentVolumeInformer. +func (v *version) PersistentVolumes() TypedPersistentVolumeInformer { return &persistentVolumeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// PersistentVolumeClaims returns a PersistentVolumeClaimInformer. -func (v *version) PersistentVolumeClaims() PersistentVolumeClaimInformer { +// PersistentVolumeClaims returns a TypedPersistentVolumeClaimInformer. +func (v *version) PersistentVolumeClaims() TypedPersistentVolumeClaimInformer { return &persistentVolumeClaimInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Pods returns a PodInformer. -func (v *version) Pods() PodInformer { +// Pods returns a TypedPodInformer. +func (v *version) Pods() TypedPodInformer { return &podInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// PodTemplates returns a PodTemplateInformer. -func (v *version) PodTemplates() PodTemplateInformer { +// PodTemplates returns a TypedPodTemplateInformer. +func (v *version) PodTemplates() TypedPodTemplateInformer { return &podTemplateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ReplicationControllers returns a ReplicationControllerInformer. -func (v *version) ReplicationControllers() ReplicationControllerInformer { +// ReplicationControllers returns a TypedReplicationControllerInformer. +func (v *version) ReplicationControllers() TypedReplicationControllerInformer { return &replicationControllerInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ResourceQuotas returns a ResourceQuotaInformer. -func (v *version) ResourceQuotas() ResourceQuotaInformer { +// ResourceQuotas returns a TypedResourceQuotaInformer. +func (v *version) ResourceQuotas() TypedResourceQuotaInformer { return &resourceQuotaInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Secrets returns a SecretInformer. -func (v *version) Secrets() SecretInformer { +// Secrets returns a TypedSecretInformer. +func (v *version) Secrets() TypedSecretInformer { return &secretInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Services returns a ServiceInformer. -func (v *version) Services() ServiceInformer { +// Services returns a TypedServiceInformer. +func (v *version) Services() TypedServiceInformer { return &serviceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ServiceAccounts returns a ServiceAccountInformer. -func (v *version) ServiceAccounts() ServiceAccountInformer { +// ServiceAccounts returns a TypedServiceAccountInformer. +func (v *version) ServiceAccounts() TypedServiceAccountInformer { return &serviceAccountInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/core/v1/limitrange.go b/vendor/k8s.io/client-go/informers/core/v1/limitrange.go index a3a01de6dc..a71e4496bc 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/limitrange.go +++ b/vendor/k8s.io/client-go/informers/core/v1/limitrange.go @@ -34,12 +34,40 @@ import ( ) // LimitRangeInformer provides access to a shared informer and lister for -// LimitRanges. +// LimitRanges. Prefer using the type-safe variant (see [TypedLimitRangeInformer]). type LimitRangeInformer interface { Informer() cache.SharedIndexInformer Lister() corev1.LimitRangeLister } +// TypedLimitRangeInformer provides access to a shared informer and lister for +// LimitRanges, including the type-safe TypedInformer variant. +// It is a superset of LimitRangeInformer. +type TypedLimitRangeInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() LimitRangeIndexInformer + Lister() corev1.LimitRangeLister +} + +// LimitRangeIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type LimitRangeIndexInformer cache.TypedSharedIndexInformer[*apicorev1.LimitRange] + +// LimitRangeHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for LimitRange. +type LimitRangeHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicorev1.LimitRange] + +// LimitRangeDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for LimitRange. +type LimitRangeDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicorev1.LimitRange] + +// LimitRangeFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for LimitRange. +type LimitRangeFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicorev1.LimitRange] + +// LimitRangeIndexers is a specialization of [cache.TypedIndexers] for LimitRange. +type LimitRangeIndexers = cache.TypedIndexers[*apicorev1.LimitRange] + +// DeletedLimitRange is a specialization of [cache.DeletedObject] for LimitRange. +type DeletedLimitRange = cache.DeletedObject[*apicorev1.LimitRange] + type limitRangeInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type limitRangeInformer struct { // NewLimitRangeInformer constructs a new informer for LimitRange type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedLimitRangeInformer]). func NewLimitRangeInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewLimitRangeInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedLimitRangeInformer constructs a new informer for LimitRange type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedLimitRangeInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers LimitRangeIndexers) LimitRangeIndexInformer { + return NewTypedLimitRangeInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredLimitRangeInformer constructs a new informer for LimitRange type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredLimitRangeInformer]). func NewFilteredLimitRangeInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewLimitRangeInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedLimitRangeInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredLimitRangeInformer constructs a new informer for LimitRange type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredLimitRangeInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers LimitRangeIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) LimitRangeIndexInformer { + return NewTypedLimitRangeInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewLimitRangeInformerWithOptions constructs a new informer for LimitRange type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedLimitRangeInformerWithOptions]). func NewLimitRangeInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedLimitRangeInformerWithOptions(client, namespace, options) +} + +// NewTypedLimitRangeInformerWithOptions constructs a new informer for LimitRange type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedLimitRangeInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) LimitRangeIndexInformer { gvr := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "limitranges"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicorev1.LimitRange](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewLimitRangeInformerWithOptions(client kubernetes.Interface, namespace str Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *limitRangeInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewLimitRangeInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedLimitRangeInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *limitRangeInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicorev1.LimitRange{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *limitRangeInformer) TypedInformer() LimitRangeIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.LimitRange](f.factory.InformerFor(&apicorev1.LimitRange{}, f.defaultInformer)) } func (f *limitRangeInformer) Lister() corev1.LimitRangeLister { return corev1.NewLimitRangeLister(f.Informer().GetIndexer()) } + +// ToTypedLimitRangeInformer converts an untyped informer into a TypedLimitRangeInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *LimitRange. If that is not the case, calling type-safe methods of the returned +// TypedLimitRangeInformer leads to runtime panics. A safer alternative is to pass +// around a TypedLimitRangeInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedLimitRangeInformer(informer LimitRangeInformer) TypedLimitRangeInformer { + if informer, ok := informer.(TypedLimitRangeInformer); ok { + return informer + } + return &limitRangeTypedInformerAdapter{informer} +} + +type limitRangeTypedInformerAdapter struct { + LimitRangeInformer +} + +func (a *limitRangeTypedInformerAdapter) TypedInformer() LimitRangeIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.LimitRange](a.Informer()) +} + +// ToLimitRangeIndexInformer converts an untyped informer into a LimitRangeIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *LimitRange. If that is not the case, calling type-safe methods of the returned +// LimitRangeIndexInformer leads to runtime panics. A safer alternative is to pass +// around a LimitRangeIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToLimitRangeIndexInformer(informer cache.SharedIndexInformer) LimitRangeIndexInformer { + if informer, ok := informer.(LimitRangeIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicorev1.LimitRange](informer) +} diff --git a/vendor/k8s.io/client-go/informers/core/v1/namespace.go b/vendor/k8s.io/client-go/informers/core/v1/namespace.go index c2a9894417..38d12c9b37 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/namespace.go +++ b/vendor/k8s.io/client-go/informers/core/v1/namespace.go @@ -34,12 +34,40 @@ import ( ) // NamespaceInformer provides access to a shared informer and lister for -// Namespaces. +// Namespaces. Prefer using the type-safe variant (see [TypedNamespaceInformer]). type NamespaceInformer interface { Informer() cache.SharedIndexInformer Lister() corev1.NamespaceLister } +// TypedNamespaceInformer provides access to a shared informer and lister for +// Namespaces, including the type-safe TypedInformer variant. +// It is a superset of NamespaceInformer. +type TypedNamespaceInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() NamespaceIndexInformer + Lister() corev1.NamespaceLister +} + +// NamespaceIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type NamespaceIndexInformer cache.TypedSharedIndexInformer[*apicorev1.Namespace] + +// NamespaceHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Namespace. +type NamespaceHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicorev1.Namespace] + +// NamespaceDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Namespace. +type NamespaceDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicorev1.Namespace] + +// NamespaceFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Namespace. +type NamespaceFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicorev1.Namespace] + +// NamespaceIndexers is a specialization of [cache.TypedIndexers] for Namespace. +type NamespaceIndexers = cache.TypedIndexers[*apicorev1.Namespace] + +// DeletedNamespace is a specialization of [cache.DeletedObject] for Namespace. +type DeletedNamespace = cache.DeletedObject[*apicorev1.Namespace] + type namespaceInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type namespaceInformer struct { // NewNamespaceInformer constructs a new informer for Namespace type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedNamespaceInformer]). func NewNamespaceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewNamespaceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedNamespaceInformer constructs a new informer for Namespace type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedNamespaceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers NamespaceIndexers) NamespaceIndexInformer { + return NewTypedNamespaceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredNamespaceInformer constructs a new informer for Namespace type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredNamespaceInformer]). func NewFilteredNamespaceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewNamespaceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedNamespaceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredNamespaceInformer constructs a new informer for Namespace type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredNamespaceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers NamespaceIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) NamespaceIndexInformer { + return NewTypedNamespaceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewNamespaceInformerWithOptions constructs a new informer for Namespace type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedNamespaceInformerWithOptions]). func NewNamespaceInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedNamespaceInformerWithOptions(client, options) +} + +// NewTypedNamespaceInformerWithOptions constructs a new informer for Namespace type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedNamespaceInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) NamespaceIndexInformer { gvr := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "namespaces"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicorev1.Namespace](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewNamespaceInformerWithOptions(client kubernetes.Interface, options intern Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *namespaceInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewNamespaceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedNamespaceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *namespaceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicorev1.Namespace{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *namespaceInformer) TypedInformer() NamespaceIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.Namespace](f.factory.InformerFor(&apicorev1.Namespace{}, f.defaultInformer)) } func (f *namespaceInformer) Lister() corev1.NamespaceLister { return corev1.NewNamespaceLister(f.Informer().GetIndexer()) } + +// ToTypedNamespaceInformer converts an untyped informer into a TypedNamespaceInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Namespace. If that is not the case, calling type-safe methods of the returned +// TypedNamespaceInformer leads to runtime panics. A safer alternative is to pass +// around a TypedNamespaceInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedNamespaceInformer(informer NamespaceInformer) TypedNamespaceInformer { + if informer, ok := informer.(TypedNamespaceInformer); ok { + return informer + } + return &namespaceTypedInformerAdapter{informer} +} + +type namespaceTypedInformerAdapter struct { + NamespaceInformer +} + +func (a *namespaceTypedInformerAdapter) TypedInformer() NamespaceIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.Namespace](a.Informer()) +} + +// ToNamespaceIndexInformer converts an untyped informer into a NamespaceIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Namespace. If that is not the case, calling type-safe methods of the returned +// NamespaceIndexInformer leads to runtime panics. A safer alternative is to pass +// around a NamespaceIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToNamespaceIndexInformer(informer cache.SharedIndexInformer) NamespaceIndexInformer { + if informer, ok := informer.(NamespaceIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicorev1.Namespace](informer) +} diff --git a/vendor/k8s.io/client-go/informers/core/v1/node.go b/vendor/k8s.io/client-go/informers/core/v1/node.go index 48e8d7d6aa..9e706202f3 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/node.go +++ b/vendor/k8s.io/client-go/informers/core/v1/node.go @@ -34,12 +34,40 @@ import ( ) // NodeInformer provides access to a shared informer and lister for -// Nodes. +// Nodes. Prefer using the type-safe variant (see [TypedNodeInformer]). type NodeInformer interface { Informer() cache.SharedIndexInformer Lister() corev1.NodeLister } +// TypedNodeInformer provides access to a shared informer and lister for +// Nodes, including the type-safe TypedInformer variant. +// It is a superset of NodeInformer. +type TypedNodeInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() NodeIndexInformer + Lister() corev1.NodeLister +} + +// NodeIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type NodeIndexInformer cache.TypedSharedIndexInformer[*apicorev1.Node] + +// NodeHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Node. +type NodeHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicorev1.Node] + +// NodeDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Node. +type NodeDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicorev1.Node] + +// NodeFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Node. +type NodeFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicorev1.Node] + +// NodeIndexers is a specialization of [cache.TypedIndexers] for Node. +type NodeIndexers = cache.TypedIndexers[*apicorev1.Node] + +// DeletedNode is a specialization of [cache.DeletedObject] for Node. +type DeletedNode = cache.DeletedObject[*apicorev1.Node] + type nodeInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type nodeInformer struct { // NewNodeInformer constructs a new informer for Node type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedNodeInformer]). func NewNodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewNodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedNodeInformer constructs a new informer for Node type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedNodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers NodeIndexers) NodeIndexInformer { + return NewTypedNodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredNodeInformer constructs a new informer for Node type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredNodeInformer]). func NewFilteredNodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewNodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedNodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredNodeInformer constructs a new informer for Node type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredNodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers NodeIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) NodeIndexInformer { + return NewTypedNodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewNodeInformerWithOptions constructs a new informer for Node type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedNodeInformerWithOptions]). func NewNodeInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedNodeInformerWithOptions(client, options) +} + +// NewTypedNodeInformerWithOptions constructs a new informer for Node type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedNodeInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) NodeIndexInformer { gvr := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "nodes"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicorev1.Node](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewNodeInformerWithOptions(client kubernetes.Interface, options internalint Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *nodeInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewNodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedNodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *nodeInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicorev1.Node{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *nodeInformer) TypedInformer() NodeIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.Node](f.factory.InformerFor(&apicorev1.Node{}, f.defaultInformer)) } func (f *nodeInformer) Lister() corev1.NodeLister { return corev1.NewNodeLister(f.Informer().GetIndexer()) } + +// ToTypedNodeInformer converts an untyped informer into a TypedNodeInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Node. If that is not the case, calling type-safe methods of the returned +// TypedNodeInformer leads to runtime panics. A safer alternative is to pass +// around a TypedNodeInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedNodeInformer(informer NodeInformer) TypedNodeInformer { + if informer, ok := informer.(TypedNodeInformer); ok { + return informer + } + return &nodeTypedInformerAdapter{informer} +} + +type nodeTypedInformerAdapter struct { + NodeInformer +} + +func (a *nodeTypedInformerAdapter) TypedInformer() NodeIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.Node](a.Informer()) +} + +// ToNodeIndexInformer converts an untyped informer into a NodeIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Node. If that is not the case, calling type-safe methods of the returned +// NodeIndexInformer leads to runtime panics. A safer alternative is to pass +// around a NodeIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToNodeIndexInformer(informer cache.SharedIndexInformer) NodeIndexInformer { + if informer, ok := informer.(NodeIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicorev1.Node](informer) +} diff --git a/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go b/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go index aebe7ffa81..d55333ce82 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go +++ b/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go @@ -34,12 +34,40 @@ import ( ) // PersistentVolumeInformer provides access to a shared informer and lister for -// PersistentVolumes. +// PersistentVolumes. Prefer using the type-safe variant (see [TypedPersistentVolumeInformer]). type PersistentVolumeInformer interface { Informer() cache.SharedIndexInformer Lister() corev1.PersistentVolumeLister } +// TypedPersistentVolumeInformer provides access to a shared informer and lister for +// PersistentVolumes, including the type-safe TypedInformer variant. +// It is a superset of PersistentVolumeInformer. +type TypedPersistentVolumeInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() PersistentVolumeIndexInformer + Lister() corev1.PersistentVolumeLister +} + +// PersistentVolumeIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type PersistentVolumeIndexInformer cache.TypedSharedIndexInformer[*apicorev1.PersistentVolume] + +// PersistentVolumeHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for PersistentVolume. +type PersistentVolumeHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicorev1.PersistentVolume] + +// PersistentVolumeDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for PersistentVolume. +type PersistentVolumeDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicorev1.PersistentVolume] + +// PersistentVolumeFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for PersistentVolume. +type PersistentVolumeFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicorev1.PersistentVolume] + +// PersistentVolumeIndexers is a specialization of [cache.TypedIndexers] for PersistentVolume. +type PersistentVolumeIndexers = cache.TypedIndexers[*apicorev1.PersistentVolume] + +// DeletedPersistentVolume is a specialization of [cache.DeletedObject] for PersistentVolume. +type DeletedPersistentVolume = cache.DeletedObject[*apicorev1.PersistentVolume] + type persistentVolumeInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type persistentVolumeInformer struct { // NewPersistentVolumeInformer constructs a new informer for PersistentVolume type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPersistentVolumeInformer]). func NewPersistentVolumeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewPersistentVolumeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedPersistentVolumeInformer constructs a new informer for PersistentVolume type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPersistentVolumeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers PersistentVolumeIndexers) PersistentVolumeIndexInformer { + return NewTypedPersistentVolumeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredPersistentVolumeInformer constructs a new informer for PersistentVolume type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredPersistentVolumeInformer]). func NewFilteredPersistentVolumeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewPersistentVolumeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedPersistentVolumeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredPersistentVolumeInformer constructs a new informer for PersistentVolume type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredPersistentVolumeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers PersistentVolumeIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) PersistentVolumeIndexInformer { + return NewTypedPersistentVolumeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewPersistentVolumeInformerWithOptions constructs a new informer for PersistentVolume type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPersistentVolumeInformerWithOptions]). func NewPersistentVolumeInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedPersistentVolumeInformerWithOptions(client, options) +} + +// NewTypedPersistentVolumeInformerWithOptions constructs a new informer for PersistentVolume type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPersistentVolumeInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) PersistentVolumeIndexInformer { gvr := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "persistentvolumes"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicorev1.PersistentVolume](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewPersistentVolumeInformerWithOptions(client kubernetes.Interface, options Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *persistentVolumeInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewPersistentVolumeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedPersistentVolumeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *persistentVolumeInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicorev1.PersistentVolume{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *persistentVolumeInformer) TypedInformer() PersistentVolumeIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.PersistentVolume](f.factory.InformerFor(&apicorev1.PersistentVolume{}, f.defaultInformer)) } func (f *persistentVolumeInformer) Lister() corev1.PersistentVolumeLister { return corev1.NewPersistentVolumeLister(f.Informer().GetIndexer()) } + +// ToTypedPersistentVolumeInformer converts an untyped informer into a TypedPersistentVolumeInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PersistentVolume. If that is not the case, calling type-safe methods of the returned +// TypedPersistentVolumeInformer leads to runtime panics. A safer alternative is to pass +// around a TypedPersistentVolumeInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedPersistentVolumeInformer(informer PersistentVolumeInformer) TypedPersistentVolumeInformer { + if informer, ok := informer.(TypedPersistentVolumeInformer); ok { + return informer + } + return &persistentVolumeTypedInformerAdapter{informer} +} + +type persistentVolumeTypedInformerAdapter struct { + PersistentVolumeInformer +} + +func (a *persistentVolumeTypedInformerAdapter) TypedInformer() PersistentVolumeIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.PersistentVolume](a.Informer()) +} + +// ToPersistentVolumeIndexInformer converts an untyped informer into a PersistentVolumeIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PersistentVolume. If that is not the case, calling type-safe methods of the returned +// PersistentVolumeIndexInformer leads to runtime panics. A safer alternative is to pass +// around a PersistentVolumeIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToPersistentVolumeIndexInformer(informer cache.SharedIndexInformer) PersistentVolumeIndexInformer { + if informer, ok := informer.(PersistentVolumeIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicorev1.PersistentVolume](informer) +} diff --git a/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go b/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go index 973b5571ed..c14ab0d8eb 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go +++ b/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go @@ -34,12 +34,40 @@ import ( ) // PersistentVolumeClaimInformer provides access to a shared informer and lister for -// PersistentVolumeClaims. +// PersistentVolumeClaims. Prefer using the type-safe variant (see [TypedPersistentVolumeClaimInformer]). type PersistentVolumeClaimInformer interface { Informer() cache.SharedIndexInformer Lister() corev1.PersistentVolumeClaimLister } +// TypedPersistentVolumeClaimInformer provides access to a shared informer and lister for +// PersistentVolumeClaims, including the type-safe TypedInformer variant. +// It is a superset of PersistentVolumeClaimInformer. +type TypedPersistentVolumeClaimInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() PersistentVolumeClaimIndexInformer + Lister() corev1.PersistentVolumeClaimLister +} + +// PersistentVolumeClaimIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type PersistentVolumeClaimIndexInformer cache.TypedSharedIndexInformer[*apicorev1.PersistentVolumeClaim] + +// PersistentVolumeClaimHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for PersistentVolumeClaim. +type PersistentVolumeClaimHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicorev1.PersistentVolumeClaim] + +// PersistentVolumeClaimDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for PersistentVolumeClaim. +type PersistentVolumeClaimDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicorev1.PersistentVolumeClaim] + +// PersistentVolumeClaimFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for PersistentVolumeClaim. +type PersistentVolumeClaimFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicorev1.PersistentVolumeClaim] + +// PersistentVolumeClaimIndexers is a specialization of [cache.TypedIndexers] for PersistentVolumeClaim. +type PersistentVolumeClaimIndexers = cache.TypedIndexers[*apicorev1.PersistentVolumeClaim] + +// DeletedPersistentVolumeClaim is a specialization of [cache.DeletedObject] for PersistentVolumeClaim. +type DeletedPersistentVolumeClaim = cache.DeletedObject[*apicorev1.PersistentVolumeClaim] + type persistentVolumeClaimInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type persistentVolumeClaimInformer struct { // NewPersistentVolumeClaimInformer constructs a new informer for PersistentVolumeClaim type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPersistentVolumeClaimInformer]). func NewPersistentVolumeClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewPersistentVolumeClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedPersistentVolumeClaimInformer constructs a new informer for PersistentVolumeClaim type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPersistentVolumeClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers PersistentVolumeClaimIndexers) PersistentVolumeClaimIndexInformer { + return NewTypedPersistentVolumeClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredPersistentVolumeClaimInformer constructs a new informer for PersistentVolumeClaim type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredPersistentVolumeClaimInformer]). func NewFilteredPersistentVolumeClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewPersistentVolumeClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedPersistentVolumeClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredPersistentVolumeClaimInformer constructs a new informer for PersistentVolumeClaim type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredPersistentVolumeClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers PersistentVolumeClaimIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) PersistentVolumeClaimIndexInformer { + return NewTypedPersistentVolumeClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewPersistentVolumeClaimInformerWithOptions constructs a new informer for PersistentVolumeClaim type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPersistentVolumeClaimInformerWithOptions]). func NewPersistentVolumeClaimInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedPersistentVolumeClaimInformerWithOptions(client, namespace, options) +} + +// NewTypedPersistentVolumeClaimInformerWithOptions constructs a new informer for PersistentVolumeClaim type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPersistentVolumeClaimInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) PersistentVolumeClaimIndexInformer { gvr := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "persistentvolumeclaims"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicorev1.PersistentVolumeClaim](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewPersistentVolumeClaimInformerWithOptions(client kubernetes.Interface, na Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *persistentVolumeClaimInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewPersistentVolumeClaimInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedPersistentVolumeClaimInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *persistentVolumeClaimInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicorev1.PersistentVolumeClaim{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *persistentVolumeClaimInformer) TypedInformer() PersistentVolumeClaimIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.PersistentVolumeClaim](f.factory.InformerFor(&apicorev1.PersistentVolumeClaim{}, f.defaultInformer)) } func (f *persistentVolumeClaimInformer) Lister() corev1.PersistentVolumeClaimLister { return corev1.NewPersistentVolumeClaimLister(f.Informer().GetIndexer()) } + +// ToTypedPersistentVolumeClaimInformer converts an untyped informer into a TypedPersistentVolumeClaimInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PersistentVolumeClaim. If that is not the case, calling type-safe methods of the returned +// TypedPersistentVolumeClaimInformer leads to runtime panics. A safer alternative is to pass +// around a TypedPersistentVolumeClaimInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedPersistentVolumeClaimInformer(informer PersistentVolumeClaimInformer) TypedPersistentVolumeClaimInformer { + if informer, ok := informer.(TypedPersistentVolumeClaimInformer); ok { + return informer + } + return &persistentVolumeClaimTypedInformerAdapter{informer} +} + +type persistentVolumeClaimTypedInformerAdapter struct { + PersistentVolumeClaimInformer +} + +func (a *persistentVolumeClaimTypedInformerAdapter) TypedInformer() PersistentVolumeClaimIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.PersistentVolumeClaim](a.Informer()) +} + +// ToPersistentVolumeClaimIndexInformer converts an untyped informer into a PersistentVolumeClaimIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PersistentVolumeClaim. If that is not the case, calling type-safe methods of the returned +// PersistentVolumeClaimIndexInformer leads to runtime panics. A safer alternative is to pass +// around a PersistentVolumeClaimIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToPersistentVolumeClaimIndexInformer(informer cache.SharedIndexInformer) PersistentVolumeClaimIndexInformer { + if informer, ok := informer.(PersistentVolumeClaimIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicorev1.PersistentVolumeClaim](informer) +} diff --git a/vendor/k8s.io/client-go/informers/core/v1/pod.go b/vendor/k8s.io/client-go/informers/core/v1/pod.go index f49dee3dee..dac8c6d0c6 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/pod.go +++ b/vendor/k8s.io/client-go/informers/core/v1/pod.go @@ -34,12 +34,40 @@ import ( ) // PodInformer provides access to a shared informer and lister for -// Pods. +// Pods. Prefer using the type-safe variant (see [TypedPodInformer]). type PodInformer interface { Informer() cache.SharedIndexInformer Lister() corev1.PodLister } +// TypedPodInformer provides access to a shared informer and lister for +// Pods, including the type-safe TypedInformer variant. +// It is a superset of PodInformer. +type TypedPodInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() PodIndexInformer + Lister() corev1.PodLister +} + +// PodIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type PodIndexInformer cache.TypedSharedIndexInformer[*apicorev1.Pod] + +// PodHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Pod. +type PodHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicorev1.Pod] + +// PodDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Pod. +type PodDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicorev1.Pod] + +// PodFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Pod. +type PodFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicorev1.Pod] + +// PodIndexers is a specialization of [cache.TypedIndexers] for Pod. +type PodIndexers = cache.TypedIndexers[*apicorev1.Pod] + +// DeletedPod is a specialization of [cache.DeletedObject] for Pod. +type DeletedPod = cache.DeletedObject[*apicorev1.Pod] + type podInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type podInformer struct { // NewPodInformer constructs a new informer for Pod type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPodInformer]). func NewPodInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewPodInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedPodInformer constructs a new informer for Pod type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPodInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers PodIndexers) PodIndexInformer { + return NewTypedPodInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredPodInformer constructs a new informer for Pod type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredPodInformer]). func NewFilteredPodInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewPodInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedPodInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredPodInformer constructs a new informer for Pod type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredPodInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers PodIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) PodIndexInformer { + return NewTypedPodInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewPodInformerWithOptions constructs a new informer for Pod type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPodInformerWithOptions]). func NewPodInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedPodInformerWithOptions(client, namespace, options) +} + +// NewTypedPodInformerWithOptions constructs a new informer for Pod type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPodInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) PodIndexInformer { gvr := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicorev1.Pod](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewPodInformerWithOptions(client kubernetes.Interface, namespace string, op Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *podInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewPodInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedPodInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *podInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicorev1.Pod{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *podInformer) TypedInformer() PodIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.Pod](f.factory.InformerFor(&apicorev1.Pod{}, f.defaultInformer)) } func (f *podInformer) Lister() corev1.PodLister { return corev1.NewPodLister(f.Informer().GetIndexer()) } + +// ToTypedPodInformer converts an untyped informer into a TypedPodInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Pod. If that is not the case, calling type-safe methods of the returned +// TypedPodInformer leads to runtime panics. A safer alternative is to pass +// around a TypedPodInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedPodInformer(informer PodInformer) TypedPodInformer { + if informer, ok := informer.(TypedPodInformer); ok { + return informer + } + return &podTypedInformerAdapter{informer} +} + +type podTypedInformerAdapter struct { + PodInformer +} + +func (a *podTypedInformerAdapter) TypedInformer() PodIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.Pod](a.Informer()) +} + +// ToPodIndexInformer converts an untyped informer into a PodIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Pod. If that is not the case, calling type-safe methods of the returned +// PodIndexInformer leads to runtime panics. A safer alternative is to pass +// around a PodIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToPodIndexInformer(informer cache.SharedIndexInformer) PodIndexInformer { + if informer, ok := informer.(PodIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicorev1.Pod](informer) +} diff --git a/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go b/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go index 940ae25999..4b705902a6 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go +++ b/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go @@ -34,12 +34,40 @@ import ( ) // PodTemplateInformer provides access to a shared informer and lister for -// PodTemplates. +// PodTemplates. Prefer using the type-safe variant (see [TypedPodTemplateInformer]). type PodTemplateInformer interface { Informer() cache.SharedIndexInformer Lister() corev1.PodTemplateLister } +// TypedPodTemplateInformer provides access to a shared informer and lister for +// PodTemplates, including the type-safe TypedInformer variant. +// It is a superset of PodTemplateInformer. +type TypedPodTemplateInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() PodTemplateIndexInformer + Lister() corev1.PodTemplateLister +} + +// PodTemplateIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type PodTemplateIndexInformer cache.TypedSharedIndexInformer[*apicorev1.PodTemplate] + +// PodTemplateHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for PodTemplate. +type PodTemplateHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicorev1.PodTemplate] + +// PodTemplateDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for PodTemplate. +type PodTemplateDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicorev1.PodTemplate] + +// PodTemplateFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for PodTemplate. +type PodTemplateFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicorev1.PodTemplate] + +// PodTemplateIndexers is a specialization of [cache.TypedIndexers] for PodTemplate. +type PodTemplateIndexers = cache.TypedIndexers[*apicorev1.PodTemplate] + +// DeletedPodTemplate is a specialization of [cache.DeletedObject] for PodTemplate. +type DeletedPodTemplate = cache.DeletedObject[*apicorev1.PodTemplate] + type podTemplateInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type podTemplateInformer struct { // NewPodTemplateInformer constructs a new informer for PodTemplate type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPodTemplateInformer]). func NewPodTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewPodTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedPodTemplateInformer constructs a new informer for PodTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPodTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers PodTemplateIndexers) PodTemplateIndexInformer { + return NewTypedPodTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredPodTemplateInformer constructs a new informer for PodTemplate type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredPodTemplateInformer]). func NewFilteredPodTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewPodTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedPodTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredPodTemplateInformer constructs a new informer for PodTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredPodTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers PodTemplateIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) PodTemplateIndexInformer { + return NewTypedPodTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewPodTemplateInformerWithOptions constructs a new informer for PodTemplate type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPodTemplateInformerWithOptions]). func NewPodTemplateInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedPodTemplateInformerWithOptions(client, namespace, options) +} + +// NewTypedPodTemplateInformerWithOptions constructs a new informer for PodTemplate type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPodTemplateInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) PodTemplateIndexInformer { gvr := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "podtemplates"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicorev1.PodTemplate](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewPodTemplateInformerWithOptions(client kubernetes.Interface, namespace st Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *podTemplateInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewPodTemplateInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedPodTemplateInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *podTemplateInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicorev1.PodTemplate{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *podTemplateInformer) TypedInformer() PodTemplateIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.PodTemplate](f.factory.InformerFor(&apicorev1.PodTemplate{}, f.defaultInformer)) } func (f *podTemplateInformer) Lister() corev1.PodTemplateLister { return corev1.NewPodTemplateLister(f.Informer().GetIndexer()) } + +// ToTypedPodTemplateInformer converts an untyped informer into a TypedPodTemplateInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PodTemplate. If that is not the case, calling type-safe methods of the returned +// TypedPodTemplateInformer leads to runtime panics. A safer alternative is to pass +// around a TypedPodTemplateInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedPodTemplateInformer(informer PodTemplateInformer) TypedPodTemplateInformer { + if informer, ok := informer.(TypedPodTemplateInformer); ok { + return informer + } + return &podTemplateTypedInformerAdapter{informer} +} + +type podTemplateTypedInformerAdapter struct { + PodTemplateInformer +} + +func (a *podTemplateTypedInformerAdapter) TypedInformer() PodTemplateIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.PodTemplate](a.Informer()) +} + +// ToPodTemplateIndexInformer converts an untyped informer into a PodTemplateIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PodTemplate. If that is not the case, calling type-safe methods of the returned +// PodTemplateIndexInformer leads to runtime panics. A safer alternative is to pass +// around a PodTemplateIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToPodTemplateIndexInformer(informer cache.SharedIndexInformer) PodTemplateIndexInformer { + if informer, ok := informer.(PodTemplateIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicorev1.PodTemplate](informer) +} diff --git a/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go b/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go index ec323d3c63..8612653d11 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go +++ b/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go @@ -34,12 +34,40 @@ import ( ) // ReplicationControllerInformer provides access to a shared informer and lister for -// ReplicationControllers. +// ReplicationControllers. Prefer using the type-safe variant (see [TypedReplicationControllerInformer]). type ReplicationControllerInformer interface { Informer() cache.SharedIndexInformer Lister() corev1.ReplicationControllerLister } +// TypedReplicationControllerInformer provides access to a shared informer and lister for +// ReplicationControllers, including the type-safe TypedInformer variant. +// It is a superset of ReplicationControllerInformer. +type TypedReplicationControllerInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ReplicationControllerIndexInformer + Lister() corev1.ReplicationControllerLister +} + +// ReplicationControllerIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ReplicationControllerIndexInformer cache.TypedSharedIndexInformer[*apicorev1.ReplicationController] + +// ReplicationControllerHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ReplicationController. +type ReplicationControllerHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicorev1.ReplicationController] + +// ReplicationControllerDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ReplicationController. +type ReplicationControllerDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicorev1.ReplicationController] + +// ReplicationControllerFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ReplicationController. +type ReplicationControllerFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicorev1.ReplicationController] + +// ReplicationControllerIndexers is a specialization of [cache.TypedIndexers] for ReplicationController. +type ReplicationControllerIndexers = cache.TypedIndexers[*apicorev1.ReplicationController] + +// DeletedReplicationController is a specialization of [cache.DeletedObject] for ReplicationController. +type DeletedReplicationController = cache.DeletedObject[*apicorev1.ReplicationController] + type replicationControllerInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type replicationControllerInformer struct { // NewReplicationControllerInformer constructs a new informer for ReplicationController type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedReplicationControllerInformer]). func NewReplicationControllerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewReplicationControllerInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedReplicationControllerInformer constructs a new informer for ReplicationController type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedReplicationControllerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ReplicationControllerIndexers) ReplicationControllerIndexInformer { + return NewTypedReplicationControllerInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredReplicationControllerInformer constructs a new informer for ReplicationController type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredReplicationControllerInformer]). func NewFilteredReplicationControllerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewReplicationControllerInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedReplicationControllerInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredReplicationControllerInformer constructs a new informer for ReplicationController type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredReplicationControllerInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ReplicationControllerIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ReplicationControllerIndexInformer { + return NewTypedReplicationControllerInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewReplicationControllerInformerWithOptions constructs a new informer for ReplicationController type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedReplicationControllerInformerWithOptions]). func NewReplicationControllerInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedReplicationControllerInformerWithOptions(client, namespace, options) +} + +// NewTypedReplicationControllerInformerWithOptions constructs a new informer for ReplicationController type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedReplicationControllerInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) ReplicationControllerIndexInformer { gvr := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "replicationcontrollers"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicorev1.ReplicationController](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewReplicationControllerInformerWithOptions(client kubernetes.Interface, na Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *replicationControllerInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewReplicationControllerInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedReplicationControllerInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *replicationControllerInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicorev1.ReplicationController{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *replicationControllerInformer) TypedInformer() ReplicationControllerIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.ReplicationController](f.factory.InformerFor(&apicorev1.ReplicationController{}, f.defaultInformer)) } func (f *replicationControllerInformer) Lister() corev1.ReplicationControllerLister { return corev1.NewReplicationControllerLister(f.Informer().GetIndexer()) } + +// ToTypedReplicationControllerInformer converts an untyped informer into a TypedReplicationControllerInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ReplicationController. If that is not the case, calling type-safe methods of the returned +// TypedReplicationControllerInformer leads to runtime panics. A safer alternative is to pass +// around a TypedReplicationControllerInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedReplicationControllerInformer(informer ReplicationControllerInformer) TypedReplicationControllerInformer { + if informer, ok := informer.(TypedReplicationControllerInformer); ok { + return informer + } + return &replicationControllerTypedInformerAdapter{informer} +} + +type replicationControllerTypedInformerAdapter struct { + ReplicationControllerInformer +} + +func (a *replicationControllerTypedInformerAdapter) TypedInformer() ReplicationControllerIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.ReplicationController](a.Informer()) +} + +// ToReplicationControllerIndexInformer converts an untyped informer into a ReplicationControllerIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ReplicationController. If that is not the case, calling type-safe methods of the returned +// ReplicationControllerIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ReplicationControllerIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToReplicationControllerIndexInformer(informer cache.SharedIndexInformer) ReplicationControllerIndexInformer { + if informer, ok := informer.(ReplicationControllerIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicorev1.ReplicationController](informer) +} diff --git a/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go b/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go index 490a31212b..5726e484c0 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go +++ b/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go @@ -34,12 +34,40 @@ import ( ) // ResourceQuotaInformer provides access to a shared informer and lister for -// ResourceQuotas. +// ResourceQuotas. Prefer using the type-safe variant (see [TypedResourceQuotaInformer]). type ResourceQuotaInformer interface { Informer() cache.SharedIndexInformer Lister() corev1.ResourceQuotaLister } +// TypedResourceQuotaInformer provides access to a shared informer and lister for +// ResourceQuotas, including the type-safe TypedInformer variant. +// It is a superset of ResourceQuotaInformer. +type TypedResourceQuotaInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ResourceQuotaIndexInformer + Lister() corev1.ResourceQuotaLister +} + +// ResourceQuotaIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ResourceQuotaIndexInformer cache.TypedSharedIndexInformer[*apicorev1.ResourceQuota] + +// ResourceQuotaHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ResourceQuota. +type ResourceQuotaHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicorev1.ResourceQuota] + +// ResourceQuotaDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ResourceQuota. +type ResourceQuotaDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicorev1.ResourceQuota] + +// ResourceQuotaFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ResourceQuota. +type ResourceQuotaFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicorev1.ResourceQuota] + +// ResourceQuotaIndexers is a specialization of [cache.TypedIndexers] for ResourceQuota. +type ResourceQuotaIndexers = cache.TypedIndexers[*apicorev1.ResourceQuota] + +// DeletedResourceQuota is a specialization of [cache.DeletedObject] for ResourceQuota. +type DeletedResourceQuota = cache.DeletedObject[*apicorev1.ResourceQuota] + type resourceQuotaInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type resourceQuotaInformer struct { // NewResourceQuotaInformer constructs a new informer for ResourceQuota type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceQuotaInformer]). func NewResourceQuotaInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewResourceQuotaInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedResourceQuotaInformer constructs a new informer for ResourceQuota type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceQuotaInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ResourceQuotaIndexers) ResourceQuotaIndexInformer { + return NewTypedResourceQuotaInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredResourceQuotaInformer constructs a new informer for ResourceQuota type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredResourceQuotaInformer]). func NewFilteredResourceQuotaInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewResourceQuotaInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedResourceQuotaInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredResourceQuotaInformer constructs a new informer for ResourceQuota type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredResourceQuotaInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ResourceQuotaIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ResourceQuotaIndexInformer { + return NewTypedResourceQuotaInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewResourceQuotaInformerWithOptions constructs a new informer for ResourceQuota type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceQuotaInformerWithOptions]). func NewResourceQuotaInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedResourceQuotaInformerWithOptions(client, namespace, options) +} + +// NewTypedResourceQuotaInformerWithOptions constructs a new informer for ResourceQuota type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceQuotaInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) ResourceQuotaIndexInformer { gvr := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "resourcequotas"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicorev1.ResourceQuota](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewResourceQuotaInformerWithOptions(client kubernetes.Interface, namespace Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *resourceQuotaInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewResourceQuotaInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedResourceQuotaInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *resourceQuotaInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicorev1.ResourceQuota{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *resourceQuotaInformer) TypedInformer() ResourceQuotaIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.ResourceQuota](f.factory.InformerFor(&apicorev1.ResourceQuota{}, f.defaultInformer)) } func (f *resourceQuotaInformer) Lister() corev1.ResourceQuotaLister { return corev1.NewResourceQuotaLister(f.Informer().GetIndexer()) } + +// ToTypedResourceQuotaInformer converts an untyped informer into a TypedResourceQuotaInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceQuota. If that is not the case, calling type-safe methods of the returned +// TypedResourceQuotaInformer leads to runtime panics. A safer alternative is to pass +// around a TypedResourceQuotaInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedResourceQuotaInformer(informer ResourceQuotaInformer) TypedResourceQuotaInformer { + if informer, ok := informer.(TypedResourceQuotaInformer); ok { + return informer + } + return &resourceQuotaTypedInformerAdapter{informer} +} + +type resourceQuotaTypedInformerAdapter struct { + ResourceQuotaInformer +} + +func (a *resourceQuotaTypedInformerAdapter) TypedInformer() ResourceQuotaIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.ResourceQuota](a.Informer()) +} + +// ToResourceQuotaIndexInformer converts an untyped informer into a ResourceQuotaIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceQuota. If that is not the case, calling type-safe methods of the returned +// ResourceQuotaIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ResourceQuotaIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToResourceQuotaIndexInformer(informer cache.SharedIndexInformer) ResourceQuotaIndexInformer { + if informer, ok := informer.(ResourceQuotaIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicorev1.ResourceQuota](informer) +} diff --git a/vendor/k8s.io/client-go/informers/core/v1/secret.go b/vendor/k8s.io/client-go/informers/core/v1/secret.go index 86458285d9..ae75b7d22c 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/secret.go +++ b/vendor/k8s.io/client-go/informers/core/v1/secret.go @@ -34,12 +34,40 @@ import ( ) // SecretInformer provides access to a shared informer and lister for -// Secrets. +// Secrets. Prefer using the type-safe variant (see [TypedSecretInformer]). type SecretInformer interface { Informer() cache.SharedIndexInformer Lister() corev1.SecretLister } +// TypedSecretInformer provides access to a shared informer and lister for +// Secrets, including the type-safe TypedInformer variant. +// It is a superset of SecretInformer. +type TypedSecretInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() SecretIndexInformer + Lister() corev1.SecretLister +} + +// SecretIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type SecretIndexInformer cache.TypedSharedIndexInformer[*apicorev1.Secret] + +// SecretHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Secret. +type SecretHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicorev1.Secret] + +// SecretDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Secret. +type SecretDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicorev1.Secret] + +// SecretFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Secret. +type SecretFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicorev1.Secret] + +// SecretIndexers is a specialization of [cache.TypedIndexers] for Secret. +type SecretIndexers = cache.TypedIndexers[*apicorev1.Secret] + +// DeletedSecret is a specialization of [cache.DeletedObject] for Secret. +type DeletedSecret = cache.DeletedObject[*apicorev1.Secret] + type secretInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type secretInformer struct { // NewSecretInformer constructs a new informer for Secret type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedSecretInformer]). func NewSecretInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewSecretInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedSecretInformer constructs a new informer for Secret type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedSecretInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers SecretIndexers) SecretIndexInformer { + return NewTypedSecretInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredSecretInformer constructs a new informer for Secret type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredSecretInformer]). func NewFilteredSecretInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewSecretInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedSecretInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredSecretInformer constructs a new informer for Secret type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredSecretInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers SecretIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) SecretIndexInformer { + return NewTypedSecretInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewSecretInformerWithOptions constructs a new informer for Secret type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedSecretInformerWithOptions]). func NewSecretInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedSecretInformerWithOptions(client, namespace, options) +} + +// NewTypedSecretInformerWithOptions constructs a new informer for Secret type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedSecretInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) SecretIndexInformer { gvr := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "secrets"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicorev1.Secret](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewSecretInformerWithOptions(client kubernetes.Interface, namespace string, Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *secretInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewSecretInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedSecretInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *secretInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicorev1.Secret{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *secretInformer) TypedInformer() SecretIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.Secret](f.factory.InformerFor(&apicorev1.Secret{}, f.defaultInformer)) } func (f *secretInformer) Lister() corev1.SecretLister { return corev1.NewSecretLister(f.Informer().GetIndexer()) } + +// ToTypedSecretInformer converts an untyped informer into a TypedSecretInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Secret. If that is not the case, calling type-safe methods of the returned +// TypedSecretInformer leads to runtime panics. A safer alternative is to pass +// around a TypedSecretInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedSecretInformer(informer SecretInformer) TypedSecretInformer { + if informer, ok := informer.(TypedSecretInformer); ok { + return informer + } + return &secretTypedInformerAdapter{informer} +} + +type secretTypedInformerAdapter struct { + SecretInformer +} + +func (a *secretTypedInformerAdapter) TypedInformer() SecretIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.Secret](a.Informer()) +} + +// ToSecretIndexInformer converts an untyped informer into a SecretIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Secret. If that is not the case, calling type-safe methods of the returned +// SecretIndexInformer leads to runtime panics. A safer alternative is to pass +// around a SecretIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToSecretIndexInformer(informer cache.SharedIndexInformer) SecretIndexInformer { + if informer, ok := informer.(SecretIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicorev1.Secret](informer) +} diff --git a/vendor/k8s.io/client-go/informers/core/v1/service.go b/vendor/k8s.io/client-go/informers/core/v1/service.go index 4ec10b3227..0c804c0220 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/service.go +++ b/vendor/k8s.io/client-go/informers/core/v1/service.go @@ -34,12 +34,40 @@ import ( ) // ServiceInformer provides access to a shared informer and lister for -// Services. +// Services. Prefer using the type-safe variant (see [TypedServiceInformer]). type ServiceInformer interface { Informer() cache.SharedIndexInformer Lister() corev1.ServiceLister } +// TypedServiceInformer provides access to a shared informer and lister for +// Services, including the type-safe TypedInformer variant. +// It is a superset of ServiceInformer. +type TypedServiceInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ServiceIndexInformer + Lister() corev1.ServiceLister +} + +// ServiceIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ServiceIndexInformer cache.TypedSharedIndexInformer[*apicorev1.Service] + +// ServiceHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Service. +type ServiceHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicorev1.Service] + +// ServiceDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Service. +type ServiceDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicorev1.Service] + +// ServiceFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Service. +type ServiceFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicorev1.Service] + +// ServiceIndexers is a specialization of [cache.TypedIndexers] for Service. +type ServiceIndexers = cache.TypedIndexers[*apicorev1.Service] + +// DeletedService is a specialization of [cache.DeletedObject] for Service. +type DeletedService = cache.DeletedObject[*apicorev1.Service] + type serviceInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type serviceInformer struct { // NewServiceInformer constructs a new informer for Service type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedServiceInformer]). func NewServiceInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewServiceInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedServiceInformer constructs a new informer for Service type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedServiceInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ServiceIndexers) ServiceIndexInformer { + return NewTypedServiceInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredServiceInformer constructs a new informer for Service type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredServiceInformer]). func NewFilteredServiceInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewServiceInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedServiceInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredServiceInformer constructs a new informer for Service type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredServiceInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ServiceIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ServiceIndexInformer { + return NewTypedServiceInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewServiceInformerWithOptions constructs a new informer for Service type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedServiceInformerWithOptions]). func NewServiceInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedServiceInformerWithOptions(client, namespace, options) +} + +// NewTypedServiceInformerWithOptions constructs a new informer for Service type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedServiceInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) ServiceIndexInformer { gvr := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "services"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicorev1.Service](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewServiceInformerWithOptions(client kubernetes.Interface, namespace string Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *serviceInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewServiceInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedServiceInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *serviceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicorev1.Service{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *serviceInformer) TypedInformer() ServiceIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.Service](f.factory.InformerFor(&apicorev1.Service{}, f.defaultInformer)) } func (f *serviceInformer) Lister() corev1.ServiceLister { return corev1.NewServiceLister(f.Informer().GetIndexer()) } + +// ToTypedServiceInformer converts an untyped informer into a TypedServiceInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Service. If that is not the case, calling type-safe methods of the returned +// TypedServiceInformer leads to runtime panics. A safer alternative is to pass +// around a TypedServiceInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedServiceInformer(informer ServiceInformer) TypedServiceInformer { + if informer, ok := informer.(TypedServiceInformer); ok { + return informer + } + return &serviceTypedInformerAdapter{informer} +} + +type serviceTypedInformerAdapter struct { + ServiceInformer +} + +func (a *serviceTypedInformerAdapter) TypedInformer() ServiceIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.Service](a.Informer()) +} + +// ToServiceIndexInformer converts an untyped informer into a ServiceIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Service. If that is not the case, calling type-safe methods of the returned +// ServiceIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ServiceIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToServiceIndexInformer(informer cache.SharedIndexInformer) ServiceIndexInformer { + if informer, ok := informer.(ServiceIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicorev1.Service](informer) +} diff --git a/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go b/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go index 32751b6a38..6ca3cf6856 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go +++ b/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go @@ -34,12 +34,40 @@ import ( ) // ServiceAccountInformer provides access to a shared informer and lister for -// ServiceAccounts. +// ServiceAccounts. Prefer using the type-safe variant (see [TypedServiceAccountInformer]). type ServiceAccountInformer interface { Informer() cache.SharedIndexInformer Lister() corev1.ServiceAccountLister } +// TypedServiceAccountInformer provides access to a shared informer and lister for +// ServiceAccounts, including the type-safe TypedInformer variant. +// It is a superset of ServiceAccountInformer. +type TypedServiceAccountInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ServiceAccountIndexInformer + Lister() corev1.ServiceAccountLister +} + +// ServiceAccountIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ServiceAccountIndexInformer cache.TypedSharedIndexInformer[*apicorev1.ServiceAccount] + +// ServiceAccountHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ServiceAccount. +type ServiceAccountHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apicorev1.ServiceAccount] + +// ServiceAccountDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ServiceAccount. +type ServiceAccountDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apicorev1.ServiceAccount] + +// ServiceAccountFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ServiceAccount. +type ServiceAccountFilteringHandler = cache.TypedFilteringResourceEventHandler[*apicorev1.ServiceAccount] + +// ServiceAccountIndexers is a specialization of [cache.TypedIndexers] for ServiceAccount. +type ServiceAccountIndexers = cache.TypedIndexers[*apicorev1.ServiceAccount] + +// DeletedServiceAccount is a specialization of [cache.DeletedObject] for ServiceAccount. +type DeletedServiceAccount = cache.DeletedObject[*apicorev1.ServiceAccount] + type serviceAccountInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type serviceAccountInformer struct { // NewServiceAccountInformer constructs a new informer for ServiceAccount type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedServiceAccountInformer]). func NewServiceAccountInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewServiceAccountInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedServiceAccountInformer constructs a new informer for ServiceAccount type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedServiceAccountInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ServiceAccountIndexers) ServiceAccountIndexInformer { + return NewTypedServiceAccountInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredServiceAccountInformer constructs a new informer for ServiceAccount type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredServiceAccountInformer]). func NewFilteredServiceAccountInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewServiceAccountInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedServiceAccountInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredServiceAccountInformer constructs a new informer for ServiceAccount type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredServiceAccountInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ServiceAccountIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ServiceAccountIndexInformer { + return NewTypedServiceAccountInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewServiceAccountInformerWithOptions constructs a new informer for ServiceAccount type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedServiceAccountInformerWithOptions]). func NewServiceAccountInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedServiceAccountInformerWithOptions(client, namespace, options) +} + +// NewTypedServiceAccountInformerWithOptions constructs a new informer for ServiceAccount type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedServiceAccountInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) ServiceAccountIndexInformer { gvr := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "serviceaccounts"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apicorev1.ServiceAccount](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewServiceAccountInformerWithOptions(client kubernetes.Interface, namespace Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *serviceAccountInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewServiceAccountInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedServiceAccountInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *serviceAccountInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apicorev1.ServiceAccount{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *serviceAccountInformer) TypedInformer() ServiceAccountIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.ServiceAccount](f.factory.InformerFor(&apicorev1.ServiceAccount{}, f.defaultInformer)) } func (f *serviceAccountInformer) Lister() corev1.ServiceAccountLister { return corev1.NewServiceAccountLister(f.Informer().GetIndexer()) } + +// ToTypedServiceAccountInformer converts an untyped informer into a TypedServiceAccountInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ServiceAccount. If that is not the case, calling type-safe methods of the returned +// TypedServiceAccountInformer leads to runtime panics. A safer alternative is to pass +// around a TypedServiceAccountInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedServiceAccountInformer(informer ServiceAccountInformer) TypedServiceAccountInformer { + if informer, ok := informer.(TypedServiceAccountInformer); ok { + return informer + } + return &serviceAccountTypedInformerAdapter{informer} +} + +type serviceAccountTypedInformerAdapter struct { + ServiceAccountInformer +} + +func (a *serviceAccountTypedInformerAdapter) TypedInformer() ServiceAccountIndexInformer { + return cache.NewTypedSharedIndexInformer[*apicorev1.ServiceAccount](a.Informer()) +} + +// ToServiceAccountIndexInformer converts an untyped informer into a ServiceAccountIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ServiceAccount. If that is not the case, calling type-safe methods of the returned +// ServiceAccountIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ServiceAccountIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToServiceAccountIndexInformer(informer cache.SharedIndexInformer) ServiceAccountIndexInformer { + if informer, ok := informer.(ServiceAccountIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apicorev1.ServiceAccount](informer) +} diff --git a/vendor/k8s.io/client-go/informers/discovery/v1/endpointslice.go b/vendor/k8s.io/client-go/informers/discovery/v1/endpointslice.go index 999d514598..f037770867 100644 --- a/vendor/k8s.io/client-go/informers/discovery/v1/endpointslice.go +++ b/vendor/k8s.io/client-go/informers/discovery/v1/endpointslice.go @@ -34,12 +34,40 @@ import ( ) // EndpointSliceInformer provides access to a shared informer and lister for -// EndpointSlices. +// EndpointSlices. Prefer using the type-safe variant (see [TypedEndpointSliceInformer]). type EndpointSliceInformer interface { Informer() cache.SharedIndexInformer Lister() discoveryv1.EndpointSliceLister } +// TypedEndpointSliceInformer provides access to a shared informer and lister for +// EndpointSlices, including the type-safe TypedInformer variant. +// It is a superset of EndpointSliceInformer. +type TypedEndpointSliceInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() EndpointSliceIndexInformer + Lister() discoveryv1.EndpointSliceLister +} + +// EndpointSliceIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type EndpointSliceIndexInformer cache.TypedSharedIndexInformer[*apidiscoveryv1.EndpointSlice] + +// EndpointSliceHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for EndpointSlice. +type EndpointSliceHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apidiscoveryv1.EndpointSlice] + +// EndpointSliceDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for EndpointSlice. +type EndpointSliceDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apidiscoveryv1.EndpointSlice] + +// EndpointSliceFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for EndpointSlice. +type EndpointSliceFilteringHandler = cache.TypedFilteringResourceEventHandler[*apidiscoveryv1.EndpointSlice] + +// EndpointSliceIndexers is a specialization of [cache.TypedIndexers] for EndpointSlice. +type EndpointSliceIndexers = cache.TypedIndexers[*apidiscoveryv1.EndpointSlice] + +// DeletedEndpointSlice is a specialization of [cache.DeletedObject] for EndpointSlice. +type DeletedEndpointSlice = cache.DeletedObject[*apidiscoveryv1.EndpointSlice] + type endpointSliceInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type endpointSliceInformer struct { // NewEndpointSliceInformer constructs a new informer for EndpointSlice type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedEndpointSliceInformer]). func NewEndpointSliceInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewEndpointSliceInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedEndpointSliceInformer constructs a new informer for EndpointSlice type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedEndpointSliceInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers EndpointSliceIndexers) EndpointSliceIndexInformer { + return NewTypedEndpointSliceInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredEndpointSliceInformer constructs a new informer for EndpointSlice type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredEndpointSliceInformer]). func NewFilteredEndpointSliceInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewEndpointSliceInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedEndpointSliceInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredEndpointSliceInformer constructs a new informer for EndpointSlice type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredEndpointSliceInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers EndpointSliceIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) EndpointSliceIndexInformer { + return NewTypedEndpointSliceInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewEndpointSliceInformerWithOptions constructs a new informer for EndpointSlice type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedEndpointSliceInformerWithOptions]). func NewEndpointSliceInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedEndpointSliceInformerWithOptions(client, namespace, options) +} + +// NewTypedEndpointSliceInformerWithOptions constructs a new informer for EndpointSlice type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedEndpointSliceInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) EndpointSliceIndexInformer { gvr := schema.GroupVersionResource{Group: "discovery.k8s.io", Version: "v1", Resource: "endpointslices"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apidiscoveryv1.EndpointSlice](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewEndpointSliceInformerWithOptions(client kubernetes.Interface, namespace Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *endpointSliceInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewEndpointSliceInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedEndpointSliceInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *endpointSliceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apidiscoveryv1.EndpointSlice{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *endpointSliceInformer) TypedInformer() EndpointSliceIndexInformer { + return cache.NewTypedSharedIndexInformer[*apidiscoveryv1.EndpointSlice](f.factory.InformerFor(&apidiscoveryv1.EndpointSlice{}, f.defaultInformer)) } func (f *endpointSliceInformer) Lister() discoveryv1.EndpointSliceLister { return discoveryv1.NewEndpointSliceLister(f.Informer().GetIndexer()) } + +// ToTypedEndpointSliceInformer converts an untyped informer into a TypedEndpointSliceInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *EndpointSlice. If that is not the case, calling type-safe methods of the returned +// TypedEndpointSliceInformer leads to runtime panics. A safer alternative is to pass +// around a TypedEndpointSliceInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedEndpointSliceInformer(informer EndpointSliceInformer) TypedEndpointSliceInformer { + if informer, ok := informer.(TypedEndpointSliceInformer); ok { + return informer + } + return &endpointSliceTypedInformerAdapter{informer} +} + +type endpointSliceTypedInformerAdapter struct { + EndpointSliceInformer +} + +func (a *endpointSliceTypedInformerAdapter) TypedInformer() EndpointSliceIndexInformer { + return cache.NewTypedSharedIndexInformer[*apidiscoveryv1.EndpointSlice](a.Informer()) +} + +// ToEndpointSliceIndexInformer converts an untyped informer into a EndpointSliceIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *EndpointSlice. If that is not the case, calling type-safe methods of the returned +// EndpointSliceIndexInformer leads to runtime panics. A safer alternative is to pass +// around a EndpointSliceIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToEndpointSliceIndexInformer(informer cache.SharedIndexInformer) EndpointSliceIndexInformer { + if informer, ok := informer.(EndpointSliceIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apidiscoveryv1.EndpointSlice](informer) +} diff --git a/vendor/k8s.io/client-go/informers/discovery/v1/interface.go b/vendor/k8s.io/client-go/informers/discovery/v1/interface.go index d90c63c0a9..889b917e05 100644 --- a/vendor/k8s.io/client-go/informers/discovery/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/discovery/v1/interface.go @@ -25,7 +25,7 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // EndpointSlices returns a EndpointSliceInformer. - EndpointSlices() EndpointSliceInformer + EndpointSlices() TypedEndpointSliceInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// EndpointSlices returns a EndpointSliceInformer. -func (v *version) EndpointSlices() EndpointSliceInformer { +// EndpointSlices returns a TypedEndpointSliceInformer. +func (v *version) EndpointSlices() TypedEndpointSliceInformer { return &endpointSliceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/discovery/v1beta1/endpointslice.go b/vendor/k8s.io/client-go/informers/discovery/v1beta1/endpointslice.go index 918e30485f..5fa7068782 100644 --- a/vendor/k8s.io/client-go/informers/discovery/v1beta1/endpointslice.go +++ b/vendor/k8s.io/client-go/informers/discovery/v1beta1/endpointslice.go @@ -34,12 +34,40 @@ import ( ) // EndpointSliceInformer provides access to a shared informer and lister for -// EndpointSlices. +// EndpointSlices. Prefer using the type-safe variant (see [TypedEndpointSliceInformer]). type EndpointSliceInformer interface { Informer() cache.SharedIndexInformer Lister() discoveryv1beta1.EndpointSliceLister } +// TypedEndpointSliceInformer provides access to a shared informer and lister for +// EndpointSlices, including the type-safe TypedInformer variant. +// It is a superset of EndpointSliceInformer. +type TypedEndpointSliceInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() EndpointSliceIndexInformer + Lister() discoveryv1beta1.EndpointSliceLister +} + +// EndpointSliceIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type EndpointSliceIndexInformer cache.TypedSharedIndexInformer[*apidiscoveryv1beta1.EndpointSlice] + +// EndpointSliceHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for EndpointSlice. +type EndpointSliceHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apidiscoveryv1beta1.EndpointSlice] + +// EndpointSliceDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for EndpointSlice. +type EndpointSliceDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apidiscoveryv1beta1.EndpointSlice] + +// EndpointSliceFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for EndpointSlice. +type EndpointSliceFilteringHandler = cache.TypedFilteringResourceEventHandler[*apidiscoveryv1beta1.EndpointSlice] + +// EndpointSliceIndexers is a specialization of [cache.TypedIndexers] for EndpointSlice. +type EndpointSliceIndexers = cache.TypedIndexers[*apidiscoveryv1beta1.EndpointSlice] + +// DeletedEndpointSlice is a specialization of [cache.DeletedObject] for EndpointSlice. +type DeletedEndpointSlice = cache.DeletedObject[*apidiscoveryv1beta1.EndpointSlice] + type endpointSliceInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type endpointSliceInformer struct { // NewEndpointSliceInformer constructs a new informer for EndpointSlice type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedEndpointSliceInformer]). func NewEndpointSliceInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewEndpointSliceInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedEndpointSliceInformer constructs a new informer for EndpointSlice type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedEndpointSliceInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers EndpointSliceIndexers) EndpointSliceIndexInformer { + return NewTypedEndpointSliceInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredEndpointSliceInformer constructs a new informer for EndpointSlice type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredEndpointSliceInformer]). func NewFilteredEndpointSliceInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewEndpointSliceInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedEndpointSliceInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredEndpointSliceInformer constructs a new informer for EndpointSlice type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredEndpointSliceInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers EndpointSliceIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) EndpointSliceIndexInformer { + return NewTypedEndpointSliceInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewEndpointSliceInformerWithOptions constructs a new informer for EndpointSlice type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedEndpointSliceInformerWithOptions]). func NewEndpointSliceInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedEndpointSliceInformerWithOptions(client, namespace, options) +} + +// NewTypedEndpointSliceInformerWithOptions constructs a new informer for EndpointSlice type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedEndpointSliceInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) EndpointSliceIndexInformer { gvr := schema.GroupVersionResource{Group: "discovery.k8s.io", Version: "v1beta1", Resource: "endpointslices"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apidiscoveryv1beta1.EndpointSlice](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewEndpointSliceInformerWithOptions(client kubernetes.Interface, namespace Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *endpointSliceInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewEndpointSliceInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedEndpointSliceInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *endpointSliceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apidiscoveryv1beta1.EndpointSlice{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *endpointSliceInformer) TypedInformer() EndpointSliceIndexInformer { + return cache.NewTypedSharedIndexInformer[*apidiscoveryv1beta1.EndpointSlice](f.factory.InformerFor(&apidiscoveryv1beta1.EndpointSlice{}, f.defaultInformer)) } func (f *endpointSliceInformer) Lister() discoveryv1beta1.EndpointSliceLister { return discoveryv1beta1.NewEndpointSliceLister(f.Informer().GetIndexer()) } + +// ToTypedEndpointSliceInformer converts an untyped informer into a TypedEndpointSliceInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *EndpointSlice. If that is not the case, calling type-safe methods of the returned +// TypedEndpointSliceInformer leads to runtime panics. A safer alternative is to pass +// around a TypedEndpointSliceInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedEndpointSliceInformer(informer EndpointSliceInformer) TypedEndpointSliceInformer { + if informer, ok := informer.(TypedEndpointSliceInformer); ok { + return informer + } + return &endpointSliceTypedInformerAdapter{informer} +} + +type endpointSliceTypedInformerAdapter struct { + EndpointSliceInformer +} + +func (a *endpointSliceTypedInformerAdapter) TypedInformer() EndpointSliceIndexInformer { + return cache.NewTypedSharedIndexInformer[*apidiscoveryv1beta1.EndpointSlice](a.Informer()) +} + +// ToEndpointSliceIndexInformer converts an untyped informer into a EndpointSliceIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *EndpointSlice. If that is not the case, calling type-safe methods of the returned +// EndpointSliceIndexInformer leads to runtime panics. A safer alternative is to pass +// around a EndpointSliceIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToEndpointSliceIndexInformer(informer cache.SharedIndexInformer) EndpointSliceIndexInformer { + if informer, ok := informer.(EndpointSliceIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apidiscoveryv1beta1.EndpointSlice](informer) +} diff --git a/vendor/k8s.io/client-go/informers/discovery/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/discovery/v1beta1/interface.go index 4661646e01..f0866a4ff6 100644 --- a/vendor/k8s.io/client-go/informers/discovery/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/discovery/v1beta1/interface.go @@ -25,7 +25,7 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // EndpointSlices returns a EndpointSliceInformer. - EndpointSlices() EndpointSliceInformer + EndpointSlices() TypedEndpointSliceInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// EndpointSlices returns a EndpointSliceInformer. -func (v *version) EndpointSlices() EndpointSliceInformer { +// EndpointSlices returns a TypedEndpointSliceInformer. +func (v *version) EndpointSlices() TypedEndpointSliceInformer { return &endpointSliceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/events/v1/event.go b/vendor/k8s.io/client-go/informers/events/v1/event.go index 23aaa68479..d0bd73b500 100644 --- a/vendor/k8s.io/client-go/informers/events/v1/event.go +++ b/vendor/k8s.io/client-go/informers/events/v1/event.go @@ -34,12 +34,40 @@ import ( ) // EventInformer provides access to a shared informer and lister for -// Events. +// Events. Prefer using the type-safe variant (see [TypedEventInformer]). type EventInformer interface { Informer() cache.SharedIndexInformer Lister() eventsv1.EventLister } +// TypedEventInformer provides access to a shared informer and lister for +// Events, including the type-safe TypedInformer variant. +// It is a superset of EventInformer. +type TypedEventInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() EventIndexInformer + Lister() eventsv1.EventLister +} + +// EventIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type EventIndexInformer cache.TypedSharedIndexInformer[*apieventsv1.Event] + +// EventHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Event. +type EventHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apieventsv1.Event] + +// EventDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Event. +type EventDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apieventsv1.Event] + +// EventFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Event. +type EventFilteringHandler = cache.TypedFilteringResourceEventHandler[*apieventsv1.Event] + +// EventIndexers is a specialization of [cache.TypedIndexers] for Event. +type EventIndexers = cache.TypedIndexers[*apieventsv1.Event] + +// DeletedEvent is a specialization of [cache.DeletedObject] for Event. +type DeletedEvent = cache.DeletedObject[*apieventsv1.Event] + type eventInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type eventInformer struct { // NewEventInformer constructs a new informer for Event type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedEventInformer]). func NewEventInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewEventInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedEventInformer constructs a new informer for Event type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedEventInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers EventIndexers) EventIndexInformer { + return NewTypedEventInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredEventInformer constructs a new informer for Event type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredEventInformer]). func NewFilteredEventInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewEventInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedEventInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredEventInformer constructs a new informer for Event type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredEventInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers EventIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) EventIndexInformer { + return NewTypedEventInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewEventInformerWithOptions constructs a new informer for Event type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedEventInformerWithOptions]). func NewEventInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedEventInformerWithOptions(client, namespace, options) +} + +// NewTypedEventInformerWithOptions constructs a new informer for Event type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedEventInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) EventIndexInformer { gvr := schema.GroupVersionResource{Group: "events.k8s.io", Version: "v1", Resource: "events"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apieventsv1.Event](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewEventInformerWithOptions(client kubernetes.Interface, namespace string, Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *eventInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewEventInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedEventInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *eventInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apieventsv1.Event{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *eventInformer) TypedInformer() EventIndexInformer { + return cache.NewTypedSharedIndexInformer[*apieventsv1.Event](f.factory.InformerFor(&apieventsv1.Event{}, f.defaultInformer)) } func (f *eventInformer) Lister() eventsv1.EventLister { return eventsv1.NewEventLister(f.Informer().GetIndexer()) } + +// ToTypedEventInformer converts an untyped informer into a TypedEventInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Event. If that is not the case, calling type-safe methods of the returned +// TypedEventInformer leads to runtime panics. A safer alternative is to pass +// around a TypedEventInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedEventInformer(informer EventInformer) TypedEventInformer { + if informer, ok := informer.(TypedEventInformer); ok { + return informer + } + return &eventTypedInformerAdapter{informer} +} + +type eventTypedInformerAdapter struct { + EventInformer +} + +func (a *eventTypedInformerAdapter) TypedInformer() EventIndexInformer { + return cache.NewTypedSharedIndexInformer[*apieventsv1.Event](a.Informer()) +} + +// ToEventIndexInformer converts an untyped informer into a EventIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Event. If that is not the case, calling type-safe methods of the returned +// EventIndexInformer leads to runtime panics. A safer alternative is to pass +// around a EventIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToEventIndexInformer(informer cache.SharedIndexInformer) EventIndexInformer { + if informer, ok := informer.(EventIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apieventsv1.Event](informer) +} diff --git a/vendor/k8s.io/client-go/informers/events/v1/interface.go b/vendor/k8s.io/client-go/informers/events/v1/interface.go index cd06e23359..8b2571298b 100644 --- a/vendor/k8s.io/client-go/informers/events/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/events/v1/interface.go @@ -25,7 +25,7 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // Events returns a EventInformer. - Events() EventInformer + Events() TypedEventInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// Events returns a EventInformer. -func (v *version) Events() EventInformer { +// Events returns a TypedEventInformer. +func (v *version) Events() TypedEventInformer { return &eventInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/events/v1beta1/event.go b/vendor/k8s.io/client-go/informers/events/v1beta1/event.go index ea0117eaca..fc3d7203dc 100644 --- a/vendor/k8s.io/client-go/informers/events/v1beta1/event.go +++ b/vendor/k8s.io/client-go/informers/events/v1beta1/event.go @@ -34,12 +34,40 @@ import ( ) // EventInformer provides access to a shared informer and lister for -// Events. +// Events. Prefer using the type-safe variant (see [TypedEventInformer]). type EventInformer interface { Informer() cache.SharedIndexInformer Lister() eventsv1beta1.EventLister } +// TypedEventInformer provides access to a shared informer and lister for +// Events, including the type-safe TypedInformer variant. +// It is a superset of EventInformer. +type TypedEventInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() EventIndexInformer + Lister() eventsv1beta1.EventLister +} + +// EventIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type EventIndexInformer cache.TypedSharedIndexInformer[*apieventsv1beta1.Event] + +// EventHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Event. +type EventHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apieventsv1beta1.Event] + +// EventDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Event. +type EventDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apieventsv1beta1.Event] + +// EventFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Event. +type EventFilteringHandler = cache.TypedFilteringResourceEventHandler[*apieventsv1beta1.Event] + +// EventIndexers is a specialization of [cache.TypedIndexers] for Event. +type EventIndexers = cache.TypedIndexers[*apieventsv1beta1.Event] + +// DeletedEvent is a specialization of [cache.DeletedObject] for Event. +type DeletedEvent = cache.DeletedObject[*apieventsv1beta1.Event] + type eventInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type eventInformer struct { // NewEventInformer constructs a new informer for Event type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedEventInformer]). func NewEventInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewEventInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedEventInformer constructs a new informer for Event type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedEventInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers EventIndexers) EventIndexInformer { + return NewTypedEventInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredEventInformer constructs a new informer for Event type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredEventInformer]). func NewFilteredEventInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewEventInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedEventInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredEventInformer constructs a new informer for Event type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredEventInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers EventIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) EventIndexInformer { + return NewTypedEventInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewEventInformerWithOptions constructs a new informer for Event type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedEventInformerWithOptions]). func NewEventInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedEventInformerWithOptions(client, namespace, options) +} + +// NewTypedEventInformerWithOptions constructs a new informer for Event type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedEventInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) EventIndexInformer { gvr := schema.GroupVersionResource{Group: "events.k8s.io", Version: "v1beta1", Resource: "events"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apieventsv1beta1.Event](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewEventInformerWithOptions(client kubernetes.Interface, namespace string, Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *eventInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewEventInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedEventInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *eventInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apieventsv1beta1.Event{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *eventInformer) TypedInformer() EventIndexInformer { + return cache.NewTypedSharedIndexInformer[*apieventsv1beta1.Event](f.factory.InformerFor(&apieventsv1beta1.Event{}, f.defaultInformer)) } func (f *eventInformer) Lister() eventsv1beta1.EventLister { return eventsv1beta1.NewEventLister(f.Informer().GetIndexer()) } + +// ToTypedEventInformer converts an untyped informer into a TypedEventInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Event. If that is not the case, calling type-safe methods of the returned +// TypedEventInformer leads to runtime panics. A safer alternative is to pass +// around a TypedEventInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedEventInformer(informer EventInformer) TypedEventInformer { + if informer, ok := informer.(TypedEventInformer); ok { + return informer + } + return &eventTypedInformerAdapter{informer} +} + +type eventTypedInformerAdapter struct { + EventInformer +} + +func (a *eventTypedInformerAdapter) TypedInformer() EventIndexInformer { + return cache.NewTypedSharedIndexInformer[*apieventsv1beta1.Event](a.Informer()) +} + +// ToEventIndexInformer converts an untyped informer into a EventIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Event. If that is not the case, calling type-safe methods of the returned +// EventIndexInformer leads to runtime panics. A safer alternative is to pass +// around a EventIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToEventIndexInformer(informer cache.SharedIndexInformer) EventIndexInformer { + if informer, ok := informer.(EventIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apieventsv1beta1.Event](informer) +} diff --git a/vendor/k8s.io/client-go/informers/events/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/events/v1beta1/interface.go index c71888c9a4..9b69ebe28e 100644 --- a/vendor/k8s.io/client-go/informers/events/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/events/v1beta1/interface.go @@ -25,7 +25,7 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // Events returns a EventInformer. - Events() EventInformer + Events() TypedEventInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// Events returns a EventInformer. -func (v *version) Events() EventInformer { +// Events returns a TypedEventInformer. +func (v *version) Events() TypedEventInformer { return &eventInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go index ed8b023038..1c3e4f7ac5 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go @@ -34,12 +34,40 @@ import ( ) // DaemonSetInformer provides access to a shared informer and lister for -// DaemonSets. +// DaemonSets. Prefer using the type-safe variant (see [TypedDaemonSetInformer]). type DaemonSetInformer interface { Informer() cache.SharedIndexInformer Lister() extensionsv1beta1.DaemonSetLister } +// TypedDaemonSetInformer provides access to a shared informer and lister for +// DaemonSets, including the type-safe TypedInformer variant. +// It is a superset of DaemonSetInformer. +type TypedDaemonSetInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() DaemonSetIndexInformer + Lister() extensionsv1beta1.DaemonSetLister +} + +// DaemonSetIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type DaemonSetIndexInformer cache.TypedSharedIndexInformer[*apiextensionsv1beta1.DaemonSet] + +// DaemonSetHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for DaemonSet. +type DaemonSetHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiextensionsv1beta1.DaemonSet] + +// DaemonSetDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for DaemonSet. +type DaemonSetDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiextensionsv1beta1.DaemonSet] + +// DaemonSetFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for DaemonSet. +type DaemonSetFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiextensionsv1beta1.DaemonSet] + +// DaemonSetIndexers is a specialization of [cache.TypedIndexers] for DaemonSet. +type DaemonSetIndexers = cache.TypedIndexers[*apiextensionsv1beta1.DaemonSet] + +// DeletedDaemonSet is a specialization of [cache.DeletedObject] for DaemonSet. +type DeletedDaemonSet = cache.DeletedObject[*apiextensionsv1beta1.DaemonSet] + type daemonSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type daemonSetInformer struct { // NewDaemonSetInformer constructs a new informer for DaemonSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDaemonSetInformer]). func NewDaemonSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewDaemonSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedDaemonSetInformer constructs a new informer for DaemonSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDaemonSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers DaemonSetIndexers) DaemonSetIndexInformer { + return NewTypedDaemonSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredDaemonSetInformer constructs a new informer for DaemonSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredDaemonSetInformer]). func NewFilteredDaemonSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewDaemonSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedDaemonSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredDaemonSetInformer constructs a new informer for DaemonSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredDaemonSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers DaemonSetIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) DaemonSetIndexInformer { + return NewTypedDaemonSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewDaemonSetInformerWithOptions constructs a new informer for DaemonSet type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDaemonSetInformerWithOptions]). func NewDaemonSetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedDaemonSetInformerWithOptions(client, namespace, options) +} + +// NewTypedDaemonSetInformerWithOptions constructs a new informer for DaemonSet type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDaemonSetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) DaemonSetIndexInformer { gvr := schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "daemonsets"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.DaemonSet](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewDaemonSetInformerWithOptions(client kubernetes.Interface, namespace stri Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *daemonSetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewDaemonSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedDaemonSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *daemonSetInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiextensionsv1beta1.DaemonSet{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *daemonSetInformer) TypedInformer() DaemonSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.DaemonSet](f.factory.InformerFor(&apiextensionsv1beta1.DaemonSet{}, f.defaultInformer)) } func (f *daemonSetInformer) Lister() extensionsv1beta1.DaemonSetLister { return extensionsv1beta1.NewDaemonSetLister(f.Informer().GetIndexer()) } + +// ToTypedDaemonSetInformer converts an untyped informer into a TypedDaemonSetInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *DaemonSet. If that is not the case, calling type-safe methods of the returned +// TypedDaemonSetInformer leads to runtime panics. A safer alternative is to pass +// around a TypedDaemonSetInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedDaemonSetInformer(informer DaemonSetInformer) TypedDaemonSetInformer { + if informer, ok := informer.(TypedDaemonSetInformer); ok { + return informer + } + return &daemonSetTypedInformerAdapter{informer} +} + +type daemonSetTypedInformerAdapter struct { + DaemonSetInformer +} + +func (a *daemonSetTypedInformerAdapter) TypedInformer() DaemonSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.DaemonSet](a.Informer()) +} + +// ToDaemonSetIndexInformer converts an untyped informer into a DaemonSetIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *DaemonSet. If that is not the case, calling type-safe methods of the returned +// DaemonSetIndexInformer leads to runtime panics. A safer alternative is to pass +// around a DaemonSetIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToDaemonSetIndexInformer(informer cache.SharedIndexInformer) DaemonSetIndexInformer { + if informer, ok := informer.(DaemonSetIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.DaemonSet](informer) +} diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go index ee328bb517..331298be94 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go @@ -34,12 +34,40 @@ import ( ) // DeploymentInformer provides access to a shared informer and lister for -// Deployments. +// Deployments. Prefer using the type-safe variant (see [TypedDeploymentInformer]). type DeploymentInformer interface { Informer() cache.SharedIndexInformer Lister() extensionsv1beta1.DeploymentLister } +// TypedDeploymentInformer provides access to a shared informer and lister for +// Deployments, including the type-safe TypedInformer variant. +// It is a superset of DeploymentInformer. +type TypedDeploymentInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() DeploymentIndexInformer + Lister() extensionsv1beta1.DeploymentLister +} + +// DeploymentIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type DeploymentIndexInformer cache.TypedSharedIndexInformer[*apiextensionsv1beta1.Deployment] + +// DeploymentHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Deployment. +type DeploymentHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiextensionsv1beta1.Deployment] + +// DeploymentDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Deployment. +type DeploymentDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiextensionsv1beta1.Deployment] + +// DeploymentFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Deployment. +type DeploymentFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiextensionsv1beta1.Deployment] + +// DeploymentIndexers is a specialization of [cache.TypedIndexers] for Deployment. +type DeploymentIndexers = cache.TypedIndexers[*apiextensionsv1beta1.Deployment] + +// DeletedDeployment is a specialization of [cache.DeletedObject] for Deployment. +type DeletedDeployment = cache.DeletedObject[*apiextensionsv1beta1.Deployment] + type deploymentInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type deploymentInformer struct { // NewDeploymentInformer constructs a new informer for Deployment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeploymentInformer]). func NewDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedDeploymentInformer constructs a new informer for Deployment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers DeploymentIndexers) DeploymentIndexInformer { + return NewTypedDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredDeploymentInformer constructs a new informer for Deployment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredDeploymentInformer]). func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredDeploymentInformer constructs a new informer for Deployment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredDeploymentInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers DeploymentIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) DeploymentIndexInformer { + return NewTypedDeploymentInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewDeploymentInformerWithOptions constructs a new informer for Deployment type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeploymentInformerWithOptions]). func NewDeploymentInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedDeploymentInformerWithOptions(client, namespace, options) +} + +// NewTypedDeploymentInformerWithOptions constructs a new informer for Deployment type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeploymentInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) DeploymentIndexInformer { gvr := schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "deployments"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.Deployment](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewDeploymentInformerWithOptions(client kubernetes.Interface, namespace str Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *deploymentInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewDeploymentInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedDeploymentInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *deploymentInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiextensionsv1beta1.Deployment{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *deploymentInformer) TypedInformer() DeploymentIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.Deployment](f.factory.InformerFor(&apiextensionsv1beta1.Deployment{}, f.defaultInformer)) } func (f *deploymentInformer) Lister() extensionsv1beta1.DeploymentLister { return extensionsv1beta1.NewDeploymentLister(f.Informer().GetIndexer()) } + +// ToTypedDeploymentInformer converts an untyped informer into a TypedDeploymentInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Deployment. If that is not the case, calling type-safe methods of the returned +// TypedDeploymentInformer leads to runtime panics. A safer alternative is to pass +// around a TypedDeploymentInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedDeploymentInformer(informer DeploymentInformer) TypedDeploymentInformer { + if informer, ok := informer.(TypedDeploymentInformer); ok { + return informer + } + return &deploymentTypedInformerAdapter{informer} +} + +type deploymentTypedInformerAdapter struct { + DeploymentInformer +} + +func (a *deploymentTypedInformerAdapter) TypedInformer() DeploymentIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.Deployment](a.Informer()) +} + +// ToDeploymentIndexInformer converts an untyped informer into a DeploymentIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Deployment. If that is not the case, calling type-safe methods of the returned +// DeploymentIndexInformer leads to runtime panics. A safer alternative is to pass +// around a DeploymentIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToDeploymentIndexInformer(informer cache.SharedIndexInformer) DeploymentIndexInformer { + if informer, ok := informer.(DeploymentIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.Deployment](informer) +} diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go index 852238a481..31fa5723f2 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go @@ -34,12 +34,40 @@ import ( ) // IngressInformer provides access to a shared informer and lister for -// Ingresses. +// Ingresses. Prefer using the type-safe variant (see [TypedIngressInformer]). type IngressInformer interface { Informer() cache.SharedIndexInformer Lister() extensionsv1beta1.IngressLister } +// TypedIngressInformer provides access to a shared informer and lister for +// Ingresses, including the type-safe TypedInformer variant. +// It is a superset of IngressInformer. +type TypedIngressInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() IngressIndexInformer + Lister() extensionsv1beta1.IngressLister +} + +// IngressIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type IngressIndexInformer cache.TypedSharedIndexInformer[*apiextensionsv1beta1.Ingress] + +// IngressHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Ingress. +type IngressHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiextensionsv1beta1.Ingress] + +// IngressDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Ingress. +type IngressDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiextensionsv1beta1.Ingress] + +// IngressFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Ingress. +type IngressFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiextensionsv1beta1.Ingress] + +// IngressIndexers is a specialization of [cache.TypedIndexers] for Ingress. +type IngressIndexers = cache.TypedIndexers[*apiextensionsv1beta1.Ingress] + +// DeletedIngress is a specialization of [cache.DeletedObject] for Ingress. +type DeletedIngress = cache.DeletedObject[*apiextensionsv1beta1.Ingress] + type ingressInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type ingressInformer struct { // NewIngressInformer constructs a new informer for Ingress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIngressInformer]). func NewIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewIngressInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedIngressInformer constructs a new informer for Ingress type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers IngressIndexers) IngressIndexInformer { + return NewTypedIngressInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredIngressInformer constructs a new informer for Ingress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredIngressInformer]). func NewFilteredIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewIngressInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedIngressInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredIngressInformer constructs a new informer for Ingress type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers IngressIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) IngressIndexInformer { + return NewTypedIngressInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewIngressInformerWithOptions constructs a new informer for Ingress type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIngressInformerWithOptions]). func NewIngressInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedIngressInformerWithOptions(client, namespace, options) +} + +// NewTypedIngressInformerWithOptions constructs a new informer for Ingress type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIngressInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) IngressIndexInformer { gvr := schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "ingresss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.Ingress](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewIngressInformerWithOptions(client kubernetes.Interface, namespace string Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *ingressInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewIngressInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedIngressInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *ingressInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiextensionsv1beta1.Ingress{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *ingressInformer) TypedInformer() IngressIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.Ingress](f.factory.InformerFor(&apiextensionsv1beta1.Ingress{}, f.defaultInformer)) } func (f *ingressInformer) Lister() extensionsv1beta1.IngressLister { return extensionsv1beta1.NewIngressLister(f.Informer().GetIndexer()) } + +// ToTypedIngressInformer converts an untyped informer into a TypedIngressInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Ingress. If that is not the case, calling type-safe methods of the returned +// TypedIngressInformer leads to runtime panics. A safer alternative is to pass +// around a TypedIngressInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedIngressInformer(informer IngressInformer) TypedIngressInformer { + if informer, ok := informer.(TypedIngressInformer); ok { + return informer + } + return &ingressTypedInformerAdapter{informer} +} + +type ingressTypedInformerAdapter struct { + IngressInformer +} + +func (a *ingressTypedInformerAdapter) TypedInformer() IngressIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.Ingress](a.Informer()) +} + +// ToIngressIndexInformer converts an untyped informer into a IngressIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Ingress. If that is not the case, calling type-safe methods of the returned +// IngressIndexInformer leads to runtime panics. A safer alternative is to pass +// around a IngressIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToIngressIndexInformer(informer cache.SharedIndexInformer) IngressIndexInformer { + if informer, ok := informer.(IngressIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.Ingress](informer) +} diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/interface.go index 600741e3a2..7c56361720 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/interface.go @@ -25,15 +25,15 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // DaemonSets returns a DaemonSetInformer. - DaemonSets() DaemonSetInformer + DaemonSets() TypedDaemonSetInformer // Deployments returns a DeploymentInformer. - Deployments() DeploymentInformer + Deployments() TypedDeploymentInformer // Ingresses returns a IngressInformer. - Ingresses() IngressInformer + Ingresses() TypedIngressInformer // NetworkPolicies returns a NetworkPolicyInformer. - NetworkPolicies() NetworkPolicyInformer + NetworkPolicies() TypedNetworkPolicyInformer // ReplicaSets returns a ReplicaSetInformer. - ReplicaSets() ReplicaSetInformer + ReplicaSets() TypedReplicaSetInformer } type version struct { @@ -47,27 +47,27 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// DaemonSets returns a DaemonSetInformer. -func (v *version) DaemonSets() DaemonSetInformer { +// DaemonSets returns a TypedDaemonSetInformer. +func (v *version) DaemonSets() TypedDaemonSetInformer { return &daemonSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Deployments returns a DeploymentInformer. -func (v *version) Deployments() DeploymentInformer { +// Deployments returns a TypedDeploymentInformer. +func (v *version) Deployments() TypedDeploymentInformer { return &deploymentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Ingresses returns a IngressInformer. -func (v *version) Ingresses() IngressInformer { +// Ingresses returns a TypedIngressInformer. +func (v *version) Ingresses() TypedIngressInformer { return &ingressInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// NetworkPolicies returns a NetworkPolicyInformer. -func (v *version) NetworkPolicies() NetworkPolicyInformer { +// NetworkPolicies returns a TypedNetworkPolicyInformer. +func (v *version) NetworkPolicies() TypedNetworkPolicyInformer { return &networkPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ReplicaSets returns a ReplicaSetInformer. -func (v *version) ReplicaSets() ReplicaSetInformer { +// ReplicaSets returns a TypedReplicaSetInformer. +func (v *version) ReplicaSets() TypedReplicaSetInformer { return &replicaSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/networkpolicy.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/networkpolicy.go index fda46c1d96..2bec16ad2b 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/networkpolicy.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/networkpolicy.go @@ -34,12 +34,40 @@ import ( ) // NetworkPolicyInformer provides access to a shared informer and lister for -// NetworkPolicies. +// NetworkPolicies. Prefer using the type-safe variant (see [TypedNetworkPolicyInformer]). type NetworkPolicyInformer interface { Informer() cache.SharedIndexInformer Lister() extensionsv1beta1.NetworkPolicyLister } +// TypedNetworkPolicyInformer provides access to a shared informer and lister for +// NetworkPolicies, including the type-safe TypedInformer variant. +// It is a superset of NetworkPolicyInformer. +type TypedNetworkPolicyInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() NetworkPolicyIndexInformer + Lister() extensionsv1beta1.NetworkPolicyLister +} + +// NetworkPolicyIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type NetworkPolicyIndexInformer cache.TypedSharedIndexInformer[*apiextensionsv1beta1.NetworkPolicy] + +// NetworkPolicyHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for NetworkPolicy. +type NetworkPolicyHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiextensionsv1beta1.NetworkPolicy] + +// NetworkPolicyDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for NetworkPolicy. +type NetworkPolicyDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiextensionsv1beta1.NetworkPolicy] + +// NetworkPolicyFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for NetworkPolicy. +type NetworkPolicyFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiextensionsv1beta1.NetworkPolicy] + +// NetworkPolicyIndexers is a specialization of [cache.TypedIndexers] for NetworkPolicy. +type NetworkPolicyIndexers = cache.TypedIndexers[*apiextensionsv1beta1.NetworkPolicy] + +// DeletedNetworkPolicy is a specialization of [cache.DeletedObject] for NetworkPolicy. +type DeletedNetworkPolicy = cache.DeletedObject[*apiextensionsv1beta1.NetworkPolicy] + type networkPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type networkPolicyInformer struct { // NewNetworkPolicyInformer constructs a new informer for NetworkPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedNetworkPolicyInformer]). func NewNetworkPolicyInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedNetworkPolicyInformer constructs a new informer for NetworkPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedNetworkPolicyInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers NetworkPolicyIndexers) NetworkPolicyIndexInformer { + return NewTypedNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredNetworkPolicyInformer constructs a new informer for NetworkPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredNetworkPolicyInformer]). func NewFilteredNetworkPolicyInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredNetworkPolicyInformer constructs a new informer for NetworkPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredNetworkPolicyInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers NetworkPolicyIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) NetworkPolicyIndexInformer { + return NewTypedNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewNetworkPolicyInformerWithOptions constructs a new informer for NetworkPolicy type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedNetworkPolicyInformerWithOptions]). func NewNetworkPolicyInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedNetworkPolicyInformerWithOptions(client, namespace, options) +} + +// NewTypedNetworkPolicyInformerWithOptions constructs a new informer for NetworkPolicy type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedNetworkPolicyInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) NetworkPolicyIndexInformer { gvr := schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "networkpolicys"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.NetworkPolicy](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewNetworkPolicyInformerWithOptions(client kubernetes.Interface, namespace Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *networkPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewNetworkPolicyInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedNetworkPolicyInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *networkPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiextensionsv1beta1.NetworkPolicy{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *networkPolicyInformer) TypedInformer() NetworkPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.NetworkPolicy](f.factory.InformerFor(&apiextensionsv1beta1.NetworkPolicy{}, f.defaultInformer)) } func (f *networkPolicyInformer) Lister() extensionsv1beta1.NetworkPolicyLister { return extensionsv1beta1.NewNetworkPolicyLister(f.Informer().GetIndexer()) } + +// ToTypedNetworkPolicyInformer converts an untyped informer into a TypedNetworkPolicyInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *NetworkPolicy. If that is not the case, calling type-safe methods of the returned +// TypedNetworkPolicyInformer leads to runtime panics. A safer alternative is to pass +// around a TypedNetworkPolicyInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedNetworkPolicyInformer(informer NetworkPolicyInformer) TypedNetworkPolicyInformer { + if informer, ok := informer.(TypedNetworkPolicyInformer); ok { + return informer + } + return &networkPolicyTypedInformerAdapter{informer} +} + +type networkPolicyTypedInformerAdapter struct { + NetworkPolicyInformer +} + +func (a *networkPolicyTypedInformerAdapter) TypedInformer() NetworkPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.NetworkPolicy](a.Informer()) +} + +// ToNetworkPolicyIndexInformer converts an untyped informer into a NetworkPolicyIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *NetworkPolicy. If that is not the case, calling type-safe methods of the returned +// NetworkPolicyIndexInformer leads to runtime panics. A safer alternative is to pass +// around a NetworkPolicyIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToNetworkPolicyIndexInformer(informer cache.SharedIndexInformer) NetworkPolicyIndexInformer { + if informer, ok := informer.(NetworkPolicyIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.NetworkPolicy](informer) +} diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go index eb0685147f..cc8ba5c76e 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go @@ -34,12 +34,40 @@ import ( ) // ReplicaSetInformer provides access to a shared informer and lister for -// ReplicaSets. +// ReplicaSets. Prefer using the type-safe variant (see [TypedReplicaSetInformer]). type ReplicaSetInformer interface { Informer() cache.SharedIndexInformer Lister() extensionsv1beta1.ReplicaSetLister } +// TypedReplicaSetInformer provides access to a shared informer and lister for +// ReplicaSets, including the type-safe TypedInformer variant. +// It is a superset of ReplicaSetInformer. +type TypedReplicaSetInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ReplicaSetIndexInformer + Lister() extensionsv1beta1.ReplicaSetLister +} + +// ReplicaSetIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ReplicaSetIndexInformer cache.TypedSharedIndexInformer[*apiextensionsv1beta1.ReplicaSet] + +// ReplicaSetHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ReplicaSet. +type ReplicaSetHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiextensionsv1beta1.ReplicaSet] + +// ReplicaSetDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ReplicaSet. +type ReplicaSetDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiextensionsv1beta1.ReplicaSet] + +// ReplicaSetFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ReplicaSet. +type ReplicaSetFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiextensionsv1beta1.ReplicaSet] + +// ReplicaSetIndexers is a specialization of [cache.TypedIndexers] for ReplicaSet. +type ReplicaSetIndexers = cache.TypedIndexers[*apiextensionsv1beta1.ReplicaSet] + +// DeletedReplicaSet is a specialization of [cache.DeletedObject] for ReplicaSet. +type DeletedReplicaSet = cache.DeletedObject[*apiextensionsv1beta1.ReplicaSet] + type replicaSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type replicaSetInformer struct { // NewReplicaSetInformer constructs a new informer for ReplicaSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedReplicaSetInformer]). func NewReplicaSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewReplicaSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedReplicaSetInformer constructs a new informer for ReplicaSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedReplicaSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ReplicaSetIndexers) ReplicaSetIndexInformer { + return NewTypedReplicaSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredReplicaSetInformer constructs a new informer for ReplicaSet type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredReplicaSetInformer]). func NewFilteredReplicaSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewReplicaSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedReplicaSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredReplicaSetInformer constructs a new informer for ReplicaSet type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredReplicaSetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ReplicaSetIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ReplicaSetIndexInformer { + return NewTypedReplicaSetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewReplicaSetInformerWithOptions constructs a new informer for ReplicaSet type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedReplicaSetInformerWithOptions]). func NewReplicaSetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedReplicaSetInformerWithOptions(client, namespace, options) +} + +// NewTypedReplicaSetInformerWithOptions constructs a new informer for ReplicaSet type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedReplicaSetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) ReplicaSetIndexInformer { gvr := schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "replicasets"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.ReplicaSet](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewReplicaSetInformerWithOptions(client kubernetes.Interface, namespace str Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *replicaSetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewReplicaSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedReplicaSetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *replicaSetInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiextensionsv1beta1.ReplicaSet{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *replicaSetInformer) TypedInformer() ReplicaSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.ReplicaSet](f.factory.InformerFor(&apiextensionsv1beta1.ReplicaSet{}, f.defaultInformer)) } func (f *replicaSetInformer) Lister() extensionsv1beta1.ReplicaSetLister { return extensionsv1beta1.NewReplicaSetLister(f.Informer().GetIndexer()) } + +// ToTypedReplicaSetInformer converts an untyped informer into a TypedReplicaSetInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ReplicaSet. If that is not the case, calling type-safe methods of the returned +// TypedReplicaSetInformer leads to runtime panics. A safer alternative is to pass +// around a TypedReplicaSetInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedReplicaSetInformer(informer ReplicaSetInformer) TypedReplicaSetInformer { + if informer, ok := informer.(TypedReplicaSetInformer); ok { + return informer + } + return &replicaSetTypedInformerAdapter{informer} +} + +type replicaSetTypedInformerAdapter struct { + ReplicaSetInformer +} + +func (a *replicaSetTypedInformerAdapter) TypedInformer() ReplicaSetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.ReplicaSet](a.Informer()) +} + +// ToReplicaSetIndexInformer converts an untyped informer into a ReplicaSetIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ReplicaSet. If that is not the case, calling type-safe methods of the returned +// ReplicaSetIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ReplicaSetIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToReplicaSetIndexInformer(informer cache.SharedIndexInformer) ReplicaSetIndexInformer { + if informer, ok := informer.(ReplicaSetIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiextensionsv1beta1.ReplicaSet](informer) +} diff --git a/vendor/k8s.io/client-go/informers/factory.go b/vendor/k8s.io/client-go/informers/factory.go index 19901079f8..4886f84653 100644 --- a/vendor/k8s.io/client-go/informers/factory.go +++ b/vendor/k8s.io/client-go/informers/factory.go @@ -41,6 +41,7 @@ import ( extensions "k8s.io/client-go/informers/extensions" flowcontrol "k8s.io/client-go/informers/flowcontrol" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + lifecycle "k8s.io/client-go/informers/lifecycle" networking "k8s.io/client-go/informers/networking" node "k8s.io/client-go/informers/node" policy "k8s.io/client-go/informers/policy" @@ -272,7 +273,7 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal // ctx, cancel := context.WithCancel(context.Background()) // defer cancel() // factory := NewSharedInformerFactory(client, resyncPeriod) -// defer factory.WaitForStop() // Returns immediately if nothing was started. +// defer factory.Shutdown() // Returns immediately if nothing was started. // genericInformer := factory.ForResource(resource) // typedInformer := factory.SomeAPIGroup().V1().SomeType() // handle, err := typeInformer.Informer().AddEventHandler(...) @@ -330,7 +331,7 @@ type SharedInformerFactory interface { // WaitForCacheSync blocks until all started informers' caches were synced // or the stop channel gets closed. // - // Contextual logging: WaitForCacheSync should be used instead of WaitForCacheSync in code which supports contextual logging. It also returns a more useful result. + // Contextual logging: WaitForCacheSyncWithContext should be used instead of WaitForCacheSync in code which supports contextual logging. It also returns a more useful result. WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool // WaitForCacheSyncWithContext blocks until all started informers' caches were synced @@ -356,6 +357,7 @@ type SharedInformerFactory interface { Events() events.Interface Extensions() extensions.Interface Flowcontrol() flowcontrol.Interface + Lifecycle() lifecycle.Interface Networking() networking.Interface Node() node.Interface Policy() policy.Interface @@ -414,6 +416,10 @@ func (f *sharedInformerFactory) Flowcontrol() flowcontrol.Interface { return flowcontrol.New(f, f.namespace, f.tweakListOptions) } +func (f *sharedInformerFactory) Lifecycle() lifecycle.Interface { + return lifecycle.New(f, f.namespace, f.tweakListOptions) +} + func (f *sharedInformerFactory) Networking() networking.Interface { return networking.New(f, f.namespace, f.tweakListOptions) } diff --git a/vendor/k8s.io/client-go/informers/flowcontrol/v1/flowschema.go b/vendor/k8s.io/client-go/informers/flowcontrol/v1/flowschema.go index 624c2f5d6d..429ac3a9ac 100644 --- a/vendor/k8s.io/client-go/informers/flowcontrol/v1/flowschema.go +++ b/vendor/k8s.io/client-go/informers/flowcontrol/v1/flowschema.go @@ -34,12 +34,40 @@ import ( ) // FlowSchemaInformer provides access to a shared informer and lister for -// FlowSchemas. +// FlowSchemas. Prefer using the type-safe variant (see [TypedFlowSchemaInformer]). type FlowSchemaInformer interface { Informer() cache.SharedIndexInformer Lister() flowcontrolv1.FlowSchemaLister } +// TypedFlowSchemaInformer provides access to a shared informer and lister for +// FlowSchemas, including the type-safe TypedInformer variant. +// It is a superset of FlowSchemaInformer. +type TypedFlowSchemaInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() FlowSchemaIndexInformer + Lister() flowcontrolv1.FlowSchemaLister +} + +// FlowSchemaIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type FlowSchemaIndexInformer cache.TypedSharedIndexInformer[*apiflowcontrolv1.FlowSchema] + +// FlowSchemaHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for FlowSchema. +type FlowSchemaHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiflowcontrolv1.FlowSchema] + +// FlowSchemaDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for FlowSchema. +type FlowSchemaDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiflowcontrolv1.FlowSchema] + +// FlowSchemaFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for FlowSchema. +type FlowSchemaFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiflowcontrolv1.FlowSchema] + +// FlowSchemaIndexers is a specialization of [cache.TypedIndexers] for FlowSchema. +type FlowSchemaIndexers = cache.TypedIndexers[*apiflowcontrolv1.FlowSchema] + +// DeletedFlowSchema is a specialization of [cache.DeletedObject] for FlowSchema. +type DeletedFlowSchema = cache.DeletedObject[*apiflowcontrolv1.FlowSchema] + type flowSchemaInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type flowSchemaInformer struct { // NewFlowSchemaInformer constructs a new informer for FlowSchema type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFlowSchemaInformer]). func NewFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedFlowSchemaInformer constructs a new informer for FlowSchema type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers FlowSchemaIndexers) FlowSchemaIndexInformer { + return NewTypedFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredFlowSchemaInformer constructs a new informer for FlowSchema type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredFlowSchemaInformer]). func NewFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredFlowSchemaInformer constructs a new informer for FlowSchema type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers FlowSchemaIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) FlowSchemaIndexInformer { + return NewTypedFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewFlowSchemaInformerWithOptions constructs a new informer for FlowSchema type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFlowSchemaInformerWithOptions]). func NewFlowSchemaInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedFlowSchemaInformerWithOptions(client, options) +} + +// NewTypedFlowSchemaInformerWithOptions constructs a new informer for FlowSchema type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFlowSchemaInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) FlowSchemaIndexInformer { gvr := schema.GroupVersionResource{Group: "flowcontrol.apiserver.k8s.io", Version: "v1", Resource: "flowschemas"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1.FlowSchema](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewFlowSchemaInformerWithOptions(client kubernetes.Interface, options inter Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *flowSchemaInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *flowSchemaInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiflowcontrolv1.FlowSchema{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *flowSchemaInformer) TypedInformer() FlowSchemaIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1.FlowSchema](f.factory.InformerFor(&apiflowcontrolv1.FlowSchema{}, f.defaultInformer)) } func (f *flowSchemaInformer) Lister() flowcontrolv1.FlowSchemaLister { return flowcontrolv1.NewFlowSchemaLister(f.Informer().GetIndexer()) } + +// ToTypedFlowSchemaInformer converts an untyped informer into a TypedFlowSchemaInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *FlowSchema. If that is not the case, calling type-safe methods of the returned +// TypedFlowSchemaInformer leads to runtime panics. A safer alternative is to pass +// around a TypedFlowSchemaInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedFlowSchemaInformer(informer FlowSchemaInformer) TypedFlowSchemaInformer { + if informer, ok := informer.(TypedFlowSchemaInformer); ok { + return informer + } + return &flowSchemaTypedInformerAdapter{informer} +} + +type flowSchemaTypedInformerAdapter struct { + FlowSchemaInformer +} + +func (a *flowSchemaTypedInformerAdapter) TypedInformer() FlowSchemaIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1.FlowSchema](a.Informer()) +} + +// ToFlowSchemaIndexInformer converts an untyped informer into a FlowSchemaIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *FlowSchema. If that is not the case, calling type-safe methods of the returned +// FlowSchemaIndexInformer leads to runtime panics. A safer alternative is to pass +// around a FlowSchemaIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToFlowSchemaIndexInformer(informer cache.SharedIndexInformer) FlowSchemaIndexInformer { + if informer, ok := informer.(FlowSchemaIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1.FlowSchema](informer) +} diff --git a/vendor/k8s.io/client-go/informers/flowcontrol/v1/interface.go b/vendor/k8s.io/client-go/informers/flowcontrol/v1/interface.go index 3de934900f..2c4a8465c7 100644 --- a/vendor/k8s.io/client-go/informers/flowcontrol/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/flowcontrol/v1/interface.go @@ -25,9 +25,9 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // FlowSchemas returns a FlowSchemaInformer. - FlowSchemas() FlowSchemaInformer + FlowSchemas() TypedFlowSchemaInformer // PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. - PriorityLevelConfigurations() PriorityLevelConfigurationInformer + PriorityLevelConfigurations() TypedPriorityLevelConfigurationInformer } type version struct { @@ -41,12 +41,12 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// FlowSchemas returns a FlowSchemaInformer. -func (v *version) FlowSchemas() FlowSchemaInformer { +// FlowSchemas returns a TypedFlowSchemaInformer. +func (v *version) FlowSchemas() TypedFlowSchemaInformer { return &flowSchemaInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. -func (v *version) PriorityLevelConfigurations() PriorityLevelConfigurationInformer { +// PriorityLevelConfigurations returns a TypedPriorityLevelConfigurationInformer. +func (v *version) PriorityLevelConfigurations() TypedPriorityLevelConfigurationInformer { return &priorityLevelConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/flowcontrol/v1/prioritylevelconfiguration.go b/vendor/k8s.io/client-go/informers/flowcontrol/v1/prioritylevelconfiguration.go index 5a42509553..7fd72aa9b8 100644 --- a/vendor/k8s.io/client-go/informers/flowcontrol/v1/prioritylevelconfiguration.go +++ b/vendor/k8s.io/client-go/informers/flowcontrol/v1/prioritylevelconfiguration.go @@ -34,12 +34,40 @@ import ( ) // PriorityLevelConfigurationInformer provides access to a shared informer and lister for -// PriorityLevelConfigurations. +// PriorityLevelConfigurations. Prefer using the type-safe variant (see [TypedPriorityLevelConfigurationInformer]). type PriorityLevelConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() flowcontrolv1.PriorityLevelConfigurationLister } +// TypedPriorityLevelConfigurationInformer provides access to a shared informer and lister for +// PriorityLevelConfigurations, including the type-safe TypedInformer variant. +// It is a superset of PriorityLevelConfigurationInformer. +type TypedPriorityLevelConfigurationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() PriorityLevelConfigurationIndexInformer + Lister() flowcontrolv1.PriorityLevelConfigurationLister +} + +// PriorityLevelConfigurationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type PriorityLevelConfigurationIndexInformer cache.TypedSharedIndexInformer[*apiflowcontrolv1.PriorityLevelConfiguration] + +// PriorityLevelConfigurationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for PriorityLevelConfiguration. +type PriorityLevelConfigurationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiflowcontrolv1.PriorityLevelConfiguration] + +// PriorityLevelConfigurationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for PriorityLevelConfiguration. +type PriorityLevelConfigurationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiflowcontrolv1.PriorityLevelConfiguration] + +// PriorityLevelConfigurationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for PriorityLevelConfiguration. +type PriorityLevelConfigurationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiflowcontrolv1.PriorityLevelConfiguration] + +// PriorityLevelConfigurationIndexers is a specialization of [cache.TypedIndexers] for PriorityLevelConfiguration. +type PriorityLevelConfigurationIndexers = cache.TypedIndexers[*apiflowcontrolv1.PriorityLevelConfiguration] + +// DeletedPriorityLevelConfiguration is a specialization of [cache.DeletedObject] for PriorityLevelConfiguration. +type DeletedPriorityLevelConfiguration = cache.DeletedObject[*apiflowcontrolv1.PriorityLevelConfiguration] + type priorityLevelConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type priorityLevelConfigurationInformer struct { // NewPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPriorityLevelConfigurationInformer]). func NewPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers PriorityLevelConfigurationIndexers) PriorityLevelConfigurationIndexInformer { + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredPriorityLevelConfigurationInformer]). func NewFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers PriorityLevelConfigurationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) PriorityLevelConfigurationIndexInformer { + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewPriorityLevelConfigurationInformerWithOptions constructs a new informer for PriorityLevelConfiguration type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPriorityLevelConfigurationInformerWithOptions]). func NewPriorityLevelConfigurationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, options) +} + +// NewTypedPriorityLevelConfigurationInformerWithOptions constructs a new informer for PriorityLevelConfiguration type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPriorityLevelConfigurationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) PriorityLevelConfigurationIndexInformer { gvr := schema.GroupVersionResource{Group: "flowcontrol.apiserver.k8s.io", Version: "v1", Resource: "prioritylevelconfigurations"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1.PriorityLevelConfiguration](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewPriorityLevelConfigurationInformerWithOptions(client kubernetes.Interfac Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *priorityLevelConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *priorityLevelConfigurationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiflowcontrolv1.PriorityLevelConfiguration{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *priorityLevelConfigurationInformer) TypedInformer() PriorityLevelConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1.PriorityLevelConfiguration](f.factory.InformerFor(&apiflowcontrolv1.PriorityLevelConfiguration{}, f.defaultInformer)) } func (f *priorityLevelConfigurationInformer) Lister() flowcontrolv1.PriorityLevelConfigurationLister { return flowcontrolv1.NewPriorityLevelConfigurationLister(f.Informer().GetIndexer()) } + +// ToTypedPriorityLevelConfigurationInformer converts an untyped informer into a TypedPriorityLevelConfigurationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PriorityLevelConfiguration. If that is not the case, calling type-safe methods of the returned +// TypedPriorityLevelConfigurationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedPriorityLevelConfigurationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedPriorityLevelConfigurationInformer(informer PriorityLevelConfigurationInformer) TypedPriorityLevelConfigurationInformer { + if informer, ok := informer.(TypedPriorityLevelConfigurationInformer); ok { + return informer + } + return &priorityLevelConfigurationTypedInformerAdapter{informer} +} + +type priorityLevelConfigurationTypedInformerAdapter struct { + PriorityLevelConfigurationInformer +} + +func (a *priorityLevelConfigurationTypedInformerAdapter) TypedInformer() PriorityLevelConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1.PriorityLevelConfiguration](a.Informer()) +} + +// ToPriorityLevelConfigurationIndexInformer converts an untyped informer into a PriorityLevelConfigurationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PriorityLevelConfiguration. If that is not the case, calling type-safe methods of the returned +// PriorityLevelConfigurationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a PriorityLevelConfigurationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToPriorityLevelConfigurationIndexInformer(informer cache.SharedIndexInformer) PriorityLevelConfigurationIndexInformer { + if informer, ok := informer.(PriorityLevelConfigurationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1.PriorityLevelConfiguration](informer) +} diff --git a/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/flowschema.go b/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/flowschema.go index 2e0098e664..d0d8778b3c 100644 --- a/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/flowschema.go +++ b/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/flowschema.go @@ -34,12 +34,40 @@ import ( ) // FlowSchemaInformer provides access to a shared informer and lister for -// FlowSchemas. +// FlowSchemas. Prefer using the type-safe variant (see [TypedFlowSchemaInformer]). type FlowSchemaInformer interface { Informer() cache.SharedIndexInformer Lister() flowcontrolv1beta1.FlowSchemaLister } +// TypedFlowSchemaInformer provides access to a shared informer and lister for +// FlowSchemas, including the type-safe TypedInformer variant. +// It is a superset of FlowSchemaInformer. +type TypedFlowSchemaInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() FlowSchemaIndexInformer + Lister() flowcontrolv1beta1.FlowSchemaLister +} + +// FlowSchemaIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type FlowSchemaIndexInformer cache.TypedSharedIndexInformer[*apiflowcontrolv1beta1.FlowSchema] + +// FlowSchemaHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for FlowSchema. +type FlowSchemaHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiflowcontrolv1beta1.FlowSchema] + +// FlowSchemaDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for FlowSchema. +type FlowSchemaDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiflowcontrolv1beta1.FlowSchema] + +// FlowSchemaFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for FlowSchema. +type FlowSchemaFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiflowcontrolv1beta1.FlowSchema] + +// FlowSchemaIndexers is a specialization of [cache.TypedIndexers] for FlowSchema. +type FlowSchemaIndexers = cache.TypedIndexers[*apiflowcontrolv1beta1.FlowSchema] + +// DeletedFlowSchema is a specialization of [cache.DeletedObject] for FlowSchema. +type DeletedFlowSchema = cache.DeletedObject[*apiflowcontrolv1beta1.FlowSchema] + type flowSchemaInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type flowSchemaInformer struct { // NewFlowSchemaInformer constructs a new informer for FlowSchema type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFlowSchemaInformer]). func NewFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedFlowSchemaInformer constructs a new informer for FlowSchema type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers FlowSchemaIndexers) FlowSchemaIndexInformer { + return NewTypedFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredFlowSchemaInformer constructs a new informer for FlowSchema type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredFlowSchemaInformer]). func NewFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredFlowSchemaInformer constructs a new informer for FlowSchema type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers FlowSchemaIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) FlowSchemaIndexInformer { + return NewTypedFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewFlowSchemaInformerWithOptions constructs a new informer for FlowSchema type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFlowSchemaInformerWithOptions]). func NewFlowSchemaInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedFlowSchemaInformerWithOptions(client, options) +} + +// NewTypedFlowSchemaInformerWithOptions constructs a new informer for FlowSchema type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFlowSchemaInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) FlowSchemaIndexInformer { gvr := schema.GroupVersionResource{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta1", Resource: "flowschemas"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta1.FlowSchema](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewFlowSchemaInformerWithOptions(client kubernetes.Interface, options inter Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *flowSchemaInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *flowSchemaInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiflowcontrolv1beta1.FlowSchema{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *flowSchemaInformer) TypedInformer() FlowSchemaIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta1.FlowSchema](f.factory.InformerFor(&apiflowcontrolv1beta1.FlowSchema{}, f.defaultInformer)) } func (f *flowSchemaInformer) Lister() flowcontrolv1beta1.FlowSchemaLister { return flowcontrolv1beta1.NewFlowSchemaLister(f.Informer().GetIndexer()) } + +// ToTypedFlowSchemaInformer converts an untyped informer into a TypedFlowSchemaInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *FlowSchema. If that is not the case, calling type-safe methods of the returned +// TypedFlowSchemaInformer leads to runtime panics. A safer alternative is to pass +// around a TypedFlowSchemaInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedFlowSchemaInformer(informer FlowSchemaInformer) TypedFlowSchemaInformer { + if informer, ok := informer.(TypedFlowSchemaInformer); ok { + return informer + } + return &flowSchemaTypedInformerAdapter{informer} +} + +type flowSchemaTypedInformerAdapter struct { + FlowSchemaInformer +} + +func (a *flowSchemaTypedInformerAdapter) TypedInformer() FlowSchemaIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta1.FlowSchema](a.Informer()) +} + +// ToFlowSchemaIndexInformer converts an untyped informer into a FlowSchemaIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *FlowSchema. If that is not the case, calling type-safe methods of the returned +// FlowSchemaIndexInformer leads to runtime panics. A safer alternative is to pass +// around a FlowSchemaIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToFlowSchemaIndexInformer(informer cache.SharedIndexInformer) FlowSchemaIndexInformer { + if informer, ok := informer.(FlowSchemaIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta1.FlowSchema](informer) +} diff --git a/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/interface.go index 50329bb0ac..576d8de678 100644 --- a/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/interface.go @@ -25,9 +25,9 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // FlowSchemas returns a FlowSchemaInformer. - FlowSchemas() FlowSchemaInformer + FlowSchemas() TypedFlowSchemaInformer // PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. - PriorityLevelConfigurations() PriorityLevelConfigurationInformer + PriorityLevelConfigurations() TypedPriorityLevelConfigurationInformer } type version struct { @@ -41,12 +41,12 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// FlowSchemas returns a FlowSchemaInformer. -func (v *version) FlowSchemas() FlowSchemaInformer { +// FlowSchemas returns a TypedFlowSchemaInformer. +func (v *version) FlowSchemas() TypedFlowSchemaInformer { return &flowSchemaInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. -func (v *version) PriorityLevelConfigurations() PriorityLevelConfigurationInformer { +// PriorityLevelConfigurations returns a TypedPriorityLevelConfigurationInformer. +func (v *version) PriorityLevelConfigurations() TypedPriorityLevelConfigurationInformer { return &priorityLevelConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/prioritylevelconfiguration.go b/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/prioritylevelconfiguration.go index 9c94839a1a..2b5cb8832f 100644 --- a/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/prioritylevelconfiguration.go +++ b/vendor/k8s.io/client-go/informers/flowcontrol/v1beta1/prioritylevelconfiguration.go @@ -34,12 +34,40 @@ import ( ) // PriorityLevelConfigurationInformer provides access to a shared informer and lister for -// PriorityLevelConfigurations. +// PriorityLevelConfigurations. Prefer using the type-safe variant (see [TypedPriorityLevelConfigurationInformer]). type PriorityLevelConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() flowcontrolv1beta1.PriorityLevelConfigurationLister } +// TypedPriorityLevelConfigurationInformer provides access to a shared informer and lister for +// PriorityLevelConfigurations, including the type-safe TypedInformer variant. +// It is a superset of PriorityLevelConfigurationInformer. +type TypedPriorityLevelConfigurationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() PriorityLevelConfigurationIndexInformer + Lister() flowcontrolv1beta1.PriorityLevelConfigurationLister +} + +// PriorityLevelConfigurationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type PriorityLevelConfigurationIndexInformer cache.TypedSharedIndexInformer[*apiflowcontrolv1beta1.PriorityLevelConfiguration] + +// PriorityLevelConfigurationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for PriorityLevelConfiguration. +type PriorityLevelConfigurationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiflowcontrolv1beta1.PriorityLevelConfiguration] + +// PriorityLevelConfigurationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for PriorityLevelConfiguration. +type PriorityLevelConfigurationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiflowcontrolv1beta1.PriorityLevelConfiguration] + +// PriorityLevelConfigurationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for PriorityLevelConfiguration. +type PriorityLevelConfigurationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiflowcontrolv1beta1.PriorityLevelConfiguration] + +// PriorityLevelConfigurationIndexers is a specialization of [cache.TypedIndexers] for PriorityLevelConfiguration. +type PriorityLevelConfigurationIndexers = cache.TypedIndexers[*apiflowcontrolv1beta1.PriorityLevelConfiguration] + +// DeletedPriorityLevelConfiguration is a specialization of [cache.DeletedObject] for PriorityLevelConfiguration. +type DeletedPriorityLevelConfiguration = cache.DeletedObject[*apiflowcontrolv1beta1.PriorityLevelConfiguration] + type priorityLevelConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type priorityLevelConfigurationInformer struct { // NewPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPriorityLevelConfigurationInformer]). func NewPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers PriorityLevelConfigurationIndexers) PriorityLevelConfigurationIndexInformer { + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredPriorityLevelConfigurationInformer]). func NewFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers PriorityLevelConfigurationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) PriorityLevelConfigurationIndexInformer { + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewPriorityLevelConfigurationInformerWithOptions constructs a new informer for PriorityLevelConfiguration type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPriorityLevelConfigurationInformerWithOptions]). func NewPriorityLevelConfigurationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, options) +} + +// NewTypedPriorityLevelConfigurationInformerWithOptions constructs a new informer for PriorityLevelConfiguration type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPriorityLevelConfigurationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) PriorityLevelConfigurationIndexInformer { gvr := schema.GroupVersionResource{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta1", Resource: "prioritylevelconfigurations"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta1.PriorityLevelConfiguration](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewPriorityLevelConfigurationInformerWithOptions(client kubernetes.Interfac Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *priorityLevelConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *priorityLevelConfigurationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiflowcontrolv1beta1.PriorityLevelConfiguration{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *priorityLevelConfigurationInformer) TypedInformer() PriorityLevelConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta1.PriorityLevelConfiguration](f.factory.InformerFor(&apiflowcontrolv1beta1.PriorityLevelConfiguration{}, f.defaultInformer)) } func (f *priorityLevelConfigurationInformer) Lister() flowcontrolv1beta1.PriorityLevelConfigurationLister { return flowcontrolv1beta1.NewPriorityLevelConfigurationLister(f.Informer().GetIndexer()) } + +// ToTypedPriorityLevelConfigurationInformer converts an untyped informer into a TypedPriorityLevelConfigurationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PriorityLevelConfiguration. If that is not the case, calling type-safe methods of the returned +// TypedPriorityLevelConfigurationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedPriorityLevelConfigurationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedPriorityLevelConfigurationInformer(informer PriorityLevelConfigurationInformer) TypedPriorityLevelConfigurationInformer { + if informer, ok := informer.(TypedPriorityLevelConfigurationInformer); ok { + return informer + } + return &priorityLevelConfigurationTypedInformerAdapter{informer} +} + +type priorityLevelConfigurationTypedInformerAdapter struct { + PriorityLevelConfigurationInformer +} + +func (a *priorityLevelConfigurationTypedInformerAdapter) TypedInformer() PriorityLevelConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta1.PriorityLevelConfiguration](a.Informer()) +} + +// ToPriorityLevelConfigurationIndexInformer converts an untyped informer into a PriorityLevelConfigurationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PriorityLevelConfiguration. If that is not the case, calling type-safe methods of the returned +// PriorityLevelConfigurationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a PriorityLevelConfigurationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToPriorityLevelConfigurationIndexInformer(informer cache.SharedIndexInformer) PriorityLevelConfigurationIndexInformer { + if informer, ok := informer.(PriorityLevelConfigurationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta1.PriorityLevelConfiguration](informer) +} diff --git a/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/flowschema.go b/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/flowschema.go index aba4d712af..39cb1fbdfb 100644 --- a/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/flowschema.go +++ b/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/flowschema.go @@ -34,12 +34,40 @@ import ( ) // FlowSchemaInformer provides access to a shared informer and lister for -// FlowSchemas. +// FlowSchemas. Prefer using the type-safe variant (see [TypedFlowSchemaInformer]). type FlowSchemaInformer interface { Informer() cache.SharedIndexInformer Lister() flowcontrolv1beta2.FlowSchemaLister } +// TypedFlowSchemaInformer provides access to a shared informer and lister for +// FlowSchemas, including the type-safe TypedInformer variant. +// It is a superset of FlowSchemaInformer. +type TypedFlowSchemaInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() FlowSchemaIndexInformer + Lister() flowcontrolv1beta2.FlowSchemaLister +} + +// FlowSchemaIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type FlowSchemaIndexInformer cache.TypedSharedIndexInformer[*apiflowcontrolv1beta2.FlowSchema] + +// FlowSchemaHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for FlowSchema. +type FlowSchemaHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiflowcontrolv1beta2.FlowSchema] + +// FlowSchemaDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for FlowSchema. +type FlowSchemaDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiflowcontrolv1beta2.FlowSchema] + +// FlowSchemaFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for FlowSchema. +type FlowSchemaFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiflowcontrolv1beta2.FlowSchema] + +// FlowSchemaIndexers is a specialization of [cache.TypedIndexers] for FlowSchema. +type FlowSchemaIndexers = cache.TypedIndexers[*apiflowcontrolv1beta2.FlowSchema] + +// DeletedFlowSchema is a specialization of [cache.DeletedObject] for FlowSchema. +type DeletedFlowSchema = cache.DeletedObject[*apiflowcontrolv1beta2.FlowSchema] + type flowSchemaInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type flowSchemaInformer struct { // NewFlowSchemaInformer constructs a new informer for FlowSchema type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFlowSchemaInformer]). func NewFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedFlowSchemaInformer constructs a new informer for FlowSchema type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers FlowSchemaIndexers) FlowSchemaIndexInformer { + return NewTypedFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredFlowSchemaInformer constructs a new informer for FlowSchema type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredFlowSchemaInformer]). func NewFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredFlowSchemaInformer constructs a new informer for FlowSchema type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers FlowSchemaIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) FlowSchemaIndexInformer { + return NewTypedFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewFlowSchemaInformerWithOptions constructs a new informer for FlowSchema type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFlowSchemaInformerWithOptions]). func NewFlowSchemaInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedFlowSchemaInformerWithOptions(client, options) +} + +// NewTypedFlowSchemaInformerWithOptions constructs a new informer for FlowSchema type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFlowSchemaInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) FlowSchemaIndexInformer { gvr := schema.GroupVersionResource{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2", Resource: "flowschemas"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta2.FlowSchema](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewFlowSchemaInformerWithOptions(client kubernetes.Interface, options inter Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *flowSchemaInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *flowSchemaInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiflowcontrolv1beta2.FlowSchema{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *flowSchemaInformer) TypedInformer() FlowSchemaIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta2.FlowSchema](f.factory.InformerFor(&apiflowcontrolv1beta2.FlowSchema{}, f.defaultInformer)) } func (f *flowSchemaInformer) Lister() flowcontrolv1beta2.FlowSchemaLister { return flowcontrolv1beta2.NewFlowSchemaLister(f.Informer().GetIndexer()) } + +// ToTypedFlowSchemaInformer converts an untyped informer into a TypedFlowSchemaInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *FlowSchema. If that is not the case, calling type-safe methods of the returned +// TypedFlowSchemaInformer leads to runtime panics. A safer alternative is to pass +// around a TypedFlowSchemaInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedFlowSchemaInformer(informer FlowSchemaInformer) TypedFlowSchemaInformer { + if informer, ok := informer.(TypedFlowSchemaInformer); ok { + return informer + } + return &flowSchemaTypedInformerAdapter{informer} +} + +type flowSchemaTypedInformerAdapter struct { + FlowSchemaInformer +} + +func (a *flowSchemaTypedInformerAdapter) TypedInformer() FlowSchemaIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta2.FlowSchema](a.Informer()) +} + +// ToFlowSchemaIndexInformer converts an untyped informer into a FlowSchemaIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *FlowSchema. If that is not the case, calling type-safe methods of the returned +// FlowSchemaIndexInformer leads to runtime panics. A safer alternative is to pass +// around a FlowSchemaIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToFlowSchemaIndexInformer(informer cache.SharedIndexInformer) FlowSchemaIndexInformer { + if informer, ok := informer.(FlowSchemaIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta2.FlowSchema](informer) +} diff --git a/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/interface.go b/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/interface.go index 142d552896..f362f533ba 100644 --- a/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/interface.go +++ b/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/interface.go @@ -25,9 +25,9 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // FlowSchemas returns a FlowSchemaInformer. - FlowSchemas() FlowSchemaInformer + FlowSchemas() TypedFlowSchemaInformer // PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. - PriorityLevelConfigurations() PriorityLevelConfigurationInformer + PriorityLevelConfigurations() TypedPriorityLevelConfigurationInformer } type version struct { @@ -41,12 +41,12 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// FlowSchemas returns a FlowSchemaInformer. -func (v *version) FlowSchemas() FlowSchemaInformer { +// FlowSchemas returns a TypedFlowSchemaInformer. +func (v *version) FlowSchemas() TypedFlowSchemaInformer { return &flowSchemaInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. -func (v *version) PriorityLevelConfigurations() PriorityLevelConfigurationInformer { +// PriorityLevelConfigurations returns a TypedPriorityLevelConfigurationInformer. +func (v *version) PriorityLevelConfigurations() TypedPriorityLevelConfigurationInformer { return &priorityLevelConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/prioritylevelconfiguration.go b/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/prioritylevelconfiguration.go index 0ce811759a..9915275498 100644 --- a/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/prioritylevelconfiguration.go +++ b/vendor/k8s.io/client-go/informers/flowcontrol/v1beta2/prioritylevelconfiguration.go @@ -34,12 +34,40 @@ import ( ) // PriorityLevelConfigurationInformer provides access to a shared informer and lister for -// PriorityLevelConfigurations. +// PriorityLevelConfigurations. Prefer using the type-safe variant (see [TypedPriorityLevelConfigurationInformer]). type PriorityLevelConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() flowcontrolv1beta2.PriorityLevelConfigurationLister } +// TypedPriorityLevelConfigurationInformer provides access to a shared informer and lister for +// PriorityLevelConfigurations, including the type-safe TypedInformer variant. +// It is a superset of PriorityLevelConfigurationInformer. +type TypedPriorityLevelConfigurationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() PriorityLevelConfigurationIndexInformer + Lister() flowcontrolv1beta2.PriorityLevelConfigurationLister +} + +// PriorityLevelConfigurationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type PriorityLevelConfigurationIndexInformer cache.TypedSharedIndexInformer[*apiflowcontrolv1beta2.PriorityLevelConfiguration] + +// PriorityLevelConfigurationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for PriorityLevelConfiguration. +type PriorityLevelConfigurationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiflowcontrolv1beta2.PriorityLevelConfiguration] + +// PriorityLevelConfigurationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for PriorityLevelConfiguration. +type PriorityLevelConfigurationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiflowcontrolv1beta2.PriorityLevelConfiguration] + +// PriorityLevelConfigurationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for PriorityLevelConfiguration. +type PriorityLevelConfigurationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiflowcontrolv1beta2.PriorityLevelConfiguration] + +// PriorityLevelConfigurationIndexers is a specialization of [cache.TypedIndexers] for PriorityLevelConfiguration. +type PriorityLevelConfigurationIndexers = cache.TypedIndexers[*apiflowcontrolv1beta2.PriorityLevelConfiguration] + +// DeletedPriorityLevelConfiguration is a specialization of [cache.DeletedObject] for PriorityLevelConfiguration. +type DeletedPriorityLevelConfiguration = cache.DeletedObject[*apiflowcontrolv1beta2.PriorityLevelConfiguration] + type priorityLevelConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type priorityLevelConfigurationInformer struct { // NewPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPriorityLevelConfigurationInformer]). func NewPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers PriorityLevelConfigurationIndexers) PriorityLevelConfigurationIndexInformer { + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredPriorityLevelConfigurationInformer]). func NewFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers PriorityLevelConfigurationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) PriorityLevelConfigurationIndexInformer { + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewPriorityLevelConfigurationInformerWithOptions constructs a new informer for PriorityLevelConfiguration type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPriorityLevelConfigurationInformerWithOptions]). func NewPriorityLevelConfigurationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, options) +} + +// NewTypedPriorityLevelConfigurationInformerWithOptions constructs a new informer for PriorityLevelConfiguration type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPriorityLevelConfigurationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) PriorityLevelConfigurationIndexInformer { gvr := schema.GroupVersionResource{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2", Resource: "prioritylevelconfigurations"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta2.PriorityLevelConfiguration](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewPriorityLevelConfigurationInformerWithOptions(client kubernetes.Interfac Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *priorityLevelConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *priorityLevelConfigurationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiflowcontrolv1beta2.PriorityLevelConfiguration{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *priorityLevelConfigurationInformer) TypedInformer() PriorityLevelConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta2.PriorityLevelConfiguration](f.factory.InformerFor(&apiflowcontrolv1beta2.PriorityLevelConfiguration{}, f.defaultInformer)) } func (f *priorityLevelConfigurationInformer) Lister() flowcontrolv1beta2.PriorityLevelConfigurationLister { return flowcontrolv1beta2.NewPriorityLevelConfigurationLister(f.Informer().GetIndexer()) } + +// ToTypedPriorityLevelConfigurationInformer converts an untyped informer into a TypedPriorityLevelConfigurationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PriorityLevelConfiguration. If that is not the case, calling type-safe methods of the returned +// TypedPriorityLevelConfigurationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedPriorityLevelConfigurationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedPriorityLevelConfigurationInformer(informer PriorityLevelConfigurationInformer) TypedPriorityLevelConfigurationInformer { + if informer, ok := informer.(TypedPriorityLevelConfigurationInformer); ok { + return informer + } + return &priorityLevelConfigurationTypedInformerAdapter{informer} +} + +type priorityLevelConfigurationTypedInformerAdapter struct { + PriorityLevelConfigurationInformer +} + +func (a *priorityLevelConfigurationTypedInformerAdapter) TypedInformer() PriorityLevelConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta2.PriorityLevelConfiguration](a.Informer()) +} + +// ToPriorityLevelConfigurationIndexInformer converts an untyped informer into a PriorityLevelConfigurationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PriorityLevelConfiguration. If that is not the case, calling type-safe methods of the returned +// PriorityLevelConfigurationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a PriorityLevelConfigurationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToPriorityLevelConfigurationIndexInformer(informer cache.SharedIndexInformer) PriorityLevelConfigurationIndexInformer { + if informer, ok := informer.(PriorityLevelConfigurationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta2.PriorityLevelConfiguration](informer) +} diff --git a/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/flowschema.go b/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/flowschema.go index 16ce2ba23c..30bd5e341f 100644 --- a/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/flowschema.go +++ b/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/flowschema.go @@ -34,12 +34,40 @@ import ( ) // FlowSchemaInformer provides access to a shared informer and lister for -// FlowSchemas. +// FlowSchemas. Prefer using the type-safe variant (see [TypedFlowSchemaInformer]). type FlowSchemaInformer interface { Informer() cache.SharedIndexInformer Lister() flowcontrolv1beta3.FlowSchemaLister } +// TypedFlowSchemaInformer provides access to a shared informer and lister for +// FlowSchemas, including the type-safe TypedInformer variant. +// It is a superset of FlowSchemaInformer. +type TypedFlowSchemaInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() FlowSchemaIndexInformer + Lister() flowcontrolv1beta3.FlowSchemaLister +} + +// FlowSchemaIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type FlowSchemaIndexInformer cache.TypedSharedIndexInformer[*apiflowcontrolv1beta3.FlowSchema] + +// FlowSchemaHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for FlowSchema. +type FlowSchemaHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiflowcontrolv1beta3.FlowSchema] + +// FlowSchemaDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for FlowSchema. +type FlowSchemaDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiflowcontrolv1beta3.FlowSchema] + +// FlowSchemaFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for FlowSchema. +type FlowSchemaFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiflowcontrolv1beta3.FlowSchema] + +// FlowSchemaIndexers is a specialization of [cache.TypedIndexers] for FlowSchema. +type FlowSchemaIndexers = cache.TypedIndexers[*apiflowcontrolv1beta3.FlowSchema] + +// DeletedFlowSchema is a specialization of [cache.DeletedObject] for FlowSchema. +type DeletedFlowSchema = cache.DeletedObject[*apiflowcontrolv1beta3.FlowSchema] + type flowSchemaInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type flowSchemaInformer struct { // NewFlowSchemaInformer constructs a new informer for FlowSchema type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFlowSchemaInformer]). func NewFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedFlowSchemaInformer constructs a new informer for FlowSchema type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers FlowSchemaIndexers) FlowSchemaIndexInformer { + return NewTypedFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredFlowSchemaInformer constructs a new informer for FlowSchema type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredFlowSchemaInformer]). func NewFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredFlowSchemaInformer constructs a new informer for FlowSchema type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers FlowSchemaIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) FlowSchemaIndexInformer { + return NewTypedFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewFlowSchemaInformerWithOptions constructs a new informer for FlowSchema type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFlowSchemaInformerWithOptions]). func NewFlowSchemaInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedFlowSchemaInformerWithOptions(client, options) +} + +// NewTypedFlowSchemaInformerWithOptions constructs a new informer for FlowSchema type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFlowSchemaInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) FlowSchemaIndexInformer { gvr := schema.GroupVersionResource{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta3", Resource: "flowschemas"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta3.FlowSchema](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewFlowSchemaInformerWithOptions(client kubernetes.Interface, options inter Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *flowSchemaInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedFlowSchemaInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *flowSchemaInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiflowcontrolv1beta3.FlowSchema{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *flowSchemaInformer) TypedInformer() FlowSchemaIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta3.FlowSchema](f.factory.InformerFor(&apiflowcontrolv1beta3.FlowSchema{}, f.defaultInformer)) } func (f *flowSchemaInformer) Lister() flowcontrolv1beta3.FlowSchemaLister { return flowcontrolv1beta3.NewFlowSchemaLister(f.Informer().GetIndexer()) } + +// ToTypedFlowSchemaInformer converts an untyped informer into a TypedFlowSchemaInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *FlowSchema. If that is not the case, calling type-safe methods of the returned +// TypedFlowSchemaInformer leads to runtime panics. A safer alternative is to pass +// around a TypedFlowSchemaInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedFlowSchemaInformer(informer FlowSchemaInformer) TypedFlowSchemaInformer { + if informer, ok := informer.(TypedFlowSchemaInformer); ok { + return informer + } + return &flowSchemaTypedInformerAdapter{informer} +} + +type flowSchemaTypedInformerAdapter struct { + FlowSchemaInformer +} + +func (a *flowSchemaTypedInformerAdapter) TypedInformer() FlowSchemaIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta3.FlowSchema](a.Informer()) +} + +// ToFlowSchemaIndexInformer converts an untyped informer into a FlowSchemaIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *FlowSchema. If that is not the case, calling type-safe methods of the returned +// FlowSchemaIndexInformer leads to runtime panics. A safer alternative is to pass +// around a FlowSchemaIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToFlowSchemaIndexInformer(informer cache.SharedIndexInformer) FlowSchemaIndexInformer { + if informer, ok := informer.(FlowSchemaIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta3.FlowSchema](informer) +} diff --git a/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/interface.go b/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/interface.go index 54c5414a2b..cff3a94cb2 100644 --- a/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/interface.go +++ b/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/interface.go @@ -25,9 +25,9 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // FlowSchemas returns a FlowSchemaInformer. - FlowSchemas() FlowSchemaInformer + FlowSchemas() TypedFlowSchemaInformer // PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. - PriorityLevelConfigurations() PriorityLevelConfigurationInformer + PriorityLevelConfigurations() TypedPriorityLevelConfigurationInformer } type version struct { @@ -41,12 +41,12 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// FlowSchemas returns a FlowSchemaInformer. -func (v *version) FlowSchemas() FlowSchemaInformer { +// FlowSchemas returns a TypedFlowSchemaInformer. +func (v *version) FlowSchemas() TypedFlowSchemaInformer { return &flowSchemaInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. -func (v *version) PriorityLevelConfigurations() PriorityLevelConfigurationInformer { +// PriorityLevelConfigurations returns a TypedPriorityLevelConfigurationInformer. +func (v *version) PriorityLevelConfigurations() TypedPriorityLevelConfigurationInformer { return &priorityLevelConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/prioritylevelconfiguration.go b/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/prioritylevelconfiguration.go index ab63c8e62b..0402662b81 100644 --- a/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/prioritylevelconfiguration.go +++ b/vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/prioritylevelconfiguration.go @@ -34,12 +34,40 @@ import ( ) // PriorityLevelConfigurationInformer provides access to a shared informer and lister for -// PriorityLevelConfigurations. +// PriorityLevelConfigurations. Prefer using the type-safe variant (see [TypedPriorityLevelConfigurationInformer]). type PriorityLevelConfigurationInformer interface { Informer() cache.SharedIndexInformer Lister() flowcontrolv1beta3.PriorityLevelConfigurationLister } +// TypedPriorityLevelConfigurationInformer provides access to a shared informer and lister for +// PriorityLevelConfigurations, including the type-safe TypedInformer variant. +// It is a superset of PriorityLevelConfigurationInformer. +type TypedPriorityLevelConfigurationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() PriorityLevelConfigurationIndexInformer + Lister() flowcontrolv1beta3.PriorityLevelConfigurationLister +} + +// PriorityLevelConfigurationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type PriorityLevelConfigurationIndexInformer cache.TypedSharedIndexInformer[*apiflowcontrolv1beta3.PriorityLevelConfiguration] + +// PriorityLevelConfigurationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for PriorityLevelConfiguration. +type PriorityLevelConfigurationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiflowcontrolv1beta3.PriorityLevelConfiguration] + +// PriorityLevelConfigurationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for PriorityLevelConfiguration. +type PriorityLevelConfigurationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiflowcontrolv1beta3.PriorityLevelConfiguration] + +// PriorityLevelConfigurationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for PriorityLevelConfiguration. +type PriorityLevelConfigurationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiflowcontrolv1beta3.PriorityLevelConfiguration] + +// PriorityLevelConfigurationIndexers is a specialization of [cache.TypedIndexers] for PriorityLevelConfiguration. +type PriorityLevelConfigurationIndexers = cache.TypedIndexers[*apiflowcontrolv1beta3.PriorityLevelConfiguration] + +// DeletedPriorityLevelConfiguration is a specialization of [cache.DeletedObject] for PriorityLevelConfiguration. +type DeletedPriorityLevelConfiguration = cache.DeletedObject[*apiflowcontrolv1beta3.PriorityLevelConfiguration] + type priorityLevelConfigurationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type priorityLevelConfigurationInformer struct { // NewPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPriorityLevelConfigurationInformer]). func NewPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers PriorityLevelConfigurationIndexers) PriorityLevelConfigurationIndexInformer { + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredPriorityLevelConfigurationInformer]). func NewFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers PriorityLevelConfigurationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) PriorityLevelConfigurationIndexInformer { + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewPriorityLevelConfigurationInformerWithOptions constructs a new informer for PriorityLevelConfiguration type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPriorityLevelConfigurationInformerWithOptions]). func NewPriorityLevelConfigurationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, options) +} + +// NewTypedPriorityLevelConfigurationInformerWithOptions constructs a new informer for PriorityLevelConfiguration type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPriorityLevelConfigurationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) PriorityLevelConfigurationIndexInformer { gvr := schema.GroupVersionResource{Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta3", Resource: "prioritylevelconfigurations"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta3.PriorityLevelConfiguration](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewPriorityLevelConfigurationInformerWithOptions(client kubernetes.Interfac Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *priorityLevelConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedPriorityLevelConfigurationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *priorityLevelConfigurationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiflowcontrolv1beta3.PriorityLevelConfiguration{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *priorityLevelConfigurationInformer) TypedInformer() PriorityLevelConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta3.PriorityLevelConfiguration](f.factory.InformerFor(&apiflowcontrolv1beta3.PriorityLevelConfiguration{}, f.defaultInformer)) } func (f *priorityLevelConfigurationInformer) Lister() flowcontrolv1beta3.PriorityLevelConfigurationLister { return flowcontrolv1beta3.NewPriorityLevelConfigurationLister(f.Informer().GetIndexer()) } + +// ToTypedPriorityLevelConfigurationInformer converts an untyped informer into a TypedPriorityLevelConfigurationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PriorityLevelConfiguration. If that is not the case, calling type-safe methods of the returned +// TypedPriorityLevelConfigurationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedPriorityLevelConfigurationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedPriorityLevelConfigurationInformer(informer PriorityLevelConfigurationInformer) TypedPriorityLevelConfigurationInformer { + if informer, ok := informer.(TypedPriorityLevelConfigurationInformer); ok { + return informer + } + return &priorityLevelConfigurationTypedInformerAdapter{informer} +} + +type priorityLevelConfigurationTypedInformerAdapter struct { + PriorityLevelConfigurationInformer +} + +func (a *priorityLevelConfigurationTypedInformerAdapter) TypedInformer() PriorityLevelConfigurationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta3.PriorityLevelConfiguration](a.Informer()) +} + +// ToPriorityLevelConfigurationIndexInformer converts an untyped informer into a PriorityLevelConfigurationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PriorityLevelConfiguration. If that is not the case, calling type-safe methods of the returned +// PriorityLevelConfigurationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a PriorityLevelConfigurationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToPriorityLevelConfigurationIndexInformer(informer cache.SharedIndexInformer) PriorityLevelConfigurationIndexInformer { + if informer, ok := informer.(PriorityLevelConfigurationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiflowcontrolv1beta3.PriorityLevelConfiguration](informer) +} diff --git a/vendor/k8s.io/client-go/informers/generic.go b/vendor/k8s.io/client-go/informers/generic.go index 03c45c71cf..ab966b9490 100644 --- a/vendor/k8s.io/client-go/informers/generic.go +++ b/vendor/k8s.io/client-go/informers/generic.go @@ -48,6 +48,7 @@ import ( flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" v1beta3 "k8s.io/api/flowcontrol/v1beta3" + lifecyclev1alpha1 "k8s.io/api/lifecycle/v1alpha1" networkingv1 "k8s.io/api/networking/v1" networkingv1beta1 "k8s.io/api/networking/v1beta1" nodev1 "k8s.io/api/node/v1" @@ -63,11 +64,12 @@ import ( resourcev1beta1 "k8s.io/api/resource/v1beta1" resourcev1beta2 "k8s.io/api/resource/v1beta2" schedulingv1 "k8s.io/api/scheduling/v1" - schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2" + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" storagev1 "k8s.io/api/storage/v1" storagev1alpha1 "k8s.io/api/storage/v1alpha1" storagev1beta1 "k8s.io/api/storage/v1beta1" + storagemigrationv1 "k8s.io/api/storagemigration/v1" storagemigrationv1beta1 "k8s.io/api/storagemigration/v1beta1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" @@ -190,6 +192,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=certificates.k8s.io, Version=v1 case certificatesv1.SchemeGroupVersion.WithResource("certificatesigningrequests"): return &genericInformer{resource: resource.GroupResource(), informer: f.Certificates().V1().CertificateSigningRequests().Informer()}, nil + case certificatesv1.SchemeGroupVersion.WithResource("clustertrustbundles"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Certificates().V1().ClusterTrustBundles().Informer()}, nil + case certificatesv1.SchemeGroupVersion.WithResource("podcertificaterequests"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Certificates().V1().PodCertificateRequests().Informer()}, nil // Group=certificates.k8s.io, Version=v1alpha1 case certificatesv1alpha1.SchemeGroupVersion.WithResource("clustertrustbundles"): @@ -307,6 +313,12 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case apiserverinternalv1alpha1.SchemeGroupVersion.WithResource("storageversions"): return &genericInformer{resource: resource.GroupResource(), informer: f.Internal().V1alpha1().StorageVersions().Informer()}, nil + // Group=lifecycle.k8s.io, Version=v1alpha1 + case lifecyclev1alpha1.SchemeGroupVersion.WithResource("evictions"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Lifecycle().V1alpha1().Evictions().Informer()}, nil + case lifecyclev1alpha1.SchemeGroupVersion.WithResource("evictionrequests"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Lifecycle().V1alpha1().EvictionRequests().Informer()}, nil + // Group=networking.k8s.io, Version=v1 case networkingv1.SchemeGroupVersion.WithResource("ipaddresses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().IPAddresses().Informer()}, nil @@ -382,6 +394,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=resource.k8s.io, Version=v1 case resourcev1.SchemeGroupVersion.WithResource("deviceclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1().DeviceClasses().Informer()}, nil + case resourcev1.SchemeGroupVersion.WithResource("devicetaintrules"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1().DeviceTaintRules().Informer()}, nil case resourcev1.SchemeGroupVersion.WithResource("resourceclaims"): return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1().ResourceClaims().Informer()}, nil case resourcev1.SchemeGroupVersion.WithResource("resourceclaimtemplates"): @@ -421,15 +435,21 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case schedulingv1.SchemeGroupVersion.WithResource("priorityclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1().PriorityClasses().Informer()}, nil - // Group=scheduling.k8s.io, Version=v1alpha2 - case schedulingv1alpha2.SchemeGroupVersion.WithResource("podgroups"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1alpha2().PodGroups().Informer()}, nil - case schedulingv1alpha2.SchemeGroupVersion.WithResource("workloads"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1alpha2().Workloads().Informer()}, nil + // Group=scheduling.k8s.io, Version=v1alpha3 + case schedulingv1alpha3.SchemeGroupVersion.WithResource("compositepodgroups"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1alpha3().CompositePodGroups().Informer()}, nil + case schedulingv1alpha3.SchemeGroupVersion.WithResource("podgroups"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1alpha3().PodGroups().Informer()}, nil + case schedulingv1alpha3.SchemeGroupVersion.WithResource("workloads"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1alpha3().Workloads().Informer()}, nil // Group=scheduling.k8s.io, Version=v1beta1 + case schedulingv1beta1.SchemeGroupVersion.WithResource("podgroups"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1beta1().PodGroups().Informer()}, nil case schedulingv1beta1.SchemeGroupVersion.WithResource("priorityclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1beta1().PriorityClasses().Informer()}, nil + case schedulingv1beta1.SchemeGroupVersion.WithResource("workloads"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1beta1().Workloads().Informer()}, nil // Group=storage.k8s.io, Version=v1 case storagev1.SchemeGroupVersion.WithResource("csidrivers"): @@ -467,6 +487,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case storagev1beta1.SchemeGroupVersion.WithResource("volumeattributesclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().VolumeAttributesClasses().Informer()}, nil + // Group=storagemigration.k8s.io, Version=v1 + case storagemigrationv1.SchemeGroupVersion.WithResource("storageversionmigrations"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Storagemigration().V1().StorageVersionMigrations().Informer()}, nil + // Group=storagemigration.k8s.io, Version=v1beta1 case storagemigrationv1beta1.SchemeGroupVersion.WithResource("storageversionmigrations"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storagemigration().V1beta1().StorageVersionMigrations().Informer()}, nil diff --git a/vendor/k8s.io/client-go/informers/lifecycle/interface.go b/vendor/k8s.io/client-go/informers/lifecycle/interface.go new file mode 100644 index 0000000000..c9b3e3476f --- /dev/null +++ b/vendor/k8s.io/client-go/informers/lifecycle/interface.go @@ -0,0 +1,46 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package lifecycle + +import ( + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + v1alpha1 "k8s.io/client-go/informers/lifecycle/v1alpha1" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/vendor/k8s.io/client-go/informers/lifecycle/v1alpha1/eviction.go b/vendor/k8s.io/client-go/informers/lifecycle/v1alpha1/eviction.go new file mode 100644 index 0000000000..bf408957fa --- /dev/null +++ b/vendor/k8s.io/client-go/informers/lifecycle/v1alpha1/eviction.go @@ -0,0 +1,208 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + apilifecyclev1alpha1 "k8s.io/api/lifecycle/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + lifecyclev1alpha1 "k8s.io/client-go/listers/lifecycle/v1alpha1" + cache "k8s.io/client-go/tools/cache" +) + +// EvictionInformer provides access to a shared informer and lister for +// Evictions. Prefer using the type-safe variant (see [TypedEvictionInformer]). +type EvictionInformer interface { + Informer() cache.SharedIndexInformer + Lister() lifecyclev1alpha1.EvictionLister +} + +// TypedEvictionInformer provides access to a shared informer and lister for +// Evictions, including the type-safe TypedInformer variant. +// It is a superset of EvictionInformer. +type TypedEvictionInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() EvictionIndexInformer + Lister() lifecyclev1alpha1.EvictionLister +} + +// EvictionIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type EvictionIndexInformer cache.TypedSharedIndexInformer[*apilifecyclev1alpha1.Eviction] + +// EvictionHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Eviction. +type EvictionHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apilifecyclev1alpha1.Eviction] + +// EvictionDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Eviction. +type EvictionDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apilifecyclev1alpha1.Eviction] + +// EvictionFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Eviction. +type EvictionFilteringHandler = cache.TypedFilteringResourceEventHandler[*apilifecyclev1alpha1.Eviction] + +// EvictionIndexers is a specialization of [cache.TypedIndexers] for Eviction. +type EvictionIndexers = cache.TypedIndexers[*apilifecyclev1alpha1.Eviction] + +// DeletedEviction is a specialization of [cache.DeletedObject] for Eviction. +type DeletedEviction = cache.DeletedObject[*apilifecyclev1alpha1.Eviction] + +type evictionInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewEvictionInformer constructs a new informer for Eviction type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedEvictionInformer]). +func NewEvictionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewEvictionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewTypedEvictionInformer constructs a new informer for Eviction type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedEvictionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers EvictionIndexers) EvictionIndexInformer { + return NewTypedEvictionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + +// NewFilteredEvictionInformer constructs a new informer for Eviction type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredEvictionInformer]). +func NewFilteredEvictionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewTypedEvictionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredEvictionInformer constructs a new informer for Eviction type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredEvictionInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers EvictionIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) EvictionIndexInformer { + return NewTypedEvictionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) +} + +// NewEvictionInformerWithOptions constructs a new informer for Eviction type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedEvictionInformerWithOptions]). +func NewEvictionInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedEvictionInformerWithOptions(client, namespace, options) +} + +// NewTypedEvictionInformerWithOptions constructs a new informer for Eviction type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedEvictionInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) EvictionIndexInformer { + gvr := schema.GroupVersionResource{Group: "lifecycle.k8s.io", Version: "v1alpha1", Resource: "evictions"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewTypedSharedIndexInformer[*apilifecyclev1alpha1.Eviction](cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.LifecycleV1alpha1().Evictions(namespace).List(context.Background(), opts) + }, + WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.LifecycleV1alpha1().Evictions(namespace).Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.LifecycleV1alpha1().Evictions(namespace).List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.LifecycleV1alpha1().Evictions(namespace).Watch(ctx, opts) + }, + }, client), + &apilifecyclev1alpha1.Eviction{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + )) +} + +func (f *evictionInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewTypedEvictionInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *evictionInformer) Informer() cache.SharedIndexInformer { + return f.TypedInformer() +} + +func (f *evictionInformer) TypedInformer() EvictionIndexInformer { + return cache.NewTypedSharedIndexInformer[*apilifecyclev1alpha1.Eviction](f.factory.InformerFor(&apilifecyclev1alpha1.Eviction{}, f.defaultInformer)) +} + +func (f *evictionInformer) Lister() lifecyclev1alpha1.EvictionLister { + return lifecyclev1alpha1.NewEvictionLister(f.Informer().GetIndexer()) +} + +// ToTypedEvictionInformer converts an untyped informer into a TypedEvictionInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Eviction. If that is not the case, calling type-safe methods of the returned +// TypedEvictionInformer leads to runtime panics. A safer alternative is to pass +// around a TypedEvictionInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedEvictionInformer(informer EvictionInformer) TypedEvictionInformer { + if informer, ok := informer.(TypedEvictionInformer); ok { + return informer + } + return &evictionTypedInformerAdapter{informer} +} + +type evictionTypedInformerAdapter struct { + EvictionInformer +} + +func (a *evictionTypedInformerAdapter) TypedInformer() EvictionIndexInformer { + return cache.NewTypedSharedIndexInformer[*apilifecyclev1alpha1.Eviction](a.Informer()) +} + +// ToEvictionIndexInformer converts an untyped informer into a EvictionIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Eviction. If that is not the case, calling type-safe methods of the returned +// EvictionIndexInformer leads to runtime panics. A safer alternative is to pass +// around a EvictionIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToEvictionIndexInformer(informer cache.SharedIndexInformer) EvictionIndexInformer { + if informer, ok := informer.(EvictionIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apilifecyclev1alpha1.Eviction](informer) +} diff --git a/vendor/k8s.io/client-go/informers/lifecycle/v1alpha1/evictionrequest.go b/vendor/k8s.io/client-go/informers/lifecycle/v1alpha1/evictionrequest.go new file mode 100644 index 0000000000..2e76157404 --- /dev/null +++ b/vendor/k8s.io/client-go/informers/lifecycle/v1alpha1/evictionrequest.go @@ -0,0 +1,208 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + apilifecyclev1alpha1 "k8s.io/api/lifecycle/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + lifecyclev1alpha1 "k8s.io/client-go/listers/lifecycle/v1alpha1" + cache "k8s.io/client-go/tools/cache" +) + +// EvictionRequestInformer provides access to a shared informer and lister for +// EvictionRequests. Prefer using the type-safe variant (see [TypedEvictionRequestInformer]). +type EvictionRequestInformer interface { + Informer() cache.SharedIndexInformer + Lister() lifecyclev1alpha1.EvictionRequestLister +} + +// TypedEvictionRequestInformer provides access to a shared informer and lister for +// EvictionRequests, including the type-safe TypedInformer variant. +// It is a superset of EvictionRequestInformer. +type TypedEvictionRequestInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() EvictionRequestIndexInformer + Lister() lifecyclev1alpha1.EvictionRequestLister +} + +// EvictionRequestIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type EvictionRequestIndexInformer cache.TypedSharedIndexInformer[*apilifecyclev1alpha1.EvictionRequest] + +// EvictionRequestHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for EvictionRequest. +type EvictionRequestHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apilifecyclev1alpha1.EvictionRequest] + +// EvictionRequestDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for EvictionRequest. +type EvictionRequestDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apilifecyclev1alpha1.EvictionRequest] + +// EvictionRequestFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for EvictionRequest. +type EvictionRequestFilteringHandler = cache.TypedFilteringResourceEventHandler[*apilifecyclev1alpha1.EvictionRequest] + +// EvictionRequestIndexers is a specialization of [cache.TypedIndexers] for EvictionRequest. +type EvictionRequestIndexers = cache.TypedIndexers[*apilifecyclev1alpha1.EvictionRequest] + +// DeletedEvictionRequest is a specialization of [cache.DeletedObject] for EvictionRequest. +type DeletedEvictionRequest = cache.DeletedObject[*apilifecyclev1alpha1.EvictionRequest] + +type evictionRequestInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewEvictionRequestInformer constructs a new informer for EvictionRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedEvictionRequestInformer]). +func NewEvictionRequestInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewEvictionRequestInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewTypedEvictionRequestInformer constructs a new informer for EvictionRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedEvictionRequestInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers EvictionRequestIndexers) EvictionRequestIndexInformer { + return NewTypedEvictionRequestInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + +// NewFilteredEvictionRequestInformer constructs a new informer for EvictionRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredEvictionRequestInformer]). +func NewFilteredEvictionRequestInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewTypedEvictionRequestInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredEvictionRequestInformer constructs a new informer for EvictionRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredEvictionRequestInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers EvictionRequestIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) EvictionRequestIndexInformer { + return NewTypedEvictionRequestInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) +} + +// NewEvictionRequestInformerWithOptions constructs a new informer for EvictionRequest type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedEvictionRequestInformerWithOptions]). +func NewEvictionRequestInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedEvictionRequestInformerWithOptions(client, namespace, options) +} + +// NewTypedEvictionRequestInformerWithOptions constructs a new informer for EvictionRequest type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedEvictionRequestInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) EvictionRequestIndexInformer { + gvr := schema.GroupVersionResource{Group: "lifecycle.k8s.io", Version: "v1alpha1", Resource: "evictionrequests"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewTypedSharedIndexInformer[*apilifecyclev1alpha1.EvictionRequest](cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.LifecycleV1alpha1().EvictionRequests(namespace).List(context.Background(), opts) + }, + WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.LifecycleV1alpha1().EvictionRequests(namespace).Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.LifecycleV1alpha1().EvictionRequests(namespace).List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.LifecycleV1alpha1().EvictionRequests(namespace).Watch(ctx, opts) + }, + }, client), + &apilifecyclev1alpha1.EvictionRequest{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + )) +} + +func (f *evictionRequestInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewTypedEvictionRequestInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *evictionRequestInformer) Informer() cache.SharedIndexInformer { + return f.TypedInformer() +} + +func (f *evictionRequestInformer) TypedInformer() EvictionRequestIndexInformer { + return cache.NewTypedSharedIndexInformer[*apilifecyclev1alpha1.EvictionRequest](f.factory.InformerFor(&apilifecyclev1alpha1.EvictionRequest{}, f.defaultInformer)) +} + +func (f *evictionRequestInformer) Lister() lifecyclev1alpha1.EvictionRequestLister { + return lifecyclev1alpha1.NewEvictionRequestLister(f.Informer().GetIndexer()) +} + +// ToTypedEvictionRequestInformer converts an untyped informer into a TypedEvictionRequestInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *EvictionRequest. If that is not the case, calling type-safe methods of the returned +// TypedEvictionRequestInformer leads to runtime panics. A safer alternative is to pass +// around a TypedEvictionRequestInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedEvictionRequestInformer(informer EvictionRequestInformer) TypedEvictionRequestInformer { + if informer, ok := informer.(TypedEvictionRequestInformer); ok { + return informer + } + return &evictionRequestTypedInformerAdapter{informer} +} + +type evictionRequestTypedInformerAdapter struct { + EvictionRequestInformer +} + +func (a *evictionRequestTypedInformerAdapter) TypedInformer() EvictionRequestIndexInformer { + return cache.NewTypedSharedIndexInformer[*apilifecyclev1alpha1.EvictionRequest](a.Informer()) +} + +// ToEvictionRequestIndexInformer converts an untyped informer into a EvictionRequestIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *EvictionRequest. If that is not the case, calling type-safe methods of the returned +// EvictionRequestIndexInformer leads to runtime panics. A safer alternative is to pass +// around a EvictionRequestIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToEvictionRequestIndexInformer(informer cache.SharedIndexInformer) EvictionRequestIndexInformer { + if informer, ok := informer.(EvictionRequestIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apilifecyclev1alpha1.EvictionRequest](informer) +} diff --git a/vendor/k8s.io/client-go/informers/lifecycle/v1alpha1/interface.go b/vendor/k8s.io/client-go/informers/lifecycle/v1alpha1/interface.go new file mode 100644 index 0000000000..81141bb1c1 --- /dev/null +++ b/vendor/k8s.io/client-go/informers/lifecycle/v1alpha1/interface.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // Evictions returns a EvictionInformer. + Evictions() TypedEvictionInformer + // EvictionRequests returns a EvictionRequestInformer. + EvictionRequests() TypedEvictionRequestInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// Evictions returns a TypedEvictionInformer. +func (v *version) Evictions() TypedEvictionInformer { + return &evictionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// EvictionRequests returns a TypedEvictionRequestInformer. +func (v *version) EvictionRequests() TypedEvictionRequestInformer { + return &evictionRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/k8s.io/client-go/informers/networking/v1/ingress.go b/vendor/k8s.io/client-go/informers/networking/v1/ingress.go index 65be7320d1..9ec5a53dc4 100644 --- a/vendor/k8s.io/client-go/informers/networking/v1/ingress.go +++ b/vendor/k8s.io/client-go/informers/networking/v1/ingress.go @@ -34,12 +34,40 @@ import ( ) // IngressInformer provides access to a shared informer and lister for -// Ingresses. +// Ingresses. Prefer using the type-safe variant (see [TypedIngressInformer]). type IngressInformer interface { Informer() cache.SharedIndexInformer Lister() networkingv1.IngressLister } +// TypedIngressInformer provides access to a shared informer and lister for +// Ingresses, including the type-safe TypedInformer variant. +// It is a superset of IngressInformer. +type TypedIngressInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() IngressIndexInformer + Lister() networkingv1.IngressLister +} + +// IngressIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type IngressIndexInformer cache.TypedSharedIndexInformer[*apinetworkingv1.Ingress] + +// IngressHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Ingress. +type IngressHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apinetworkingv1.Ingress] + +// IngressDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Ingress. +type IngressDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apinetworkingv1.Ingress] + +// IngressFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Ingress. +type IngressFilteringHandler = cache.TypedFilteringResourceEventHandler[*apinetworkingv1.Ingress] + +// IngressIndexers is a specialization of [cache.TypedIndexers] for Ingress. +type IngressIndexers = cache.TypedIndexers[*apinetworkingv1.Ingress] + +// DeletedIngress is a specialization of [cache.DeletedObject] for Ingress. +type DeletedIngress = cache.DeletedObject[*apinetworkingv1.Ingress] + type ingressInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type ingressInformer struct { // NewIngressInformer constructs a new informer for Ingress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIngressInformer]). func NewIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewIngressInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedIngressInformer constructs a new informer for Ingress type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers IngressIndexers) IngressIndexInformer { + return NewTypedIngressInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredIngressInformer constructs a new informer for Ingress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredIngressInformer]). func NewFilteredIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewIngressInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedIngressInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredIngressInformer constructs a new informer for Ingress type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers IngressIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) IngressIndexInformer { + return NewTypedIngressInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewIngressInformerWithOptions constructs a new informer for Ingress type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIngressInformerWithOptions]). func NewIngressInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedIngressInformerWithOptions(client, namespace, options) +} + +// NewTypedIngressInformerWithOptions constructs a new informer for Ingress type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIngressInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) IngressIndexInformer { gvr := schema.GroupVersionResource{Group: "networking.k8s.io", Version: "v1", Resource: "ingresss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.Ingress](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewIngressInformerWithOptions(client kubernetes.Interface, namespace string Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *ingressInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewIngressInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedIngressInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *ingressInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apinetworkingv1.Ingress{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *ingressInformer) TypedInformer() IngressIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.Ingress](f.factory.InformerFor(&apinetworkingv1.Ingress{}, f.defaultInformer)) } func (f *ingressInformer) Lister() networkingv1.IngressLister { return networkingv1.NewIngressLister(f.Informer().GetIndexer()) } + +// ToTypedIngressInformer converts an untyped informer into a TypedIngressInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Ingress. If that is not the case, calling type-safe methods of the returned +// TypedIngressInformer leads to runtime panics. A safer alternative is to pass +// around a TypedIngressInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedIngressInformer(informer IngressInformer) TypedIngressInformer { + if informer, ok := informer.(TypedIngressInformer); ok { + return informer + } + return &ingressTypedInformerAdapter{informer} +} + +type ingressTypedInformerAdapter struct { + IngressInformer +} + +func (a *ingressTypedInformerAdapter) TypedInformer() IngressIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.Ingress](a.Informer()) +} + +// ToIngressIndexInformer converts an untyped informer into a IngressIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Ingress. If that is not the case, calling type-safe methods of the returned +// IngressIndexInformer leads to runtime panics. A safer alternative is to pass +// around a IngressIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToIngressIndexInformer(informer cache.SharedIndexInformer) IngressIndexInformer { + if informer, ok := informer.(IngressIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.Ingress](informer) +} diff --git a/vendor/k8s.io/client-go/informers/networking/v1/ingressclass.go b/vendor/k8s.io/client-go/informers/networking/v1/ingressclass.go index bcb118f991..9174877fe4 100644 --- a/vendor/k8s.io/client-go/informers/networking/v1/ingressclass.go +++ b/vendor/k8s.io/client-go/informers/networking/v1/ingressclass.go @@ -34,12 +34,40 @@ import ( ) // IngressClassInformer provides access to a shared informer and lister for -// IngressClasses. +// IngressClasses. Prefer using the type-safe variant (see [TypedIngressClassInformer]). type IngressClassInformer interface { Informer() cache.SharedIndexInformer Lister() networkingv1.IngressClassLister } +// TypedIngressClassInformer provides access to a shared informer and lister for +// IngressClasses, including the type-safe TypedInformer variant. +// It is a superset of IngressClassInformer. +type TypedIngressClassInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() IngressClassIndexInformer + Lister() networkingv1.IngressClassLister +} + +// IngressClassIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type IngressClassIndexInformer cache.TypedSharedIndexInformer[*apinetworkingv1.IngressClass] + +// IngressClassHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for IngressClass. +type IngressClassHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apinetworkingv1.IngressClass] + +// IngressClassDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for IngressClass. +type IngressClassDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apinetworkingv1.IngressClass] + +// IngressClassFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for IngressClass. +type IngressClassFilteringHandler = cache.TypedFilteringResourceEventHandler[*apinetworkingv1.IngressClass] + +// IngressClassIndexers is a specialization of [cache.TypedIndexers] for IngressClass. +type IngressClassIndexers = cache.TypedIndexers[*apinetworkingv1.IngressClass] + +// DeletedIngressClass is a specialization of [cache.DeletedObject] for IngressClass. +type DeletedIngressClass = cache.DeletedObject[*apinetworkingv1.IngressClass] + type ingressClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type ingressClassInformer struct { // NewIngressClassInformer constructs a new informer for IngressClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIngressClassInformer]). func NewIngressClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewIngressClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedIngressClassInformer constructs a new informer for IngressClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIngressClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers IngressClassIndexers) IngressClassIndexInformer { + return NewTypedIngressClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredIngressClassInformer constructs a new informer for IngressClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredIngressClassInformer]). func NewFilteredIngressClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewIngressClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedIngressClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredIngressClassInformer constructs a new informer for IngressClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredIngressClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers IngressClassIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) IngressClassIndexInformer { + return NewTypedIngressClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewIngressClassInformerWithOptions constructs a new informer for IngressClass type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIngressClassInformerWithOptions]). func NewIngressClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedIngressClassInformerWithOptions(client, options) +} + +// NewTypedIngressClassInformerWithOptions constructs a new informer for IngressClass type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIngressClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) IngressClassIndexInformer { gvr := schema.GroupVersionResource{Group: "networking.k8s.io", Version: "v1", Resource: "ingressclasss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.IngressClass](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewIngressClassInformerWithOptions(client kubernetes.Interface, options int Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *ingressClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewIngressClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedIngressClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *ingressClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apinetworkingv1.IngressClass{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *ingressClassInformer) TypedInformer() IngressClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.IngressClass](f.factory.InformerFor(&apinetworkingv1.IngressClass{}, f.defaultInformer)) } func (f *ingressClassInformer) Lister() networkingv1.IngressClassLister { return networkingv1.NewIngressClassLister(f.Informer().GetIndexer()) } + +// ToTypedIngressClassInformer converts an untyped informer into a TypedIngressClassInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *IngressClass. If that is not the case, calling type-safe methods of the returned +// TypedIngressClassInformer leads to runtime panics. A safer alternative is to pass +// around a TypedIngressClassInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedIngressClassInformer(informer IngressClassInformer) TypedIngressClassInformer { + if informer, ok := informer.(TypedIngressClassInformer); ok { + return informer + } + return &ingressClassTypedInformerAdapter{informer} +} + +type ingressClassTypedInformerAdapter struct { + IngressClassInformer +} + +func (a *ingressClassTypedInformerAdapter) TypedInformer() IngressClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.IngressClass](a.Informer()) +} + +// ToIngressClassIndexInformer converts an untyped informer into a IngressClassIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *IngressClass. If that is not the case, calling type-safe methods of the returned +// IngressClassIndexInformer leads to runtime panics. A safer alternative is to pass +// around a IngressClassIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToIngressClassIndexInformer(informer cache.SharedIndexInformer) IngressClassIndexInformer { + if informer, ok := informer.(IngressClassIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.IngressClass](informer) +} diff --git a/vendor/k8s.io/client-go/informers/networking/v1/interface.go b/vendor/k8s.io/client-go/informers/networking/v1/interface.go index 09634929b3..6fecd84d6c 100644 --- a/vendor/k8s.io/client-go/informers/networking/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/networking/v1/interface.go @@ -25,15 +25,15 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // IPAddresses returns a IPAddressInformer. - IPAddresses() IPAddressInformer + IPAddresses() TypedIPAddressInformer // Ingresses returns a IngressInformer. - Ingresses() IngressInformer + Ingresses() TypedIngressInformer // IngressClasses returns a IngressClassInformer. - IngressClasses() IngressClassInformer + IngressClasses() TypedIngressClassInformer // NetworkPolicies returns a NetworkPolicyInformer. - NetworkPolicies() NetworkPolicyInformer + NetworkPolicies() TypedNetworkPolicyInformer // ServiceCIDRs returns a ServiceCIDRInformer. - ServiceCIDRs() ServiceCIDRInformer + ServiceCIDRs() TypedServiceCIDRInformer } type version struct { @@ -47,27 +47,27 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// IPAddresses returns a IPAddressInformer. -func (v *version) IPAddresses() IPAddressInformer { +// IPAddresses returns a TypedIPAddressInformer. +func (v *version) IPAddresses() TypedIPAddressInformer { return &iPAddressInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// Ingresses returns a IngressInformer. -func (v *version) Ingresses() IngressInformer { +// Ingresses returns a TypedIngressInformer. +func (v *version) Ingresses() TypedIngressInformer { return &ingressInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// IngressClasses returns a IngressClassInformer. -func (v *version) IngressClasses() IngressClassInformer { +// IngressClasses returns a TypedIngressClassInformer. +func (v *version) IngressClasses() TypedIngressClassInformer { return &ingressClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// NetworkPolicies returns a NetworkPolicyInformer. -func (v *version) NetworkPolicies() NetworkPolicyInformer { +// NetworkPolicies returns a TypedNetworkPolicyInformer. +func (v *version) NetworkPolicies() TypedNetworkPolicyInformer { return &networkPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ServiceCIDRs returns a ServiceCIDRInformer. -func (v *version) ServiceCIDRs() ServiceCIDRInformer { +// ServiceCIDRs returns a TypedServiceCIDRInformer. +func (v *version) ServiceCIDRs() TypedServiceCIDRInformer { return &serviceCIDRInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/networking/v1/ipaddress.go b/vendor/k8s.io/client-go/informers/networking/v1/ipaddress.go index ea4bb280c8..45d85ae872 100644 --- a/vendor/k8s.io/client-go/informers/networking/v1/ipaddress.go +++ b/vendor/k8s.io/client-go/informers/networking/v1/ipaddress.go @@ -34,12 +34,40 @@ import ( ) // IPAddressInformer provides access to a shared informer and lister for -// IPAddresses. +// IPAddresses. Prefer using the type-safe variant (see [TypedIPAddressInformer]). type IPAddressInformer interface { Informer() cache.SharedIndexInformer Lister() networkingv1.IPAddressLister } +// TypedIPAddressInformer provides access to a shared informer and lister for +// IPAddresses, including the type-safe TypedInformer variant. +// It is a superset of IPAddressInformer. +type TypedIPAddressInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() IPAddressIndexInformer + Lister() networkingv1.IPAddressLister +} + +// IPAddressIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type IPAddressIndexInformer cache.TypedSharedIndexInformer[*apinetworkingv1.IPAddress] + +// IPAddressHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for IPAddress. +type IPAddressHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apinetworkingv1.IPAddress] + +// IPAddressDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for IPAddress. +type IPAddressDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apinetworkingv1.IPAddress] + +// IPAddressFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for IPAddress. +type IPAddressFilteringHandler = cache.TypedFilteringResourceEventHandler[*apinetworkingv1.IPAddress] + +// IPAddressIndexers is a specialization of [cache.TypedIndexers] for IPAddress. +type IPAddressIndexers = cache.TypedIndexers[*apinetworkingv1.IPAddress] + +// DeletedIPAddress is a specialization of [cache.DeletedObject] for IPAddress. +type DeletedIPAddress = cache.DeletedObject[*apinetworkingv1.IPAddress] + type iPAddressInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type iPAddressInformer struct { // NewIPAddressInformer constructs a new informer for IPAddress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIPAddressInformer]). func NewIPAddressInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewIPAddressInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedIPAddressInformer constructs a new informer for IPAddress type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIPAddressInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers IPAddressIndexers) IPAddressIndexInformer { + return NewTypedIPAddressInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredIPAddressInformer constructs a new informer for IPAddress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredIPAddressInformer]). func NewFilteredIPAddressInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewIPAddressInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedIPAddressInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredIPAddressInformer constructs a new informer for IPAddress type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredIPAddressInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers IPAddressIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) IPAddressIndexInformer { + return NewTypedIPAddressInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewIPAddressInformerWithOptions constructs a new informer for IPAddress type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIPAddressInformerWithOptions]). func NewIPAddressInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedIPAddressInformerWithOptions(client, options) +} + +// NewTypedIPAddressInformerWithOptions constructs a new informer for IPAddress type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIPAddressInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) IPAddressIndexInformer { gvr := schema.GroupVersionResource{Group: "networking.k8s.io", Version: "v1", Resource: "ipaddresss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.IPAddress](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewIPAddressInformerWithOptions(client kubernetes.Interface, options intern Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *iPAddressInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewIPAddressInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedIPAddressInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *iPAddressInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apinetworkingv1.IPAddress{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *iPAddressInformer) TypedInformer() IPAddressIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.IPAddress](f.factory.InformerFor(&apinetworkingv1.IPAddress{}, f.defaultInformer)) } func (f *iPAddressInformer) Lister() networkingv1.IPAddressLister { return networkingv1.NewIPAddressLister(f.Informer().GetIndexer()) } + +// ToTypedIPAddressInformer converts an untyped informer into a TypedIPAddressInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *IPAddress. If that is not the case, calling type-safe methods of the returned +// TypedIPAddressInformer leads to runtime panics. A safer alternative is to pass +// around a TypedIPAddressInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedIPAddressInformer(informer IPAddressInformer) TypedIPAddressInformer { + if informer, ok := informer.(TypedIPAddressInformer); ok { + return informer + } + return &iPAddressTypedInformerAdapter{informer} +} + +type iPAddressTypedInformerAdapter struct { + IPAddressInformer +} + +func (a *iPAddressTypedInformerAdapter) TypedInformer() IPAddressIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.IPAddress](a.Informer()) +} + +// ToIPAddressIndexInformer converts an untyped informer into a IPAddressIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *IPAddress. If that is not the case, calling type-safe methods of the returned +// IPAddressIndexInformer leads to runtime panics. A safer alternative is to pass +// around a IPAddressIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToIPAddressIndexInformer(informer cache.SharedIndexInformer) IPAddressIndexInformer { + if informer, ok := informer.(IPAddressIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.IPAddress](informer) +} diff --git a/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go b/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go index 237fe6266d..41586c52ab 100644 --- a/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go +++ b/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go @@ -34,12 +34,40 @@ import ( ) // NetworkPolicyInformer provides access to a shared informer and lister for -// NetworkPolicies. +// NetworkPolicies. Prefer using the type-safe variant (see [TypedNetworkPolicyInformer]). type NetworkPolicyInformer interface { Informer() cache.SharedIndexInformer Lister() networkingv1.NetworkPolicyLister } +// TypedNetworkPolicyInformer provides access to a shared informer and lister for +// NetworkPolicies, including the type-safe TypedInformer variant. +// It is a superset of NetworkPolicyInformer. +type TypedNetworkPolicyInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() NetworkPolicyIndexInformer + Lister() networkingv1.NetworkPolicyLister +} + +// NetworkPolicyIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type NetworkPolicyIndexInformer cache.TypedSharedIndexInformer[*apinetworkingv1.NetworkPolicy] + +// NetworkPolicyHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for NetworkPolicy. +type NetworkPolicyHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apinetworkingv1.NetworkPolicy] + +// NetworkPolicyDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for NetworkPolicy. +type NetworkPolicyDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apinetworkingv1.NetworkPolicy] + +// NetworkPolicyFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for NetworkPolicy. +type NetworkPolicyFilteringHandler = cache.TypedFilteringResourceEventHandler[*apinetworkingv1.NetworkPolicy] + +// NetworkPolicyIndexers is a specialization of [cache.TypedIndexers] for NetworkPolicy. +type NetworkPolicyIndexers = cache.TypedIndexers[*apinetworkingv1.NetworkPolicy] + +// DeletedNetworkPolicy is a specialization of [cache.DeletedObject] for NetworkPolicy. +type DeletedNetworkPolicy = cache.DeletedObject[*apinetworkingv1.NetworkPolicy] + type networkPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type networkPolicyInformer struct { // NewNetworkPolicyInformer constructs a new informer for NetworkPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedNetworkPolicyInformer]). func NewNetworkPolicyInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedNetworkPolicyInformer constructs a new informer for NetworkPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedNetworkPolicyInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers NetworkPolicyIndexers) NetworkPolicyIndexInformer { + return NewTypedNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredNetworkPolicyInformer constructs a new informer for NetworkPolicy type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredNetworkPolicyInformer]). func NewFilteredNetworkPolicyInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredNetworkPolicyInformer constructs a new informer for NetworkPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredNetworkPolicyInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers NetworkPolicyIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) NetworkPolicyIndexInformer { + return NewTypedNetworkPolicyInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewNetworkPolicyInformerWithOptions constructs a new informer for NetworkPolicy type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedNetworkPolicyInformerWithOptions]). func NewNetworkPolicyInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedNetworkPolicyInformerWithOptions(client, namespace, options) +} + +// NewTypedNetworkPolicyInformerWithOptions constructs a new informer for NetworkPolicy type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedNetworkPolicyInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) NetworkPolicyIndexInformer { gvr := schema.GroupVersionResource{Group: "networking.k8s.io", Version: "v1", Resource: "networkpolicys"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.NetworkPolicy](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewNetworkPolicyInformerWithOptions(client kubernetes.Interface, namespace Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *networkPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewNetworkPolicyInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedNetworkPolicyInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *networkPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apinetworkingv1.NetworkPolicy{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *networkPolicyInformer) TypedInformer() NetworkPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.NetworkPolicy](f.factory.InformerFor(&apinetworkingv1.NetworkPolicy{}, f.defaultInformer)) } func (f *networkPolicyInformer) Lister() networkingv1.NetworkPolicyLister { return networkingv1.NewNetworkPolicyLister(f.Informer().GetIndexer()) } + +// ToTypedNetworkPolicyInformer converts an untyped informer into a TypedNetworkPolicyInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *NetworkPolicy. If that is not the case, calling type-safe methods of the returned +// TypedNetworkPolicyInformer leads to runtime panics. A safer alternative is to pass +// around a TypedNetworkPolicyInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedNetworkPolicyInformer(informer NetworkPolicyInformer) TypedNetworkPolicyInformer { + if informer, ok := informer.(TypedNetworkPolicyInformer); ok { + return informer + } + return &networkPolicyTypedInformerAdapter{informer} +} + +type networkPolicyTypedInformerAdapter struct { + NetworkPolicyInformer +} + +func (a *networkPolicyTypedInformerAdapter) TypedInformer() NetworkPolicyIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.NetworkPolicy](a.Informer()) +} + +// ToNetworkPolicyIndexInformer converts an untyped informer into a NetworkPolicyIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *NetworkPolicy. If that is not the case, calling type-safe methods of the returned +// NetworkPolicyIndexInformer leads to runtime panics. A safer alternative is to pass +// around a NetworkPolicyIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToNetworkPolicyIndexInformer(informer cache.SharedIndexInformer) NetworkPolicyIndexInformer { + if informer, ok := informer.(NetworkPolicyIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.NetworkPolicy](informer) +} diff --git a/vendor/k8s.io/client-go/informers/networking/v1/servicecidr.go b/vendor/k8s.io/client-go/informers/networking/v1/servicecidr.go index ee1810f817..e78ac8908b 100644 --- a/vendor/k8s.io/client-go/informers/networking/v1/servicecidr.go +++ b/vendor/k8s.io/client-go/informers/networking/v1/servicecidr.go @@ -34,12 +34,40 @@ import ( ) // ServiceCIDRInformer provides access to a shared informer and lister for -// ServiceCIDRs. +// ServiceCIDRs. Prefer using the type-safe variant (see [TypedServiceCIDRInformer]). type ServiceCIDRInformer interface { Informer() cache.SharedIndexInformer Lister() networkingv1.ServiceCIDRLister } +// TypedServiceCIDRInformer provides access to a shared informer and lister for +// ServiceCIDRs, including the type-safe TypedInformer variant. +// It is a superset of ServiceCIDRInformer. +type TypedServiceCIDRInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ServiceCIDRIndexInformer + Lister() networkingv1.ServiceCIDRLister +} + +// ServiceCIDRIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ServiceCIDRIndexInformer cache.TypedSharedIndexInformer[*apinetworkingv1.ServiceCIDR] + +// ServiceCIDRHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ServiceCIDR. +type ServiceCIDRHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apinetworkingv1.ServiceCIDR] + +// ServiceCIDRDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ServiceCIDR. +type ServiceCIDRDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apinetworkingv1.ServiceCIDR] + +// ServiceCIDRFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ServiceCIDR. +type ServiceCIDRFilteringHandler = cache.TypedFilteringResourceEventHandler[*apinetworkingv1.ServiceCIDR] + +// ServiceCIDRIndexers is a specialization of [cache.TypedIndexers] for ServiceCIDR. +type ServiceCIDRIndexers = cache.TypedIndexers[*apinetworkingv1.ServiceCIDR] + +// DeletedServiceCIDR is a specialization of [cache.DeletedObject] for ServiceCIDR. +type DeletedServiceCIDR = cache.DeletedObject[*apinetworkingv1.ServiceCIDR] + type serviceCIDRInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type serviceCIDRInformer struct { // NewServiceCIDRInformer constructs a new informer for ServiceCIDR type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedServiceCIDRInformer]). func NewServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewServiceCIDRInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedServiceCIDRInformer constructs a new informer for ServiceCIDR type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ServiceCIDRIndexers) ServiceCIDRIndexInformer { + return NewTypedServiceCIDRInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredServiceCIDRInformer constructs a new informer for ServiceCIDR type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredServiceCIDRInformer]). func NewFilteredServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewServiceCIDRInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedServiceCIDRInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredServiceCIDRInformer constructs a new informer for ServiceCIDR type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ServiceCIDRIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ServiceCIDRIndexInformer { + return NewTypedServiceCIDRInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewServiceCIDRInformerWithOptions constructs a new informer for ServiceCIDR type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedServiceCIDRInformerWithOptions]). func NewServiceCIDRInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedServiceCIDRInformerWithOptions(client, options) +} + +// NewTypedServiceCIDRInformerWithOptions constructs a new informer for ServiceCIDR type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedServiceCIDRInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ServiceCIDRIndexInformer { gvr := schema.GroupVersionResource{Group: "networking.k8s.io", Version: "v1", Resource: "servicecidrs"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.ServiceCIDR](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewServiceCIDRInformerWithOptions(client kubernetes.Interface, options inte Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *serviceCIDRInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewServiceCIDRInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedServiceCIDRInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *serviceCIDRInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apinetworkingv1.ServiceCIDR{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *serviceCIDRInformer) TypedInformer() ServiceCIDRIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.ServiceCIDR](f.factory.InformerFor(&apinetworkingv1.ServiceCIDR{}, f.defaultInformer)) } func (f *serviceCIDRInformer) Lister() networkingv1.ServiceCIDRLister { return networkingv1.NewServiceCIDRLister(f.Informer().GetIndexer()) } + +// ToTypedServiceCIDRInformer converts an untyped informer into a TypedServiceCIDRInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ServiceCIDR. If that is not the case, calling type-safe methods of the returned +// TypedServiceCIDRInformer leads to runtime panics. A safer alternative is to pass +// around a TypedServiceCIDRInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedServiceCIDRInformer(informer ServiceCIDRInformer) TypedServiceCIDRInformer { + if informer, ok := informer.(TypedServiceCIDRInformer); ok { + return informer + } + return &serviceCIDRTypedInformerAdapter{informer} +} + +type serviceCIDRTypedInformerAdapter struct { + ServiceCIDRInformer +} + +func (a *serviceCIDRTypedInformerAdapter) TypedInformer() ServiceCIDRIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.ServiceCIDR](a.Informer()) +} + +// ToServiceCIDRIndexInformer converts an untyped informer into a ServiceCIDRIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ServiceCIDR. If that is not the case, calling type-safe methods of the returned +// ServiceCIDRIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ServiceCIDRIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToServiceCIDRIndexInformer(informer cache.SharedIndexInformer) ServiceCIDRIndexInformer { + if informer, ok := informer.(ServiceCIDRIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apinetworkingv1.ServiceCIDR](informer) +} diff --git a/vendor/k8s.io/client-go/informers/networking/v1beta1/ingress.go b/vendor/k8s.io/client-go/informers/networking/v1beta1/ingress.go index ba35b8ac70..60ca6fb847 100644 --- a/vendor/k8s.io/client-go/informers/networking/v1beta1/ingress.go +++ b/vendor/k8s.io/client-go/informers/networking/v1beta1/ingress.go @@ -34,12 +34,40 @@ import ( ) // IngressInformer provides access to a shared informer and lister for -// Ingresses. +// Ingresses. Prefer using the type-safe variant (see [TypedIngressInformer]). type IngressInformer interface { Informer() cache.SharedIndexInformer Lister() networkingv1beta1.IngressLister } +// TypedIngressInformer provides access to a shared informer and lister for +// Ingresses, including the type-safe TypedInformer variant. +// It is a superset of IngressInformer. +type TypedIngressInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() IngressIndexInformer + Lister() networkingv1beta1.IngressLister +} + +// IngressIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type IngressIndexInformer cache.TypedSharedIndexInformer[*apinetworkingv1beta1.Ingress] + +// IngressHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Ingress. +type IngressHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apinetworkingv1beta1.Ingress] + +// IngressDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Ingress. +type IngressDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apinetworkingv1beta1.Ingress] + +// IngressFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Ingress. +type IngressFilteringHandler = cache.TypedFilteringResourceEventHandler[*apinetworkingv1beta1.Ingress] + +// IngressIndexers is a specialization of [cache.TypedIndexers] for Ingress. +type IngressIndexers = cache.TypedIndexers[*apinetworkingv1beta1.Ingress] + +// DeletedIngress is a specialization of [cache.DeletedObject] for Ingress. +type DeletedIngress = cache.DeletedObject[*apinetworkingv1beta1.Ingress] + type ingressInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type ingressInformer struct { // NewIngressInformer constructs a new informer for Ingress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIngressInformer]). func NewIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewIngressInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedIngressInformer constructs a new informer for Ingress type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers IngressIndexers) IngressIndexInformer { + return NewTypedIngressInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredIngressInformer constructs a new informer for Ingress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredIngressInformer]). func NewFilteredIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewIngressInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedIngressInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredIngressInformer constructs a new informer for Ingress type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredIngressInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers IngressIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) IngressIndexInformer { + return NewTypedIngressInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewIngressInformerWithOptions constructs a new informer for Ingress type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIngressInformerWithOptions]). func NewIngressInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedIngressInformerWithOptions(client, namespace, options) +} + +// NewTypedIngressInformerWithOptions constructs a new informer for Ingress type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIngressInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) IngressIndexInformer { gvr := schema.GroupVersionResource{Group: "networking.k8s.io", Version: "v1beta1", Resource: "ingresss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apinetworkingv1beta1.Ingress](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewIngressInformerWithOptions(client kubernetes.Interface, namespace string Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *ingressInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewIngressInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedIngressInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *ingressInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apinetworkingv1beta1.Ingress{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *ingressInformer) TypedInformer() IngressIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinetworkingv1beta1.Ingress](f.factory.InformerFor(&apinetworkingv1beta1.Ingress{}, f.defaultInformer)) } func (f *ingressInformer) Lister() networkingv1beta1.IngressLister { return networkingv1beta1.NewIngressLister(f.Informer().GetIndexer()) } + +// ToTypedIngressInformer converts an untyped informer into a TypedIngressInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Ingress. If that is not the case, calling type-safe methods of the returned +// TypedIngressInformer leads to runtime panics. A safer alternative is to pass +// around a TypedIngressInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedIngressInformer(informer IngressInformer) TypedIngressInformer { + if informer, ok := informer.(TypedIngressInformer); ok { + return informer + } + return &ingressTypedInformerAdapter{informer} +} + +type ingressTypedInformerAdapter struct { + IngressInformer +} + +func (a *ingressTypedInformerAdapter) TypedInformer() IngressIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinetworkingv1beta1.Ingress](a.Informer()) +} + +// ToIngressIndexInformer converts an untyped informer into a IngressIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Ingress. If that is not the case, calling type-safe methods of the returned +// IngressIndexInformer leads to runtime panics. A safer alternative is to pass +// around a IngressIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToIngressIndexInformer(informer cache.SharedIndexInformer) IngressIndexInformer { + if informer, ok := informer.(IngressIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apinetworkingv1beta1.Ingress](informer) +} diff --git a/vendor/k8s.io/client-go/informers/networking/v1beta1/ingressclass.go b/vendor/k8s.io/client-go/informers/networking/v1beta1/ingressclass.go index 97d761a633..71ccdad0c0 100644 --- a/vendor/k8s.io/client-go/informers/networking/v1beta1/ingressclass.go +++ b/vendor/k8s.io/client-go/informers/networking/v1beta1/ingressclass.go @@ -34,12 +34,40 @@ import ( ) // IngressClassInformer provides access to a shared informer and lister for -// IngressClasses. +// IngressClasses. Prefer using the type-safe variant (see [TypedIngressClassInformer]). type IngressClassInformer interface { Informer() cache.SharedIndexInformer Lister() networkingv1beta1.IngressClassLister } +// TypedIngressClassInformer provides access to a shared informer and lister for +// IngressClasses, including the type-safe TypedInformer variant. +// It is a superset of IngressClassInformer. +type TypedIngressClassInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() IngressClassIndexInformer + Lister() networkingv1beta1.IngressClassLister +} + +// IngressClassIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type IngressClassIndexInformer cache.TypedSharedIndexInformer[*apinetworkingv1beta1.IngressClass] + +// IngressClassHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for IngressClass. +type IngressClassHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apinetworkingv1beta1.IngressClass] + +// IngressClassDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for IngressClass. +type IngressClassDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apinetworkingv1beta1.IngressClass] + +// IngressClassFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for IngressClass. +type IngressClassFilteringHandler = cache.TypedFilteringResourceEventHandler[*apinetworkingv1beta1.IngressClass] + +// IngressClassIndexers is a specialization of [cache.TypedIndexers] for IngressClass. +type IngressClassIndexers = cache.TypedIndexers[*apinetworkingv1beta1.IngressClass] + +// DeletedIngressClass is a specialization of [cache.DeletedObject] for IngressClass. +type DeletedIngressClass = cache.DeletedObject[*apinetworkingv1beta1.IngressClass] + type ingressClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type ingressClassInformer struct { // NewIngressClassInformer constructs a new informer for IngressClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIngressClassInformer]). func NewIngressClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewIngressClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedIngressClassInformer constructs a new informer for IngressClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIngressClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers IngressClassIndexers) IngressClassIndexInformer { + return NewTypedIngressClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredIngressClassInformer constructs a new informer for IngressClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredIngressClassInformer]). func NewFilteredIngressClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewIngressClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedIngressClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredIngressClassInformer constructs a new informer for IngressClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredIngressClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers IngressClassIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) IngressClassIndexInformer { + return NewTypedIngressClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewIngressClassInformerWithOptions constructs a new informer for IngressClass type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIngressClassInformerWithOptions]). func NewIngressClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedIngressClassInformerWithOptions(client, options) +} + +// NewTypedIngressClassInformerWithOptions constructs a new informer for IngressClass type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIngressClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) IngressClassIndexInformer { gvr := schema.GroupVersionResource{Group: "networking.k8s.io", Version: "v1beta1", Resource: "ingressclasss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apinetworkingv1beta1.IngressClass](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewIngressClassInformerWithOptions(client kubernetes.Interface, options int Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *ingressClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewIngressClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedIngressClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *ingressClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apinetworkingv1beta1.IngressClass{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *ingressClassInformer) TypedInformer() IngressClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinetworkingv1beta1.IngressClass](f.factory.InformerFor(&apinetworkingv1beta1.IngressClass{}, f.defaultInformer)) } func (f *ingressClassInformer) Lister() networkingv1beta1.IngressClassLister { return networkingv1beta1.NewIngressClassLister(f.Informer().GetIndexer()) } + +// ToTypedIngressClassInformer converts an untyped informer into a TypedIngressClassInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *IngressClass. If that is not the case, calling type-safe methods of the returned +// TypedIngressClassInformer leads to runtime panics. A safer alternative is to pass +// around a TypedIngressClassInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedIngressClassInformer(informer IngressClassInformer) TypedIngressClassInformer { + if informer, ok := informer.(TypedIngressClassInformer); ok { + return informer + } + return &ingressClassTypedInformerAdapter{informer} +} + +type ingressClassTypedInformerAdapter struct { + IngressClassInformer +} + +func (a *ingressClassTypedInformerAdapter) TypedInformer() IngressClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinetworkingv1beta1.IngressClass](a.Informer()) +} + +// ToIngressClassIndexInformer converts an untyped informer into a IngressClassIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *IngressClass. If that is not the case, calling type-safe methods of the returned +// IngressClassIndexInformer leads to runtime panics. A safer alternative is to pass +// around a IngressClassIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToIngressClassIndexInformer(informer cache.SharedIndexInformer) IngressClassIndexInformer { + if informer, ok := informer.(IngressClassIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apinetworkingv1beta1.IngressClass](informer) +} diff --git a/vendor/k8s.io/client-go/informers/networking/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/networking/v1beta1/interface.go index 974a8fd5bf..f6489bd5d7 100644 --- a/vendor/k8s.io/client-go/informers/networking/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/networking/v1beta1/interface.go @@ -25,13 +25,13 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // IPAddresses returns a IPAddressInformer. - IPAddresses() IPAddressInformer + IPAddresses() TypedIPAddressInformer // Ingresses returns a IngressInformer. - Ingresses() IngressInformer + Ingresses() TypedIngressInformer // IngressClasses returns a IngressClassInformer. - IngressClasses() IngressClassInformer + IngressClasses() TypedIngressClassInformer // ServiceCIDRs returns a ServiceCIDRInformer. - ServiceCIDRs() ServiceCIDRInformer + ServiceCIDRs() TypedServiceCIDRInformer } type version struct { @@ -45,22 +45,22 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// IPAddresses returns a IPAddressInformer. -func (v *version) IPAddresses() IPAddressInformer { +// IPAddresses returns a TypedIPAddressInformer. +func (v *version) IPAddresses() TypedIPAddressInformer { return &iPAddressInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// Ingresses returns a IngressInformer. -func (v *version) Ingresses() IngressInformer { +// Ingresses returns a TypedIngressInformer. +func (v *version) Ingresses() TypedIngressInformer { return &ingressInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// IngressClasses returns a IngressClassInformer. -func (v *version) IngressClasses() IngressClassInformer { +// IngressClasses returns a TypedIngressClassInformer. +func (v *version) IngressClasses() TypedIngressClassInformer { return &ingressClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ServiceCIDRs returns a ServiceCIDRInformer. -func (v *version) ServiceCIDRs() ServiceCIDRInformer { +// ServiceCIDRs returns a TypedServiceCIDRInformer. +func (v *version) ServiceCIDRs() TypedServiceCIDRInformer { return &serviceCIDRInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/networking/v1beta1/ipaddress.go b/vendor/k8s.io/client-go/informers/networking/v1beta1/ipaddress.go index fd94392393..b63d156d76 100644 --- a/vendor/k8s.io/client-go/informers/networking/v1beta1/ipaddress.go +++ b/vendor/k8s.io/client-go/informers/networking/v1beta1/ipaddress.go @@ -34,12 +34,40 @@ import ( ) // IPAddressInformer provides access to a shared informer and lister for -// IPAddresses. +// IPAddresses. Prefer using the type-safe variant (see [TypedIPAddressInformer]). type IPAddressInformer interface { Informer() cache.SharedIndexInformer Lister() networkingv1beta1.IPAddressLister } +// TypedIPAddressInformer provides access to a shared informer and lister for +// IPAddresses, including the type-safe TypedInformer variant. +// It is a superset of IPAddressInformer. +type TypedIPAddressInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() IPAddressIndexInformer + Lister() networkingv1beta1.IPAddressLister +} + +// IPAddressIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type IPAddressIndexInformer cache.TypedSharedIndexInformer[*apinetworkingv1beta1.IPAddress] + +// IPAddressHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for IPAddress. +type IPAddressHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apinetworkingv1beta1.IPAddress] + +// IPAddressDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for IPAddress. +type IPAddressDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apinetworkingv1beta1.IPAddress] + +// IPAddressFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for IPAddress. +type IPAddressFilteringHandler = cache.TypedFilteringResourceEventHandler[*apinetworkingv1beta1.IPAddress] + +// IPAddressIndexers is a specialization of [cache.TypedIndexers] for IPAddress. +type IPAddressIndexers = cache.TypedIndexers[*apinetworkingv1beta1.IPAddress] + +// DeletedIPAddress is a specialization of [cache.DeletedObject] for IPAddress. +type DeletedIPAddress = cache.DeletedObject[*apinetworkingv1beta1.IPAddress] + type iPAddressInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type iPAddressInformer struct { // NewIPAddressInformer constructs a new informer for IPAddress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIPAddressInformer]). func NewIPAddressInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewIPAddressInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedIPAddressInformer constructs a new informer for IPAddress type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIPAddressInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers IPAddressIndexers) IPAddressIndexInformer { + return NewTypedIPAddressInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredIPAddressInformer constructs a new informer for IPAddress type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredIPAddressInformer]). func NewFilteredIPAddressInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewIPAddressInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedIPAddressInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredIPAddressInformer constructs a new informer for IPAddress type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredIPAddressInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers IPAddressIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) IPAddressIndexInformer { + return NewTypedIPAddressInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewIPAddressInformerWithOptions constructs a new informer for IPAddress type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedIPAddressInformerWithOptions]). func NewIPAddressInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedIPAddressInformerWithOptions(client, options) +} + +// NewTypedIPAddressInformerWithOptions constructs a new informer for IPAddress type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedIPAddressInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) IPAddressIndexInformer { gvr := schema.GroupVersionResource{Group: "networking.k8s.io", Version: "v1beta1", Resource: "ipaddresss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apinetworkingv1beta1.IPAddress](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewIPAddressInformerWithOptions(client kubernetes.Interface, options intern Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *iPAddressInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewIPAddressInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedIPAddressInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *iPAddressInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apinetworkingv1beta1.IPAddress{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *iPAddressInformer) TypedInformer() IPAddressIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinetworkingv1beta1.IPAddress](f.factory.InformerFor(&apinetworkingv1beta1.IPAddress{}, f.defaultInformer)) } func (f *iPAddressInformer) Lister() networkingv1beta1.IPAddressLister { return networkingv1beta1.NewIPAddressLister(f.Informer().GetIndexer()) } + +// ToTypedIPAddressInformer converts an untyped informer into a TypedIPAddressInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *IPAddress. If that is not the case, calling type-safe methods of the returned +// TypedIPAddressInformer leads to runtime panics. A safer alternative is to pass +// around a TypedIPAddressInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedIPAddressInformer(informer IPAddressInformer) TypedIPAddressInformer { + if informer, ok := informer.(TypedIPAddressInformer); ok { + return informer + } + return &iPAddressTypedInformerAdapter{informer} +} + +type iPAddressTypedInformerAdapter struct { + IPAddressInformer +} + +func (a *iPAddressTypedInformerAdapter) TypedInformer() IPAddressIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinetworkingv1beta1.IPAddress](a.Informer()) +} + +// ToIPAddressIndexInformer converts an untyped informer into a IPAddressIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *IPAddress. If that is not the case, calling type-safe methods of the returned +// IPAddressIndexInformer leads to runtime panics. A safer alternative is to pass +// around a IPAddressIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToIPAddressIndexInformer(informer cache.SharedIndexInformer) IPAddressIndexInformer { + if informer, ok := informer.(IPAddressIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apinetworkingv1beta1.IPAddress](informer) +} diff --git a/vendor/k8s.io/client-go/informers/networking/v1beta1/servicecidr.go b/vendor/k8s.io/client-go/informers/networking/v1beta1/servicecidr.go index 6fe8c3bd11..538ef31327 100644 --- a/vendor/k8s.io/client-go/informers/networking/v1beta1/servicecidr.go +++ b/vendor/k8s.io/client-go/informers/networking/v1beta1/servicecidr.go @@ -34,12 +34,40 @@ import ( ) // ServiceCIDRInformer provides access to a shared informer and lister for -// ServiceCIDRs. +// ServiceCIDRs. Prefer using the type-safe variant (see [TypedServiceCIDRInformer]). type ServiceCIDRInformer interface { Informer() cache.SharedIndexInformer Lister() networkingv1beta1.ServiceCIDRLister } +// TypedServiceCIDRInformer provides access to a shared informer and lister for +// ServiceCIDRs, including the type-safe TypedInformer variant. +// It is a superset of ServiceCIDRInformer. +type TypedServiceCIDRInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ServiceCIDRIndexInformer + Lister() networkingv1beta1.ServiceCIDRLister +} + +// ServiceCIDRIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ServiceCIDRIndexInformer cache.TypedSharedIndexInformer[*apinetworkingv1beta1.ServiceCIDR] + +// ServiceCIDRHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ServiceCIDR. +type ServiceCIDRHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apinetworkingv1beta1.ServiceCIDR] + +// ServiceCIDRDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ServiceCIDR. +type ServiceCIDRDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apinetworkingv1beta1.ServiceCIDR] + +// ServiceCIDRFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ServiceCIDR. +type ServiceCIDRFilteringHandler = cache.TypedFilteringResourceEventHandler[*apinetworkingv1beta1.ServiceCIDR] + +// ServiceCIDRIndexers is a specialization of [cache.TypedIndexers] for ServiceCIDR. +type ServiceCIDRIndexers = cache.TypedIndexers[*apinetworkingv1beta1.ServiceCIDR] + +// DeletedServiceCIDR is a specialization of [cache.DeletedObject] for ServiceCIDR. +type DeletedServiceCIDR = cache.DeletedObject[*apinetworkingv1beta1.ServiceCIDR] + type serviceCIDRInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type serviceCIDRInformer struct { // NewServiceCIDRInformer constructs a new informer for ServiceCIDR type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedServiceCIDRInformer]). func NewServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewServiceCIDRInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedServiceCIDRInformer constructs a new informer for ServiceCIDR type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ServiceCIDRIndexers) ServiceCIDRIndexInformer { + return NewTypedServiceCIDRInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredServiceCIDRInformer constructs a new informer for ServiceCIDR type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredServiceCIDRInformer]). func NewFilteredServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewServiceCIDRInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedServiceCIDRInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredServiceCIDRInformer constructs a new informer for ServiceCIDR type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ServiceCIDRIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ServiceCIDRIndexInformer { + return NewTypedServiceCIDRInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewServiceCIDRInformerWithOptions constructs a new informer for ServiceCIDR type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedServiceCIDRInformerWithOptions]). func NewServiceCIDRInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedServiceCIDRInformerWithOptions(client, options) +} + +// NewTypedServiceCIDRInformerWithOptions constructs a new informer for ServiceCIDR type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedServiceCIDRInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ServiceCIDRIndexInformer { gvr := schema.GroupVersionResource{Group: "networking.k8s.io", Version: "v1beta1", Resource: "servicecidrs"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apinetworkingv1beta1.ServiceCIDR](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewServiceCIDRInformerWithOptions(client kubernetes.Interface, options inte Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *serviceCIDRInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewServiceCIDRInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedServiceCIDRInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *serviceCIDRInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apinetworkingv1beta1.ServiceCIDR{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *serviceCIDRInformer) TypedInformer() ServiceCIDRIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinetworkingv1beta1.ServiceCIDR](f.factory.InformerFor(&apinetworkingv1beta1.ServiceCIDR{}, f.defaultInformer)) } func (f *serviceCIDRInformer) Lister() networkingv1beta1.ServiceCIDRLister { return networkingv1beta1.NewServiceCIDRLister(f.Informer().GetIndexer()) } + +// ToTypedServiceCIDRInformer converts an untyped informer into a TypedServiceCIDRInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ServiceCIDR. If that is not the case, calling type-safe methods of the returned +// TypedServiceCIDRInformer leads to runtime panics. A safer alternative is to pass +// around a TypedServiceCIDRInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedServiceCIDRInformer(informer ServiceCIDRInformer) TypedServiceCIDRInformer { + if informer, ok := informer.(TypedServiceCIDRInformer); ok { + return informer + } + return &serviceCIDRTypedInformerAdapter{informer} +} + +type serviceCIDRTypedInformerAdapter struct { + ServiceCIDRInformer +} + +func (a *serviceCIDRTypedInformerAdapter) TypedInformer() ServiceCIDRIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinetworkingv1beta1.ServiceCIDR](a.Informer()) +} + +// ToServiceCIDRIndexInformer converts an untyped informer into a ServiceCIDRIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ServiceCIDR. If that is not the case, calling type-safe methods of the returned +// ServiceCIDRIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ServiceCIDRIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToServiceCIDRIndexInformer(informer cache.SharedIndexInformer) ServiceCIDRIndexInformer { + if informer, ok := informer.(ServiceCIDRIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apinetworkingv1beta1.ServiceCIDR](informer) +} diff --git a/vendor/k8s.io/client-go/informers/node/v1/interface.go b/vendor/k8s.io/client-go/informers/node/v1/interface.go index 913fec4aca..53a4abd92e 100644 --- a/vendor/k8s.io/client-go/informers/node/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/node/v1/interface.go @@ -25,7 +25,7 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // RuntimeClasses returns a RuntimeClassInformer. - RuntimeClasses() RuntimeClassInformer + RuntimeClasses() TypedRuntimeClassInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// RuntimeClasses returns a RuntimeClassInformer. -func (v *version) RuntimeClasses() RuntimeClassInformer { +// RuntimeClasses returns a TypedRuntimeClassInformer. +func (v *version) RuntimeClasses() TypedRuntimeClassInformer { return &runtimeClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/node/v1/runtimeclass.go b/vendor/k8s.io/client-go/informers/node/v1/runtimeclass.go index 3b7d4a25d2..4fe4065465 100644 --- a/vendor/k8s.io/client-go/informers/node/v1/runtimeclass.go +++ b/vendor/k8s.io/client-go/informers/node/v1/runtimeclass.go @@ -34,12 +34,40 @@ import ( ) // RuntimeClassInformer provides access to a shared informer and lister for -// RuntimeClasses. +// RuntimeClasses. Prefer using the type-safe variant (see [TypedRuntimeClassInformer]). type RuntimeClassInformer interface { Informer() cache.SharedIndexInformer Lister() nodev1.RuntimeClassLister } +// TypedRuntimeClassInformer provides access to a shared informer and lister for +// RuntimeClasses, including the type-safe TypedInformer variant. +// It is a superset of RuntimeClassInformer. +type TypedRuntimeClassInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() RuntimeClassIndexInformer + Lister() nodev1.RuntimeClassLister +} + +// RuntimeClassIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type RuntimeClassIndexInformer cache.TypedSharedIndexInformer[*apinodev1.RuntimeClass] + +// RuntimeClassHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for RuntimeClass. +type RuntimeClassHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apinodev1.RuntimeClass] + +// RuntimeClassDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for RuntimeClass. +type RuntimeClassDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apinodev1.RuntimeClass] + +// RuntimeClassFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for RuntimeClass. +type RuntimeClassFilteringHandler = cache.TypedFilteringResourceEventHandler[*apinodev1.RuntimeClass] + +// RuntimeClassIndexers is a specialization of [cache.TypedIndexers] for RuntimeClass. +type RuntimeClassIndexers = cache.TypedIndexers[*apinodev1.RuntimeClass] + +// DeletedRuntimeClass is a specialization of [cache.DeletedObject] for RuntimeClass. +type DeletedRuntimeClass = cache.DeletedObject[*apinodev1.RuntimeClass] + type runtimeClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type runtimeClassInformer struct { // NewRuntimeClassInformer constructs a new informer for RuntimeClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedRuntimeClassInformer]). func NewRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedRuntimeClassInformer constructs a new informer for RuntimeClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers RuntimeClassIndexers) RuntimeClassIndexInformer { + return NewTypedRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredRuntimeClassInformer constructs a new informer for RuntimeClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredRuntimeClassInformer]). func NewFilteredRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredRuntimeClassInformer constructs a new informer for RuntimeClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers RuntimeClassIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) RuntimeClassIndexInformer { + return NewTypedRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewRuntimeClassInformerWithOptions constructs a new informer for RuntimeClass type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedRuntimeClassInformerWithOptions]). func NewRuntimeClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedRuntimeClassInformerWithOptions(client, options) +} + +// NewTypedRuntimeClassInformerWithOptions constructs a new informer for RuntimeClass type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedRuntimeClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) RuntimeClassIndexInformer { gvr := schema.GroupVersionResource{Group: "node.k8s.io", Version: "v1", Resource: "runtimeclasss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apinodev1.RuntimeClass](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewRuntimeClassInformerWithOptions(client kubernetes.Interface, options int Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *runtimeClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *runtimeClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apinodev1.RuntimeClass{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *runtimeClassInformer) TypedInformer() RuntimeClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinodev1.RuntimeClass](f.factory.InformerFor(&apinodev1.RuntimeClass{}, f.defaultInformer)) } func (f *runtimeClassInformer) Lister() nodev1.RuntimeClassLister { return nodev1.NewRuntimeClassLister(f.Informer().GetIndexer()) } + +// ToTypedRuntimeClassInformer converts an untyped informer into a TypedRuntimeClassInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *RuntimeClass. If that is not the case, calling type-safe methods of the returned +// TypedRuntimeClassInformer leads to runtime panics. A safer alternative is to pass +// around a TypedRuntimeClassInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedRuntimeClassInformer(informer RuntimeClassInformer) TypedRuntimeClassInformer { + if informer, ok := informer.(TypedRuntimeClassInformer); ok { + return informer + } + return &runtimeClassTypedInformerAdapter{informer} +} + +type runtimeClassTypedInformerAdapter struct { + RuntimeClassInformer +} + +func (a *runtimeClassTypedInformerAdapter) TypedInformer() RuntimeClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinodev1.RuntimeClass](a.Informer()) +} + +// ToRuntimeClassIndexInformer converts an untyped informer into a RuntimeClassIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *RuntimeClass. If that is not the case, calling type-safe methods of the returned +// RuntimeClassIndexInformer leads to runtime panics. A safer alternative is to pass +// around a RuntimeClassIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToRuntimeClassIndexInformer(informer cache.SharedIndexInformer) RuntimeClassIndexInformer { + if informer, ok := informer.(RuntimeClassIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apinodev1.RuntimeClass](informer) +} diff --git a/vendor/k8s.io/client-go/informers/node/v1alpha1/interface.go b/vendor/k8s.io/client-go/informers/node/v1alpha1/interface.go index c56442957e..402674241c 100644 --- a/vendor/k8s.io/client-go/informers/node/v1alpha1/interface.go +++ b/vendor/k8s.io/client-go/informers/node/v1alpha1/interface.go @@ -25,7 +25,7 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // RuntimeClasses returns a RuntimeClassInformer. - RuntimeClasses() RuntimeClassInformer + RuntimeClasses() TypedRuntimeClassInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// RuntimeClasses returns a RuntimeClassInformer. -func (v *version) RuntimeClasses() RuntimeClassInformer { +// RuntimeClasses returns a TypedRuntimeClassInformer. +func (v *version) RuntimeClasses() TypedRuntimeClassInformer { return &runtimeClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/node/v1alpha1/runtimeclass.go b/vendor/k8s.io/client-go/informers/node/v1alpha1/runtimeclass.go index 1907a122d2..d264133fef 100644 --- a/vendor/k8s.io/client-go/informers/node/v1alpha1/runtimeclass.go +++ b/vendor/k8s.io/client-go/informers/node/v1alpha1/runtimeclass.go @@ -34,12 +34,40 @@ import ( ) // RuntimeClassInformer provides access to a shared informer and lister for -// RuntimeClasses. +// RuntimeClasses. Prefer using the type-safe variant (see [TypedRuntimeClassInformer]). type RuntimeClassInformer interface { Informer() cache.SharedIndexInformer Lister() nodev1alpha1.RuntimeClassLister } +// TypedRuntimeClassInformer provides access to a shared informer and lister for +// RuntimeClasses, including the type-safe TypedInformer variant. +// It is a superset of RuntimeClassInformer. +type TypedRuntimeClassInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() RuntimeClassIndexInformer + Lister() nodev1alpha1.RuntimeClassLister +} + +// RuntimeClassIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type RuntimeClassIndexInformer cache.TypedSharedIndexInformer[*apinodev1alpha1.RuntimeClass] + +// RuntimeClassHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for RuntimeClass. +type RuntimeClassHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apinodev1alpha1.RuntimeClass] + +// RuntimeClassDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for RuntimeClass. +type RuntimeClassDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apinodev1alpha1.RuntimeClass] + +// RuntimeClassFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for RuntimeClass. +type RuntimeClassFilteringHandler = cache.TypedFilteringResourceEventHandler[*apinodev1alpha1.RuntimeClass] + +// RuntimeClassIndexers is a specialization of [cache.TypedIndexers] for RuntimeClass. +type RuntimeClassIndexers = cache.TypedIndexers[*apinodev1alpha1.RuntimeClass] + +// DeletedRuntimeClass is a specialization of [cache.DeletedObject] for RuntimeClass. +type DeletedRuntimeClass = cache.DeletedObject[*apinodev1alpha1.RuntimeClass] + type runtimeClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type runtimeClassInformer struct { // NewRuntimeClassInformer constructs a new informer for RuntimeClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedRuntimeClassInformer]). func NewRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedRuntimeClassInformer constructs a new informer for RuntimeClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers RuntimeClassIndexers) RuntimeClassIndexInformer { + return NewTypedRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredRuntimeClassInformer constructs a new informer for RuntimeClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredRuntimeClassInformer]). func NewFilteredRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredRuntimeClassInformer constructs a new informer for RuntimeClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers RuntimeClassIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) RuntimeClassIndexInformer { + return NewTypedRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewRuntimeClassInformerWithOptions constructs a new informer for RuntimeClass type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedRuntimeClassInformerWithOptions]). func NewRuntimeClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedRuntimeClassInformerWithOptions(client, options) +} + +// NewTypedRuntimeClassInformerWithOptions constructs a new informer for RuntimeClass type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedRuntimeClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) RuntimeClassIndexInformer { gvr := schema.GroupVersionResource{Group: "node.k8s.io", Version: "v1alpha1", Resource: "runtimeclasss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apinodev1alpha1.RuntimeClass](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewRuntimeClassInformerWithOptions(client kubernetes.Interface, options int Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *runtimeClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *runtimeClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apinodev1alpha1.RuntimeClass{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *runtimeClassInformer) TypedInformer() RuntimeClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinodev1alpha1.RuntimeClass](f.factory.InformerFor(&apinodev1alpha1.RuntimeClass{}, f.defaultInformer)) } func (f *runtimeClassInformer) Lister() nodev1alpha1.RuntimeClassLister { return nodev1alpha1.NewRuntimeClassLister(f.Informer().GetIndexer()) } + +// ToTypedRuntimeClassInformer converts an untyped informer into a TypedRuntimeClassInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *RuntimeClass. If that is not the case, calling type-safe methods of the returned +// TypedRuntimeClassInformer leads to runtime panics. A safer alternative is to pass +// around a TypedRuntimeClassInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedRuntimeClassInformer(informer RuntimeClassInformer) TypedRuntimeClassInformer { + if informer, ok := informer.(TypedRuntimeClassInformer); ok { + return informer + } + return &runtimeClassTypedInformerAdapter{informer} +} + +type runtimeClassTypedInformerAdapter struct { + RuntimeClassInformer +} + +func (a *runtimeClassTypedInformerAdapter) TypedInformer() RuntimeClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinodev1alpha1.RuntimeClass](a.Informer()) +} + +// ToRuntimeClassIndexInformer converts an untyped informer into a RuntimeClassIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *RuntimeClass. If that is not the case, calling type-safe methods of the returned +// RuntimeClassIndexInformer leads to runtime panics. A safer alternative is to pass +// around a RuntimeClassIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToRuntimeClassIndexInformer(informer cache.SharedIndexInformer) RuntimeClassIndexInformer { + if informer, ok := informer.(RuntimeClassIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apinodev1alpha1.RuntimeClass](informer) +} diff --git a/vendor/k8s.io/client-go/informers/node/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/node/v1beta1/interface.go index 44a1defb6b..6e81a66e4e 100644 --- a/vendor/k8s.io/client-go/informers/node/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/node/v1beta1/interface.go @@ -25,7 +25,7 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // RuntimeClasses returns a RuntimeClassInformer. - RuntimeClasses() RuntimeClassInformer + RuntimeClasses() TypedRuntimeClassInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// RuntimeClasses returns a RuntimeClassInformer. -func (v *version) RuntimeClasses() RuntimeClassInformer { +// RuntimeClasses returns a TypedRuntimeClassInformer. +func (v *version) RuntimeClasses() TypedRuntimeClassInformer { return &runtimeClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/node/v1beta1/runtimeclass.go b/vendor/k8s.io/client-go/informers/node/v1beta1/runtimeclass.go index ca7e9307ac..58d602da20 100644 --- a/vendor/k8s.io/client-go/informers/node/v1beta1/runtimeclass.go +++ b/vendor/k8s.io/client-go/informers/node/v1beta1/runtimeclass.go @@ -34,12 +34,40 @@ import ( ) // RuntimeClassInformer provides access to a shared informer and lister for -// RuntimeClasses. +// RuntimeClasses. Prefer using the type-safe variant (see [TypedRuntimeClassInformer]). type RuntimeClassInformer interface { Informer() cache.SharedIndexInformer Lister() nodev1beta1.RuntimeClassLister } +// TypedRuntimeClassInformer provides access to a shared informer and lister for +// RuntimeClasses, including the type-safe TypedInformer variant. +// It is a superset of RuntimeClassInformer. +type TypedRuntimeClassInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() RuntimeClassIndexInformer + Lister() nodev1beta1.RuntimeClassLister +} + +// RuntimeClassIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type RuntimeClassIndexInformer cache.TypedSharedIndexInformer[*apinodev1beta1.RuntimeClass] + +// RuntimeClassHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for RuntimeClass. +type RuntimeClassHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apinodev1beta1.RuntimeClass] + +// RuntimeClassDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for RuntimeClass. +type RuntimeClassDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apinodev1beta1.RuntimeClass] + +// RuntimeClassFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for RuntimeClass. +type RuntimeClassFilteringHandler = cache.TypedFilteringResourceEventHandler[*apinodev1beta1.RuntimeClass] + +// RuntimeClassIndexers is a specialization of [cache.TypedIndexers] for RuntimeClass. +type RuntimeClassIndexers = cache.TypedIndexers[*apinodev1beta1.RuntimeClass] + +// DeletedRuntimeClass is a specialization of [cache.DeletedObject] for RuntimeClass. +type DeletedRuntimeClass = cache.DeletedObject[*apinodev1beta1.RuntimeClass] + type runtimeClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type runtimeClassInformer struct { // NewRuntimeClassInformer constructs a new informer for RuntimeClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedRuntimeClassInformer]). func NewRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedRuntimeClassInformer constructs a new informer for RuntimeClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers RuntimeClassIndexers) RuntimeClassIndexInformer { + return NewTypedRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredRuntimeClassInformer constructs a new informer for RuntimeClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredRuntimeClassInformer]). func NewFilteredRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredRuntimeClassInformer constructs a new informer for RuntimeClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredRuntimeClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers RuntimeClassIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) RuntimeClassIndexInformer { + return NewTypedRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewRuntimeClassInformerWithOptions constructs a new informer for RuntimeClass type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedRuntimeClassInformerWithOptions]). func NewRuntimeClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedRuntimeClassInformerWithOptions(client, options) +} + +// NewTypedRuntimeClassInformerWithOptions constructs a new informer for RuntimeClass type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedRuntimeClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) RuntimeClassIndexInformer { gvr := schema.GroupVersionResource{Group: "node.k8s.io", Version: "v1beta1", Resource: "runtimeclasss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apinodev1beta1.RuntimeClass](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewRuntimeClassInformerWithOptions(client kubernetes.Interface, options int Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *runtimeClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedRuntimeClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *runtimeClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apinodev1beta1.RuntimeClass{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *runtimeClassInformer) TypedInformer() RuntimeClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinodev1beta1.RuntimeClass](f.factory.InformerFor(&apinodev1beta1.RuntimeClass{}, f.defaultInformer)) } func (f *runtimeClassInformer) Lister() nodev1beta1.RuntimeClassLister { return nodev1beta1.NewRuntimeClassLister(f.Informer().GetIndexer()) } + +// ToTypedRuntimeClassInformer converts an untyped informer into a TypedRuntimeClassInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *RuntimeClass. If that is not the case, calling type-safe methods of the returned +// TypedRuntimeClassInformer leads to runtime panics. A safer alternative is to pass +// around a TypedRuntimeClassInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedRuntimeClassInformer(informer RuntimeClassInformer) TypedRuntimeClassInformer { + if informer, ok := informer.(TypedRuntimeClassInformer); ok { + return informer + } + return &runtimeClassTypedInformerAdapter{informer} +} + +type runtimeClassTypedInformerAdapter struct { + RuntimeClassInformer +} + +func (a *runtimeClassTypedInformerAdapter) TypedInformer() RuntimeClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apinodev1beta1.RuntimeClass](a.Informer()) +} + +// ToRuntimeClassIndexInformer converts an untyped informer into a RuntimeClassIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *RuntimeClass. If that is not the case, calling type-safe methods of the returned +// RuntimeClassIndexInformer leads to runtime panics. A safer alternative is to pass +// around a RuntimeClassIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToRuntimeClassIndexInformer(informer cache.SharedIndexInformer) RuntimeClassIndexInformer { + if informer, ok := informer.(RuntimeClassIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apinodev1beta1.RuntimeClass](informer) +} diff --git a/vendor/k8s.io/client-go/informers/policy/v1/interface.go b/vendor/k8s.io/client-go/informers/policy/v1/interface.go index 2c42e1993c..2035254dc1 100644 --- a/vendor/k8s.io/client-go/informers/policy/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/policy/v1/interface.go @@ -25,7 +25,7 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // PodDisruptionBudgets returns a PodDisruptionBudgetInformer. - PodDisruptionBudgets() PodDisruptionBudgetInformer + PodDisruptionBudgets() TypedPodDisruptionBudgetInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// PodDisruptionBudgets returns a PodDisruptionBudgetInformer. -func (v *version) PodDisruptionBudgets() PodDisruptionBudgetInformer { +// PodDisruptionBudgets returns a TypedPodDisruptionBudgetInformer. +func (v *version) PodDisruptionBudgets() TypedPodDisruptionBudgetInformer { return &podDisruptionBudgetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/policy/v1/poddisruptionbudget.go b/vendor/k8s.io/client-go/informers/policy/v1/poddisruptionbudget.go index 2945e543d7..24ed2870df 100644 --- a/vendor/k8s.io/client-go/informers/policy/v1/poddisruptionbudget.go +++ b/vendor/k8s.io/client-go/informers/policy/v1/poddisruptionbudget.go @@ -34,12 +34,40 @@ import ( ) // PodDisruptionBudgetInformer provides access to a shared informer and lister for -// PodDisruptionBudgets. +// PodDisruptionBudgets. Prefer using the type-safe variant (see [TypedPodDisruptionBudgetInformer]). type PodDisruptionBudgetInformer interface { Informer() cache.SharedIndexInformer Lister() policyv1.PodDisruptionBudgetLister } +// TypedPodDisruptionBudgetInformer provides access to a shared informer and lister for +// PodDisruptionBudgets, including the type-safe TypedInformer variant. +// It is a superset of PodDisruptionBudgetInformer. +type TypedPodDisruptionBudgetInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() PodDisruptionBudgetIndexInformer + Lister() policyv1.PodDisruptionBudgetLister +} + +// PodDisruptionBudgetIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type PodDisruptionBudgetIndexInformer cache.TypedSharedIndexInformer[*apipolicyv1.PodDisruptionBudget] + +// PodDisruptionBudgetHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for PodDisruptionBudget. +type PodDisruptionBudgetHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apipolicyv1.PodDisruptionBudget] + +// PodDisruptionBudgetDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for PodDisruptionBudget. +type PodDisruptionBudgetDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apipolicyv1.PodDisruptionBudget] + +// PodDisruptionBudgetFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for PodDisruptionBudget. +type PodDisruptionBudgetFilteringHandler = cache.TypedFilteringResourceEventHandler[*apipolicyv1.PodDisruptionBudget] + +// PodDisruptionBudgetIndexers is a specialization of [cache.TypedIndexers] for PodDisruptionBudget. +type PodDisruptionBudgetIndexers = cache.TypedIndexers[*apipolicyv1.PodDisruptionBudget] + +// DeletedPodDisruptionBudget is a specialization of [cache.DeletedObject] for PodDisruptionBudget. +type DeletedPodDisruptionBudget = cache.DeletedObject[*apipolicyv1.PodDisruptionBudget] + type podDisruptionBudgetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type podDisruptionBudgetInformer struct { // NewPodDisruptionBudgetInformer constructs a new informer for PodDisruptionBudget type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPodDisruptionBudgetInformer]). func NewPodDisruptionBudgetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewPodDisruptionBudgetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedPodDisruptionBudgetInformer constructs a new informer for PodDisruptionBudget type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPodDisruptionBudgetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers PodDisruptionBudgetIndexers) PodDisruptionBudgetIndexInformer { + return NewTypedPodDisruptionBudgetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredPodDisruptionBudgetInformer constructs a new informer for PodDisruptionBudget type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredPodDisruptionBudgetInformer]). func NewFilteredPodDisruptionBudgetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewPodDisruptionBudgetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedPodDisruptionBudgetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredPodDisruptionBudgetInformer constructs a new informer for PodDisruptionBudget type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredPodDisruptionBudgetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers PodDisruptionBudgetIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) PodDisruptionBudgetIndexInformer { + return NewTypedPodDisruptionBudgetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewPodDisruptionBudgetInformerWithOptions constructs a new informer for PodDisruptionBudget type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPodDisruptionBudgetInformerWithOptions]). func NewPodDisruptionBudgetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedPodDisruptionBudgetInformerWithOptions(client, namespace, options) +} + +// NewTypedPodDisruptionBudgetInformerWithOptions constructs a new informer for PodDisruptionBudget type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPodDisruptionBudgetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) PodDisruptionBudgetIndexInformer { gvr := schema.GroupVersionResource{Group: "policy", Version: "v1", Resource: "poddisruptionbudgets"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apipolicyv1.PodDisruptionBudget](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewPodDisruptionBudgetInformerWithOptions(client kubernetes.Interface, name Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *podDisruptionBudgetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewPodDisruptionBudgetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedPodDisruptionBudgetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *podDisruptionBudgetInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apipolicyv1.PodDisruptionBudget{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *podDisruptionBudgetInformer) TypedInformer() PodDisruptionBudgetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apipolicyv1.PodDisruptionBudget](f.factory.InformerFor(&apipolicyv1.PodDisruptionBudget{}, f.defaultInformer)) } func (f *podDisruptionBudgetInformer) Lister() policyv1.PodDisruptionBudgetLister { return policyv1.NewPodDisruptionBudgetLister(f.Informer().GetIndexer()) } + +// ToTypedPodDisruptionBudgetInformer converts an untyped informer into a TypedPodDisruptionBudgetInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PodDisruptionBudget. If that is not the case, calling type-safe methods of the returned +// TypedPodDisruptionBudgetInformer leads to runtime panics. A safer alternative is to pass +// around a TypedPodDisruptionBudgetInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedPodDisruptionBudgetInformer(informer PodDisruptionBudgetInformer) TypedPodDisruptionBudgetInformer { + if informer, ok := informer.(TypedPodDisruptionBudgetInformer); ok { + return informer + } + return &podDisruptionBudgetTypedInformerAdapter{informer} +} + +type podDisruptionBudgetTypedInformerAdapter struct { + PodDisruptionBudgetInformer +} + +func (a *podDisruptionBudgetTypedInformerAdapter) TypedInformer() PodDisruptionBudgetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apipolicyv1.PodDisruptionBudget](a.Informer()) +} + +// ToPodDisruptionBudgetIndexInformer converts an untyped informer into a PodDisruptionBudgetIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PodDisruptionBudget. If that is not the case, calling type-safe methods of the returned +// PodDisruptionBudgetIndexInformer leads to runtime panics. A safer alternative is to pass +// around a PodDisruptionBudgetIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToPodDisruptionBudgetIndexInformer(informer cache.SharedIndexInformer) PodDisruptionBudgetIndexInformer { + if informer, ok := informer.(PodDisruptionBudgetIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apipolicyv1.PodDisruptionBudget](informer) +} diff --git a/vendor/k8s.io/client-go/informers/policy/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/policy/v1beta1/interface.go index 055c8adc55..31c09bc17b 100644 --- a/vendor/k8s.io/client-go/informers/policy/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/policy/v1beta1/interface.go @@ -25,7 +25,7 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // PodDisruptionBudgets returns a PodDisruptionBudgetInformer. - PodDisruptionBudgets() PodDisruptionBudgetInformer + PodDisruptionBudgets() TypedPodDisruptionBudgetInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// PodDisruptionBudgets returns a PodDisruptionBudgetInformer. -func (v *version) PodDisruptionBudgets() PodDisruptionBudgetInformer { +// PodDisruptionBudgets returns a TypedPodDisruptionBudgetInformer. +func (v *version) PodDisruptionBudgets() TypedPodDisruptionBudgetInformer { return &podDisruptionBudgetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go b/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go index 70c79683fe..8069aad312 100644 --- a/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go +++ b/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go @@ -34,12 +34,40 @@ import ( ) // PodDisruptionBudgetInformer provides access to a shared informer and lister for -// PodDisruptionBudgets. +// PodDisruptionBudgets. Prefer using the type-safe variant (see [TypedPodDisruptionBudgetInformer]). type PodDisruptionBudgetInformer interface { Informer() cache.SharedIndexInformer Lister() policyv1beta1.PodDisruptionBudgetLister } +// TypedPodDisruptionBudgetInformer provides access to a shared informer and lister for +// PodDisruptionBudgets, including the type-safe TypedInformer variant. +// It is a superset of PodDisruptionBudgetInformer. +type TypedPodDisruptionBudgetInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() PodDisruptionBudgetIndexInformer + Lister() policyv1beta1.PodDisruptionBudgetLister +} + +// PodDisruptionBudgetIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type PodDisruptionBudgetIndexInformer cache.TypedSharedIndexInformer[*apipolicyv1beta1.PodDisruptionBudget] + +// PodDisruptionBudgetHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for PodDisruptionBudget. +type PodDisruptionBudgetHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apipolicyv1beta1.PodDisruptionBudget] + +// PodDisruptionBudgetDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for PodDisruptionBudget. +type PodDisruptionBudgetDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apipolicyv1beta1.PodDisruptionBudget] + +// PodDisruptionBudgetFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for PodDisruptionBudget. +type PodDisruptionBudgetFilteringHandler = cache.TypedFilteringResourceEventHandler[*apipolicyv1beta1.PodDisruptionBudget] + +// PodDisruptionBudgetIndexers is a specialization of [cache.TypedIndexers] for PodDisruptionBudget. +type PodDisruptionBudgetIndexers = cache.TypedIndexers[*apipolicyv1beta1.PodDisruptionBudget] + +// DeletedPodDisruptionBudget is a specialization of [cache.DeletedObject] for PodDisruptionBudget. +type DeletedPodDisruptionBudget = cache.DeletedObject[*apipolicyv1beta1.PodDisruptionBudget] + type podDisruptionBudgetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type podDisruptionBudgetInformer struct { // NewPodDisruptionBudgetInformer constructs a new informer for PodDisruptionBudget type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPodDisruptionBudgetInformer]). func NewPodDisruptionBudgetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewPodDisruptionBudgetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedPodDisruptionBudgetInformer constructs a new informer for PodDisruptionBudget type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPodDisruptionBudgetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers PodDisruptionBudgetIndexers) PodDisruptionBudgetIndexInformer { + return NewTypedPodDisruptionBudgetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredPodDisruptionBudgetInformer constructs a new informer for PodDisruptionBudget type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredPodDisruptionBudgetInformer]). func NewFilteredPodDisruptionBudgetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewPodDisruptionBudgetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedPodDisruptionBudgetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredPodDisruptionBudgetInformer constructs a new informer for PodDisruptionBudget type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredPodDisruptionBudgetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers PodDisruptionBudgetIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) PodDisruptionBudgetIndexInformer { + return NewTypedPodDisruptionBudgetInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewPodDisruptionBudgetInformerWithOptions constructs a new informer for PodDisruptionBudget type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPodDisruptionBudgetInformerWithOptions]). func NewPodDisruptionBudgetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedPodDisruptionBudgetInformerWithOptions(client, namespace, options) +} + +// NewTypedPodDisruptionBudgetInformerWithOptions constructs a new informer for PodDisruptionBudget type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPodDisruptionBudgetInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) PodDisruptionBudgetIndexInformer { gvr := schema.GroupVersionResource{Group: "policy", Version: "v1beta1", Resource: "poddisruptionbudgets"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apipolicyv1beta1.PodDisruptionBudget](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewPodDisruptionBudgetInformerWithOptions(client kubernetes.Interface, name Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *podDisruptionBudgetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewPodDisruptionBudgetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedPodDisruptionBudgetInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *podDisruptionBudgetInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apipolicyv1beta1.PodDisruptionBudget{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *podDisruptionBudgetInformer) TypedInformer() PodDisruptionBudgetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apipolicyv1beta1.PodDisruptionBudget](f.factory.InformerFor(&apipolicyv1beta1.PodDisruptionBudget{}, f.defaultInformer)) } func (f *podDisruptionBudgetInformer) Lister() policyv1beta1.PodDisruptionBudgetLister { return policyv1beta1.NewPodDisruptionBudgetLister(f.Informer().GetIndexer()) } + +// ToTypedPodDisruptionBudgetInformer converts an untyped informer into a TypedPodDisruptionBudgetInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PodDisruptionBudget. If that is not the case, calling type-safe methods of the returned +// TypedPodDisruptionBudgetInformer leads to runtime panics. A safer alternative is to pass +// around a TypedPodDisruptionBudgetInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedPodDisruptionBudgetInformer(informer PodDisruptionBudgetInformer) TypedPodDisruptionBudgetInformer { + if informer, ok := informer.(TypedPodDisruptionBudgetInformer); ok { + return informer + } + return &podDisruptionBudgetTypedInformerAdapter{informer} +} + +type podDisruptionBudgetTypedInformerAdapter struct { + PodDisruptionBudgetInformer +} + +func (a *podDisruptionBudgetTypedInformerAdapter) TypedInformer() PodDisruptionBudgetIndexInformer { + return cache.NewTypedSharedIndexInformer[*apipolicyv1beta1.PodDisruptionBudget](a.Informer()) +} + +// ToPodDisruptionBudgetIndexInformer converts an untyped informer into a PodDisruptionBudgetIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PodDisruptionBudget. If that is not the case, calling type-safe methods of the returned +// PodDisruptionBudgetIndexInformer leads to runtime panics. A safer alternative is to pass +// around a PodDisruptionBudgetIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToPodDisruptionBudgetIndexInformer(informer cache.SharedIndexInformer) PodDisruptionBudgetIndexInformer { + if informer, ok := informer.(PodDisruptionBudgetIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apipolicyv1beta1.PodDisruptionBudget](informer) +} diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go b/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go index d938be79ee..3c0bc9e125 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go @@ -34,12 +34,40 @@ import ( ) // ClusterRoleInformer provides access to a shared informer and lister for -// ClusterRoles. +// ClusterRoles. Prefer using the type-safe variant (see [TypedClusterRoleInformer]). type ClusterRoleInformer interface { Informer() cache.SharedIndexInformer Lister() rbacv1.ClusterRoleLister } +// TypedClusterRoleInformer provides access to a shared informer and lister for +// ClusterRoles, including the type-safe TypedInformer variant. +// It is a superset of ClusterRoleInformer. +type TypedClusterRoleInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ClusterRoleIndexInformer + Lister() rbacv1.ClusterRoleLister +} + +// ClusterRoleIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ClusterRoleIndexInformer cache.TypedSharedIndexInformer[*apirbacv1.ClusterRole] + +// ClusterRoleHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ClusterRole. +type ClusterRoleHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apirbacv1.ClusterRole] + +// ClusterRoleDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ClusterRole. +type ClusterRoleDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apirbacv1.ClusterRole] + +// ClusterRoleFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ClusterRole. +type ClusterRoleFilteringHandler = cache.TypedFilteringResourceEventHandler[*apirbacv1.ClusterRole] + +// ClusterRoleIndexers is a specialization of [cache.TypedIndexers] for ClusterRole. +type ClusterRoleIndexers = cache.TypedIndexers[*apirbacv1.ClusterRole] + +// DeletedClusterRole is a specialization of [cache.DeletedObject] for ClusterRole. +type DeletedClusterRole = cache.DeletedObject[*apirbacv1.ClusterRole] + type clusterRoleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type clusterRoleInformer struct { // NewClusterRoleInformer constructs a new informer for ClusterRole type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterRoleInformer]). func NewClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedClusterRoleInformer constructs a new informer for ClusterRole type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ClusterRoleIndexers) ClusterRoleIndexInformer { + return NewTypedClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredClusterRoleInformer constructs a new informer for ClusterRole type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredClusterRoleInformer]). func NewFilteredClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredClusterRoleInformer constructs a new informer for ClusterRole type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ClusterRoleIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ClusterRoleIndexInformer { + return NewTypedClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewClusterRoleInformerWithOptions constructs a new informer for ClusterRole type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterRoleInformerWithOptions]). func NewClusterRoleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedClusterRoleInformerWithOptions(client, options) +} + +// NewTypedClusterRoleInformerWithOptions constructs a new informer for ClusterRole type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterRoleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ClusterRoleIndexInformer { gvr := schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "clusterroles"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apirbacv1.ClusterRole](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewClusterRoleInformerWithOptions(client kubernetes.Interface, options inte Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *clusterRoleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *clusterRoleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apirbacv1.ClusterRole{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *clusterRoleInformer) TypedInformer() ClusterRoleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1.ClusterRole](f.factory.InformerFor(&apirbacv1.ClusterRole{}, f.defaultInformer)) } func (f *clusterRoleInformer) Lister() rbacv1.ClusterRoleLister { return rbacv1.NewClusterRoleLister(f.Informer().GetIndexer()) } + +// ToTypedClusterRoleInformer converts an untyped informer into a TypedClusterRoleInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterRole. If that is not the case, calling type-safe methods of the returned +// TypedClusterRoleInformer leads to runtime panics. A safer alternative is to pass +// around a TypedClusterRoleInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedClusterRoleInformer(informer ClusterRoleInformer) TypedClusterRoleInformer { + if informer, ok := informer.(TypedClusterRoleInformer); ok { + return informer + } + return &clusterRoleTypedInformerAdapter{informer} +} + +type clusterRoleTypedInformerAdapter struct { + ClusterRoleInformer +} + +func (a *clusterRoleTypedInformerAdapter) TypedInformer() ClusterRoleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1.ClusterRole](a.Informer()) +} + +// ToClusterRoleIndexInformer converts an untyped informer into a ClusterRoleIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterRole. If that is not the case, calling type-safe methods of the returned +// ClusterRoleIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ClusterRoleIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToClusterRoleIndexInformer(informer cache.SharedIndexInformer) ClusterRoleIndexInformer { + if informer, ok := informer.(ClusterRoleIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apirbacv1.ClusterRole](informer) +} diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go index 72fe655da8..34dde5197e 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go @@ -34,12 +34,40 @@ import ( ) // ClusterRoleBindingInformer provides access to a shared informer and lister for -// ClusterRoleBindings. +// ClusterRoleBindings. Prefer using the type-safe variant (see [TypedClusterRoleBindingInformer]). type ClusterRoleBindingInformer interface { Informer() cache.SharedIndexInformer Lister() rbacv1.ClusterRoleBindingLister } +// TypedClusterRoleBindingInformer provides access to a shared informer and lister for +// ClusterRoleBindings, including the type-safe TypedInformer variant. +// It is a superset of ClusterRoleBindingInformer. +type TypedClusterRoleBindingInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ClusterRoleBindingIndexInformer + Lister() rbacv1.ClusterRoleBindingLister +} + +// ClusterRoleBindingIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ClusterRoleBindingIndexInformer cache.TypedSharedIndexInformer[*apirbacv1.ClusterRoleBinding] + +// ClusterRoleBindingHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ClusterRoleBinding. +type ClusterRoleBindingHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apirbacv1.ClusterRoleBinding] + +// ClusterRoleBindingDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ClusterRoleBinding. +type ClusterRoleBindingDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apirbacv1.ClusterRoleBinding] + +// ClusterRoleBindingFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ClusterRoleBinding. +type ClusterRoleBindingFilteringHandler = cache.TypedFilteringResourceEventHandler[*apirbacv1.ClusterRoleBinding] + +// ClusterRoleBindingIndexers is a specialization of [cache.TypedIndexers] for ClusterRoleBinding. +type ClusterRoleBindingIndexers = cache.TypedIndexers[*apirbacv1.ClusterRoleBinding] + +// DeletedClusterRoleBinding is a specialization of [cache.DeletedObject] for ClusterRoleBinding. +type DeletedClusterRoleBinding = cache.DeletedObject[*apirbacv1.ClusterRoleBinding] + type clusterRoleBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type clusterRoleBindingInformer struct { // NewClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterRoleBindingInformer]). func NewClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ClusterRoleBindingIndexers) ClusterRoleBindingIndexInformer { + return NewTypedClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredClusterRoleBindingInformer]). func NewFilteredClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ClusterRoleBindingIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ClusterRoleBindingIndexInformer { + return NewTypedClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewClusterRoleBindingInformerWithOptions constructs a new informer for ClusterRoleBinding type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterRoleBindingInformerWithOptions]). func NewClusterRoleBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedClusterRoleBindingInformerWithOptions(client, options) +} + +// NewTypedClusterRoleBindingInformerWithOptions constructs a new informer for ClusterRoleBinding type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterRoleBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ClusterRoleBindingIndexInformer { gvr := schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "clusterrolebindings"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apirbacv1.ClusterRoleBinding](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewClusterRoleBindingInformerWithOptions(client kubernetes.Interface, optio Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *clusterRoleBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *clusterRoleBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apirbacv1.ClusterRoleBinding{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *clusterRoleBindingInformer) TypedInformer() ClusterRoleBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1.ClusterRoleBinding](f.factory.InformerFor(&apirbacv1.ClusterRoleBinding{}, f.defaultInformer)) } func (f *clusterRoleBindingInformer) Lister() rbacv1.ClusterRoleBindingLister { return rbacv1.NewClusterRoleBindingLister(f.Informer().GetIndexer()) } + +// ToTypedClusterRoleBindingInformer converts an untyped informer into a TypedClusterRoleBindingInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterRoleBinding. If that is not the case, calling type-safe methods of the returned +// TypedClusterRoleBindingInformer leads to runtime panics. A safer alternative is to pass +// around a TypedClusterRoleBindingInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedClusterRoleBindingInformer(informer ClusterRoleBindingInformer) TypedClusterRoleBindingInformer { + if informer, ok := informer.(TypedClusterRoleBindingInformer); ok { + return informer + } + return &clusterRoleBindingTypedInformerAdapter{informer} +} + +type clusterRoleBindingTypedInformerAdapter struct { + ClusterRoleBindingInformer +} + +func (a *clusterRoleBindingTypedInformerAdapter) TypedInformer() ClusterRoleBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1.ClusterRoleBinding](a.Informer()) +} + +// ToClusterRoleBindingIndexInformer converts an untyped informer into a ClusterRoleBindingIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterRoleBinding. If that is not the case, calling type-safe methods of the returned +// ClusterRoleBindingIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ClusterRoleBindingIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToClusterRoleBindingIndexInformer(informer cache.SharedIndexInformer) ClusterRoleBindingIndexInformer { + if informer, ok := informer.(ClusterRoleBindingIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apirbacv1.ClusterRoleBinding](informer) +} diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/interface.go b/vendor/k8s.io/client-go/informers/rbac/v1/interface.go index 7f99c9454b..829564c283 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/interface.go @@ -25,13 +25,13 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // ClusterRoles returns a ClusterRoleInformer. - ClusterRoles() ClusterRoleInformer + ClusterRoles() TypedClusterRoleInformer // ClusterRoleBindings returns a ClusterRoleBindingInformer. - ClusterRoleBindings() ClusterRoleBindingInformer + ClusterRoleBindings() TypedClusterRoleBindingInformer // Roles returns a RoleInformer. - Roles() RoleInformer + Roles() TypedRoleInformer // RoleBindings returns a RoleBindingInformer. - RoleBindings() RoleBindingInformer + RoleBindings() TypedRoleBindingInformer } type version struct { @@ -45,22 +45,22 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// ClusterRoles returns a ClusterRoleInformer. -func (v *version) ClusterRoles() ClusterRoleInformer { +// ClusterRoles returns a TypedClusterRoleInformer. +func (v *version) ClusterRoles() TypedClusterRoleInformer { return &clusterRoleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ClusterRoleBindings returns a ClusterRoleBindingInformer. -func (v *version) ClusterRoleBindings() ClusterRoleBindingInformer { +// ClusterRoleBindings returns a TypedClusterRoleBindingInformer. +func (v *version) ClusterRoleBindings() TypedClusterRoleBindingInformer { return &clusterRoleBindingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// Roles returns a RoleInformer. -func (v *version) Roles() RoleInformer { +// Roles returns a TypedRoleInformer. +func (v *version) Roles() TypedRoleInformer { return &roleInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// RoleBindings returns a RoleBindingInformer. -func (v *version) RoleBindings() RoleBindingInformer { +// RoleBindings returns a TypedRoleBindingInformer. +func (v *version) RoleBindings() TypedRoleBindingInformer { return &roleBindingInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/role.go b/vendor/k8s.io/client-go/informers/rbac/v1/role.go index f66decf040..0e288582b3 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/role.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/role.go @@ -34,12 +34,40 @@ import ( ) // RoleInformer provides access to a shared informer and lister for -// Roles. +// Roles. Prefer using the type-safe variant (see [TypedRoleInformer]). type RoleInformer interface { Informer() cache.SharedIndexInformer Lister() rbacv1.RoleLister } +// TypedRoleInformer provides access to a shared informer and lister for +// Roles, including the type-safe TypedInformer variant. +// It is a superset of RoleInformer. +type TypedRoleInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() RoleIndexInformer + Lister() rbacv1.RoleLister +} + +// RoleIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type RoleIndexInformer cache.TypedSharedIndexInformer[*apirbacv1.Role] + +// RoleHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Role. +type RoleHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apirbacv1.Role] + +// RoleDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Role. +type RoleDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apirbacv1.Role] + +// RoleFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Role. +type RoleFilteringHandler = cache.TypedFilteringResourceEventHandler[*apirbacv1.Role] + +// RoleIndexers is a specialization of [cache.TypedIndexers] for Role. +type RoleIndexers = cache.TypedIndexers[*apirbacv1.Role] + +// DeletedRole is a specialization of [cache.DeletedObject] for Role. +type DeletedRole = cache.DeletedObject[*apirbacv1.Role] + type roleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type roleInformer struct { // NewRoleInformer constructs a new informer for Role type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedRoleInformer]). func NewRoleInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewRoleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedRoleInformer constructs a new informer for Role type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedRoleInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers RoleIndexers) RoleIndexInformer { + return NewTypedRoleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredRoleInformer constructs a new informer for Role type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredRoleInformer]). func NewFilteredRoleInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewRoleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedRoleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredRoleInformer constructs a new informer for Role type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredRoleInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers RoleIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) RoleIndexInformer { + return NewTypedRoleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewRoleInformerWithOptions constructs a new informer for Role type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedRoleInformerWithOptions]). func NewRoleInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedRoleInformerWithOptions(client, namespace, options) +} + +// NewTypedRoleInformerWithOptions constructs a new informer for Role type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedRoleInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) RoleIndexInformer { gvr := schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "roles"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apirbacv1.Role](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewRoleInformerWithOptions(client kubernetes.Interface, namespace string, o Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *roleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewRoleInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedRoleInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *roleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apirbacv1.Role{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *roleInformer) TypedInformer() RoleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1.Role](f.factory.InformerFor(&apirbacv1.Role{}, f.defaultInformer)) } func (f *roleInformer) Lister() rbacv1.RoleLister { return rbacv1.NewRoleLister(f.Informer().GetIndexer()) } + +// ToTypedRoleInformer converts an untyped informer into a TypedRoleInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Role. If that is not the case, calling type-safe methods of the returned +// TypedRoleInformer leads to runtime panics. A safer alternative is to pass +// around a TypedRoleInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedRoleInformer(informer RoleInformer) TypedRoleInformer { + if informer, ok := informer.(TypedRoleInformer); ok { + return informer + } + return &roleTypedInformerAdapter{informer} +} + +type roleTypedInformerAdapter struct { + RoleInformer +} + +func (a *roleTypedInformerAdapter) TypedInformer() RoleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1.Role](a.Informer()) +} + +// ToRoleIndexInformer converts an untyped informer into a RoleIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Role. If that is not the case, calling type-safe methods of the returned +// RoleIndexInformer leads to runtime panics. A safer alternative is to pass +// around a RoleIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToRoleIndexInformer(informer cache.SharedIndexInformer) RoleIndexInformer { + if informer, ok := informer.(RoleIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apirbacv1.Role](informer) +} diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go index c17b1c474f..261a1d03ae 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go @@ -34,12 +34,40 @@ import ( ) // RoleBindingInformer provides access to a shared informer and lister for -// RoleBindings. +// RoleBindings. Prefer using the type-safe variant (see [TypedRoleBindingInformer]). type RoleBindingInformer interface { Informer() cache.SharedIndexInformer Lister() rbacv1.RoleBindingLister } +// TypedRoleBindingInformer provides access to a shared informer and lister for +// RoleBindings, including the type-safe TypedInformer variant. +// It is a superset of RoleBindingInformer. +type TypedRoleBindingInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() RoleBindingIndexInformer + Lister() rbacv1.RoleBindingLister +} + +// RoleBindingIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type RoleBindingIndexInformer cache.TypedSharedIndexInformer[*apirbacv1.RoleBinding] + +// RoleBindingHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for RoleBinding. +type RoleBindingHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apirbacv1.RoleBinding] + +// RoleBindingDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for RoleBinding. +type RoleBindingDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apirbacv1.RoleBinding] + +// RoleBindingFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for RoleBinding. +type RoleBindingFilteringHandler = cache.TypedFilteringResourceEventHandler[*apirbacv1.RoleBinding] + +// RoleBindingIndexers is a specialization of [cache.TypedIndexers] for RoleBinding. +type RoleBindingIndexers = cache.TypedIndexers[*apirbacv1.RoleBinding] + +// DeletedRoleBinding is a specialization of [cache.DeletedObject] for RoleBinding. +type DeletedRoleBinding = cache.DeletedObject[*apirbacv1.RoleBinding] + type roleBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type roleBindingInformer struct { // NewRoleBindingInformer constructs a new informer for RoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedRoleBindingInformer]). func NewRoleBindingInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewRoleBindingInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedRoleBindingInformer constructs a new informer for RoleBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedRoleBindingInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers RoleBindingIndexers) RoleBindingIndexInformer { + return NewTypedRoleBindingInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredRoleBindingInformer constructs a new informer for RoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredRoleBindingInformer]). func NewFilteredRoleBindingInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewRoleBindingInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedRoleBindingInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredRoleBindingInformer constructs a new informer for RoleBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredRoleBindingInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers RoleBindingIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) RoleBindingIndexInformer { + return NewTypedRoleBindingInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewRoleBindingInformerWithOptions constructs a new informer for RoleBinding type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedRoleBindingInformerWithOptions]). func NewRoleBindingInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedRoleBindingInformerWithOptions(client, namespace, options) +} + +// NewTypedRoleBindingInformerWithOptions constructs a new informer for RoleBinding type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedRoleBindingInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) RoleBindingIndexInformer { gvr := schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "rolebindings"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apirbacv1.RoleBinding](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewRoleBindingInformerWithOptions(client kubernetes.Interface, namespace st Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *roleBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewRoleBindingInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedRoleBindingInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *roleBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apirbacv1.RoleBinding{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *roleBindingInformer) TypedInformer() RoleBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1.RoleBinding](f.factory.InformerFor(&apirbacv1.RoleBinding{}, f.defaultInformer)) } func (f *roleBindingInformer) Lister() rbacv1.RoleBindingLister { return rbacv1.NewRoleBindingLister(f.Informer().GetIndexer()) } + +// ToTypedRoleBindingInformer converts an untyped informer into a TypedRoleBindingInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *RoleBinding. If that is not the case, calling type-safe methods of the returned +// TypedRoleBindingInformer leads to runtime panics. A safer alternative is to pass +// around a TypedRoleBindingInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedRoleBindingInformer(informer RoleBindingInformer) TypedRoleBindingInformer { + if informer, ok := informer.(TypedRoleBindingInformer); ok { + return informer + } + return &roleBindingTypedInformerAdapter{informer} +} + +type roleBindingTypedInformerAdapter struct { + RoleBindingInformer +} + +func (a *roleBindingTypedInformerAdapter) TypedInformer() RoleBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1.RoleBinding](a.Informer()) +} + +// ToRoleBindingIndexInformer converts an untyped informer into a RoleBindingIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *RoleBinding. If that is not the case, calling type-safe methods of the returned +// RoleBindingIndexInformer leads to runtime panics. A safer alternative is to pass +// around a RoleBindingIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToRoleBindingIndexInformer(informer cache.SharedIndexInformer) RoleBindingIndexInformer { + if informer, ok := informer.(RoleBindingIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apirbacv1.RoleBinding](informer) +} diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go index cac4ba05b9..2fbc6c2f72 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go @@ -34,12 +34,40 @@ import ( ) // ClusterRoleInformer provides access to a shared informer and lister for -// ClusterRoles. +// ClusterRoles. Prefer using the type-safe variant (see [TypedClusterRoleInformer]). type ClusterRoleInformer interface { Informer() cache.SharedIndexInformer Lister() rbacv1alpha1.ClusterRoleLister } +// TypedClusterRoleInformer provides access to a shared informer and lister for +// ClusterRoles, including the type-safe TypedInformer variant. +// It is a superset of ClusterRoleInformer. +type TypedClusterRoleInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ClusterRoleIndexInformer + Lister() rbacv1alpha1.ClusterRoleLister +} + +// ClusterRoleIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ClusterRoleIndexInformer cache.TypedSharedIndexInformer[*apirbacv1alpha1.ClusterRole] + +// ClusterRoleHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ClusterRole. +type ClusterRoleHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apirbacv1alpha1.ClusterRole] + +// ClusterRoleDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ClusterRole. +type ClusterRoleDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apirbacv1alpha1.ClusterRole] + +// ClusterRoleFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ClusterRole. +type ClusterRoleFilteringHandler = cache.TypedFilteringResourceEventHandler[*apirbacv1alpha1.ClusterRole] + +// ClusterRoleIndexers is a specialization of [cache.TypedIndexers] for ClusterRole. +type ClusterRoleIndexers = cache.TypedIndexers[*apirbacv1alpha1.ClusterRole] + +// DeletedClusterRole is a specialization of [cache.DeletedObject] for ClusterRole. +type DeletedClusterRole = cache.DeletedObject[*apirbacv1alpha1.ClusterRole] + type clusterRoleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type clusterRoleInformer struct { // NewClusterRoleInformer constructs a new informer for ClusterRole type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterRoleInformer]). func NewClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedClusterRoleInformer constructs a new informer for ClusterRole type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ClusterRoleIndexers) ClusterRoleIndexInformer { + return NewTypedClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredClusterRoleInformer constructs a new informer for ClusterRole type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredClusterRoleInformer]). func NewFilteredClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredClusterRoleInformer constructs a new informer for ClusterRole type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ClusterRoleIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ClusterRoleIndexInformer { + return NewTypedClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewClusterRoleInformerWithOptions constructs a new informer for ClusterRole type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterRoleInformerWithOptions]). func NewClusterRoleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedClusterRoleInformerWithOptions(client, options) +} + +// NewTypedClusterRoleInformerWithOptions constructs a new informer for ClusterRole type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterRoleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ClusterRoleIndexInformer { gvr := schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1alpha1", Resource: "clusterroles"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apirbacv1alpha1.ClusterRole](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewClusterRoleInformerWithOptions(client kubernetes.Interface, options inte Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *clusterRoleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *clusterRoleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apirbacv1alpha1.ClusterRole{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *clusterRoleInformer) TypedInformer() ClusterRoleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1alpha1.ClusterRole](f.factory.InformerFor(&apirbacv1alpha1.ClusterRole{}, f.defaultInformer)) } func (f *clusterRoleInformer) Lister() rbacv1alpha1.ClusterRoleLister { return rbacv1alpha1.NewClusterRoleLister(f.Informer().GetIndexer()) } + +// ToTypedClusterRoleInformer converts an untyped informer into a TypedClusterRoleInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterRole. If that is not the case, calling type-safe methods of the returned +// TypedClusterRoleInformer leads to runtime panics. A safer alternative is to pass +// around a TypedClusterRoleInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedClusterRoleInformer(informer ClusterRoleInformer) TypedClusterRoleInformer { + if informer, ok := informer.(TypedClusterRoleInformer); ok { + return informer + } + return &clusterRoleTypedInformerAdapter{informer} +} + +type clusterRoleTypedInformerAdapter struct { + ClusterRoleInformer +} + +func (a *clusterRoleTypedInformerAdapter) TypedInformer() ClusterRoleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1alpha1.ClusterRole](a.Informer()) +} + +// ToClusterRoleIndexInformer converts an untyped informer into a ClusterRoleIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterRole. If that is not the case, calling type-safe methods of the returned +// ClusterRoleIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ClusterRoleIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToClusterRoleIndexInformer(informer cache.SharedIndexInformer) ClusterRoleIndexInformer { + if informer, ok := informer.(ClusterRoleIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apirbacv1alpha1.ClusterRole](informer) +} diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go index 944e16cef6..1932c1ef4b 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go @@ -34,12 +34,40 @@ import ( ) // ClusterRoleBindingInformer provides access to a shared informer and lister for -// ClusterRoleBindings. +// ClusterRoleBindings. Prefer using the type-safe variant (see [TypedClusterRoleBindingInformer]). type ClusterRoleBindingInformer interface { Informer() cache.SharedIndexInformer Lister() rbacv1alpha1.ClusterRoleBindingLister } +// TypedClusterRoleBindingInformer provides access to a shared informer and lister for +// ClusterRoleBindings, including the type-safe TypedInformer variant. +// It is a superset of ClusterRoleBindingInformer. +type TypedClusterRoleBindingInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ClusterRoleBindingIndexInformer + Lister() rbacv1alpha1.ClusterRoleBindingLister +} + +// ClusterRoleBindingIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ClusterRoleBindingIndexInformer cache.TypedSharedIndexInformer[*apirbacv1alpha1.ClusterRoleBinding] + +// ClusterRoleBindingHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ClusterRoleBinding. +type ClusterRoleBindingHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apirbacv1alpha1.ClusterRoleBinding] + +// ClusterRoleBindingDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ClusterRoleBinding. +type ClusterRoleBindingDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apirbacv1alpha1.ClusterRoleBinding] + +// ClusterRoleBindingFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ClusterRoleBinding. +type ClusterRoleBindingFilteringHandler = cache.TypedFilteringResourceEventHandler[*apirbacv1alpha1.ClusterRoleBinding] + +// ClusterRoleBindingIndexers is a specialization of [cache.TypedIndexers] for ClusterRoleBinding. +type ClusterRoleBindingIndexers = cache.TypedIndexers[*apirbacv1alpha1.ClusterRoleBinding] + +// DeletedClusterRoleBinding is a specialization of [cache.DeletedObject] for ClusterRoleBinding. +type DeletedClusterRoleBinding = cache.DeletedObject[*apirbacv1alpha1.ClusterRoleBinding] + type clusterRoleBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type clusterRoleBindingInformer struct { // NewClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterRoleBindingInformer]). func NewClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ClusterRoleBindingIndexers) ClusterRoleBindingIndexInformer { + return NewTypedClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredClusterRoleBindingInformer]). func NewFilteredClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ClusterRoleBindingIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ClusterRoleBindingIndexInformer { + return NewTypedClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewClusterRoleBindingInformerWithOptions constructs a new informer for ClusterRoleBinding type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterRoleBindingInformerWithOptions]). func NewClusterRoleBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedClusterRoleBindingInformerWithOptions(client, options) +} + +// NewTypedClusterRoleBindingInformerWithOptions constructs a new informer for ClusterRoleBinding type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterRoleBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ClusterRoleBindingIndexInformer { gvr := schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1alpha1", Resource: "clusterrolebindings"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apirbacv1alpha1.ClusterRoleBinding](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewClusterRoleBindingInformerWithOptions(client kubernetes.Interface, optio Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *clusterRoleBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *clusterRoleBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apirbacv1alpha1.ClusterRoleBinding{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *clusterRoleBindingInformer) TypedInformer() ClusterRoleBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1alpha1.ClusterRoleBinding](f.factory.InformerFor(&apirbacv1alpha1.ClusterRoleBinding{}, f.defaultInformer)) } func (f *clusterRoleBindingInformer) Lister() rbacv1alpha1.ClusterRoleBindingLister { return rbacv1alpha1.NewClusterRoleBindingLister(f.Informer().GetIndexer()) } + +// ToTypedClusterRoleBindingInformer converts an untyped informer into a TypedClusterRoleBindingInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterRoleBinding. If that is not the case, calling type-safe methods of the returned +// TypedClusterRoleBindingInformer leads to runtime panics. A safer alternative is to pass +// around a TypedClusterRoleBindingInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedClusterRoleBindingInformer(informer ClusterRoleBindingInformer) TypedClusterRoleBindingInformer { + if informer, ok := informer.(TypedClusterRoleBindingInformer); ok { + return informer + } + return &clusterRoleBindingTypedInformerAdapter{informer} +} + +type clusterRoleBindingTypedInformerAdapter struct { + ClusterRoleBindingInformer +} + +func (a *clusterRoleBindingTypedInformerAdapter) TypedInformer() ClusterRoleBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1alpha1.ClusterRoleBinding](a.Informer()) +} + +// ToClusterRoleBindingIndexInformer converts an untyped informer into a ClusterRoleBindingIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterRoleBinding. If that is not the case, calling type-safe methods of the returned +// ClusterRoleBindingIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ClusterRoleBindingIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToClusterRoleBindingIndexInformer(informer cache.SharedIndexInformer) ClusterRoleBindingIndexInformer { + if informer, ok := informer.(ClusterRoleBindingIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apirbacv1alpha1.ClusterRoleBinding](informer) +} diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/interface.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/interface.go index d27c79987f..fcfc9d232c 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/interface.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/interface.go @@ -25,13 +25,13 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // ClusterRoles returns a ClusterRoleInformer. - ClusterRoles() ClusterRoleInformer + ClusterRoles() TypedClusterRoleInformer // ClusterRoleBindings returns a ClusterRoleBindingInformer. - ClusterRoleBindings() ClusterRoleBindingInformer + ClusterRoleBindings() TypedClusterRoleBindingInformer // Roles returns a RoleInformer. - Roles() RoleInformer + Roles() TypedRoleInformer // RoleBindings returns a RoleBindingInformer. - RoleBindings() RoleBindingInformer + RoleBindings() TypedRoleBindingInformer } type version struct { @@ -45,22 +45,22 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// ClusterRoles returns a ClusterRoleInformer. -func (v *version) ClusterRoles() ClusterRoleInformer { +// ClusterRoles returns a TypedClusterRoleInformer. +func (v *version) ClusterRoles() TypedClusterRoleInformer { return &clusterRoleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ClusterRoleBindings returns a ClusterRoleBindingInformer. -func (v *version) ClusterRoleBindings() ClusterRoleBindingInformer { +// ClusterRoleBindings returns a TypedClusterRoleBindingInformer. +func (v *version) ClusterRoleBindings() TypedClusterRoleBindingInformer { return &clusterRoleBindingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// Roles returns a RoleInformer. -func (v *version) Roles() RoleInformer { +// Roles returns a TypedRoleInformer. +func (v *version) Roles() TypedRoleInformer { return &roleInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// RoleBindings returns a RoleBindingInformer. -func (v *version) RoleBindings() RoleBindingInformer { +// RoleBindings returns a TypedRoleBindingInformer. +func (v *version) RoleBindings() TypedRoleBindingInformer { return &roleBindingInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go index c4e2a6cf6c..f50036840c 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go @@ -34,12 +34,40 @@ import ( ) // RoleInformer provides access to a shared informer and lister for -// Roles. +// Roles. Prefer using the type-safe variant (see [TypedRoleInformer]). type RoleInformer interface { Informer() cache.SharedIndexInformer Lister() rbacv1alpha1.RoleLister } +// TypedRoleInformer provides access to a shared informer and lister for +// Roles, including the type-safe TypedInformer variant. +// It is a superset of RoleInformer. +type TypedRoleInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() RoleIndexInformer + Lister() rbacv1alpha1.RoleLister +} + +// RoleIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type RoleIndexInformer cache.TypedSharedIndexInformer[*apirbacv1alpha1.Role] + +// RoleHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Role. +type RoleHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apirbacv1alpha1.Role] + +// RoleDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Role. +type RoleDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apirbacv1alpha1.Role] + +// RoleFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Role. +type RoleFilteringHandler = cache.TypedFilteringResourceEventHandler[*apirbacv1alpha1.Role] + +// RoleIndexers is a specialization of [cache.TypedIndexers] for Role. +type RoleIndexers = cache.TypedIndexers[*apirbacv1alpha1.Role] + +// DeletedRole is a specialization of [cache.DeletedObject] for Role. +type DeletedRole = cache.DeletedObject[*apirbacv1alpha1.Role] + type roleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type roleInformer struct { // NewRoleInformer constructs a new informer for Role type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedRoleInformer]). func NewRoleInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewRoleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedRoleInformer constructs a new informer for Role type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedRoleInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers RoleIndexers) RoleIndexInformer { + return NewTypedRoleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredRoleInformer constructs a new informer for Role type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredRoleInformer]). func NewFilteredRoleInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewRoleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedRoleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredRoleInformer constructs a new informer for Role type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredRoleInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers RoleIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) RoleIndexInformer { + return NewTypedRoleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewRoleInformerWithOptions constructs a new informer for Role type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedRoleInformerWithOptions]). func NewRoleInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedRoleInformerWithOptions(client, namespace, options) +} + +// NewTypedRoleInformerWithOptions constructs a new informer for Role type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedRoleInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) RoleIndexInformer { gvr := schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1alpha1", Resource: "roles"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apirbacv1alpha1.Role](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewRoleInformerWithOptions(client kubernetes.Interface, namespace string, o Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *roleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewRoleInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedRoleInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *roleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apirbacv1alpha1.Role{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *roleInformer) TypedInformer() RoleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1alpha1.Role](f.factory.InformerFor(&apirbacv1alpha1.Role{}, f.defaultInformer)) } func (f *roleInformer) Lister() rbacv1alpha1.RoleLister { return rbacv1alpha1.NewRoleLister(f.Informer().GetIndexer()) } + +// ToTypedRoleInformer converts an untyped informer into a TypedRoleInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Role. If that is not the case, calling type-safe methods of the returned +// TypedRoleInformer leads to runtime panics. A safer alternative is to pass +// around a TypedRoleInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedRoleInformer(informer RoleInformer) TypedRoleInformer { + if informer, ok := informer.(TypedRoleInformer); ok { + return informer + } + return &roleTypedInformerAdapter{informer} +} + +type roleTypedInformerAdapter struct { + RoleInformer +} + +func (a *roleTypedInformerAdapter) TypedInformer() RoleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1alpha1.Role](a.Informer()) +} + +// ToRoleIndexInformer converts an untyped informer into a RoleIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Role. If that is not the case, calling type-safe methods of the returned +// RoleIndexInformer leads to runtime panics. A safer alternative is to pass +// around a RoleIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToRoleIndexInformer(informer cache.SharedIndexInformer) RoleIndexInformer { + if informer, ok := informer.(RoleIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apirbacv1alpha1.Role](informer) +} diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go index ef1e246f5b..64b5b257fb 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go @@ -34,12 +34,40 @@ import ( ) // RoleBindingInformer provides access to a shared informer and lister for -// RoleBindings. +// RoleBindings. Prefer using the type-safe variant (see [TypedRoleBindingInformer]). type RoleBindingInformer interface { Informer() cache.SharedIndexInformer Lister() rbacv1alpha1.RoleBindingLister } +// TypedRoleBindingInformer provides access to a shared informer and lister for +// RoleBindings, including the type-safe TypedInformer variant. +// It is a superset of RoleBindingInformer. +type TypedRoleBindingInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() RoleBindingIndexInformer + Lister() rbacv1alpha1.RoleBindingLister +} + +// RoleBindingIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type RoleBindingIndexInformer cache.TypedSharedIndexInformer[*apirbacv1alpha1.RoleBinding] + +// RoleBindingHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for RoleBinding. +type RoleBindingHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apirbacv1alpha1.RoleBinding] + +// RoleBindingDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for RoleBinding. +type RoleBindingDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apirbacv1alpha1.RoleBinding] + +// RoleBindingFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for RoleBinding. +type RoleBindingFilteringHandler = cache.TypedFilteringResourceEventHandler[*apirbacv1alpha1.RoleBinding] + +// RoleBindingIndexers is a specialization of [cache.TypedIndexers] for RoleBinding. +type RoleBindingIndexers = cache.TypedIndexers[*apirbacv1alpha1.RoleBinding] + +// DeletedRoleBinding is a specialization of [cache.DeletedObject] for RoleBinding. +type DeletedRoleBinding = cache.DeletedObject[*apirbacv1alpha1.RoleBinding] + type roleBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type roleBindingInformer struct { // NewRoleBindingInformer constructs a new informer for RoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedRoleBindingInformer]). func NewRoleBindingInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewRoleBindingInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedRoleBindingInformer constructs a new informer for RoleBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedRoleBindingInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers RoleBindingIndexers) RoleBindingIndexInformer { + return NewTypedRoleBindingInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredRoleBindingInformer constructs a new informer for RoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredRoleBindingInformer]). func NewFilteredRoleBindingInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewRoleBindingInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedRoleBindingInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredRoleBindingInformer constructs a new informer for RoleBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredRoleBindingInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers RoleBindingIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) RoleBindingIndexInformer { + return NewTypedRoleBindingInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewRoleBindingInformerWithOptions constructs a new informer for RoleBinding type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedRoleBindingInformerWithOptions]). func NewRoleBindingInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedRoleBindingInformerWithOptions(client, namespace, options) +} + +// NewTypedRoleBindingInformerWithOptions constructs a new informer for RoleBinding type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedRoleBindingInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) RoleBindingIndexInformer { gvr := schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1alpha1", Resource: "rolebindings"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apirbacv1alpha1.RoleBinding](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewRoleBindingInformerWithOptions(client kubernetes.Interface, namespace st Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *roleBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewRoleBindingInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedRoleBindingInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *roleBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apirbacv1alpha1.RoleBinding{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *roleBindingInformer) TypedInformer() RoleBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1alpha1.RoleBinding](f.factory.InformerFor(&apirbacv1alpha1.RoleBinding{}, f.defaultInformer)) } func (f *roleBindingInformer) Lister() rbacv1alpha1.RoleBindingLister { return rbacv1alpha1.NewRoleBindingLister(f.Informer().GetIndexer()) } + +// ToTypedRoleBindingInformer converts an untyped informer into a TypedRoleBindingInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *RoleBinding. If that is not the case, calling type-safe methods of the returned +// TypedRoleBindingInformer leads to runtime panics. A safer alternative is to pass +// around a TypedRoleBindingInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedRoleBindingInformer(informer RoleBindingInformer) TypedRoleBindingInformer { + if informer, ok := informer.(TypedRoleBindingInformer); ok { + return informer + } + return &roleBindingTypedInformerAdapter{informer} +} + +type roleBindingTypedInformerAdapter struct { + RoleBindingInformer +} + +func (a *roleBindingTypedInformerAdapter) TypedInformer() RoleBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1alpha1.RoleBinding](a.Informer()) +} + +// ToRoleBindingIndexInformer converts an untyped informer into a RoleBindingIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *RoleBinding. If that is not the case, calling type-safe methods of the returned +// RoleBindingIndexInformer leads to runtime panics. A safer alternative is to pass +// around a RoleBindingIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToRoleBindingIndexInformer(informer cache.SharedIndexInformer) RoleBindingIndexInformer { + if informer, ok := informer.(RoleBindingIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apirbacv1alpha1.RoleBinding](informer) +} diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go index df87d468ca..20261642d4 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go @@ -34,12 +34,40 @@ import ( ) // ClusterRoleInformer provides access to a shared informer and lister for -// ClusterRoles. +// ClusterRoles. Prefer using the type-safe variant (see [TypedClusterRoleInformer]). type ClusterRoleInformer interface { Informer() cache.SharedIndexInformer Lister() rbacv1beta1.ClusterRoleLister } +// TypedClusterRoleInformer provides access to a shared informer and lister for +// ClusterRoles, including the type-safe TypedInformer variant. +// It is a superset of ClusterRoleInformer. +type TypedClusterRoleInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ClusterRoleIndexInformer + Lister() rbacv1beta1.ClusterRoleLister +} + +// ClusterRoleIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ClusterRoleIndexInformer cache.TypedSharedIndexInformer[*apirbacv1beta1.ClusterRole] + +// ClusterRoleHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ClusterRole. +type ClusterRoleHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apirbacv1beta1.ClusterRole] + +// ClusterRoleDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ClusterRole. +type ClusterRoleDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apirbacv1beta1.ClusterRole] + +// ClusterRoleFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ClusterRole. +type ClusterRoleFilteringHandler = cache.TypedFilteringResourceEventHandler[*apirbacv1beta1.ClusterRole] + +// ClusterRoleIndexers is a specialization of [cache.TypedIndexers] for ClusterRole. +type ClusterRoleIndexers = cache.TypedIndexers[*apirbacv1beta1.ClusterRole] + +// DeletedClusterRole is a specialization of [cache.DeletedObject] for ClusterRole. +type DeletedClusterRole = cache.DeletedObject[*apirbacv1beta1.ClusterRole] + type clusterRoleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type clusterRoleInformer struct { // NewClusterRoleInformer constructs a new informer for ClusterRole type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterRoleInformer]). func NewClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedClusterRoleInformer constructs a new informer for ClusterRole type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ClusterRoleIndexers) ClusterRoleIndexInformer { + return NewTypedClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredClusterRoleInformer constructs a new informer for ClusterRole type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredClusterRoleInformer]). func NewFilteredClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredClusterRoleInformer constructs a new informer for ClusterRole type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ClusterRoleIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ClusterRoleIndexInformer { + return NewTypedClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewClusterRoleInformerWithOptions constructs a new informer for ClusterRole type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterRoleInformerWithOptions]). func NewClusterRoleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedClusterRoleInformerWithOptions(client, options) +} + +// NewTypedClusterRoleInformerWithOptions constructs a new informer for ClusterRole type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterRoleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ClusterRoleIndexInformer { gvr := schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1beta1", Resource: "clusterroles"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apirbacv1beta1.ClusterRole](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewClusterRoleInformerWithOptions(client kubernetes.Interface, options inte Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *clusterRoleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedClusterRoleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *clusterRoleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apirbacv1beta1.ClusterRole{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *clusterRoleInformer) TypedInformer() ClusterRoleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1beta1.ClusterRole](f.factory.InformerFor(&apirbacv1beta1.ClusterRole{}, f.defaultInformer)) } func (f *clusterRoleInformer) Lister() rbacv1beta1.ClusterRoleLister { return rbacv1beta1.NewClusterRoleLister(f.Informer().GetIndexer()) } + +// ToTypedClusterRoleInformer converts an untyped informer into a TypedClusterRoleInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterRole. If that is not the case, calling type-safe methods of the returned +// TypedClusterRoleInformer leads to runtime panics. A safer alternative is to pass +// around a TypedClusterRoleInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedClusterRoleInformer(informer ClusterRoleInformer) TypedClusterRoleInformer { + if informer, ok := informer.(TypedClusterRoleInformer); ok { + return informer + } + return &clusterRoleTypedInformerAdapter{informer} +} + +type clusterRoleTypedInformerAdapter struct { + ClusterRoleInformer +} + +func (a *clusterRoleTypedInformerAdapter) TypedInformer() ClusterRoleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1beta1.ClusterRole](a.Informer()) +} + +// ToClusterRoleIndexInformer converts an untyped informer into a ClusterRoleIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterRole. If that is not the case, calling type-safe methods of the returned +// ClusterRoleIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ClusterRoleIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToClusterRoleIndexInformer(informer cache.SharedIndexInformer) ClusterRoleIndexInformer { + if informer, ok := informer.(ClusterRoleIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apirbacv1beta1.ClusterRole](informer) +} diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go index 9f14c10daf..a454f0c643 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go @@ -34,12 +34,40 @@ import ( ) // ClusterRoleBindingInformer provides access to a shared informer and lister for -// ClusterRoleBindings. +// ClusterRoleBindings. Prefer using the type-safe variant (see [TypedClusterRoleBindingInformer]). type ClusterRoleBindingInformer interface { Informer() cache.SharedIndexInformer Lister() rbacv1beta1.ClusterRoleBindingLister } +// TypedClusterRoleBindingInformer provides access to a shared informer and lister for +// ClusterRoleBindings, including the type-safe TypedInformer variant. +// It is a superset of ClusterRoleBindingInformer. +type TypedClusterRoleBindingInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ClusterRoleBindingIndexInformer + Lister() rbacv1beta1.ClusterRoleBindingLister +} + +// ClusterRoleBindingIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ClusterRoleBindingIndexInformer cache.TypedSharedIndexInformer[*apirbacv1beta1.ClusterRoleBinding] + +// ClusterRoleBindingHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ClusterRoleBinding. +type ClusterRoleBindingHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apirbacv1beta1.ClusterRoleBinding] + +// ClusterRoleBindingDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ClusterRoleBinding. +type ClusterRoleBindingDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apirbacv1beta1.ClusterRoleBinding] + +// ClusterRoleBindingFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ClusterRoleBinding. +type ClusterRoleBindingFilteringHandler = cache.TypedFilteringResourceEventHandler[*apirbacv1beta1.ClusterRoleBinding] + +// ClusterRoleBindingIndexers is a specialization of [cache.TypedIndexers] for ClusterRoleBinding. +type ClusterRoleBindingIndexers = cache.TypedIndexers[*apirbacv1beta1.ClusterRoleBinding] + +// DeletedClusterRoleBinding is a specialization of [cache.DeletedObject] for ClusterRoleBinding. +type DeletedClusterRoleBinding = cache.DeletedObject[*apirbacv1beta1.ClusterRoleBinding] + type clusterRoleBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type clusterRoleBindingInformer struct { // NewClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterRoleBindingInformer]). func NewClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ClusterRoleBindingIndexers) ClusterRoleBindingIndexInformer { + return NewTypedClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredClusterRoleBindingInformer]). func NewFilteredClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ClusterRoleBindingIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ClusterRoleBindingIndexInformer { + return NewTypedClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewClusterRoleBindingInformerWithOptions constructs a new informer for ClusterRoleBinding type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterRoleBindingInformerWithOptions]). func NewClusterRoleBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedClusterRoleBindingInformerWithOptions(client, options) +} + +// NewTypedClusterRoleBindingInformerWithOptions constructs a new informer for ClusterRoleBinding type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterRoleBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ClusterRoleBindingIndexInformer { gvr := schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1beta1", Resource: "clusterrolebindings"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apirbacv1beta1.ClusterRoleBinding](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewClusterRoleBindingInformerWithOptions(client kubernetes.Interface, optio Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *clusterRoleBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedClusterRoleBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *clusterRoleBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apirbacv1beta1.ClusterRoleBinding{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *clusterRoleBindingInformer) TypedInformer() ClusterRoleBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1beta1.ClusterRoleBinding](f.factory.InformerFor(&apirbacv1beta1.ClusterRoleBinding{}, f.defaultInformer)) } func (f *clusterRoleBindingInformer) Lister() rbacv1beta1.ClusterRoleBindingLister { return rbacv1beta1.NewClusterRoleBindingLister(f.Informer().GetIndexer()) } + +// ToTypedClusterRoleBindingInformer converts an untyped informer into a TypedClusterRoleBindingInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterRoleBinding. If that is not the case, calling type-safe methods of the returned +// TypedClusterRoleBindingInformer leads to runtime panics. A safer alternative is to pass +// around a TypedClusterRoleBindingInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedClusterRoleBindingInformer(informer ClusterRoleBindingInformer) TypedClusterRoleBindingInformer { + if informer, ok := informer.(TypedClusterRoleBindingInformer); ok { + return informer + } + return &clusterRoleBindingTypedInformerAdapter{informer} +} + +type clusterRoleBindingTypedInformerAdapter struct { + ClusterRoleBindingInformer +} + +func (a *clusterRoleBindingTypedInformerAdapter) TypedInformer() ClusterRoleBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1beta1.ClusterRoleBinding](a.Informer()) +} + +// ToClusterRoleBindingIndexInformer converts an untyped informer into a ClusterRoleBindingIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterRoleBinding. If that is not the case, calling type-safe methods of the returned +// ClusterRoleBindingIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ClusterRoleBindingIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToClusterRoleBindingIndexInformer(informer cache.SharedIndexInformer) ClusterRoleBindingIndexInformer { + if informer, ok := informer.(ClusterRoleBindingIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apirbacv1beta1.ClusterRoleBinding](informer) +} diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/interface.go index 04add43afa..af356b40e2 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/interface.go @@ -25,13 +25,13 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // ClusterRoles returns a ClusterRoleInformer. - ClusterRoles() ClusterRoleInformer + ClusterRoles() TypedClusterRoleInformer // ClusterRoleBindings returns a ClusterRoleBindingInformer. - ClusterRoleBindings() ClusterRoleBindingInformer + ClusterRoleBindings() TypedClusterRoleBindingInformer // Roles returns a RoleInformer. - Roles() RoleInformer + Roles() TypedRoleInformer // RoleBindings returns a RoleBindingInformer. - RoleBindings() RoleBindingInformer + RoleBindings() TypedRoleBindingInformer } type version struct { @@ -45,22 +45,22 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// ClusterRoles returns a ClusterRoleInformer. -func (v *version) ClusterRoles() ClusterRoleInformer { +// ClusterRoles returns a TypedClusterRoleInformer. +func (v *version) ClusterRoles() TypedClusterRoleInformer { return &clusterRoleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ClusterRoleBindings returns a ClusterRoleBindingInformer. -func (v *version) ClusterRoleBindings() ClusterRoleBindingInformer { +// ClusterRoleBindings returns a TypedClusterRoleBindingInformer. +func (v *version) ClusterRoleBindings() TypedClusterRoleBindingInformer { return &clusterRoleBindingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// Roles returns a RoleInformer. -func (v *version) Roles() RoleInformer { +// Roles returns a TypedRoleInformer. +func (v *version) Roles() TypedRoleInformer { return &roleInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// RoleBindings returns a RoleBindingInformer. -func (v *version) RoleBindings() RoleBindingInformer { +// RoleBindings returns a TypedRoleBindingInformer. +func (v *version) RoleBindings() TypedRoleBindingInformer { return &roleBindingInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go index 4dd948f167..fe0d4acf9a 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go @@ -34,12 +34,40 @@ import ( ) // RoleInformer provides access to a shared informer and lister for -// Roles. +// Roles. Prefer using the type-safe variant (see [TypedRoleInformer]). type RoleInformer interface { Informer() cache.SharedIndexInformer Lister() rbacv1beta1.RoleLister } +// TypedRoleInformer provides access to a shared informer and lister for +// Roles, including the type-safe TypedInformer variant. +// It is a superset of RoleInformer. +type TypedRoleInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() RoleIndexInformer + Lister() rbacv1beta1.RoleLister +} + +// RoleIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type RoleIndexInformer cache.TypedSharedIndexInformer[*apirbacv1beta1.Role] + +// RoleHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Role. +type RoleHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apirbacv1beta1.Role] + +// RoleDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Role. +type RoleDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apirbacv1beta1.Role] + +// RoleFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Role. +type RoleFilteringHandler = cache.TypedFilteringResourceEventHandler[*apirbacv1beta1.Role] + +// RoleIndexers is a specialization of [cache.TypedIndexers] for Role. +type RoleIndexers = cache.TypedIndexers[*apirbacv1beta1.Role] + +// DeletedRole is a specialization of [cache.DeletedObject] for Role. +type DeletedRole = cache.DeletedObject[*apirbacv1beta1.Role] + type roleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type roleInformer struct { // NewRoleInformer constructs a new informer for Role type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedRoleInformer]). func NewRoleInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewRoleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedRoleInformer constructs a new informer for Role type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedRoleInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers RoleIndexers) RoleIndexInformer { + return NewTypedRoleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredRoleInformer constructs a new informer for Role type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredRoleInformer]). func NewFilteredRoleInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewRoleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedRoleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredRoleInformer constructs a new informer for Role type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredRoleInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers RoleIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) RoleIndexInformer { + return NewTypedRoleInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewRoleInformerWithOptions constructs a new informer for Role type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedRoleInformerWithOptions]). func NewRoleInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedRoleInformerWithOptions(client, namespace, options) +} + +// NewTypedRoleInformerWithOptions constructs a new informer for Role type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedRoleInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) RoleIndexInformer { gvr := schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1beta1", Resource: "roles"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apirbacv1beta1.Role](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewRoleInformerWithOptions(client kubernetes.Interface, namespace string, o Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *roleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewRoleInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedRoleInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *roleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apirbacv1beta1.Role{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *roleInformer) TypedInformer() RoleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1beta1.Role](f.factory.InformerFor(&apirbacv1beta1.Role{}, f.defaultInformer)) } func (f *roleInformer) Lister() rbacv1beta1.RoleLister { return rbacv1beta1.NewRoleLister(f.Informer().GetIndexer()) } + +// ToTypedRoleInformer converts an untyped informer into a TypedRoleInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Role. If that is not the case, calling type-safe methods of the returned +// TypedRoleInformer leads to runtime panics. A safer alternative is to pass +// around a TypedRoleInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedRoleInformer(informer RoleInformer) TypedRoleInformer { + if informer, ok := informer.(TypedRoleInformer); ok { + return informer + } + return &roleTypedInformerAdapter{informer} +} + +type roleTypedInformerAdapter struct { + RoleInformer +} + +func (a *roleTypedInformerAdapter) TypedInformer() RoleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1beta1.Role](a.Informer()) +} + +// ToRoleIndexInformer converts an untyped informer into a RoleIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Role. If that is not the case, calling type-safe methods of the returned +// RoleIndexInformer leads to runtime panics. A safer alternative is to pass +// around a RoleIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToRoleIndexInformer(informer cache.SharedIndexInformer) RoleIndexInformer { + if informer, ok := informer.(RoleIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apirbacv1beta1.Role](informer) +} diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go index 882d59471e..dc92e5433c 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go @@ -34,12 +34,40 @@ import ( ) // RoleBindingInformer provides access to a shared informer and lister for -// RoleBindings. +// RoleBindings. Prefer using the type-safe variant (see [TypedRoleBindingInformer]). type RoleBindingInformer interface { Informer() cache.SharedIndexInformer Lister() rbacv1beta1.RoleBindingLister } +// TypedRoleBindingInformer provides access to a shared informer and lister for +// RoleBindings, including the type-safe TypedInformer variant. +// It is a superset of RoleBindingInformer. +type TypedRoleBindingInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() RoleBindingIndexInformer + Lister() rbacv1beta1.RoleBindingLister +} + +// RoleBindingIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type RoleBindingIndexInformer cache.TypedSharedIndexInformer[*apirbacv1beta1.RoleBinding] + +// RoleBindingHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for RoleBinding. +type RoleBindingHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apirbacv1beta1.RoleBinding] + +// RoleBindingDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for RoleBinding. +type RoleBindingDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apirbacv1beta1.RoleBinding] + +// RoleBindingFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for RoleBinding. +type RoleBindingFilteringHandler = cache.TypedFilteringResourceEventHandler[*apirbacv1beta1.RoleBinding] + +// RoleBindingIndexers is a specialization of [cache.TypedIndexers] for RoleBinding. +type RoleBindingIndexers = cache.TypedIndexers[*apirbacv1beta1.RoleBinding] + +// DeletedRoleBinding is a specialization of [cache.DeletedObject] for RoleBinding. +type DeletedRoleBinding = cache.DeletedObject[*apirbacv1beta1.RoleBinding] + type roleBindingInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type roleBindingInformer struct { // NewRoleBindingInformer constructs a new informer for RoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedRoleBindingInformer]). func NewRoleBindingInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewRoleBindingInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedRoleBindingInformer constructs a new informer for RoleBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedRoleBindingInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers RoleBindingIndexers) RoleBindingIndexInformer { + return NewTypedRoleBindingInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredRoleBindingInformer constructs a new informer for RoleBinding type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredRoleBindingInformer]). func NewFilteredRoleBindingInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewRoleBindingInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedRoleBindingInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredRoleBindingInformer constructs a new informer for RoleBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredRoleBindingInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers RoleBindingIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) RoleBindingIndexInformer { + return NewTypedRoleBindingInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewRoleBindingInformerWithOptions constructs a new informer for RoleBinding type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedRoleBindingInformerWithOptions]). func NewRoleBindingInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedRoleBindingInformerWithOptions(client, namespace, options) +} + +// NewTypedRoleBindingInformerWithOptions constructs a new informer for RoleBinding type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedRoleBindingInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) RoleBindingIndexInformer { gvr := schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1beta1", Resource: "rolebindings"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apirbacv1beta1.RoleBinding](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewRoleBindingInformerWithOptions(client kubernetes.Interface, namespace st Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *roleBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewRoleBindingInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedRoleBindingInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *roleBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apirbacv1beta1.RoleBinding{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *roleBindingInformer) TypedInformer() RoleBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1beta1.RoleBinding](f.factory.InformerFor(&apirbacv1beta1.RoleBinding{}, f.defaultInformer)) } func (f *roleBindingInformer) Lister() rbacv1beta1.RoleBindingLister { return rbacv1beta1.NewRoleBindingLister(f.Informer().GetIndexer()) } + +// ToTypedRoleBindingInformer converts an untyped informer into a TypedRoleBindingInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *RoleBinding. If that is not the case, calling type-safe methods of the returned +// TypedRoleBindingInformer leads to runtime panics. A safer alternative is to pass +// around a TypedRoleBindingInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedRoleBindingInformer(informer RoleBindingInformer) TypedRoleBindingInformer { + if informer, ok := informer.(TypedRoleBindingInformer); ok { + return informer + } + return &roleBindingTypedInformerAdapter{informer} +} + +type roleBindingTypedInformerAdapter struct { + RoleBindingInformer +} + +func (a *roleBindingTypedInformerAdapter) TypedInformer() RoleBindingIndexInformer { + return cache.NewTypedSharedIndexInformer[*apirbacv1beta1.RoleBinding](a.Informer()) +} + +// ToRoleBindingIndexInformer converts an untyped informer into a RoleBindingIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *RoleBinding. If that is not the case, calling type-safe methods of the returned +// RoleBindingIndexInformer leads to runtime panics. A safer alternative is to pass +// around a RoleBindingIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToRoleBindingIndexInformer(informer cache.SharedIndexInformer) RoleBindingIndexInformer { + if informer, ok := informer.(RoleBindingIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apirbacv1beta1.RoleBinding](informer) +} diff --git a/vendor/k8s.io/client-go/informers/resource/v1/deviceclass.go b/vendor/k8s.io/client-go/informers/resource/v1/deviceclass.go index bacc65a28f..807a8f946b 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1/deviceclass.go +++ b/vendor/k8s.io/client-go/informers/resource/v1/deviceclass.go @@ -34,12 +34,40 @@ import ( ) // DeviceClassInformer provides access to a shared informer and lister for -// DeviceClasses. +// DeviceClasses. Prefer using the type-safe variant (see [TypedDeviceClassInformer]). type DeviceClassInformer interface { Informer() cache.SharedIndexInformer Lister() resourcev1.DeviceClassLister } +// TypedDeviceClassInformer provides access to a shared informer and lister for +// DeviceClasses, including the type-safe TypedInformer variant. +// It is a superset of DeviceClassInformer. +type TypedDeviceClassInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() DeviceClassIndexInformer + Lister() resourcev1.DeviceClassLister +} + +// DeviceClassIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type DeviceClassIndexInformer cache.TypedSharedIndexInformer[*apiresourcev1.DeviceClass] + +// DeviceClassHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for DeviceClass. +type DeviceClassHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiresourcev1.DeviceClass] + +// DeviceClassDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for DeviceClass. +type DeviceClassDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiresourcev1.DeviceClass] + +// DeviceClassFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for DeviceClass. +type DeviceClassFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiresourcev1.DeviceClass] + +// DeviceClassIndexers is a specialization of [cache.TypedIndexers] for DeviceClass. +type DeviceClassIndexers = cache.TypedIndexers[*apiresourcev1.DeviceClass] + +// DeletedDeviceClass is a specialization of [cache.DeletedObject] for DeviceClass. +type DeletedDeviceClass = cache.DeletedObject[*apiresourcev1.DeviceClass] + type deviceClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type deviceClassInformer struct { // NewDeviceClassInformer constructs a new informer for DeviceClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeviceClassInformer]). func NewDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedDeviceClassInformer constructs a new informer for DeviceClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers DeviceClassIndexers) DeviceClassIndexInformer { + return NewTypedDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredDeviceClassInformer constructs a new informer for DeviceClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredDeviceClassInformer]). func NewFilteredDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredDeviceClassInformer constructs a new informer for DeviceClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers DeviceClassIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) DeviceClassIndexInformer { + return NewTypedDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewDeviceClassInformerWithOptions constructs a new informer for DeviceClass type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeviceClassInformerWithOptions]). func NewDeviceClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedDeviceClassInformerWithOptions(client, options) +} + +// NewTypedDeviceClassInformerWithOptions constructs a new informer for DeviceClass type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeviceClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) DeviceClassIndexInformer { gvr := schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1", Resource: "deviceclasss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiresourcev1.DeviceClass](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewDeviceClassInformerWithOptions(client kubernetes.Interface, options inte Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *deviceClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *deviceClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiresourcev1.DeviceClass{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *deviceClassInformer) TypedInformer() DeviceClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1.DeviceClass](f.factory.InformerFor(&apiresourcev1.DeviceClass{}, f.defaultInformer)) } func (f *deviceClassInformer) Lister() resourcev1.DeviceClassLister { return resourcev1.NewDeviceClassLister(f.Informer().GetIndexer()) } + +// ToTypedDeviceClassInformer converts an untyped informer into a TypedDeviceClassInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *DeviceClass. If that is not the case, calling type-safe methods of the returned +// TypedDeviceClassInformer leads to runtime panics. A safer alternative is to pass +// around a TypedDeviceClassInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedDeviceClassInformer(informer DeviceClassInformer) TypedDeviceClassInformer { + if informer, ok := informer.(TypedDeviceClassInformer); ok { + return informer + } + return &deviceClassTypedInformerAdapter{informer} +} + +type deviceClassTypedInformerAdapter struct { + DeviceClassInformer +} + +func (a *deviceClassTypedInformerAdapter) TypedInformer() DeviceClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1.DeviceClass](a.Informer()) +} + +// ToDeviceClassIndexInformer converts an untyped informer into a DeviceClassIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *DeviceClass. If that is not the case, calling type-safe methods of the returned +// DeviceClassIndexInformer leads to runtime panics. A safer alternative is to pass +// around a DeviceClassIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToDeviceClassIndexInformer(informer cache.SharedIndexInformer) DeviceClassIndexInformer { + if informer, ok := informer.(DeviceClassIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiresourcev1.DeviceClass](informer) +} diff --git a/vendor/k8s.io/client-go/informers/resource/v1/devicetaintrule.go b/vendor/k8s.io/client-go/informers/resource/v1/devicetaintrule.go new file mode 100644 index 0000000000..c0776f5fb8 --- /dev/null +++ b/vendor/k8s.io/client-go/informers/resource/v1/devicetaintrule.go @@ -0,0 +1,207 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + time "time" + + apiresourcev1 "k8s.io/api/resource/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + resourcev1 "k8s.io/client-go/listers/resource/v1" + cache "k8s.io/client-go/tools/cache" +) + +// DeviceTaintRuleInformer provides access to a shared informer and lister for +// DeviceTaintRules. Prefer using the type-safe variant (see [TypedDeviceTaintRuleInformer]). +type DeviceTaintRuleInformer interface { + Informer() cache.SharedIndexInformer + Lister() resourcev1.DeviceTaintRuleLister +} + +// TypedDeviceTaintRuleInformer provides access to a shared informer and lister for +// DeviceTaintRules, including the type-safe TypedInformer variant. +// It is a superset of DeviceTaintRuleInformer. +type TypedDeviceTaintRuleInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() DeviceTaintRuleIndexInformer + Lister() resourcev1.DeviceTaintRuleLister +} + +// DeviceTaintRuleIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type DeviceTaintRuleIndexInformer cache.TypedSharedIndexInformer[*apiresourcev1.DeviceTaintRule] + +// DeviceTaintRuleHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for DeviceTaintRule. +type DeviceTaintRuleHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiresourcev1.DeviceTaintRule] + +// DeviceTaintRuleDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for DeviceTaintRule. +type DeviceTaintRuleDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiresourcev1.DeviceTaintRule] + +// DeviceTaintRuleFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for DeviceTaintRule. +type DeviceTaintRuleFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiresourcev1.DeviceTaintRule] + +// DeviceTaintRuleIndexers is a specialization of [cache.TypedIndexers] for DeviceTaintRule. +type DeviceTaintRuleIndexers = cache.TypedIndexers[*apiresourcev1.DeviceTaintRule] + +// DeletedDeviceTaintRule is a specialization of [cache.DeletedObject] for DeviceTaintRule. +type DeletedDeviceTaintRule = cache.DeletedObject[*apiresourcev1.DeviceTaintRule] + +type deviceTaintRuleInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDeviceTaintRuleInformer constructs a new informer for DeviceTaintRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeviceTaintRuleInformer]). +func NewDeviceTaintRuleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewTypedDeviceTaintRuleInformer constructs a new informer for DeviceTaintRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeviceTaintRuleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers DeviceTaintRuleIndexers) DeviceTaintRuleIndexInformer { + return NewTypedDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + +// NewFilteredDeviceTaintRuleInformer constructs a new informer for DeviceTaintRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredDeviceTaintRuleInformer]). +func NewFilteredDeviceTaintRuleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewTypedDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredDeviceTaintRuleInformer constructs a new informer for DeviceTaintRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredDeviceTaintRuleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers DeviceTaintRuleIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) DeviceTaintRuleIndexInformer { + return NewTypedDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) +} + +// NewDeviceTaintRuleInformerWithOptions constructs a new informer for DeviceTaintRule type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeviceTaintRuleInformerWithOptions]). +func NewDeviceTaintRuleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedDeviceTaintRuleInformerWithOptions(client, options) +} + +// NewTypedDeviceTaintRuleInformerWithOptions constructs a new informer for DeviceTaintRule type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeviceTaintRuleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) DeviceTaintRuleIndexInformer { + gvr := schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1", Resource: "devicetaintrules"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewTypedSharedIndexInformer[*apiresourcev1.DeviceTaintRule](cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.ResourceV1().DeviceTaintRules().List(context.Background(), opts) + }, + WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.ResourceV1().DeviceTaintRules().Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.ResourceV1().DeviceTaintRules().List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.ResourceV1().DeviceTaintRules().Watch(ctx, opts) + }, + }, client), + &apiresourcev1.DeviceTaintRule{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + )) +} + +func (f *deviceTaintRuleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewTypedDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *deviceTaintRuleInformer) Informer() cache.SharedIndexInformer { + return f.TypedInformer() +} + +func (f *deviceTaintRuleInformer) TypedInformer() DeviceTaintRuleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1.DeviceTaintRule](f.factory.InformerFor(&apiresourcev1.DeviceTaintRule{}, f.defaultInformer)) +} + +func (f *deviceTaintRuleInformer) Lister() resourcev1.DeviceTaintRuleLister { + return resourcev1.NewDeviceTaintRuleLister(f.Informer().GetIndexer()) +} + +// ToTypedDeviceTaintRuleInformer converts an untyped informer into a TypedDeviceTaintRuleInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *DeviceTaintRule. If that is not the case, calling type-safe methods of the returned +// TypedDeviceTaintRuleInformer leads to runtime panics. A safer alternative is to pass +// around a TypedDeviceTaintRuleInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedDeviceTaintRuleInformer(informer DeviceTaintRuleInformer) TypedDeviceTaintRuleInformer { + if informer, ok := informer.(TypedDeviceTaintRuleInformer); ok { + return informer + } + return &deviceTaintRuleTypedInformerAdapter{informer} +} + +type deviceTaintRuleTypedInformerAdapter struct { + DeviceTaintRuleInformer +} + +func (a *deviceTaintRuleTypedInformerAdapter) TypedInformer() DeviceTaintRuleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1.DeviceTaintRule](a.Informer()) +} + +// ToDeviceTaintRuleIndexInformer converts an untyped informer into a DeviceTaintRuleIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *DeviceTaintRule. If that is not the case, calling type-safe methods of the returned +// DeviceTaintRuleIndexInformer leads to runtime panics. A safer alternative is to pass +// around a DeviceTaintRuleIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToDeviceTaintRuleIndexInformer(informer cache.SharedIndexInformer) DeviceTaintRuleIndexInformer { + if informer, ok := informer.(DeviceTaintRuleIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiresourcev1.DeviceTaintRule](informer) +} diff --git a/vendor/k8s.io/client-go/informers/resource/v1/interface.go b/vendor/k8s.io/client-go/informers/resource/v1/interface.go index 4b409fbba1..c0456078ff 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/resource/v1/interface.go @@ -25,13 +25,15 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // DeviceClasses returns a DeviceClassInformer. - DeviceClasses() DeviceClassInformer + DeviceClasses() TypedDeviceClassInformer + // DeviceTaintRules returns a DeviceTaintRuleInformer. + DeviceTaintRules() TypedDeviceTaintRuleInformer // ResourceClaims returns a ResourceClaimInformer. - ResourceClaims() ResourceClaimInformer + ResourceClaims() TypedResourceClaimInformer // ResourceClaimTemplates returns a ResourceClaimTemplateInformer. - ResourceClaimTemplates() ResourceClaimTemplateInformer + ResourceClaimTemplates() TypedResourceClaimTemplateInformer // ResourceSlices returns a ResourceSliceInformer. - ResourceSlices() ResourceSliceInformer + ResourceSlices() TypedResourceSliceInformer } type version struct { @@ -45,22 +47,27 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// DeviceClasses returns a DeviceClassInformer. -func (v *version) DeviceClasses() DeviceClassInformer { +// DeviceClasses returns a TypedDeviceClassInformer. +func (v *version) DeviceClasses() TypedDeviceClassInformer { return &deviceClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ResourceClaims returns a ResourceClaimInformer. -func (v *version) ResourceClaims() ResourceClaimInformer { +// DeviceTaintRules returns a TypedDeviceTaintRuleInformer. +func (v *version) DeviceTaintRules() TypedDeviceTaintRuleInformer { + return &deviceTaintRuleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ResourceClaims returns a TypedResourceClaimInformer. +func (v *version) ResourceClaims() TypedResourceClaimInformer { return &resourceClaimInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ResourceClaimTemplates returns a ResourceClaimTemplateInformer. -func (v *version) ResourceClaimTemplates() ResourceClaimTemplateInformer { +// ResourceClaimTemplates returns a TypedResourceClaimTemplateInformer. +func (v *version) ResourceClaimTemplates() TypedResourceClaimTemplateInformer { return &resourceClaimTemplateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ResourceSlices returns a ResourceSliceInformer. -func (v *version) ResourceSlices() ResourceSliceInformer { +// ResourceSlices returns a TypedResourceSliceInformer. +func (v *version) ResourceSlices() TypedResourceSliceInformer { return &resourceSliceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/resource/v1/resourceclaim.go b/vendor/k8s.io/client-go/informers/resource/v1/resourceclaim.go index 996cc77f61..cd54867391 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1/resourceclaim.go +++ b/vendor/k8s.io/client-go/informers/resource/v1/resourceclaim.go @@ -34,12 +34,40 @@ import ( ) // ResourceClaimInformer provides access to a shared informer and lister for -// ResourceClaims. +// ResourceClaims. Prefer using the type-safe variant (see [TypedResourceClaimInformer]). type ResourceClaimInformer interface { Informer() cache.SharedIndexInformer Lister() resourcev1.ResourceClaimLister } +// TypedResourceClaimInformer provides access to a shared informer and lister for +// ResourceClaims, including the type-safe TypedInformer variant. +// It is a superset of ResourceClaimInformer. +type TypedResourceClaimInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ResourceClaimIndexInformer + Lister() resourcev1.ResourceClaimLister +} + +// ResourceClaimIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ResourceClaimIndexInformer cache.TypedSharedIndexInformer[*apiresourcev1.ResourceClaim] + +// ResourceClaimHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ResourceClaim. +type ResourceClaimHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiresourcev1.ResourceClaim] + +// ResourceClaimDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ResourceClaim. +type ResourceClaimDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiresourcev1.ResourceClaim] + +// ResourceClaimFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ResourceClaim. +type ResourceClaimFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiresourcev1.ResourceClaim] + +// ResourceClaimIndexers is a specialization of [cache.TypedIndexers] for ResourceClaim. +type ResourceClaimIndexers = cache.TypedIndexers[*apiresourcev1.ResourceClaim] + +// DeletedResourceClaim is a specialization of [cache.DeletedObject] for ResourceClaim. +type DeletedResourceClaim = cache.DeletedObject[*apiresourcev1.ResourceClaim] + type resourceClaimInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type resourceClaimInformer struct { // NewResourceClaimInformer constructs a new informer for ResourceClaim type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceClaimInformer]). func NewResourceClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewResourceClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedResourceClaimInformer constructs a new informer for ResourceClaim type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ResourceClaimIndexers) ResourceClaimIndexInformer { + return NewTypedResourceClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredResourceClaimInformer constructs a new informer for ResourceClaim type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredResourceClaimInformer]). func NewFilteredResourceClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewResourceClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedResourceClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredResourceClaimInformer constructs a new informer for ResourceClaim type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredResourceClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ResourceClaimIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ResourceClaimIndexInformer { + return NewTypedResourceClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewResourceClaimInformerWithOptions constructs a new informer for ResourceClaim type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceClaimInformerWithOptions]). func NewResourceClaimInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedResourceClaimInformerWithOptions(client, namespace, options) +} + +// NewTypedResourceClaimInformerWithOptions constructs a new informer for ResourceClaim type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceClaimInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) ResourceClaimIndexInformer { gvr := schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1", Resource: "resourceclaims"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiresourcev1.ResourceClaim](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewResourceClaimInformerWithOptions(client kubernetes.Interface, namespace Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *resourceClaimInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewResourceClaimInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedResourceClaimInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *resourceClaimInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiresourcev1.ResourceClaim{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *resourceClaimInformer) TypedInformer() ResourceClaimIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1.ResourceClaim](f.factory.InformerFor(&apiresourcev1.ResourceClaim{}, f.defaultInformer)) } func (f *resourceClaimInformer) Lister() resourcev1.ResourceClaimLister { return resourcev1.NewResourceClaimLister(f.Informer().GetIndexer()) } + +// ToTypedResourceClaimInformer converts an untyped informer into a TypedResourceClaimInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceClaim. If that is not the case, calling type-safe methods of the returned +// TypedResourceClaimInformer leads to runtime panics. A safer alternative is to pass +// around a TypedResourceClaimInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedResourceClaimInformer(informer ResourceClaimInformer) TypedResourceClaimInformer { + if informer, ok := informer.(TypedResourceClaimInformer); ok { + return informer + } + return &resourceClaimTypedInformerAdapter{informer} +} + +type resourceClaimTypedInformerAdapter struct { + ResourceClaimInformer +} + +func (a *resourceClaimTypedInformerAdapter) TypedInformer() ResourceClaimIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1.ResourceClaim](a.Informer()) +} + +// ToResourceClaimIndexInformer converts an untyped informer into a ResourceClaimIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceClaim. If that is not the case, calling type-safe methods of the returned +// ResourceClaimIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ResourceClaimIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToResourceClaimIndexInformer(informer cache.SharedIndexInformer) ResourceClaimIndexInformer { + if informer, ok := informer.(ResourceClaimIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiresourcev1.ResourceClaim](informer) +} diff --git a/vendor/k8s.io/client-go/informers/resource/v1/resourceclaimtemplate.go b/vendor/k8s.io/client-go/informers/resource/v1/resourceclaimtemplate.go index e562314dc1..9e2925ec27 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1/resourceclaimtemplate.go +++ b/vendor/k8s.io/client-go/informers/resource/v1/resourceclaimtemplate.go @@ -34,12 +34,40 @@ import ( ) // ResourceClaimTemplateInformer provides access to a shared informer and lister for -// ResourceClaimTemplates. +// ResourceClaimTemplates. Prefer using the type-safe variant (see [TypedResourceClaimTemplateInformer]). type ResourceClaimTemplateInformer interface { Informer() cache.SharedIndexInformer Lister() resourcev1.ResourceClaimTemplateLister } +// TypedResourceClaimTemplateInformer provides access to a shared informer and lister for +// ResourceClaimTemplates, including the type-safe TypedInformer variant. +// It is a superset of ResourceClaimTemplateInformer. +type TypedResourceClaimTemplateInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ResourceClaimTemplateIndexInformer + Lister() resourcev1.ResourceClaimTemplateLister +} + +// ResourceClaimTemplateIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ResourceClaimTemplateIndexInformer cache.TypedSharedIndexInformer[*apiresourcev1.ResourceClaimTemplate] + +// ResourceClaimTemplateHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ResourceClaimTemplate. +type ResourceClaimTemplateHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiresourcev1.ResourceClaimTemplate] + +// ResourceClaimTemplateDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ResourceClaimTemplate. +type ResourceClaimTemplateDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiresourcev1.ResourceClaimTemplate] + +// ResourceClaimTemplateFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ResourceClaimTemplate. +type ResourceClaimTemplateFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiresourcev1.ResourceClaimTemplate] + +// ResourceClaimTemplateIndexers is a specialization of [cache.TypedIndexers] for ResourceClaimTemplate. +type ResourceClaimTemplateIndexers = cache.TypedIndexers[*apiresourcev1.ResourceClaimTemplate] + +// DeletedResourceClaimTemplate is a specialization of [cache.DeletedObject] for ResourceClaimTemplate. +type DeletedResourceClaimTemplate = cache.DeletedObject[*apiresourcev1.ResourceClaimTemplate] + type resourceClaimTemplateInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type resourceClaimTemplateInformer struct { // NewResourceClaimTemplateInformer constructs a new informer for ResourceClaimTemplate type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceClaimTemplateInformer]). func NewResourceClaimTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewResourceClaimTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedResourceClaimTemplateInformer constructs a new informer for ResourceClaimTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceClaimTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ResourceClaimTemplateIndexers) ResourceClaimTemplateIndexInformer { + return NewTypedResourceClaimTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredResourceClaimTemplateInformer constructs a new informer for ResourceClaimTemplate type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredResourceClaimTemplateInformer]). func NewFilteredResourceClaimTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewResourceClaimTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedResourceClaimTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredResourceClaimTemplateInformer constructs a new informer for ResourceClaimTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredResourceClaimTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ResourceClaimTemplateIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ResourceClaimTemplateIndexInformer { + return NewTypedResourceClaimTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewResourceClaimTemplateInformerWithOptions constructs a new informer for ResourceClaimTemplate type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceClaimTemplateInformerWithOptions]). func NewResourceClaimTemplateInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedResourceClaimTemplateInformerWithOptions(client, namespace, options) +} + +// NewTypedResourceClaimTemplateInformerWithOptions constructs a new informer for ResourceClaimTemplate type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceClaimTemplateInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) ResourceClaimTemplateIndexInformer { gvr := schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1", Resource: "resourceclaimtemplates"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiresourcev1.ResourceClaimTemplate](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewResourceClaimTemplateInformerWithOptions(client kubernetes.Interface, na Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *resourceClaimTemplateInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewResourceClaimTemplateInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedResourceClaimTemplateInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *resourceClaimTemplateInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiresourcev1.ResourceClaimTemplate{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *resourceClaimTemplateInformer) TypedInformer() ResourceClaimTemplateIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1.ResourceClaimTemplate](f.factory.InformerFor(&apiresourcev1.ResourceClaimTemplate{}, f.defaultInformer)) } func (f *resourceClaimTemplateInformer) Lister() resourcev1.ResourceClaimTemplateLister { return resourcev1.NewResourceClaimTemplateLister(f.Informer().GetIndexer()) } + +// ToTypedResourceClaimTemplateInformer converts an untyped informer into a TypedResourceClaimTemplateInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceClaimTemplate. If that is not the case, calling type-safe methods of the returned +// TypedResourceClaimTemplateInformer leads to runtime panics. A safer alternative is to pass +// around a TypedResourceClaimTemplateInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedResourceClaimTemplateInformer(informer ResourceClaimTemplateInformer) TypedResourceClaimTemplateInformer { + if informer, ok := informer.(TypedResourceClaimTemplateInformer); ok { + return informer + } + return &resourceClaimTemplateTypedInformerAdapter{informer} +} + +type resourceClaimTemplateTypedInformerAdapter struct { + ResourceClaimTemplateInformer +} + +func (a *resourceClaimTemplateTypedInformerAdapter) TypedInformer() ResourceClaimTemplateIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1.ResourceClaimTemplate](a.Informer()) +} + +// ToResourceClaimTemplateIndexInformer converts an untyped informer into a ResourceClaimTemplateIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceClaimTemplate. If that is not the case, calling type-safe methods of the returned +// ResourceClaimTemplateIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ResourceClaimTemplateIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToResourceClaimTemplateIndexInformer(informer cache.SharedIndexInformer) ResourceClaimTemplateIndexInformer { + if informer, ok := informer.(ResourceClaimTemplateIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiresourcev1.ResourceClaimTemplate](informer) +} diff --git a/vendor/k8s.io/client-go/informers/resource/v1/resourceslice.go b/vendor/k8s.io/client-go/informers/resource/v1/resourceslice.go index 85c877f803..b03bc1b723 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1/resourceslice.go +++ b/vendor/k8s.io/client-go/informers/resource/v1/resourceslice.go @@ -34,12 +34,40 @@ import ( ) // ResourceSliceInformer provides access to a shared informer and lister for -// ResourceSlices. +// ResourceSlices. Prefer using the type-safe variant (see [TypedResourceSliceInformer]). type ResourceSliceInformer interface { Informer() cache.SharedIndexInformer Lister() resourcev1.ResourceSliceLister } +// TypedResourceSliceInformer provides access to a shared informer and lister for +// ResourceSlices, including the type-safe TypedInformer variant. +// It is a superset of ResourceSliceInformer. +type TypedResourceSliceInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ResourceSliceIndexInformer + Lister() resourcev1.ResourceSliceLister +} + +// ResourceSliceIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ResourceSliceIndexInformer cache.TypedSharedIndexInformer[*apiresourcev1.ResourceSlice] + +// ResourceSliceHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ResourceSlice. +type ResourceSliceHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiresourcev1.ResourceSlice] + +// ResourceSliceDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ResourceSlice. +type ResourceSliceDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiresourcev1.ResourceSlice] + +// ResourceSliceFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ResourceSlice. +type ResourceSliceFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiresourcev1.ResourceSlice] + +// ResourceSliceIndexers is a specialization of [cache.TypedIndexers] for ResourceSlice. +type ResourceSliceIndexers = cache.TypedIndexers[*apiresourcev1.ResourceSlice] + +// DeletedResourceSlice is a specialization of [cache.DeletedObject] for ResourceSlice. +type DeletedResourceSlice = cache.DeletedObject[*apiresourcev1.ResourceSlice] + type resourceSliceInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type resourceSliceInformer struct { // NewResourceSliceInformer constructs a new informer for ResourceSlice type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceSliceInformer]). func NewResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedResourceSliceInformer constructs a new informer for ResourceSlice type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ResourceSliceIndexers) ResourceSliceIndexInformer { + return NewTypedResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredResourceSliceInformer constructs a new informer for ResourceSlice type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredResourceSliceInformer]). func NewFilteredResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredResourceSliceInformer constructs a new informer for ResourceSlice type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ResourceSliceIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ResourceSliceIndexInformer { + return NewTypedResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewResourceSliceInformerWithOptions constructs a new informer for ResourceSlice type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceSliceInformerWithOptions]). func NewResourceSliceInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedResourceSliceInformerWithOptions(client, options) +} + +// NewTypedResourceSliceInformerWithOptions constructs a new informer for ResourceSlice type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceSliceInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ResourceSliceIndexInformer { gvr := schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1", Resource: "resourceslices"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiresourcev1.ResourceSlice](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewResourceSliceInformerWithOptions(client kubernetes.Interface, options in Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *resourceSliceInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *resourceSliceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiresourcev1.ResourceSlice{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *resourceSliceInformer) TypedInformer() ResourceSliceIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1.ResourceSlice](f.factory.InformerFor(&apiresourcev1.ResourceSlice{}, f.defaultInformer)) } func (f *resourceSliceInformer) Lister() resourcev1.ResourceSliceLister { return resourcev1.NewResourceSliceLister(f.Informer().GetIndexer()) } + +// ToTypedResourceSliceInformer converts an untyped informer into a TypedResourceSliceInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceSlice. If that is not the case, calling type-safe methods of the returned +// TypedResourceSliceInformer leads to runtime panics. A safer alternative is to pass +// around a TypedResourceSliceInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedResourceSliceInformer(informer ResourceSliceInformer) TypedResourceSliceInformer { + if informer, ok := informer.(TypedResourceSliceInformer); ok { + return informer + } + return &resourceSliceTypedInformerAdapter{informer} +} + +type resourceSliceTypedInformerAdapter struct { + ResourceSliceInformer +} + +func (a *resourceSliceTypedInformerAdapter) TypedInformer() ResourceSliceIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1.ResourceSlice](a.Informer()) +} + +// ToResourceSliceIndexInformer converts an untyped informer into a ResourceSliceIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceSlice. If that is not the case, calling type-safe methods of the returned +// ResourceSliceIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ResourceSliceIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToResourceSliceIndexInformer(informer cache.SharedIndexInformer) ResourceSliceIndexInformer { + if informer, ok := informer.(ResourceSliceIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiresourcev1.ResourceSlice](informer) +} diff --git a/vendor/k8s.io/client-go/informers/resource/v1alpha3/devicetaintrule.go b/vendor/k8s.io/client-go/informers/resource/v1alpha3/devicetaintrule.go index 0b0029ab54..a8775bd885 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1alpha3/devicetaintrule.go +++ b/vendor/k8s.io/client-go/informers/resource/v1alpha3/devicetaintrule.go @@ -34,12 +34,40 @@ import ( ) // DeviceTaintRuleInformer provides access to a shared informer and lister for -// DeviceTaintRules. +// DeviceTaintRules. Prefer using the type-safe variant (see [TypedDeviceTaintRuleInformer]). type DeviceTaintRuleInformer interface { Informer() cache.SharedIndexInformer Lister() resourcev1alpha3.DeviceTaintRuleLister } +// TypedDeviceTaintRuleInformer provides access to a shared informer and lister for +// DeviceTaintRules, including the type-safe TypedInformer variant. +// It is a superset of DeviceTaintRuleInformer. +type TypedDeviceTaintRuleInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() DeviceTaintRuleIndexInformer + Lister() resourcev1alpha3.DeviceTaintRuleLister +} + +// DeviceTaintRuleIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type DeviceTaintRuleIndexInformer cache.TypedSharedIndexInformer[*apiresourcev1alpha3.DeviceTaintRule] + +// DeviceTaintRuleHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for DeviceTaintRule. +type DeviceTaintRuleHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiresourcev1alpha3.DeviceTaintRule] + +// DeviceTaintRuleDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for DeviceTaintRule. +type DeviceTaintRuleDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiresourcev1alpha3.DeviceTaintRule] + +// DeviceTaintRuleFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for DeviceTaintRule. +type DeviceTaintRuleFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiresourcev1alpha3.DeviceTaintRule] + +// DeviceTaintRuleIndexers is a specialization of [cache.TypedIndexers] for DeviceTaintRule. +type DeviceTaintRuleIndexers = cache.TypedIndexers[*apiresourcev1alpha3.DeviceTaintRule] + +// DeletedDeviceTaintRule is a specialization of [cache.DeletedObject] for DeviceTaintRule. +type DeletedDeviceTaintRule = cache.DeletedObject[*apiresourcev1alpha3.DeviceTaintRule] + type deviceTaintRuleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type deviceTaintRuleInformer struct { // NewDeviceTaintRuleInformer constructs a new informer for DeviceTaintRule type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeviceTaintRuleInformer]). func NewDeviceTaintRuleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedDeviceTaintRuleInformer constructs a new informer for DeviceTaintRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeviceTaintRuleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers DeviceTaintRuleIndexers) DeviceTaintRuleIndexInformer { + return NewTypedDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredDeviceTaintRuleInformer constructs a new informer for DeviceTaintRule type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredDeviceTaintRuleInformer]). func NewFilteredDeviceTaintRuleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredDeviceTaintRuleInformer constructs a new informer for DeviceTaintRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredDeviceTaintRuleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers DeviceTaintRuleIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) DeviceTaintRuleIndexInformer { + return NewTypedDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewDeviceTaintRuleInformerWithOptions constructs a new informer for DeviceTaintRule type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeviceTaintRuleInformerWithOptions]). func NewDeviceTaintRuleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedDeviceTaintRuleInformerWithOptions(client, options) +} + +// NewTypedDeviceTaintRuleInformerWithOptions constructs a new informer for DeviceTaintRule type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeviceTaintRuleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) DeviceTaintRuleIndexInformer { gvr := schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1alpha3", Resource: "devicetaintrules"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiresourcev1alpha3.DeviceTaintRule](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewDeviceTaintRuleInformerWithOptions(client kubernetes.Interface, options Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *deviceTaintRuleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *deviceTaintRuleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiresourcev1alpha3.DeviceTaintRule{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *deviceTaintRuleInformer) TypedInformer() DeviceTaintRuleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1alpha3.DeviceTaintRule](f.factory.InformerFor(&apiresourcev1alpha3.DeviceTaintRule{}, f.defaultInformer)) } func (f *deviceTaintRuleInformer) Lister() resourcev1alpha3.DeviceTaintRuleLister { return resourcev1alpha3.NewDeviceTaintRuleLister(f.Informer().GetIndexer()) } + +// ToTypedDeviceTaintRuleInformer converts an untyped informer into a TypedDeviceTaintRuleInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *DeviceTaintRule. If that is not the case, calling type-safe methods of the returned +// TypedDeviceTaintRuleInformer leads to runtime panics. A safer alternative is to pass +// around a TypedDeviceTaintRuleInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedDeviceTaintRuleInformer(informer DeviceTaintRuleInformer) TypedDeviceTaintRuleInformer { + if informer, ok := informer.(TypedDeviceTaintRuleInformer); ok { + return informer + } + return &deviceTaintRuleTypedInformerAdapter{informer} +} + +type deviceTaintRuleTypedInformerAdapter struct { + DeviceTaintRuleInformer +} + +func (a *deviceTaintRuleTypedInformerAdapter) TypedInformer() DeviceTaintRuleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1alpha3.DeviceTaintRule](a.Informer()) +} + +// ToDeviceTaintRuleIndexInformer converts an untyped informer into a DeviceTaintRuleIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *DeviceTaintRule. If that is not the case, calling type-safe methods of the returned +// DeviceTaintRuleIndexInformer leads to runtime panics. A safer alternative is to pass +// around a DeviceTaintRuleIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToDeviceTaintRuleIndexInformer(informer cache.SharedIndexInformer) DeviceTaintRuleIndexInformer { + if informer, ok := informer.(DeviceTaintRuleIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiresourcev1alpha3.DeviceTaintRule](informer) +} diff --git a/vendor/k8s.io/client-go/informers/resource/v1alpha3/interface.go b/vendor/k8s.io/client-go/informers/resource/v1alpha3/interface.go index b305681236..46bdb3b162 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1alpha3/interface.go +++ b/vendor/k8s.io/client-go/informers/resource/v1alpha3/interface.go @@ -25,9 +25,9 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // DeviceTaintRules returns a DeviceTaintRuleInformer. - DeviceTaintRules() DeviceTaintRuleInformer + DeviceTaintRules() TypedDeviceTaintRuleInformer // ResourcePoolStatusRequests returns a ResourcePoolStatusRequestInformer. - ResourcePoolStatusRequests() ResourcePoolStatusRequestInformer + ResourcePoolStatusRequests() TypedResourcePoolStatusRequestInformer } type version struct { @@ -41,12 +41,12 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// DeviceTaintRules returns a DeviceTaintRuleInformer. -func (v *version) DeviceTaintRules() DeviceTaintRuleInformer { +// DeviceTaintRules returns a TypedDeviceTaintRuleInformer. +func (v *version) DeviceTaintRules() TypedDeviceTaintRuleInformer { return &deviceTaintRuleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ResourcePoolStatusRequests returns a ResourcePoolStatusRequestInformer. -func (v *version) ResourcePoolStatusRequests() ResourcePoolStatusRequestInformer { +// ResourcePoolStatusRequests returns a TypedResourcePoolStatusRequestInformer. +func (v *version) ResourcePoolStatusRequests() TypedResourcePoolStatusRequestInformer { return &resourcePoolStatusRequestInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/resource/v1alpha3/resourcepoolstatusrequest.go b/vendor/k8s.io/client-go/informers/resource/v1alpha3/resourcepoolstatusrequest.go index f34d57e138..87842dfbeb 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1alpha3/resourcepoolstatusrequest.go +++ b/vendor/k8s.io/client-go/informers/resource/v1alpha3/resourcepoolstatusrequest.go @@ -34,12 +34,40 @@ import ( ) // ResourcePoolStatusRequestInformer provides access to a shared informer and lister for -// ResourcePoolStatusRequests. +// ResourcePoolStatusRequests. Prefer using the type-safe variant (see [TypedResourcePoolStatusRequestInformer]). type ResourcePoolStatusRequestInformer interface { Informer() cache.SharedIndexInformer Lister() resourcev1alpha3.ResourcePoolStatusRequestLister } +// TypedResourcePoolStatusRequestInformer provides access to a shared informer and lister for +// ResourcePoolStatusRequests, including the type-safe TypedInformer variant. +// It is a superset of ResourcePoolStatusRequestInformer. +type TypedResourcePoolStatusRequestInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ResourcePoolStatusRequestIndexInformer + Lister() resourcev1alpha3.ResourcePoolStatusRequestLister +} + +// ResourcePoolStatusRequestIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ResourcePoolStatusRequestIndexInformer cache.TypedSharedIndexInformer[*apiresourcev1alpha3.ResourcePoolStatusRequest] + +// ResourcePoolStatusRequestHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ResourcePoolStatusRequest. +type ResourcePoolStatusRequestHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiresourcev1alpha3.ResourcePoolStatusRequest] + +// ResourcePoolStatusRequestDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ResourcePoolStatusRequest. +type ResourcePoolStatusRequestDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiresourcev1alpha3.ResourcePoolStatusRequest] + +// ResourcePoolStatusRequestFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ResourcePoolStatusRequest. +type ResourcePoolStatusRequestFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiresourcev1alpha3.ResourcePoolStatusRequest] + +// ResourcePoolStatusRequestIndexers is a specialization of [cache.TypedIndexers] for ResourcePoolStatusRequest. +type ResourcePoolStatusRequestIndexers = cache.TypedIndexers[*apiresourcev1alpha3.ResourcePoolStatusRequest] + +// DeletedResourcePoolStatusRequest is a specialization of [cache.DeletedObject] for ResourcePoolStatusRequest. +type DeletedResourcePoolStatusRequest = cache.DeletedObject[*apiresourcev1alpha3.ResourcePoolStatusRequest] + type resourcePoolStatusRequestInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type resourcePoolStatusRequestInformer struct { // NewResourcePoolStatusRequestInformer constructs a new informer for ResourcePoolStatusRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourcePoolStatusRequestInformer]). func NewResourcePoolStatusRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewResourcePoolStatusRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedResourcePoolStatusRequestInformer constructs a new informer for ResourcePoolStatusRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourcePoolStatusRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ResourcePoolStatusRequestIndexers) ResourcePoolStatusRequestIndexInformer { + return NewTypedResourcePoolStatusRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredResourcePoolStatusRequestInformer constructs a new informer for ResourcePoolStatusRequest type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredResourcePoolStatusRequestInformer]). func NewFilteredResourcePoolStatusRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewResourcePoolStatusRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedResourcePoolStatusRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredResourcePoolStatusRequestInformer constructs a new informer for ResourcePoolStatusRequest type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredResourcePoolStatusRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ResourcePoolStatusRequestIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ResourcePoolStatusRequestIndexInformer { + return NewTypedResourcePoolStatusRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewResourcePoolStatusRequestInformerWithOptions constructs a new informer for ResourcePoolStatusRequest type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourcePoolStatusRequestInformerWithOptions]). func NewResourcePoolStatusRequestInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedResourcePoolStatusRequestInformerWithOptions(client, options) +} + +// NewTypedResourcePoolStatusRequestInformerWithOptions constructs a new informer for ResourcePoolStatusRequest type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourcePoolStatusRequestInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ResourcePoolStatusRequestIndexInformer { gvr := schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1alpha3", Resource: "resourcepoolstatusrequests"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiresourcev1alpha3.ResourcePoolStatusRequest](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewResourcePoolStatusRequestInformerWithOptions(client kubernetes.Interface Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *resourcePoolStatusRequestInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewResourcePoolStatusRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedResourcePoolStatusRequestInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *resourcePoolStatusRequestInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiresourcev1alpha3.ResourcePoolStatusRequest{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *resourcePoolStatusRequestInformer) TypedInformer() ResourcePoolStatusRequestIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1alpha3.ResourcePoolStatusRequest](f.factory.InformerFor(&apiresourcev1alpha3.ResourcePoolStatusRequest{}, f.defaultInformer)) } func (f *resourcePoolStatusRequestInformer) Lister() resourcev1alpha3.ResourcePoolStatusRequestLister { return resourcev1alpha3.NewResourcePoolStatusRequestLister(f.Informer().GetIndexer()) } + +// ToTypedResourcePoolStatusRequestInformer converts an untyped informer into a TypedResourcePoolStatusRequestInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourcePoolStatusRequest. If that is not the case, calling type-safe methods of the returned +// TypedResourcePoolStatusRequestInformer leads to runtime panics. A safer alternative is to pass +// around a TypedResourcePoolStatusRequestInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedResourcePoolStatusRequestInformer(informer ResourcePoolStatusRequestInformer) TypedResourcePoolStatusRequestInformer { + if informer, ok := informer.(TypedResourcePoolStatusRequestInformer); ok { + return informer + } + return &resourcePoolStatusRequestTypedInformerAdapter{informer} +} + +type resourcePoolStatusRequestTypedInformerAdapter struct { + ResourcePoolStatusRequestInformer +} + +func (a *resourcePoolStatusRequestTypedInformerAdapter) TypedInformer() ResourcePoolStatusRequestIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1alpha3.ResourcePoolStatusRequest](a.Informer()) +} + +// ToResourcePoolStatusRequestIndexInformer converts an untyped informer into a ResourcePoolStatusRequestIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourcePoolStatusRequest. If that is not the case, calling type-safe methods of the returned +// ResourcePoolStatusRequestIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ResourcePoolStatusRequestIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToResourcePoolStatusRequestIndexInformer(informer cache.SharedIndexInformer) ResourcePoolStatusRequestIndexInformer { + if informer, ok := informer.(ResourcePoolStatusRequestIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiresourcev1alpha3.ResourcePoolStatusRequest](informer) +} diff --git a/vendor/k8s.io/client-go/informers/resource/v1beta1/deviceclass.go b/vendor/k8s.io/client-go/informers/resource/v1beta1/deviceclass.go index 0a4d4bea64..bbc371bd27 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1beta1/deviceclass.go +++ b/vendor/k8s.io/client-go/informers/resource/v1beta1/deviceclass.go @@ -34,12 +34,40 @@ import ( ) // DeviceClassInformer provides access to a shared informer and lister for -// DeviceClasses. +// DeviceClasses. Prefer using the type-safe variant (see [TypedDeviceClassInformer]). type DeviceClassInformer interface { Informer() cache.SharedIndexInformer Lister() resourcev1beta1.DeviceClassLister } +// TypedDeviceClassInformer provides access to a shared informer and lister for +// DeviceClasses, including the type-safe TypedInformer variant. +// It is a superset of DeviceClassInformer. +type TypedDeviceClassInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() DeviceClassIndexInformer + Lister() resourcev1beta1.DeviceClassLister +} + +// DeviceClassIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type DeviceClassIndexInformer cache.TypedSharedIndexInformer[*apiresourcev1beta1.DeviceClass] + +// DeviceClassHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for DeviceClass. +type DeviceClassHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiresourcev1beta1.DeviceClass] + +// DeviceClassDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for DeviceClass. +type DeviceClassDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiresourcev1beta1.DeviceClass] + +// DeviceClassFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for DeviceClass. +type DeviceClassFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiresourcev1beta1.DeviceClass] + +// DeviceClassIndexers is a specialization of [cache.TypedIndexers] for DeviceClass. +type DeviceClassIndexers = cache.TypedIndexers[*apiresourcev1beta1.DeviceClass] + +// DeletedDeviceClass is a specialization of [cache.DeletedObject] for DeviceClass. +type DeletedDeviceClass = cache.DeletedObject[*apiresourcev1beta1.DeviceClass] + type deviceClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type deviceClassInformer struct { // NewDeviceClassInformer constructs a new informer for DeviceClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeviceClassInformer]). func NewDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedDeviceClassInformer constructs a new informer for DeviceClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers DeviceClassIndexers) DeviceClassIndexInformer { + return NewTypedDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredDeviceClassInformer constructs a new informer for DeviceClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredDeviceClassInformer]). func NewFilteredDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredDeviceClassInformer constructs a new informer for DeviceClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers DeviceClassIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) DeviceClassIndexInformer { + return NewTypedDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewDeviceClassInformerWithOptions constructs a new informer for DeviceClass type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeviceClassInformerWithOptions]). func NewDeviceClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedDeviceClassInformerWithOptions(client, options) +} + +// NewTypedDeviceClassInformerWithOptions constructs a new informer for DeviceClass type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeviceClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) DeviceClassIndexInformer { gvr := schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1beta1", Resource: "deviceclasss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta1.DeviceClass](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewDeviceClassInformerWithOptions(client kubernetes.Interface, options inte Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *deviceClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *deviceClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiresourcev1beta1.DeviceClass{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *deviceClassInformer) TypedInformer() DeviceClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta1.DeviceClass](f.factory.InformerFor(&apiresourcev1beta1.DeviceClass{}, f.defaultInformer)) } func (f *deviceClassInformer) Lister() resourcev1beta1.DeviceClassLister { return resourcev1beta1.NewDeviceClassLister(f.Informer().GetIndexer()) } + +// ToTypedDeviceClassInformer converts an untyped informer into a TypedDeviceClassInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *DeviceClass. If that is not the case, calling type-safe methods of the returned +// TypedDeviceClassInformer leads to runtime panics. A safer alternative is to pass +// around a TypedDeviceClassInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedDeviceClassInformer(informer DeviceClassInformer) TypedDeviceClassInformer { + if informer, ok := informer.(TypedDeviceClassInformer); ok { + return informer + } + return &deviceClassTypedInformerAdapter{informer} +} + +type deviceClassTypedInformerAdapter struct { + DeviceClassInformer +} + +func (a *deviceClassTypedInformerAdapter) TypedInformer() DeviceClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta1.DeviceClass](a.Informer()) +} + +// ToDeviceClassIndexInformer converts an untyped informer into a DeviceClassIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *DeviceClass. If that is not the case, calling type-safe methods of the returned +// DeviceClassIndexInformer leads to runtime panics. A safer alternative is to pass +// around a DeviceClassIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToDeviceClassIndexInformer(informer cache.SharedIndexInformer) DeviceClassIndexInformer { + if informer, ok := informer.(DeviceClassIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta1.DeviceClass](informer) +} diff --git a/vendor/k8s.io/client-go/informers/resource/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/resource/v1beta1/interface.go index 07330763ba..6cddfa8f42 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/resource/v1beta1/interface.go @@ -25,13 +25,13 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // DeviceClasses returns a DeviceClassInformer. - DeviceClasses() DeviceClassInformer + DeviceClasses() TypedDeviceClassInformer // ResourceClaims returns a ResourceClaimInformer. - ResourceClaims() ResourceClaimInformer + ResourceClaims() TypedResourceClaimInformer // ResourceClaimTemplates returns a ResourceClaimTemplateInformer. - ResourceClaimTemplates() ResourceClaimTemplateInformer + ResourceClaimTemplates() TypedResourceClaimTemplateInformer // ResourceSlices returns a ResourceSliceInformer. - ResourceSlices() ResourceSliceInformer + ResourceSlices() TypedResourceSliceInformer } type version struct { @@ -45,22 +45,22 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// DeviceClasses returns a DeviceClassInformer. -func (v *version) DeviceClasses() DeviceClassInformer { +// DeviceClasses returns a TypedDeviceClassInformer. +func (v *version) DeviceClasses() TypedDeviceClassInformer { return &deviceClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ResourceClaims returns a ResourceClaimInformer. -func (v *version) ResourceClaims() ResourceClaimInformer { +// ResourceClaims returns a TypedResourceClaimInformer. +func (v *version) ResourceClaims() TypedResourceClaimInformer { return &resourceClaimInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ResourceClaimTemplates returns a ResourceClaimTemplateInformer. -func (v *version) ResourceClaimTemplates() ResourceClaimTemplateInformer { +// ResourceClaimTemplates returns a TypedResourceClaimTemplateInformer. +func (v *version) ResourceClaimTemplates() TypedResourceClaimTemplateInformer { return &resourceClaimTemplateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ResourceSlices returns a ResourceSliceInformer. -func (v *version) ResourceSlices() ResourceSliceInformer { +// ResourceSlices returns a TypedResourceSliceInformer. +func (v *version) ResourceSlices() TypedResourceSliceInformer { return &resourceSliceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceclaim.go b/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceclaim.go index 9ec1ece317..31f1dec80a 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceclaim.go +++ b/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceclaim.go @@ -34,12 +34,40 @@ import ( ) // ResourceClaimInformer provides access to a shared informer and lister for -// ResourceClaims. +// ResourceClaims. Prefer using the type-safe variant (see [TypedResourceClaimInformer]). type ResourceClaimInformer interface { Informer() cache.SharedIndexInformer Lister() resourcev1beta1.ResourceClaimLister } +// TypedResourceClaimInformer provides access to a shared informer and lister for +// ResourceClaims, including the type-safe TypedInformer variant. +// It is a superset of ResourceClaimInformer. +type TypedResourceClaimInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ResourceClaimIndexInformer + Lister() resourcev1beta1.ResourceClaimLister +} + +// ResourceClaimIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ResourceClaimIndexInformer cache.TypedSharedIndexInformer[*apiresourcev1beta1.ResourceClaim] + +// ResourceClaimHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ResourceClaim. +type ResourceClaimHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiresourcev1beta1.ResourceClaim] + +// ResourceClaimDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ResourceClaim. +type ResourceClaimDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiresourcev1beta1.ResourceClaim] + +// ResourceClaimFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ResourceClaim. +type ResourceClaimFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiresourcev1beta1.ResourceClaim] + +// ResourceClaimIndexers is a specialization of [cache.TypedIndexers] for ResourceClaim. +type ResourceClaimIndexers = cache.TypedIndexers[*apiresourcev1beta1.ResourceClaim] + +// DeletedResourceClaim is a specialization of [cache.DeletedObject] for ResourceClaim. +type DeletedResourceClaim = cache.DeletedObject[*apiresourcev1beta1.ResourceClaim] + type resourceClaimInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type resourceClaimInformer struct { // NewResourceClaimInformer constructs a new informer for ResourceClaim type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceClaimInformer]). func NewResourceClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewResourceClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedResourceClaimInformer constructs a new informer for ResourceClaim type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ResourceClaimIndexers) ResourceClaimIndexInformer { + return NewTypedResourceClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredResourceClaimInformer constructs a new informer for ResourceClaim type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredResourceClaimInformer]). func NewFilteredResourceClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewResourceClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedResourceClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredResourceClaimInformer constructs a new informer for ResourceClaim type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredResourceClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ResourceClaimIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ResourceClaimIndexInformer { + return NewTypedResourceClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewResourceClaimInformerWithOptions constructs a new informer for ResourceClaim type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceClaimInformerWithOptions]). func NewResourceClaimInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedResourceClaimInformerWithOptions(client, namespace, options) +} + +// NewTypedResourceClaimInformerWithOptions constructs a new informer for ResourceClaim type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceClaimInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) ResourceClaimIndexInformer { gvr := schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1beta1", Resource: "resourceclaims"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta1.ResourceClaim](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewResourceClaimInformerWithOptions(client kubernetes.Interface, namespace Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *resourceClaimInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewResourceClaimInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedResourceClaimInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *resourceClaimInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiresourcev1beta1.ResourceClaim{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *resourceClaimInformer) TypedInformer() ResourceClaimIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta1.ResourceClaim](f.factory.InformerFor(&apiresourcev1beta1.ResourceClaim{}, f.defaultInformer)) } func (f *resourceClaimInformer) Lister() resourcev1beta1.ResourceClaimLister { return resourcev1beta1.NewResourceClaimLister(f.Informer().GetIndexer()) } + +// ToTypedResourceClaimInformer converts an untyped informer into a TypedResourceClaimInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceClaim. If that is not the case, calling type-safe methods of the returned +// TypedResourceClaimInformer leads to runtime panics. A safer alternative is to pass +// around a TypedResourceClaimInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedResourceClaimInformer(informer ResourceClaimInformer) TypedResourceClaimInformer { + if informer, ok := informer.(TypedResourceClaimInformer); ok { + return informer + } + return &resourceClaimTypedInformerAdapter{informer} +} + +type resourceClaimTypedInformerAdapter struct { + ResourceClaimInformer +} + +func (a *resourceClaimTypedInformerAdapter) TypedInformer() ResourceClaimIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta1.ResourceClaim](a.Informer()) +} + +// ToResourceClaimIndexInformer converts an untyped informer into a ResourceClaimIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceClaim. If that is not the case, calling type-safe methods of the returned +// ResourceClaimIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ResourceClaimIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToResourceClaimIndexInformer(informer cache.SharedIndexInformer) ResourceClaimIndexInformer { + if informer, ok := informer.(ResourceClaimIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta1.ResourceClaim](informer) +} diff --git a/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceclaimtemplate.go b/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceclaimtemplate.go index b6aa9cb919..ff00567105 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceclaimtemplate.go +++ b/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceclaimtemplate.go @@ -34,12 +34,40 @@ import ( ) // ResourceClaimTemplateInformer provides access to a shared informer and lister for -// ResourceClaimTemplates. +// ResourceClaimTemplates. Prefer using the type-safe variant (see [TypedResourceClaimTemplateInformer]). type ResourceClaimTemplateInformer interface { Informer() cache.SharedIndexInformer Lister() resourcev1beta1.ResourceClaimTemplateLister } +// TypedResourceClaimTemplateInformer provides access to a shared informer and lister for +// ResourceClaimTemplates, including the type-safe TypedInformer variant. +// It is a superset of ResourceClaimTemplateInformer. +type TypedResourceClaimTemplateInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ResourceClaimTemplateIndexInformer + Lister() resourcev1beta1.ResourceClaimTemplateLister +} + +// ResourceClaimTemplateIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ResourceClaimTemplateIndexInformer cache.TypedSharedIndexInformer[*apiresourcev1beta1.ResourceClaimTemplate] + +// ResourceClaimTemplateHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ResourceClaimTemplate. +type ResourceClaimTemplateHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiresourcev1beta1.ResourceClaimTemplate] + +// ResourceClaimTemplateDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ResourceClaimTemplate. +type ResourceClaimTemplateDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiresourcev1beta1.ResourceClaimTemplate] + +// ResourceClaimTemplateFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ResourceClaimTemplate. +type ResourceClaimTemplateFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiresourcev1beta1.ResourceClaimTemplate] + +// ResourceClaimTemplateIndexers is a specialization of [cache.TypedIndexers] for ResourceClaimTemplate. +type ResourceClaimTemplateIndexers = cache.TypedIndexers[*apiresourcev1beta1.ResourceClaimTemplate] + +// DeletedResourceClaimTemplate is a specialization of [cache.DeletedObject] for ResourceClaimTemplate. +type DeletedResourceClaimTemplate = cache.DeletedObject[*apiresourcev1beta1.ResourceClaimTemplate] + type resourceClaimTemplateInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type resourceClaimTemplateInformer struct { // NewResourceClaimTemplateInformer constructs a new informer for ResourceClaimTemplate type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceClaimTemplateInformer]). func NewResourceClaimTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewResourceClaimTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedResourceClaimTemplateInformer constructs a new informer for ResourceClaimTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceClaimTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ResourceClaimTemplateIndexers) ResourceClaimTemplateIndexInformer { + return NewTypedResourceClaimTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredResourceClaimTemplateInformer constructs a new informer for ResourceClaimTemplate type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredResourceClaimTemplateInformer]). func NewFilteredResourceClaimTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewResourceClaimTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedResourceClaimTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredResourceClaimTemplateInformer constructs a new informer for ResourceClaimTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredResourceClaimTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ResourceClaimTemplateIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ResourceClaimTemplateIndexInformer { + return NewTypedResourceClaimTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewResourceClaimTemplateInformerWithOptions constructs a new informer for ResourceClaimTemplate type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceClaimTemplateInformerWithOptions]). func NewResourceClaimTemplateInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedResourceClaimTemplateInformerWithOptions(client, namespace, options) +} + +// NewTypedResourceClaimTemplateInformerWithOptions constructs a new informer for ResourceClaimTemplate type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceClaimTemplateInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) ResourceClaimTemplateIndexInformer { gvr := schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1beta1", Resource: "resourceclaimtemplates"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta1.ResourceClaimTemplate](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewResourceClaimTemplateInformerWithOptions(client kubernetes.Interface, na Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *resourceClaimTemplateInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewResourceClaimTemplateInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedResourceClaimTemplateInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *resourceClaimTemplateInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiresourcev1beta1.ResourceClaimTemplate{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *resourceClaimTemplateInformer) TypedInformer() ResourceClaimTemplateIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta1.ResourceClaimTemplate](f.factory.InformerFor(&apiresourcev1beta1.ResourceClaimTemplate{}, f.defaultInformer)) } func (f *resourceClaimTemplateInformer) Lister() resourcev1beta1.ResourceClaimTemplateLister { return resourcev1beta1.NewResourceClaimTemplateLister(f.Informer().GetIndexer()) } + +// ToTypedResourceClaimTemplateInformer converts an untyped informer into a TypedResourceClaimTemplateInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceClaimTemplate. If that is not the case, calling type-safe methods of the returned +// TypedResourceClaimTemplateInformer leads to runtime panics. A safer alternative is to pass +// around a TypedResourceClaimTemplateInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedResourceClaimTemplateInformer(informer ResourceClaimTemplateInformer) TypedResourceClaimTemplateInformer { + if informer, ok := informer.(TypedResourceClaimTemplateInformer); ok { + return informer + } + return &resourceClaimTemplateTypedInformerAdapter{informer} +} + +type resourceClaimTemplateTypedInformerAdapter struct { + ResourceClaimTemplateInformer +} + +func (a *resourceClaimTemplateTypedInformerAdapter) TypedInformer() ResourceClaimTemplateIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta1.ResourceClaimTemplate](a.Informer()) +} + +// ToResourceClaimTemplateIndexInformer converts an untyped informer into a ResourceClaimTemplateIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceClaimTemplate. If that is not the case, calling type-safe methods of the returned +// ResourceClaimTemplateIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ResourceClaimTemplateIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToResourceClaimTemplateIndexInformer(informer cache.SharedIndexInformer) ResourceClaimTemplateIndexInformer { + if informer, ok := informer.(ResourceClaimTemplateIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta1.ResourceClaimTemplate](informer) +} diff --git a/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceslice.go b/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceslice.go index 39e971aec2..72cc3062b1 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceslice.go +++ b/vendor/k8s.io/client-go/informers/resource/v1beta1/resourceslice.go @@ -34,12 +34,40 @@ import ( ) // ResourceSliceInformer provides access to a shared informer and lister for -// ResourceSlices. +// ResourceSlices. Prefer using the type-safe variant (see [TypedResourceSliceInformer]). type ResourceSliceInformer interface { Informer() cache.SharedIndexInformer Lister() resourcev1beta1.ResourceSliceLister } +// TypedResourceSliceInformer provides access to a shared informer and lister for +// ResourceSlices, including the type-safe TypedInformer variant. +// It is a superset of ResourceSliceInformer. +type TypedResourceSliceInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ResourceSliceIndexInformer + Lister() resourcev1beta1.ResourceSliceLister +} + +// ResourceSliceIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ResourceSliceIndexInformer cache.TypedSharedIndexInformer[*apiresourcev1beta1.ResourceSlice] + +// ResourceSliceHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ResourceSlice. +type ResourceSliceHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiresourcev1beta1.ResourceSlice] + +// ResourceSliceDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ResourceSlice. +type ResourceSliceDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiresourcev1beta1.ResourceSlice] + +// ResourceSliceFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ResourceSlice. +type ResourceSliceFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiresourcev1beta1.ResourceSlice] + +// ResourceSliceIndexers is a specialization of [cache.TypedIndexers] for ResourceSlice. +type ResourceSliceIndexers = cache.TypedIndexers[*apiresourcev1beta1.ResourceSlice] + +// DeletedResourceSlice is a specialization of [cache.DeletedObject] for ResourceSlice. +type DeletedResourceSlice = cache.DeletedObject[*apiresourcev1beta1.ResourceSlice] + type resourceSliceInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type resourceSliceInformer struct { // NewResourceSliceInformer constructs a new informer for ResourceSlice type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceSliceInformer]). func NewResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedResourceSliceInformer constructs a new informer for ResourceSlice type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ResourceSliceIndexers) ResourceSliceIndexInformer { + return NewTypedResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredResourceSliceInformer constructs a new informer for ResourceSlice type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredResourceSliceInformer]). func NewFilteredResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredResourceSliceInformer constructs a new informer for ResourceSlice type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ResourceSliceIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ResourceSliceIndexInformer { + return NewTypedResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewResourceSliceInformerWithOptions constructs a new informer for ResourceSlice type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceSliceInformerWithOptions]). func NewResourceSliceInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedResourceSliceInformerWithOptions(client, options) +} + +// NewTypedResourceSliceInformerWithOptions constructs a new informer for ResourceSlice type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceSliceInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ResourceSliceIndexInformer { gvr := schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1beta1", Resource: "resourceslices"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta1.ResourceSlice](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewResourceSliceInformerWithOptions(client kubernetes.Interface, options in Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *resourceSliceInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *resourceSliceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiresourcev1beta1.ResourceSlice{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *resourceSliceInformer) TypedInformer() ResourceSliceIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta1.ResourceSlice](f.factory.InformerFor(&apiresourcev1beta1.ResourceSlice{}, f.defaultInformer)) } func (f *resourceSliceInformer) Lister() resourcev1beta1.ResourceSliceLister { return resourcev1beta1.NewResourceSliceLister(f.Informer().GetIndexer()) } + +// ToTypedResourceSliceInformer converts an untyped informer into a TypedResourceSliceInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceSlice. If that is not the case, calling type-safe methods of the returned +// TypedResourceSliceInformer leads to runtime panics. A safer alternative is to pass +// around a TypedResourceSliceInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedResourceSliceInformer(informer ResourceSliceInformer) TypedResourceSliceInformer { + if informer, ok := informer.(TypedResourceSliceInformer); ok { + return informer + } + return &resourceSliceTypedInformerAdapter{informer} +} + +type resourceSliceTypedInformerAdapter struct { + ResourceSliceInformer +} + +func (a *resourceSliceTypedInformerAdapter) TypedInformer() ResourceSliceIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta1.ResourceSlice](a.Informer()) +} + +// ToResourceSliceIndexInformer converts an untyped informer into a ResourceSliceIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceSlice. If that is not the case, calling type-safe methods of the returned +// ResourceSliceIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ResourceSliceIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToResourceSliceIndexInformer(informer cache.SharedIndexInformer) ResourceSliceIndexInformer { + if informer, ok := informer.(ResourceSliceIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta1.ResourceSlice](informer) +} diff --git a/vendor/k8s.io/client-go/informers/resource/v1beta2/deviceclass.go b/vendor/k8s.io/client-go/informers/resource/v1beta2/deviceclass.go index d98b4d658e..7108cba10a 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1beta2/deviceclass.go +++ b/vendor/k8s.io/client-go/informers/resource/v1beta2/deviceclass.go @@ -34,12 +34,40 @@ import ( ) // DeviceClassInformer provides access to a shared informer and lister for -// DeviceClasses. +// DeviceClasses. Prefer using the type-safe variant (see [TypedDeviceClassInformer]). type DeviceClassInformer interface { Informer() cache.SharedIndexInformer Lister() resourcev1beta2.DeviceClassLister } +// TypedDeviceClassInformer provides access to a shared informer and lister for +// DeviceClasses, including the type-safe TypedInformer variant. +// It is a superset of DeviceClassInformer. +type TypedDeviceClassInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() DeviceClassIndexInformer + Lister() resourcev1beta2.DeviceClassLister +} + +// DeviceClassIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type DeviceClassIndexInformer cache.TypedSharedIndexInformer[*apiresourcev1beta2.DeviceClass] + +// DeviceClassHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for DeviceClass. +type DeviceClassHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiresourcev1beta2.DeviceClass] + +// DeviceClassDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for DeviceClass. +type DeviceClassDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiresourcev1beta2.DeviceClass] + +// DeviceClassFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for DeviceClass. +type DeviceClassFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiresourcev1beta2.DeviceClass] + +// DeviceClassIndexers is a specialization of [cache.TypedIndexers] for DeviceClass. +type DeviceClassIndexers = cache.TypedIndexers[*apiresourcev1beta2.DeviceClass] + +// DeletedDeviceClass is a specialization of [cache.DeletedObject] for DeviceClass. +type DeletedDeviceClass = cache.DeletedObject[*apiresourcev1beta2.DeviceClass] + type deviceClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type deviceClassInformer struct { // NewDeviceClassInformer constructs a new informer for DeviceClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeviceClassInformer]). func NewDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedDeviceClassInformer constructs a new informer for DeviceClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers DeviceClassIndexers) DeviceClassIndexInformer { + return NewTypedDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredDeviceClassInformer constructs a new informer for DeviceClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredDeviceClassInformer]). func NewFilteredDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredDeviceClassInformer constructs a new informer for DeviceClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers DeviceClassIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) DeviceClassIndexInformer { + return NewTypedDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewDeviceClassInformerWithOptions constructs a new informer for DeviceClass type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeviceClassInformerWithOptions]). func NewDeviceClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedDeviceClassInformerWithOptions(client, options) +} + +// NewTypedDeviceClassInformerWithOptions constructs a new informer for DeviceClass type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeviceClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) DeviceClassIndexInformer { gvr := schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1beta2", Resource: "deviceclasss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.DeviceClass](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewDeviceClassInformerWithOptions(client kubernetes.Interface, options inte Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *deviceClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedDeviceClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *deviceClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiresourcev1beta2.DeviceClass{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *deviceClassInformer) TypedInformer() DeviceClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.DeviceClass](f.factory.InformerFor(&apiresourcev1beta2.DeviceClass{}, f.defaultInformer)) } func (f *deviceClassInformer) Lister() resourcev1beta2.DeviceClassLister { return resourcev1beta2.NewDeviceClassLister(f.Informer().GetIndexer()) } + +// ToTypedDeviceClassInformer converts an untyped informer into a TypedDeviceClassInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *DeviceClass. If that is not the case, calling type-safe methods of the returned +// TypedDeviceClassInformer leads to runtime panics. A safer alternative is to pass +// around a TypedDeviceClassInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedDeviceClassInformer(informer DeviceClassInformer) TypedDeviceClassInformer { + if informer, ok := informer.(TypedDeviceClassInformer); ok { + return informer + } + return &deviceClassTypedInformerAdapter{informer} +} + +type deviceClassTypedInformerAdapter struct { + DeviceClassInformer +} + +func (a *deviceClassTypedInformerAdapter) TypedInformer() DeviceClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.DeviceClass](a.Informer()) +} + +// ToDeviceClassIndexInformer converts an untyped informer into a DeviceClassIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *DeviceClass. If that is not the case, calling type-safe methods of the returned +// DeviceClassIndexInformer leads to runtime panics. A safer alternative is to pass +// around a DeviceClassIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToDeviceClassIndexInformer(informer cache.SharedIndexInformer) DeviceClassIndexInformer { + if informer, ok := informer.(DeviceClassIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.DeviceClass](informer) +} diff --git a/vendor/k8s.io/client-go/informers/resource/v1beta2/devicetaintrule.go b/vendor/k8s.io/client-go/informers/resource/v1beta2/devicetaintrule.go index 328a9c3939..7bc04a161f 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1beta2/devicetaintrule.go +++ b/vendor/k8s.io/client-go/informers/resource/v1beta2/devicetaintrule.go @@ -34,12 +34,40 @@ import ( ) // DeviceTaintRuleInformer provides access to a shared informer and lister for -// DeviceTaintRules. +// DeviceTaintRules. Prefer using the type-safe variant (see [TypedDeviceTaintRuleInformer]). type DeviceTaintRuleInformer interface { Informer() cache.SharedIndexInformer Lister() resourcev1beta2.DeviceTaintRuleLister } +// TypedDeviceTaintRuleInformer provides access to a shared informer and lister for +// DeviceTaintRules, including the type-safe TypedInformer variant. +// It is a superset of DeviceTaintRuleInformer. +type TypedDeviceTaintRuleInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() DeviceTaintRuleIndexInformer + Lister() resourcev1beta2.DeviceTaintRuleLister +} + +// DeviceTaintRuleIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type DeviceTaintRuleIndexInformer cache.TypedSharedIndexInformer[*apiresourcev1beta2.DeviceTaintRule] + +// DeviceTaintRuleHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for DeviceTaintRule. +type DeviceTaintRuleHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiresourcev1beta2.DeviceTaintRule] + +// DeviceTaintRuleDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for DeviceTaintRule. +type DeviceTaintRuleDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiresourcev1beta2.DeviceTaintRule] + +// DeviceTaintRuleFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for DeviceTaintRule. +type DeviceTaintRuleFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiresourcev1beta2.DeviceTaintRule] + +// DeviceTaintRuleIndexers is a specialization of [cache.TypedIndexers] for DeviceTaintRule. +type DeviceTaintRuleIndexers = cache.TypedIndexers[*apiresourcev1beta2.DeviceTaintRule] + +// DeletedDeviceTaintRule is a specialization of [cache.DeletedObject] for DeviceTaintRule. +type DeletedDeviceTaintRule = cache.DeletedObject[*apiresourcev1beta2.DeviceTaintRule] + type deviceTaintRuleInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type deviceTaintRuleInformer struct { // NewDeviceTaintRuleInformer constructs a new informer for DeviceTaintRule type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeviceTaintRuleInformer]). func NewDeviceTaintRuleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedDeviceTaintRuleInformer constructs a new informer for DeviceTaintRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeviceTaintRuleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers DeviceTaintRuleIndexers) DeviceTaintRuleIndexInformer { + return NewTypedDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredDeviceTaintRuleInformer constructs a new informer for DeviceTaintRule type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredDeviceTaintRuleInformer]). func NewFilteredDeviceTaintRuleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredDeviceTaintRuleInformer constructs a new informer for DeviceTaintRule type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredDeviceTaintRuleInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers DeviceTaintRuleIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) DeviceTaintRuleIndexInformer { + return NewTypedDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewDeviceTaintRuleInformerWithOptions constructs a new informer for DeviceTaintRule type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDeviceTaintRuleInformerWithOptions]). func NewDeviceTaintRuleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedDeviceTaintRuleInformerWithOptions(client, options) +} + +// NewTypedDeviceTaintRuleInformerWithOptions constructs a new informer for DeviceTaintRule type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDeviceTaintRuleInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) DeviceTaintRuleIndexInformer { gvr := schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1beta2", Resource: "devicetaintrules"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.DeviceTaintRule](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewDeviceTaintRuleInformerWithOptions(client kubernetes.Interface, options Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *deviceTaintRuleInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedDeviceTaintRuleInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *deviceTaintRuleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiresourcev1beta2.DeviceTaintRule{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *deviceTaintRuleInformer) TypedInformer() DeviceTaintRuleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.DeviceTaintRule](f.factory.InformerFor(&apiresourcev1beta2.DeviceTaintRule{}, f.defaultInformer)) } func (f *deviceTaintRuleInformer) Lister() resourcev1beta2.DeviceTaintRuleLister { return resourcev1beta2.NewDeviceTaintRuleLister(f.Informer().GetIndexer()) } + +// ToTypedDeviceTaintRuleInformer converts an untyped informer into a TypedDeviceTaintRuleInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *DeviceTaintRule. If that is not the case, calling type-safe methods of the returned +// TypedDeviceTaintRuleInformer leads to runtime panics. A safer alternative is to pass +// around a TypedDeviceTaintRuleInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedDeviceTaintRuleInformer(informer DeviceTaintRuleInformer) TypedDeviceTaintRuleInformer { + if informer, ok := informer.(TypedDeviceTaintRuleInformer); ok { + return informer + } + return &deviceTaintRuleTypedInformerAdapter{informer} +} + +type deviceTaintRuleTypedInformerAdapter struct { + DeviceTaintRuleInformer +} + +func (a *deviceTaintRuleTypedInformerAdapter) TypedInformer() DeviceTaintRuleIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.DeviceTaintRule](a.Informer()) +} + +// ToDeviceTaintRuleIndexInformer converts an untyped informer into a DeviceTaintRuleIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *DeviceTaintRule. If that is not the case, calling type-safe methods of the returned +// DeviceTaintRuleIndexInformer leads to runtime panics. A safer alternative is to pass +// around a DeviceTaintRuleIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToDeviceTaintRuleIndexInformer(informer cache.SharedIndexInformer) DeviceTaintRuleIndexInformer { + if informer, ok := informer.(DeviceTaintRuleIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.DeviceTaintRule](informer) +} diff --git a/vendor/k8s.io/client-go/informers/resource/v1beta2/interface.go b/vendor/k8s.io/client-go/informers/resource/v1beta2/interface.go index a05e518e2e..29ac4b38f1 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1beta2/interface.go +++ b/vendor/k8s.io/client-go/informers/resource/v1beta2/interface.go @@ -25,15 +25,15 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // DeviceClasses returns a DeviceClassInformer. - DeviceClasses() DeviceClassInformer + DeviceClasses() TypedDeviceClassInformer // DeviceTaintRules returns a DeviceTaintRuleInformer. - DeviceTaintRules() DeviceTaintRuleInformer + DeviceTaintRules() TypedDeviceTaintRuleInformer // ResourceClaims returns a ResourceClaimInformer. - ResourceClaims() ResourceClaimInformer + ResourceClaims() TypedResourceClaimInformer // ResourceClaimTemplates returns a ResourceClaimTemplateInformer. - ResourceClaimTemplates() ResourceClaimTemplateInformer + ResourceClaimTemplates() TypedResourceClaimTemplateInformer // ResourceSlices returns a ResourceSliceInformer. - ResourceSlices() ResourceSliceInformer + ResourceSlices() TypedResourceSliceInformer } type version struct { @@ -47,27 +47,27 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// DeviceClasses returns a DeviceClassInformer. -func (v *version) DeviceClasses() DeviceClassInformer { +// DeviceClasses returns a TypedDeviceClassInformer. +func (v *version) DeviceClasses() TypedDeviceClassInformer { return &deviceClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// DeviceTaintRules returns a DeviceTaintRuleInformer. -func (v *version) DeviceTaintRules() DeviceTaintRuleInformer { +// DeviceTaintRules returns a TypedDeviceTaintRuleInformer. +func (v *version) DeviceTaintRules() TypedDeviceTaintRuleInformer { return &deviceTaintRuleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// ResourceClaims returns a ResourceClaimInformer. -func (v *version) ResourceClaims() ResourceClaimInformer { +// ResourceClaims returns a TypedResourceClaimInformer. +func (v *version) ResourceClaims() TypedResourceClaimInformer { return &resourceClaimInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ResourceClaimTemplates returns a ResourceClaimTemplateInformer. -func (v *version) ResourceClaimTemplates() ResourceClaimTemplateInformer { +// ResourceClaimTemplates returns a TypedResourceClaimTemplateInformer. +func (v *version) ResourceClaimTemplates() TypedResourceClaimTemplateInformer { return &resourceClaimTemplateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ResourceSlices returns a ResourceSliceInformer. -func (v *version) ResourceSlices() ResourceSliceInformer { +// ResourceSlices returns a TypedResourceSliceInformer. +func (v *version) ResourceSlices() TypedResourceSliceInformer { return &resourceSliceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceclaim.go b/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceclaim.go index 61dc6db17d..afea5d0d94 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceclaim.go +++ b/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceclaim.go @@ -34,12 +34,40 @@ import ( ) // ResourceClaimInformer provides access to a shared informer and lister for -// ResourceClaims. +// ResourceClaims. Prefer using the type-safe variant (see [TypedResourceClaimInformer]). type ResourceClaimInformer interface { Informer() cache.SharedIndexInformer Lister() resourcev1beta2.ResourceClaimLister } +// TypedResourceClaimInformer provides access to a shared informer and lister for +// ResourceClaims, including the type-safe TypedInformer variant. +// It is a superset of ResourceClaimInformer. +type TypedResourceClaimInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ResourceClaimIndexInformer + Lister() resourcev1beta2.ResourceClaimLister +} + +// ResourceClaimIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ResourceClaimIndexInformer cache.TypedSharedIndexInformer[*apiresourcev1beta2.ResourceClaim] + +// ResourceClaimHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ResourceClaim. +type ResourceClaimHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiresourcev1beta2.ResourceClaim] + +// ResourceClaimDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ResourceClaim. +type ResourceClaimDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiresourcev1beta2.ResourceClaim] + +// ResourceClaimFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ResourceClaim. +type ResourceClaimFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiresourcev1beta2.ResourceClaim] + +// ResourceClaimIndexers is a specialization of [cache.TypedIndexers] for ResourceClaim. +type ResourceClaimIndexers = cache.TypedIndexers[*apiresourcev1beta2.ResourceClaim] + +// DeletedResourceClaim is a specialization of [cache.DeletedObject] for ResourceClaim. +type DeletedResourceClaim = cache.DeletedObject[*apiresourcev1beta2.ResourceClaim] + type resourceClaimInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type resourceClaimInformer struct { // NewResourceClaimInformer constructs a new informer for ResourceClaim type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceClaimInformer]). func NewResourceClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewResourceClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedResourceClaimInformer constructs a new informer for ResourceClaim type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ResourceClaimIndexers) ResourceClaimIndexInformer { + return NewTypedResourceClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredResourceClaimInformer constructs a new informer for ResourceClaim type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredResourceClaimInformer]). func NewFilteredResourceClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewResourceClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedResourceClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredResourceClaimInformer constructs a new informer for ResourceClaim type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredResourceClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ResourceClaimIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ResourceClaimIndexInformer { + return NewTypedResourceClaimInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewResourceClaimInformerWithOptions constructs a new informer for ResourceClaim type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceClaimInformerWithOptions]). func NewResourceClaimInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedResourceClaimInformerWithOptions(client, namespace, options) +} + +// NewTypedResourceClaimInformerWithOptions constructs a new informer for ResourceClaim type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceClaimInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) ResourceClaimIndexInformer { gvr := schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1beta2", Resource: "resourceclaims"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.ResourceClaim](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewResourceClaimInformerWithOptions(client kubernetes.Interface, namespace Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *resourceClaimInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewResourceClaimInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedResourceClaimInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *resourceClaimInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiresourcev1beta2.ResourceClaim{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *resourceClaimInformer) TypedInformer() ResourceClaimIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.ResourceClaim](f.factory.InformerFor(&apiresourcev1beta2.ResourceClaim{}, f.defaultInformer)) } func (f *resourceClaimInformer) Lister() resourcev1beta2.ResourceClaimLister { return resourcev1beta2.NewResourceClaimLister(f.Informer().GetIndexer()) } + +// ToTypedResourceClaimInformer converts an untyped informer into a TypedResourceClaimInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceClaim. If that is not the case, calling type-safe methods of the returned +// TypedResourceClaimInformer leads to runtime panics. A safer alternative is to pass +// around a TypedResourceClaimInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedResourceClaimInformer(informer ResourceClaimInformer) TypedResourceClaimInformer { + if informer, ok := informer.(TypedResourceClaimInformer); ok { + return informer + } + return &resourceClaimTypedInformerAdapter{informer} +} + +type resourceClaimTypedInformerAdapter struct { + ResourceClaimInformer +} + +func (a *resourceClaimTypedInformerAdapter) TypedInformer() ResourceClaimIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.ResourceClaim](a.Informer()) +} + +// ToResourceClaimIndexInformer converts an untyped informer into a ResourceClaimIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceClaim. If that is not the case, calling type-safe methods of the returned +// ResourceClaimIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ResourceClaimIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToResourceClaimIndexInformer(informer cache.SharedIndexInformer) ResourceClaimIndexInformer { + if informer, ok := informer.(ResourceClaimIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.ResourceClaim](informer) +} diff --git a/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceclaimtemplate.go b/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceclaimtemplate.go index ee22977a39..c7ee33df62 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceclaimtemplate.go +++ b/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceclaimtemplate.go @@ -34,12 +34,40 @@ import ( ) // ResourceClaimTemplateInformer provides access to a shared informer and lister for -// ResourceClaimTemplates. +// ResourceClaimTemplates. Prefer using the type-safe variant (see [TypedResourceClaimTemplateInformer]). type ResourceClaimTemplateInformer interface { Informer() cache.SharedIndexInformer Lister() resourcev1beta2.ResourceClaimTemplateLister } +// TypedResourceClaimTemplateInformer provides access to a shared informer and lister for +// ResourceClaimTemplates, including the type-safe TypedInformer variant. +// It is a superset of ResourceClaimTemplateInformer. +type TypedResourceClaimTemplateInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ResourceClaimTemplateIndexInformer + Lister() resourcev1beta2.ResourceClaimTemplateLister +} + +// ResourceClaimTemplateIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ResourceClaimTemplateIndexInformer cache.TypedSharedIndexInformer[*apiresourcev1beta2.ResourceClaimTemplate] + +// ResourceClaimTemplateHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ResourceClaimTemplate. +type ResourceClaimTemplateHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiresourcev1beta2.ResourceClaimTemplate] + +// ResourceClaimTemplateDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ResourceClaimTemplate. +type ResourceClaimTemplateDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiresourcev1beta2.ResourceClaimTemplate] + +// ResourceClaimTemplateFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ResourceClaimTemplate. +type ResourceClaimTemplateFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiresourcev1beta2.ResourceClaimTemplate] + +// ResourceClaimTemplateIndexers is a specialization of [cache.TypedIndexers] for ResourceClaimTemplate. +type ResourceClaimTemplateIndexers = cache.TypedIndexers[*apiresourcev1beta2.ResourceClaimTemplate] + +// DeletedResourceClaimTemplate is a specialization of [cache.DeletedObject] for ResourceClaimTemplate. +type DeletedResourceClaimTemplate = cache.DeletedObject[*apiresourcev1beta2.ResourceClaimTemplate] + type resourceClaimTemplateInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type resourceClaimTemplateInformer struct { // NewResourceClaimTemplateInformer constructs a new informer for ResourceClaimTemplate type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceClaimTemplateInformer]). func NewResourceClaimTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewResourceClaimTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedResourceClaimTemplateInformer constructs a new informer for ResourceClaimTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceClaimTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ResourceClaimTemplateIndexers) ResourceClaimTemplateIndexInformer { + return NewTypedResourceClaimTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredResourceClaimTemplateInformer constructs a new informer for ResourceClaimTemplate type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredResourceClaimTemplateInformer]). func NewFilteredResourceClaimTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewResourceClaimTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedResourceClaimTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredResourceClaimTemplateInformer constructs a new informer for ResourceClaimTemplate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredResourceClaimTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers ResourceClaimTemplateIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ResourceClaimTemplateIndexInformer { + return NewTypedResourceClaimTemplateInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewResourceClaimTemplateInformerWithOptions constructs a new informer for ResourceClaimTemplate type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceClaimTemplateInformerWithOptions]). func NewResourceClaimTemplateInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedResourceClaimTemplateInformerWithOptions(client, namespace, options) +} + +// NewTypedResourceClaimTemplateInformerWithOptions constructs a new informer for ResourceClaimTemplate type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceClaimTemplateInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) ResourceClaimTemplateIndexInformer { gvr := schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1beta2", Resource: "resourceclaimtemplates"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.ResourceClaimTemplate](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewResourceClaimTemplateInformerWithOptions(client kubernetes.Interface, na Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *resourceClaimTemplateInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewResourceClaimTemplateInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedResourceClaimTemplateInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *resourceClaimTemplateInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiresourcev1beta2.ResourceClaimTemplate{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *resourceClaimTemplateInformer) TypedInformer() ResourceClaimTemplateIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.ResourceClaimTemplate](f.factory.InformerFor(&apiresourcev1beta2.ResourceClaimTemplate{}, f.defaultInformer)) } func (f *resourceClaimTemplateInformer) Lister() resourcev1beta2.ResourceClaimTemplateLister { return resourcev1beta2.NewResourceClaimTemplateLister(f.Informer().GetIndexer()) } + +// ToTypedResourceClaimTemplateInformer converts an untyped informer into a TypedResourceClaimTemplateInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceClaimTemplate. If that is not the case, calling type-safe methods of the returned +// TypedResourceClaimTemplateInformer leads to runtime panics. A safer alternative is to pass +// around a TypedResourceClaimTemplateInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedResourceClaimTemplateInformer(informer ResourceClaimTemplateInformer) TypedResourceClaimTemplateInformer { + if informer, ok := informer.(TypedResourceClaimTemplateInformer); ok { + return informer + } + return &resourceClaimTemplateTypedInformerAdapter{informer} +} + +type resourceClaimTemplateTypedInformerAdapter struct { + ResourceClaimTemplateInformer +} + +func (a *resourceClaimTemplateTypedInformerAdapter) TypedInformer() ResourceClaimTemplateIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.ResourceClaimTemplate](a.Informer()) +} + +// ToResourceClaimTemplateIndexInformer converts an untyped informer into a ResourceClaimTemplateIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceClaimTemplate. If that is not the case, calling type-safe methods of the returned +// ResourceClaimTemplateIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ResourceClaimTemplateIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToResourceClaimTemplateIndexInformer(informer cache.SharedIndexInformer) ResourceClaimTemplateIndexInformer { + if informer, ok := informer.(ResourceClaimTemplateIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.ResourceClaimTemplate](informer) +} diff --git a/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceslice.go b/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceslice.go index 7a8027886e..248ad44786 100644 --- a/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceslice.go +++ b/vendor/k8s.io/client-go/informers/resource/v1beta2/resourceslice.go @@ -34,12 +34,40 @@ import ( ) // ResourceSliceInformer provides access to a shared informer and lister for -// ResourceSlices. +// ResourceSlices. Prefer using the type-safe variant (see [TypedResourceSliceInformer]). type ResourceSliceInformer interface { Informer() cache.SharedIndexInformer Lister() resourcev1beta2.ResourceSliceLister } +// TypedResourceSliceInformer provides access to a shared informer and lister for +// ResourceSlices, including the type-safe TypedInformer variant. +// It is a superset of ResourceSliceInformer. +type TypedResourceSliceInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ResourceSliceIndexInformer + Lister() resourcev1beta2.ResourceSliceLister +} + +// ResourceSliceIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ResourceSliceIndexInformer cache.TypedSharedIndexInformer[*apiresourcev1beta2.ResourceSlice] + +// ResourceSliceHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ResourceSlice. +type ResourceSliceHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apiresourcev1beta2.ResourceSlice] + +// ResourceSliceDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ResourceSlice. +type ResourceSliceDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apiresourcev1beta2.ResourceSlice] + +// ResourceSliceFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ResourceSlice. +type ResourceSliceFilteringHandler = cache.TypedFilteringResourceEventHandler[*apiresourcev1beta2.ResourceSlice] + +// ResourceSliceIndexers is a specialization of [cache.TypedIndexers] for ResourceSlice. +type ResourceSliceIndexers = cache.TypedIndexers[*apiresourcev1beta2.ResourceSlice] + +// DeletedResourceSlice is a specialization of [cache.DeletedObject] for ResourceSlice. +type DeletedResourceSlice = cache.DeletedObject[*apiresourcev1beta2.ResourceSlice] + type resourceSliceInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type resourceSliceInformer struct { // NewResourceSliceInformer constructs a new informer for ResourceSlice type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceSliceInformer]). func NewResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedResourceSliceInformer constructs a new informer for ResourceSlice type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ResourceSliceIndexers) ResourceSliceIndexInformer { + return NewTypedResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredResourceSliceInformer constructs a new informer for ResourceSlice type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredResourceSliceInformer]). func NewFilteredResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredResourceSliceInformer constructs a new informer for ResourceSlice type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers ResourceSliceIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ResourceSliceIndexInformer { + return NewTypedResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewResourceSliceInformerWithOptions constructs a new informer for ResourceSlice type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedResourceSliceInformerWithOptions]). func NewResourceSliceInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedResourceSliceInformerWithOptions(client, options) +} + +// NewTypedResourceSliceInformerWithOptions constructs a new informer for ResourceSlice type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedResourceSliceInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) ResourceSliceIndexInformer { gvr := schema.GroupVersionResource{Group: "resource.k8s.io", Version: "v1beta2", Resource: "resourceslices"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.ResourceSlice](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewResourceSliceInformerWithOptions(client kubernetes.Interface, options in Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *resourceSliceInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedResourceSliceInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *resourceSliceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiresourcev1beta2.ResourceSlice{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *resourceSliceInformer) TypedInformer() ResourceSliceIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.ResourceSlice](f.factory.InformerFor(&apiresourcev1beta2.ResourceSlice{}, f.defaultInformer)) } func (f *resourceSliceInformer) Lister() resourcev1beta2.ResourceSliceLister { return resourcev1beta2.NewResourceSliceLister(f.Informer().GetIndexer()) } + +// ToTypedResourceSliceInformer converts an untyped informer into a TypedResourceSliceInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceSlice. If that is not the case, calling type-safe methods of the returned +// TypedResourceSliceInformer leads to runtime panics. A safer alternative is to pass +// around a TypedResourceSliceInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedResourceSliceInformer(informer ResourceSliceInformer) TypedResourceSliceInformer { + if informer, ok := informer.(TypedResourceSliceInformer); ok { + return informer + } + return &resourceSliceTypedInformerAdapter{informer} +} + +type resourceSliceTypedInformerAdapter struct { + ResourceSliceInformer +} + +func (a *resourceSliceTypedInformerAdapter) TypedInformer() ResourceSliceIndexInformer { + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.ResourceSlice](a.Informer()) +} + +// ToResourceSliceIndexInformer converts an untyped informer into a ResourceSliceIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ResourceSlice. If that is not the case, calling type-safe methods of the returned +// ResourceSliceIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ResourceSliceIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToResourceSliceIndexInformer(informer cache.SharedIndexInformer) ResourceSliceIndexInformer { + if informer, ok := informer.(ResourceSliceIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apiresourcev1beta2.ResourceSlice](informer) +} diff --git a/vendor/k8s.io/client-go/informers/scheduling/interface.go b/vendor/k8s.io/client-go/informers/scheduling/interface.go index e55a8410d1..bd66d6c3ab 100644 --- a/vendor/k8s.io/client-go/informers/scheduling/interface.go +++ b/vendor/k8s.io/client-go/informers/scheduling/interface.go @@ -21,7 +21,7 @@ package scheduling import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" v1 "k8s.io/client-go/informers/scheduling/v1" - v1alpha2 "k8s.io/client-go/informers/scheduling/v1alpha2" + v1alpha3 "k8s.io/client-go/informers/scheduling/v1alpha3" v1beta1 "k8s.io/client-go/informers/scheduling/v1beta1" ) @@ -29,8 +29,8 @@ import ( type Interface interface { // V1 provides access to shared informers for resources in V1. V1() v1.Interface - // V1alpha2 provides access to shared informers for resources in V1alpha2. - V1alpha2() v1alpha2.Interface + // V1alpha3 provides access to shared informers for resources in V1alpha3. + V1alpha3() v1alpha3.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface } @@ -51,9 +51,9 @@ func (g *group) V1() v1.Interface { return v1.New(g.factory, g.namespace, g.tweakListOptions) } -// V1alpha2 returns a new v1alpha2.Interface. -func (g *group) V1alpha2() v1alpha2.Interface { - return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions) +// V1alpha3 returns a new v1alpha3.Interface. +func (g *group) V1alpha3() v1alpha3.Interface { + return v1alpha3.New(g.factory, g.namespace, g.tweakListOptions) } // V1beta1 returns a new v1beta1.Interface. diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1/interface.go b/vendor/k8s.io/client-go/informers/scheduling/v1/interface.go index fd7931f34a..fd3b20d969 100644 --- a/vendor/k8s.io/client-go/informers/scheduling/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/scheduling/v1/interface.go @@ -25,7 +25,7 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // PriorityClasses returns a PriorityClassInformer. - PriorityClasses() PriorityClassInformer + PriorityClasses() TypedPriorityClassInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// PriorityClasses returns a PriorityClassInformer. -func (v *version) PriorityClasses() PriorityClassInformer { +// PriorityClasses returns a TypedPriorityClassInformer. +func (v *version) PriorityClasses() TypedPriorityClassInformer { return &priorityClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1/priorityclass.go b/vendor/k8s.io/client-go/informers/scheduling/v1/priorityclass.go index f1d18f2a01..8b4daf5caa 100644 --- a/vendor/k8s.io/client-go/informers/scheduling/v1/priorityclass.go +++ b/vendor/k8s.io/client-go/informers/scheduling/v1/priorityclass.go @@ -34,12 +34,40 @@ import ( ) // PriorityClassInformer provides access to a shared informer and lister for -// PriorityClasses. +// PriorityClasses. Prefer using the type-safe variant (see [TypedPriorityClassInformer]). type PriorityClassInformer interface { Informer() cache.SharedIndexInformer Lister() schedulingv1.PriorityClassLister } +// TypedPriorityClassInformer provides access to a shared informer and lister for +// PriorityClasses, including the type-safe TypedInformer variant. +// It is a superset of PriorityClassInformer. +type TypedPriorityClassInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() PriorityClassIndexInformer + Lister() schedulingv1.PriorityClassLister +} + +// PriorityClassIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type PriorityClassIndexInformer cache.TypedSharedIndexInformer[*apischedulingv1.PriorityClass] + +// PriorityClassHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for PriorityClass. +type PriorityClassHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apischedulingv1.PriorityClass] + +// PriorityClassDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for PriorityClass. +type PriorityClassDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apischedulingv1.PriorityClass] + +// PriorityClassFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for PriorityClass. +type PriorityClassFilteringHandler = cache.TypedFilteringResourceEventHandler[*apischedulingv1.PriorityClass] + +// PriorityClassIndexers is a specialization of [cache.TypedIndexers] for PriorityClass. +type PriorityClassIndexers = cache.TypedIndexers[*apischedulingv1.PriorityClass] + +// DeletedPriorityClass is a specialization of [cache.DeletedObject] for PriorityClass. +type DeletedPriorityClass = cache.DeletedObject[*apischedulingv1.PriorityClass] + type priorityClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type priorityClassInformer struct { // NewPriorityClassInformer constructs a new informer for PriorityClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPriorityClassInformer]). func NewPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewPriorityClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedPriorityClassInformer constructs a new informer for PriorityClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers PriorityClassIndexers) PriorityClassIndexInformer { + return NewTypedPriorityClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredPriorityClassInformer constructs a new informer for PriorityClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredPriorityClassInformer]). func NewFilteredPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewPriorityClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedPriorityClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredPriorityClassInformer constructs a new informer for PriorityClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers PriorityClassIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) PriorityClassIndexInformer { + return NewTypedPriorityClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewPriorityClassInformerWithOptions constructs a new informer for PriorityClass type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPriorityClassInformerWithOptions]). func NewPriorityClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedPriorityClassInformerWithOptions(client, options) +} + +// NewTypedPriorityClassInformerWithOptions constructs a new informer for PriorityClass type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPriorityClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) PriorityClassIndexInformer { gvr := schema.GroupVersionResource{Group: "scheduling.k8s.io", Version: "v1", Resource: "priorityclasss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apischedulingv1.PriorityClass](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewPriorityClassInformerWithOptions(client kubernetes.Interface, options in Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *priorityClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewPriorityClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedPriorityClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *priorityClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apischedulingv1.PriorityClass{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *priorityClassInformer) TypedInformer() PriorityClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apischedulingv1.PriorityClass](f.factory.InformerFor(&apischedulingv1.PriorityClass{}, f.defaultInformer)) } func (f *priorityClassInformer) Lister() schedulingv1.PriorityClassLister { return schedulingv1.NewPriorityClassLister(f.Informer().GetIndexer()) } + +// ToTypedPriorityClassInformer converts an untyped informer into a TypedPriorityClassInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PriorityClass. If that is not the case, calling type-safe methods of the returned +// TypedPriorityClassInformer leads to runtime panics. A safer alternative is to pass +// around a TypedPriorityClassInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedPriorityClassInformer(informer PriorityClassInformer) TypedPriorityClassInformer { + if informer, ok := informer.(TypedPriorityClassInformer); ok { + return informer + } + return &priorityClassTypedInformerAdapter{informer} +} + +type priorityClassTypedInformerAdapter struct { + PriorityClassInformer +} + +func (a *priorityClassTypedInformerAdapter) TypedInformer() PriorityClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apischedulingv1.PriorityClass](a.Informer()) +} + +// ToPriorityClassIndexInformer converts an untyped informer into a PriorityClassIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PriorityClass. If that is not the case, calling type-safe methods of the returned +// PriorityClassIndexInformer leads to runtime panics. A safer alternative is to pass +// around a PriorityClassIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToPriorityClassIndexInformer(informer cache.SharedIndexInformer) PriorityClassIndexInformer { + if informer, ok := informer.(PriorityClassIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apischedulingv1.PriorityClass](informer) +} diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1alpha2/podgroup.go b/vendor/k8s.io/client-go/informers/scheduling/v1alpha2/podgroup.go deleted file mode 100644 index 5f39858c65..0000000000 --- a/vendor/k8s.io/client-go/informers/scheduling/v1alpha2/podgroup.go +++ /dev/null @@ -1,116 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - context "context" - time "time" - - apischedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - watch "k8s.io/apimachinery/pkg/watch" - internalinterfaces "k8s.io/client-go/informers/internalinterfaces" - kubernetes "k8s.io/client-go/kubernetes" - schedulingv1alpha2 "k8s.io/client-go/listers/scheduling/v1alpha2" - cache "k8s.io/client-go/tools/cache" -) - -// PodGroupInformer provides access to a shared informer and lister for -// PodGroups. -type PodGroupInformer interface { - Informer() cache.SharedIndexInformer - Lister() schedulingv1alpha2.PodGroupLister -} - -type podGroupInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewPodGroupInformer constructs a new informer for PodGroup type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewPodGroupInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewPodGroupInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) -} - -// NewFilteredPodGroupInformer constructs a new informer for PodGroup type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredPodGroupInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewPodGroupInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) -} - -// NewPodGroupInformerWithOptions constructs a new informer for PodGroup type with additional options. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewPodGroupInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { - gvr := schema.GroupVersionResource{Group: "scheduling.k8s.io", Version: "v1alpha2", Resource: "podgroups"} - identifier := options.InformerName.WithResource(gvr) - tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( - cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ - ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&opts) - } - return client.SchedulingV1alpha2().PodGroups(namespace).List(context.Background(), opts) - }, - WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&opts) - } - return client.SchedulingV1alpha2().PodGroups(namespace).Watch(context.Background(), opts) - }, - ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&opts) - } - return client.SchedulingV1alpha2().PodGroups(namespace).List(ctx, opts) - }, - WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&opts) - } - return client.SchedulingV1alpha2().PodGroups(namespace).Watch(ctx, opts) - }, - }, client), - &apischedulingv1alpha2.PodGroup{}, - cache.SharedIndexInformerOptions{ - ResyncPeriod: options.ResyncPeriod, - Indexers: options.Indexers, - Identifier: identifier, - }, - ) -} - -func (f *podGroupInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewPodGroupInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) -} - -func (f *podGroupInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apischedulingv1alpha2.PodGroup{}, f.defaultInformer) -} - -func (f *podGroupInformer) Lister() schedulingv1alpha2.PodGroupLister { - return schedulingv1alpha2.NewPodGroupLister(f.Informer().GetIndexer()) -} diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1alpha2/workload.go b/vendor/k8s.io/client-go/informers/scheduling/v1alpha2/workload.go deleted file mode 100644 index ffe2f4ece7..0000000000 --- a/vendor/k8s.io/client-go/informers/scheduling/v1alpha2/workload.go +++ /dev/null @@ -1,116 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - context "context" - time "time" - - apischedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - watch "k8s.io/apimachinery/pkg/watch" - internalinterfaces "k8s.io/client-go/informers/internalinterfaces" - kubernetes "k8s.io/client-go/kubernetes" - schedulingv1alpha2 "k8s.io/client-go/listers/scheduling/v1alpha2" - cache "k8s.io/client-go/tools/cache" -) - -// WorkloadInformer provides access to a shared informer and lister for -// Workloads. -type WorkloadInformer interface { - Informer() cache.SharedIndexInformer - Lister() schedulingv1alpha2.WorkloadLister -} - -type workloadInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewWorkloadInformer constructs a new informer for Workload type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewWorkloadInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewWorkloadInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) -} - -// NewFilteredWorkloadInformer constructs a new informer for Workload type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredWorkloadInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewWorkloadInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) -} - -// NewWorkloadInformerWithOptions constructs a new informer for Workload type with additional options. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewWorkloadInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { - gvr := schema.GroupVersionResource{Group: "scheduling.k8s.io", Version: "v1alpha2", Resource: "workloads"} - identifier := options.InformerName.WithResource(gvr) - tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( - cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ - ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&opts) - } - return client.SchedulingV1alpha2().Workloads(namespace).List(context.Background(), opts) - }, - WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&opts) - } - return client.SchedulingV1alpha2().Workloads(namespace).Watch(context.Background(), opts) - }, - ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&opts) - } - return client.SchedulingV1alpha2().Workloads(namespace).List(ctx, opts) - }, - WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&opts) - } - return client.SchedulingV1alpha2().Workloads(namespace).Watch(ctx, opts) - }, - }, client), - &apischedulingv1alpha2.Workload{}, - cache.SharedIndexInformerOptions{ - ResyncPeriod: options.ResyncPeriod, - Indexers: options.Indexers, - Identifier: identifier, - }, - ) -} - -func (f *workloadInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewWorkloadInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) -} - -func (f *workloadInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apischedulingv1alpha2.Workload{}, f.defaultInformer) -} - -func (f *workloadInformer) Lister() schedulingv1alpha2.WorkloadLister { - return schedulingv1alpha2.NewWorkloadLister(f.Informer().GetIndexer()) -} diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1alpha3/compositepodgroup.go b/vendor/k8s.io/client-go/informers/scheduling/v1alpha3/compositepodgroup.go new file mode 100644 index 0000000000..9556755dc9 --- /dev/null +++ b/vendor/k8s.io/client-go/informers/scheduling/v1alpha3/compositepodgroup.go @@ -0,0 +1,208 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + context "context" + time "time" + + apischedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + schedulingv1alpha3 "k8s.io/client-go/listers/scheduling/v1alpha3" + cache "k8s.io/client-go/tools/cache" +) + +// CompositePodGroupInformer provides access to a shared informer and lister for +// CompositePodGroups. Prefer using the type-safe variant (see [TypedCompositePodGroupInformer]). +type CompositePodGroupInformer interface { + Informer() cache.SharedIndexInformer + Lister() schedulingv1alpha3.CompositePodGroupLister +} + +// TypedCompositePodGroupInformer provides access to a shared informer and lister for +// CompositePodGroups, including the type-safe TypedInformer variant. +// It is a superset of CompositePodGroupInformer. +type TypedCompositePodGroupInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CompositePodGroupIndexInformer + Lister() schedulingv1alpha3.CompositePodGroupLister +} + +// CompositePodGroupIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CompositePodGroupIndexInformer cache.TypedSharedIndexInformer[*apischedulingv1alpha3.CompositePodGroup] + +// CompositePodGroupHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CompositePodGroup. +type CompositePodGroupHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apischedulingv1alpha3.CompositePodGroup] + +// CompositePodGroupDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CompositePodGroup. +type CompositePodGroupDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apischedulingv1alpha3.CompositePodGroup] + +// CompositePodGroupFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CompositePodGroup. +type CompositePodGroupFilteringHandler = cache.TypedFilteringResourceEventHandler[*apischedulingv1alpha3.CompositePodGroup] + +// CompositePodGroupIndexers is a specialization of [cache.TypedIndexers] for CompositePodGroup. +type CompositePodGroupIndexers = cache.TypedIndexers[*apischedulingv1alpha3.CompositePodGroup] + +// DeletedCompositePodGroup is a specialization of [cache.DeletedObject] for CompositePodGroup. +type DeletedCompositePodGroup = cache.DeletedObject[*apischedulingv1alpha3.CompositePodGroup] + +type compositePodGroupInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewCompositePodGroupInformer constructs a new informer for CompositePodGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCompositePodGroupInformer]). +func NewCompositePodGroupInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewCompositePodGroupInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewTypedCompositePodGroupInformer constructs a new informer for CompositePodGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCompositePodGroupInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers CompositePodGroupIndexers) CompositePodGroupIndexInformer { + return NewTypedCompositePodGroupInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + +// NewFilteredCompositePodGroupInformer constructs a new informer for CompositePodGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCompositePodGroupInformer]). +func NewFilteredCompositePodGroupInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewTypedCompositePodGroupInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCompositePodGroupInformer constructs a new informer for CompositePodGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredCompositePodGroupInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers CompositePodGroupIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CompositePodGroupIndexInformer { + return NewTypedCompositePodGroupInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) +} + +// NewCompositePodGroupInformerWithOptions constructs a new informer for CompositePodGroup type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCompositePodGroupInformerWithOptions]). +func NewCompositePodGroupInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCompositePodGroupInformerWithOptions(client, namespace, options) +} + +// NewTypedCompositePodGroupInformerWithOptions constructs a new informer for CompositePodGroup type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCompositePodGroupInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) CompositePodGroupIndexInformer { + gvr := schema.GroupVersionResource{Group: "scheduling.k8s.io", Version: "v1alpha3", Resource: "compositepodgroups"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewTypedSharedIndexInformer[*apischedulingv1alpha3.CompositePodGroup](cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1alpha3().CompositePodGroups(namespace).List(context.Background(), opts) + }, + WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1alpha3().CompositePodGroups(namespace).Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1alpha3().CompositePodGroups(namespace).List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1alpha3().CompositePodGroups(namespace).Watch(ctx, opts) + }, + }, client), + &apischedulingv1alpha3.CompositePodGroup{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + )) +} + +func (f *compositePodGroupInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewTypedCompositePodGroupInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *compositePodGroupInformer) Informer() cache.SharedIndexInformer { + return f.TypedInformer() +} + +func (f *compositePodGroupInformer) TypedInformer() CompositePodGroupIndexInformer { + return cache.NewTypedSharedIndexInformer[*apischedulingv1alpha3.CompositePodGroup](f.factory.InformerFor(&apischedulingv1alpha3.CompositePodGroup{}, f.defaultInformer)) +} + +func (f *compositePodGroupInformer) Lister() schedulingv1alpha3.CompositePodGroupLister { + return schedulingv1alpha3.NewCompositePodGroupLister(f.Informer().GetIndexer()) +} + +// ToTypedCompositePodGroupInformer converts an untyped informer into a TypedCompositePodGroupInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CompositePodGroup. If that is not the case, calling type-safe methods of the returned +// TypedCompositePodGroupInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCompositePodGroupInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCompositePodGroupInformer(informer CompositePodGroupInformer) TypedCompositePodGroupInformer { + if informer, ok := informer.(TypedCompositePodGroupInformer); ok { + return informer + } + return &compositePodGroupTypedInformerAdapter{informer} +} + +type compositePodGroupTypedInformerAdapter struct { + CompositePodGroupInformer +} + +func (a *compositePodGroupTypedInformerAdapter) TypedInformer() CompositePodGroupIndexInformer { + return cache.NewTypedSharedIndexInformer[*apischedulingv1alpha3.CompositePodGroup](a.Informer()) +} + +// ToCompositePodGroupIndexInformer converts an untyped informer into a CompositePodGroupIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CompositePodGroup. If that is not the case, calling type-safe methods of the returned +// CompositePodGroupIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CompositePodGroupIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCompositePodGroupIndexInformer(informer cache.SharedIndexInformer) CompositePodGroupIndexInformer { + if informer, ok := informer.(CompositePodGroupIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apischedulingv1alpha3.CompositePodGroup](informer) +} diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1alpha2/interface.go b/vendor/k8s.io/client-go/informers/scheduling/v1alpha3/interface.go similarity index 70% rename from vendor/k8s.io/client-go/informers/scheduling/v1alpha2/interface.go rename to vendor/k8s.io/client-go/informers/scheduling/v1alpha3/interface.go index 8edc498b67..1471eb3d5b 100644 --- a/vendor/k8s.io/client-go/informers/scheduling/v1alpha2/interface.go +++ b/vendor/k8s.io/client-go/informers/scheduling/v1alpha3/interface.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" @@ -24,10 +24,12 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { + // CompositePodGroups returns a CompositePodGroupInformer. + CompositePodGroups() TypedCompositePodGroupInformer // PodGroups returns a PodGroupInformer. - PodGroups() PodGroupInformer + PodGroups() TypedPodGroupInformer // Workloads returns a WorkloadInformer. - Workloads() WorkloadInformer + Workloads() TypedWorkloadInformer } type version struct { @@ -41,12 +43,17 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// PodGroups returns a PodGroupInformer. -func (v *version) PodGroups() PodGroupInformer { +// CompositePodGroups returns a TypedCompositePodGroupInformer. +func (v *version) CompositePodGroups() TypedCompositePodGroupInformer { + return &compositePodGroupInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// PodGroups returns a TypedPodGroupInformer. +func (v *version) PodGroups() TypedPodGroupInformer { return &podGroupInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Workloads returns a WorkloadInformer. -func (v *version) Workloads() WorkloadInformer { +// Workloads returns a TypedWorkloadInformer. +func (v *version) Workloads() TypedWorkloadInformer { return &workloadInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1alpha3/podgroup.go b/vendor/k8s.io/client-go/informers/scheduling/v1alpha3/podgroup.go new file mode 100644 index 0000000000..3b0c4d8315 --- /dev/null +++ b/vendor/k8s.io/client-go/informers/scheduling/v1alpha3/podgroup.go @@ -0,0 +1,208 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + context "context" + time "time" + + apischedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + schedulingv1alpha3 "k8s.io/client-go/listers/scheduling/v1alpha3" + cache "k8s.io/client-go/tools/cache" +) + +// PodGroupInformer provides access to a shared informer and lister for +// PodGroups. Prefer using the type-safe variant (see [TypedPodGroupInformer]). +type PodGroupInformer interface { + Informer() cache.SharedIndexInformer + Lister() schedulingv1alpha3.PodGroupLister +} + +// TypedPodGroupInformer provides access to a shared informer and lister for +// PodGroups, including the type-safe TypedInformer variant. +// It is a superset of PodGroupInformer. +type TypedPodGroupInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() PodGroupIndexInformer + Lister() schedulingv1alpha3.PodGroupLister +} + +// PodGroupIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type PodGroupIndexInformer cache.TypedSharedIndexInformer[*apischedulingv1alpha3.PodGroup] + +// PodGroupHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for PodGroup. +type PodGroupHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apischedulingv1alpha3.PodGroup] + +// PodGroupDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for PodGroup. +type PodGroupDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apischedulingv1alpha3.PodGroup] + +// PodGroupFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for PodGroup. +type PodGroupFilteringHandler = cache.TypedFilteringResourceEventHandler[*apischedulingv1alpha3.PodGroup] + +// PodGroupIndexers is a specialization of [cache.TypedIndexers] for PodGroup. +type PodGroupIndexers = cache.TypedIndexers[*apischedulingv1alpha3.PodGroup] + +// DeletedPodGroup is a specialization of [cache.DeletedObject] for PodGroup. +type DeletedPodGroup = cache.DeletedObject[*apischedulingv1alpha3.PodGroup] + +type podGroupInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewPodGroupInformer constructs a new informer for PodGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPodGroupInformer]). +func NewPodGroupInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewPodGroupInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewTypedPodGroupInformer constructs a new informer for PodGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPodGroupInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers PodGroupIndexers) PodGroupIndexInformer { + return NewTypedPodGroupInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + +// NewFilteredPodGroupInformer constructs a new informer for PodGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredPodGroupInformer]). +func NewFilteredPodGroupInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewTypedPodGroupInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredPodGroupInformer constructs a new informer for PodGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredPodGroupInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers PodGroupIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) PodGroupIndexInformer { + return NewTypedPodGroupInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) +} + +// NewPodGroupInformerWithOptions constructs a new informer for PodGroup type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPodGroupInformerWithOptions]). +func NewPodGroupInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedPodGroupInformerWithOptions(client, namespace, options) +} + +// NewTypedPodGroupInformerWithOptions constructs a new informer for PodGroup type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPodGroupInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) PodGroupIndexInformer { + gvr := schema.GroupVersionResource{Group: "scheduling.k8s.io", Version: "v1alpha3", Resource: "podgroups"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewTypedSharedIndexInformer[*apischedulingv1alpha3.PodGroup](cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1alpha3().PodGroups(namespace).List(context.Background(), opts) + }, + WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1alpha3().PodGroups(namespace).Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1alpha3().PodGroups(namespace).List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1alpha3().PodGroups(namespace).Watch(ctx, opts) + }, + }, client), + &apischedulingv1alpha3.PodGroup{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + )) +} + +func (f *podGroupInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewTypedPodGroupInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *podGroupInformer) Informer() cache.SharedIndexInformer { + return f.TypedInformer() +} + +func (f *podGroupInformer) TypedInformer() PodGroupIndexInformer { + return cache.NewTypedSharedIndexInformer[*apischedulingv1alpha3.PodGroup](f.factory.InformerFor(&apischedulingv1alpha3.PodGroup{}, f.defaultInformer)) +} + +func (f *podGroupInformer) Lister() schedulingv1alpha3.PodGroupLister { + return schedulingv1alpha3.NewPodGroupLister(f.Informer().GetIndexer()) +} + +// ToTypedPodGroupInformer converts an untyped informer into a TypedPodGroupInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PodGroup. If that is not the case, calling type-safe methods of the returned +// TypedPodGroupInformer leads to runtime panics. A safer alternative is to pass +// around a TypedPodGroupInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedPodGroupInformer(informer PodGroupInformer) TypedPodGroupInformer { + if informer, ok := informer.(TypedPodGroupInformer); ok { + return informer + } + return &podGroupTypedInformerAdapter{informer} +} + +type podGroupTypedInformerAdapter struct { + PodGroupInformer +} + +func (a *podGroupTypedInformerAdapter) TypedInformer() PodGroupIndexInformer { + return cache.NewTypedSharedIndexInformer[*apischedulingv1alpha3.PodGroup](a.Informer()) +} + +// ToPodGroupIndexInformer converts an untyped informer into a PodGroupIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PodGroup. If that is not the case, calling type-safe methods of the returned +// PodGroupIndexInformer leads to runtime panics. A safer alternative is to pass +// around a PodGroupIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToPodGroupIndexInformer(informer cache.SharedIndexInformer) PodGroupIndexInformer { + if informer, ok := informer.(PodGroupIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apischedulingv1alpha3.PodGroup](informer) +} diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1alpha3/workload.go b/vendor/k8s.io/client-go/informers/scheduling/v1alpha3/workload.go new file mode 100644 index 0000000000..9917620161 --- /dev/null +++ b/vendor/k8s.io/client-go/informers/scheduling/v1alpha3/workload.go @@ -0,0 +1,208 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + context "context" + time "time" + + apischedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + schedulingv1alpha3 "k8s.io/client-go/listers/scheduling/v1alpha3" + cache "k8s.io/client-go/tools/cache" +) + +// WorkloadInformer provides access to a shared informer and lister for +// Workloads. Prefer using the type-safe variant (see [TypedWorkloadInformer]). +type WorkloadInformer interface { + Informer() cache.SharedIndexInformer + Lister() schedulingv1alpha3.WorkloadLister +} + +// TypedWorkloadInformer provides access to a shared informer and lister for +// Workloads, including the type-safe TypedInformer variant. +// It is a superset of WorkloadInformer. +type TypedWorkloadInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() WorkloadIndexInformer + Lister() schedulingv1alpha3.WorkloadLister +} + +// WorkloadIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type WorkloadIndexInformer cache.TypedSharedIndexInformer[*apischedulingv1alpha3.Workload] + +// WorkloadHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Workload. +type WorkloadHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apischedulingv1alpha3.Workload] + +// WorkloadDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Workload. +type WorkloadDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apischedulingv1alpha3.Workload] + +// WorkloadFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Workload. +type WorkloadFilteringHandler = cache.TypedFilteringResourceEventHandler[*apischedulingv1alpha3.Workload] + +// WorkloadIndexers is a specialization of [cache.TypedIndexers] for Workload. +type WorkloadIndexers = cache.TypedIndexers[*apischedulingv1alpha3.Workload] + +// DeletedWorkload is a specialization of [cache.DeletedObject] for Workload. +type DeletedWorkload = cache.DeletedObject[*apischedulingv1alpha3.Workload] + +type workloadInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewWorkloadInformer constructs a new informer for Workload type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedWorkloadInformer]). +func NewWorkloadInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewWorkloadInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewTypedWorkloadInformer constructs a new informer for Workload type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedWorkloadInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers WorkloadIndexers) WorkloadIndexInformer { + return NewTypedWorkloadInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + +// NewFilteredWorkloadInformer constructs a new informer for Workload type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredWorkloadInformer]). +func NewFilteredWorkloadInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewTypedWorkloadInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredWorkloadInformer constructs a new informer for Workload type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredWorkloadInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers WorkloadIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) WorkloadIndexInformer { + return NewTypedWorkloadInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) +} + +// NewWorkloadInformerWithOptions constructs a new informer for Workload type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedWorkloadInformerWithOptions]). +func NewWorkloadInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedWorkloadInformerWithOptions(client, namespace, options) +} + +// NewTypedWorkloadInformerWithOptions constructs a new informer for Workload type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedWorkloadInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) WorkloadIndexInformer { + gvr := schema.GroupVersionResource{Group: "scheduling.k8s.io", Version: "v1alpha3", Resource: "workloads"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewTypedSharedIndexInformer[*apischedulingv1alpha3.Workload](cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1alpha3().Workloads(namespace).List(context.Background(), opts) + }, + WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1alpha3().Workloads(namespace).Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1alpha3().Workloads(namespace).List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1alpha3().Workloads(namespace).Watch(ctx, opts) + }, + }, client), + &apischedulingv1alpha3.Workload{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + )) +} + +func (f *workloadInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewTypedWorkloadInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *workloadInformer) Informer() cache.SharedIndexInformer { + return f.TypedInformer() +} + +func (f *workloadInformer) TypedInformer() WorkloadIndexInformer { + return cache.NewTypedSharedIndexInformer[*apischedulingv1alpha3.Workload](f.factory.InformerFor(&apischedulingv1alpha3.Workload{}, f.defaultInformer)) +} + +func (f *workloadInformer) Lister() schedulingv1alpha3.WorkloadLister { + return schedulingv1alpha3.NewWorkloadLister(f.Informer().GetIndexer()) +} + +// ToTypedWorkloadInformer converts an untyped informer into a TypedWorkloadInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Workload. If that is not the case, calling type-safe methods of the returned +// TypedWorkloadInformer leads to runtime panics. A safer alternative is to pass +// around a TypedWorkloadInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedWorkloadInformer(informer WorkloadInformer) TypedWorkloadInformer { + if informer, ok := informer.(TypedWorkloadInformer); ok { + return informer + } + return &workloadTypedInformerAdapter{informer} +} + +type workloadTypedInformerAdapter struct { + WorkloadInformer +} + +func (a *workloadTypedInformerAdapter) TypedInformer() WorkloadIndexInformer { + return cache.NewTypedSharedIndexInformer[*apischedulingv1alpha3.Workload](a.Informer()) +} + +// ToWorkloadIndexInformer converts an untyped informer into a WorkloadIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Workload. If that is not the case, calling type-safe methods of the returned +// WorkloadIndexInformer leads to runtime panics. A safer alternative is to pass +// around a WorkloadIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToWorkloadIndexInformer(informer cache.SharedIndexInformer) WorkloadIndexInformer { + if informer, ok := informer.(WorkloadIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apischedulingv1alpha3.Workload](informer) +} diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/scheduling/v1beta1/interface.go index 52840a9cee..f57d050b18 100644 --- a/vendor/k8s.io/client-go/informers/scheduling/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/scheduling/v1beta1/interface.go @@ -24,8 +24,12 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { + // PodGroups returns a PodGroupInformer. + PodGroups() TypedPodGroupInformer // PriorityClasses returns a PriorityClassInformer. - PriorityClasses() PriorityClassInformer + PriorityClasses() TypedPriorityClassInformer + // Workloads returns a WorkloadInformer. + Workloads() TypedWorkloadInformer } type version struct { @@ -39,7 +43,17 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// PriorityClasses returns a PriorityClassInformer. -func (v *version) PriorityClasses() PriorityClassInformer { +// PodGroups returns a TypedPodGroupInformer. +func (v *version) PodGroups() TypedPodGroupInformer { + return &podGroupInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// PriorityClasses returns a TypedPriorityClassInformer. +func (v *version) PriorityClasses() TypedPriorityClassInformer { return &priorityClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } + +// Workloads returns a TypedWorkloadInformer. +func (v *version) Workloads() TypedWorkloadInformer { + return &workloadInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1beta1/podgroup.go b/vendor/k8s.io/client-go/informers/scheduling/v1beta1/podgroup.go new file mode 100644 index 0000000000..ed77beccd9 --- /dev/null +++ b/vendor/k8s.io/client-go/informers/scheduling/v1beta1/podgroup.go @@ -0,0 +1,208 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + context "context" + time "time" + + apischedulingv1beta1 "k8s.io/api/scheduling/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + schedulingv1beta1 "k8s.io/client-go/listers/scheduling/v1beta1" + cache "k8s.io/client-go/tools/cache" +) + +// PodGroupInformer provides access to a shared informer and lister for +// PodGroups. Prefer using the type-safe variant (see [TypedPodGroupInformer]). +type PodGroupInformer interface { + Informer() cache.SharedIndexInformer + Lister() schedulingv1beta1.PodGroupLister +} + +// TypedPodGroupInformer provides access to a shared informer and lister for +// PodGroups, including the type-safe TypedInformer variant. +// It is a superset of PodGroupInformer. +type TypedPodGroupInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() PodGroupIndexInformer + Lister() schedulingv1beta1.PodGroupLister +} + +// PodGroupIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type PodGroupIndexInformer cache.TypedSharedIndexInformer[*apischedulingv1beta1.PodGroup] + +// PodGroupHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for PodGroup. +type PodGroupHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apischedulingv1beta1.PodGroup] + +// PodGroupDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for PodGroup. +type PodGroupDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apischedulingv1beta1.PodGroup] + +// PodGroupFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for PodGroup. +type PodGroupFilteringHandler = cache.TypedFilteringResourceEventHandler[*apischedulingv1beta1.PodGroup] + +// PodGroupIndexers is a specialization of [cache.TypedIndexers] for PodGroup. +type PodGroupIndexers = cache.TypedIndexers[*apischedulingv1beta1.PodGroup] + +// DeletedPodGroup is a specialization of [cache.DeletedObject] for PodGroup. +type DeletedPodGroup = cache.DeletedObject[*apischedulingv1beta1.PodGroup] + +type podGroupInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewPodGroupInformer constructs a new informer for PodGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPodGroupInformer]). +func NewPodGroupInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewPodGroupInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewTypedPodGroupInformer constructs a new informer for PodGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPodGroupInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers PodGroupIndexers) PodGroupIndexInformer { + return NewTypedPodGroupInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + +// NewFilteredPodGroupInformer constructs a new informer for PodGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredPodGroupInformer]). +func NewFilteredPodGroupInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewTypedPodGroupInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredPodGroupInformer constructs a new informer for PodGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredPodGroupInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers PodGroupIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) PodGroupIndexInformer { + return NewTypedPodGroupInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) +} + +// NewPodGroupInformerWithOptions constructs a new informer for PodGroup type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPodGroupInformerWithOptions]). +func NewPodGroupInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedPodGroupInformerWithOptions(client, namespace, options) +} + +// NewTypedPodGroupInformerWithOptions constructs a new informer for PodGroup type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPodGroupInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) PodGroupIndexInformer { + gvr := schema.GroupVersionResource{Group: "scheduling.k8s.io", Version: "v1beta1", Resource: "podgroups"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewTypedSharedIndexInformer[*apischedulingv1beta1.PodGroup](cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1beta1().PodGroups(namespace).List(context.Background(), opts) + }, + WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1beta1().PodGroups(namespace).Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1beta1().PodGroups(namespace).List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1beta1().PodGroups(namespace).Watch(ctx, opts) + }, + }, client), + &apischedulingv1beta1.PodGroup{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + )) +} + +func (f *podGroupInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewTypedPodGroupInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *podGroupInformer) Informer() cache.SharedIndexInformer { + return f.TypedInformer() +} + +func (f *podGroupInformer) TypedInformer() PodGroupIndexInformer { + return cache.NewTypedSharedIndexInformer[*apischedulingv1beta1.PodGroup](f.factory.InformerFor(&apischedulingv1beta1.PodGroup{}, f.defaultInformer)) +} + +func (f *podGroupInformer) Lister() schedulingv1beta1.PodGroupLister { + return schedulingv1beta1.NewPodGroupLister(f.Informer().GetIndexer()) +} + +// ToTypedPodGroupInformer converts an untyped informer into a TypedPodGroupInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PodGroup. If that is not the case, calling type-safe methods of the returned +// TypedPodGroupInformer leads to runtime panics. A safer alternative is to pass +// around a TypedPodGroupInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedPodGroupInformer(informer PodGroupInformer) TypedPodGroupInformer { + if informer, ok := informer.(TypedPodGroupInformer); ok { + return informer + } + return &podGroupTypedInformerAdapter{informer} +} + +type podGroupTypedInformerAdapter struct { + PodGroupInformer +} + +func (a *podGroupTypedInformerAdapter) TypedInformer() PodGroupIndexInformer { + return cache.NewTypedSharedIndexInformer[*apischedulingv1beta1.PodGroup](a.Informer()) +} + +// ToPodGroupIndexInformer converts an untyped informer into a PodGroupIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PodGroup. If that is not the case, calling type-safe methods of the returned +// PodGroupIndexInformer leads to runtime panics. A safer alternative is to pass +// around a PodGroupIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToPodGroupIndexInformer(informer cache.SharedIndexInformer) PodGroupIndexInformer { + if informer, ok := informer.(PodGroupIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apischedulingv1beta1.PodGroup](informer) +} diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1beta1/priorityclass.go b/vendor/k8s.io/client-go/informers/scheduling/v1beta1/priorityclass.go index a5cae3ea56..74b968d26e 100644 --- a/vendor/k8s.io/client-go/informers/scheduling/v1beta1/priorityclass.go +++ b/vendor/k8s.io/client-go/informers/scheduling/v1beta1/priorityclass.go @@ -34,12 +34,40 @@ import ( ) // PriorityClassInformer provides access to a shared informer and lister for -// PriorityClasses. +// PriorityClasses. Prefer using the type-safe variant (see [TypedPriorityClassInformer]). type PriorityClassInformer interface { Informer() cache.SharedIndexInformer Lister() schedulingv1beta1.PriorityClassLister } +// TypedPriorityClassInformer provides access to a shared informer and lister for +// PriorityClasses, including the type-safe TypedInformer variant. +// It is a superset of PriorityClassInformer. +type TypedPriorityClassInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() PriorityClassIndexInformer + Lister() schedulingv1beta1.PriorityClassLister +} + +// PriorityClassIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type PriorityClassIndexInformer cache.TypedSharedIndexInformer[*apischedulingv1beta1.PriorityClass] + +// PriorityClassHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for PriorityClass. +type PriorityClassHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apischedulingv1beta1.PriorityClass] + +// PriorityClassDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for PriorityClass. +type PriorityClassDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apischedulingv1beta1.PriorityClass] + +// PriorityClassFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for PriorityClass. +type PriorityClassFilteringHandler = cache.TypedFilteringResourceEventHandler[*apischedulingv1beta1.PriorityClass] + +// PriorityClassIndexers is a specialization of [cache.TypedIndexers] for PriorityClass. +type PriorityClassIndexers = cache.TypedIndexers[*apischedulingv1beta1.PriorityClass] + +// DeletedPriorityClass is a specialization of [cache.DeletedObject] for PriorityClass. +type DeletedPriorityClass = cache.DeletedObject[*apischedulingv1beta1.PriorityClass] + type priorityClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type priorityClassInformer struct { // NewPriorityClassInformer constructs a new informer for PriorityClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPriorityClassInformer]). func NewPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewPriorityClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedPriorityClassInformer constructs a new informer for PriorityClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers PriorityClassIndexers) PriorityClassIndexInformer { + return NewTypedPriorityClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredPriorityClassInformer constructs a new informer for PriorityClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredPriorityClassInformer]). func NewFilteredPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewPriorityClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedPriorityClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredPriorityClassInformer constructs a new informer for PriorityClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers PriorityClassIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) PriorityClassIndexInformer { + return NewTypedPriorityClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewPriorityClassInformerWithOptions constructs a new informer for PriorityClass type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedPriorityClassInformerWithOptions]). func NewPriorityClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedPriorityClassInformerWithOptions(client, options) +} + +// NewTypedPriorityClassInformerWithOptions constructs a new informer for PriorityClass type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedPriorityClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) PriorityClassIndexInformer { gvr := schema.GroupVersionResource{Group: "scheduling.k8s.io", Version: "v1beta1", Resource: "priorityclasss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apischedulingv1beta1.PriorityClass](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewPriorityClassInformerWithOptions(client kubernetes.Interface, options in Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *priorityClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewPriorityClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedPriorityClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *priorityClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apischedulingv1beta1.PriorityClass{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *priorityClassInformer) TypedInformer() PriorityClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apischedulingv1beta1.PriorityClass](f.factory.InformerFor(&apischedulingv1beta1.PriorityClass{}, f.defaultInformer)) } func (f *priorityClassInformer) Lister() schedulingv1beta1.PriorityClassLister { return schedulingv1beta1.NewPriorityClassLister(f.Informer().GetIndexer()) } + +// ToTypedPriorityClassInformer converts an untyped informer into a TypedPriorityClassInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PriorityClass. If that is not the case, calling type-safe methods of the returned +// TypedPriorityClassInformer leads to runtime panics. A safer alternative is to pass +// around a TypedPriorityClassInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedPriorityClassInformer(informer PriorityClassInformer) TypedPriorityClassInformer { + if informer, ok := informer.(TypedPriorityClassInformer); ok { + return informer + } + return &priorityClassTypedInformerAdapter{informer} +} + +type priorityClassTypedInformerAdapter struct { + PriorityClassInformer +} + +func (a *priorityClassTypedInformerAdapter) TypedInformer() PriorityClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apischedulingv1beta1.PriorityClass](a.Informer()) +} + +// ToPriorityClassIndexInformer converts an untyped informer into a PriorityClassIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *PriorityClass. If that is not the case, calling type-safe methods of the returned +// PriorityClassIndexInformer leads to runtime panics. A safer alternative is to pass +// around a PriorityClassIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToPriorityClassIndexInformer(informer cache.SharedIndexInformer) PriorityClassIndexInformer { + if informer, ok := informer.(PriorityClassIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apischedulingv1beta1.PriorityClass](informer) +} diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1beta1/workload.go b/vendor/k8s.io/client-go/informers/scheduling/v1beta1/workload.go new file mode 100644 index 0000000000..86c30f27ea --- /dev/null +++ b/vendor/k8s.io/client-go/informers/scheduling/v1beta1/workload.go @@ -0,0 +1,208 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + context "context" + time "time" + + apischedulingv1beta1 "k8s.io/api/scheduling/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + schedulingv1beta1 "k8s.io/client-go/listers/scheduling/v1beta1" + cache "k8s.io/client-go/tools/cache" +) + +// WorkloadInformer provides access to a shared informer and lister for +// Workloads. Prefer using the type-safe variant (see [TypedWorkloadInformer]). +type WorkloadInformer interface { + Informer() cache.SharedIndexInformer + Lister() schedulingv1beta1.WorkloadLister +} + +// TypedWorkloadInformer provides access to a shared informer and lister for +// Workloads, including the type-safe TypedInformer variant. +// It is a superset of WorkloadInformer. +type TypedWorkloadInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() WorkloadIndexInformer + Lister() schedulingv1beta1.WorkloadLister +} + +// WorkloadIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type WorkloadIndexInformer cache.TypedSharedIndexInformer[*apischedulingv1beta1.Workload] + +// WorkloadHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Workload. +type WorkloadHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apischedulingv1beta1.Workload] + +// WorkloadDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Workload. +type WorkloadDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apischedulingv1beta1.Workload] + +// WorkloadFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Workload. +type WorkloadFilteringHandler = cache.TypedFilteringResourceEventHandler[*apischedulingv1beta1.Workload] + +// WorkloadIndexers is a specialization of [cache.TypedIndexers] for Workload. +type WorkloadIndexers = cache.TypedIndexers[*apischedulingv1beta1.Workload] + +// DeletedWorkload is a specialization of [cache.DeletedObject] for Workload. +type DeletedWorkload = cache.DeletedObject[*apischedulingv1beta1.Workload] + +type workloadInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewWorkloadInformer constructs a new informer for Workload type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedWorkloadInformer]). +func NewWorkloadInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewWorkloadInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewTypedWorkloadInformer constructs a new informer for Workload type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedWorkloadInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers WorkloadIndexers) WorkloadIndexInformer { + return NewTypedWorkloadInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + +// NewFilteredWorkloadInformer constructs a new informer for Workload type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredWorkloadInformer]). +func NewFilteredWorkloadInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewTypedWorkloadInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredWorkloadInformer constructs a new informer for Workload type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredWorkloadInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers WorkloadIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) WorkloadIndexInformer { + return NewTypedWorkloadInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) +} + +// NewWorkloadInformerWithOptions constructs a new informer for Workload type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedWorkloadInformerWithOptions]). +func NewWorkloadInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedWorkloadInformerWithOptions(client, namespace, options) +} + +// NewTypedWorkloadInformerWithOptions constructs a new informer for Workload type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedWorkloadInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) WorkloadIndexInformer { + gvr := schema.GroupVersionResource{Group: "scheduling.k8s.io", Version: "v1beta1", Resource: "workloads"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewTypedSharedIndexInformer[*apischedulingv1beta1.Workload](cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1beta1().Workloads(namespace).List(context.Background(), opts) + }, + WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1beta1().Workloads(namespace).Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1beta1().Workloads(namespace).List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SchedulingV1beta1().Workloads(namespace).Watch(ctx, opts) + }, + }, client), + &apischedulingv1beta1.Workload{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + )) +} + +func (f *workloadInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewTypedWorkloadInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *workloadInformer) Informer() cache.SharedIndexInformer { + return f.TypedInformer() +} + +func (f *workloadInformer) TypedInformer() WorkloadIndexInformer { + return cache.NewTypedSharedIndexInformer[*apischedulingv1beta1.Workload](f.factory.InformerFor(&apischedulingv1beta1.Workload{}, f.defaultInformer)) +} + +func (f *workloadInformer) Lister() schedulingv1beta1.WorkloadLister { + return schedulingv1beta1.NewWorkloadLister(f.Informer().GetIndexer()) +} + +// ToTypedWorkloadInformer converts an untyped informer into a TypedWorkloadInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Workload. If that is not the case, calling type-safe methods of the returned +// TypedWorkloadInformer leads to runtime panics. A safer alternative is to pass +// around a TypedWorkloadInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedWorkloadInformer(informer WorkloadInformer) TypedWorkloadInformer { + if informer, ok := informer.(TypedWorkloadInformer); ok { + return informer + } + return &workloadTypedInformerAdapter{informer} +} + +type workloadTypedInformerAdapter struct { + WorkloadInformer +} + +func (a *workloadTypedInformerAdapter) TypedInformer() WorkloadIndexInformer { + return cache.NewTypedSharedIndexInformer[*apischedulingv1beta1.Workload](a.Informer()) +} + +// ToWorkloadIndexInformer converts an untyped informer into a WorkloadIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Workload. If that is not the case, calling type-safe methods of the returned +// WorkloadIndexInformer leads to runtime panics. A safer alternative is to pass +// around a WorkloadIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToWorkloadIndexInformer(informer cache.SharedIndexInformer) WorkloadIndexInformer { + if informer, ok := informer.(WorkloadIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apischedulingv1beta1.Workload](informer) +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1/csidriver.go b/vendor/k8s.io/client-go/informers/storage/v1/csidriver.go index 56ed349e26..f7b4d393ea 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1/csidriver.go +++ b/vendor/k8s.io/client-go/informers/storage/v1/csidriver.go @@ -34,12 +34,40 @@ import ( ) // CSIDriverInformer provides access to a shared informer and lister for -// CSIDrivers. +// CSIDrivers. Prefer using the type-safe variant (see [TypedCSIDriverInformer]). type CSIDriverInformer interface { Informer() cache.SharedIndexInformer Lister() storagev1.CSIDriverLister } +// TypedCSIDriverInformer provides access to a shared informer and lister for +// CSIDrivers, including the type-safe TypedInformer variant. +// It is a superset of CSIDriverInformer. +type TypedCSIDriverInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CSIDriverIndexInformer + Lister() storagev1.CSIDriverLister +} + +// CSIDriverIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CSIDriverIndexInformer cache.TypedSharedIndexInformer[*apistoragev1.CSIDriver] + +// CSIDriverHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CSIDriver. +type CSIDriverHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apistoragev1.CSIDriver] + +// CSIDriverDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CSIDriver. +type CSIDriverDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apistoragev1.CSIDriver] + +// CSIDriverFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CSIDriver. +type CSIDriverFilteringHandler = cache.TypedFilteringResourceEventHandler[*apistoragev1.CSIDriver] + +// CSIDriverIndexers is a specialization of [cache.TypedIndexers] for CSIDriver. +type CSIDriverIndexers = cache.TypedIndexers[*apistoragev1.CSIDriver] + +// DeletedCSIDriver is a specialization of [cache.DeletedObject] for CSIDriver. +type DeletedCSIDriver = cache.DeletedObject[*apistoragev1.CSIDriver] + type cSIDriverInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type cSIDriverInformer struct { // NewCSIDriverInformer constructs a new informer for CSIDriver type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCSIDriverInformer]). func NewCSIDriverInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewCSIDriverInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedCSIDriverInformer constructs a new informer for CSIDriver type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCSIDriverInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers CSIDriverIndexers) CSIDriverIndexInformer { + return NewTypedCSIDriverInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredCSIDriverInformer constructs a new informer for CSIDriver type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCSIDriverInformer]). func NewFilteredCSIDriverInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewCSIDriverInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedCSIDriverInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCSIDriverInformer constructs a new informer for CSIDriver type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredCSIDriverInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers CSIDriverIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CSIDriverIndexInformer { + return NewTypedCSIDriverInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewCSIDriverInformerWithOptions constructs a new informer for CSIDriver type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCSIDriverInformerWithOptions]). func NewCSIDriverInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCSIDriverInformerWithOptions(client, options) +} + +// NewTypedCSIDriverInformerWithOptions constructs a new informer for CSIDriver type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCSIDriverInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) CSIDriverIndexInformer { gvr := schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1", Resource: "csidrivers"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apistoragev1.CSIDriver](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewCSIDriverInformerWithOptions(client kubernetes.Interface, options intern Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *cSIDriverInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewCSIDriverInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedCSIDriverInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *cSIDriverInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apistoragev1.CSIDriver{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *cSIDriverInformer) TypedInformer() CSIDriverIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1.CSIDriver](f.factory.InformerFor(&apistoragev1.CSIDriver{}, f.defaultInformer)) } func (f *cSIDriverInformer) Lister() storagev1.CSIDriverLister { return storagev1.NewCSIDriverLister(f.Informer().GetIndexer()) } + +// ToTypedCSIDriverInformer converts an untyped informer into a TypedCSIDriverInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CSIDriver. If that is not the case, calling type-safe methods of the returned +// TypedCSIDriverInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCSIDriverInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCSIDriverInformer(informer CSIDriverInformer) TypedCSIDriverInformer { + if informer, ok := informer.(TypedCSIDriverInformer); ok { + return informer + } + return &cSIDriverTypedInformerAdapter{informer} +} + +type cSIDriverTypedInformerAdapter struct { + CSIDriverInformer +} + +func (a *cSIDriverTypedInformerAdapter) TypedInformer() CSIDriverIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1.CSIDriver](a.Informer()) +} + +// ToCSIDriverIndexInformer converts an untyped informer into a CSIDriverIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CSIDriver. If that is not the case, calling type-safe methods of the returned +// CSIDriverIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CSIDriverIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCSIDriverIndexInformer(informer cache.SharedIndexInformer) CSIDriverIndexInformer { + if informer, ok := informer.(CSIDriverIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apistoragev1.CSIDriver](informer) +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1/csinode.go b/vendor/k8s.io/client-go/informers/storage/v1/csinode.go index c90686bf78..8a841028ba 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1/csinode.go +++ b/vendor/k8s.io/client-go/informers/storage/v1/csinode.go @@ -34,12 +34,40 @@ import ( ) // CSINodeInformer provides access to a shared informer and lister for -// CSINodes. +// CSINodes. Prefer using the type-safe variant (see [TypedCSINodeInformer]). type CSINodeInformer interface { Informer() cache.SharedIndexInformer Lister() storagev1.CSINodeLister } +// TypedCSINodeInformer provides access to a shared informer and lister for +// CSINodes, including the type-safe TypedInformer variant. +// It is a superset of CSINodeInformer. +type TypedCSINodeInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CSINodeIndexInformer + Lister() storagev1.CSINodeLister +} + +// CSINodeIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CSINodeIndexInformer cache.TypedSharedIndexInformer[*apistoragev1.CSINode] + +// CSINodeHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CSINode. +type CSINodeHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apistoragev1.CSINode] + +// CSINodeDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CSINode. +type CSINodeDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apistoragev1.CSINode] + +// CSINodeFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CSINode. +type CSINodeFilteringHandler = cache.TypedFilteringResourceEventHandler[*apistoragev1.CSINode] + +// CSINodeIndexers is a specialization of [cache.TypedIndexers] for CSINode. +type CSINodeIndexers = cache.TypedIndexers[*apistoragev1.CSINode] + +// DeletedCSINode is a specialization of [cache.DeletedObject] for CSINode. +type DeletedCSINode = cache.DeletedObject[*apistoragev1.CSINode] + type cSINodeInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type cSINodeInformer struct { // NewCSINodeInformer constructs a new informer for CSINode type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCSINodeInformer]). func NewCSINodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewCSINodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedCSINodeInformer constructs a new informer for CSINode type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCSINodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers CSINodeIndexers) CSINodeIndexInformer { + return NewTypedCSINodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredCSINodeInformer constructs a new informer for CSINode type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCSINodeInformer]). func NewFilteredCSINodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewCSINodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedCSINodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCSINodeInformer constructs a new informer for CSINode type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredCSINodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers CSINodeIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CSINodeIndexInformer { + return NewTypedCSINodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewCSINodeInformerWithOptions constructs a new informer for CSINode type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCSINodeInformerWithOptions]). func NewCSINodeInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCSINodeInformerWithOptions(client, options) +} + +// NewTypedCSINodeInformerWithOptions constructs a new informer for CSINode type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCSINodeInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) CSINodeIndexInformer { gvr := schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1", Resource: "csinodes"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apistoragev1.CSINode](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewCSINodeInformerWithOptions(client kubernetes.Interface, options internal Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *cSINodeInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewCSINodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedCSINodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *cSINodeInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apistoragev1.CSINode{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *cSINodeInformer) TypedInformer() CSINodeIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1.CSINode](f.factory.InformerFor(&apistoragev1.CSINode{}, f.defaultInformer)) } func (f *cSINodeInformer) Lister() storagev1.CSINodeLister { return storagev1.NewCSINodeLister(f.Informer().GetIndexer()) } + +// ToTypedCSINodeInformer converts an untyped informer into a TypedCSINodeInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CSINode. If that is not the case, calling type-safe methods of the returned +// TypedCSINodeInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCSINodeInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCSINodeInformer(informer CSINodeInformer) TypedCSINodeInformer { + if informer, ok := informer.(TypedCSINodeInformer); ok { + return informer + } + return &cSINodeTypedInformerAdapter{informer} +} + +type cSINodeTypedInformerAdapter struct { + CSINodeInformer +} + +func (a *cSINodeTypedInformerAdapter) TypedInformer() CSINodeIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1.CSINode](a.Informer()) +} + +// ToCSINodeIndexInformer converts an untyped informer into a CSINodeIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CSINode. If that is not the case, calling type-safe methods of the returned +// CSINodeIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CSINodeIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCSINodeIndexInformer(informer cache.SharedIndexInformer) CSINodeIndexInformer { + if informer, ok := informer.(CSINodeIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apistoragev1.CSINode](informer) +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1/csistoragecapacity.go b/vendor/k8s.io/client-go/informers/storage/v1/csistoragecapacity.go index 52c0e281ac..3052b40d9a 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1/csistoragecapacity.go +++ b/vendor/k8s.io/client-go/informers/storage/v1/csistoragecapacity.go @@ -34,12 +34,40 @@ import ( ) // CSIStorageCapacityInformer provides access to a shared informer and lister for -// CSIStorageCapacities. +// CSIStorageCapacities. Prefer using the type-safe variant (see [TypedCSIStorageCapacityInformer]). type CSIStorageCapacityInformer interface { Informer() cache.SharedIndexInformer Lister() storagev1.CSIStorageCapacityLister } +// TypedCSIStorageCapacityInformer provides access to a shared informer and lister for +// CSIStorageCapacities, including the type-safe TypedInformer variant. +// It is a superset of CSIStorageCapacityInformer. +type TypedCSIStorageCapacityInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CSIStorageCapacityIndexInformer + Lister() storagev1.CSIStorageCapacityLister +} + +// CSIStorageCapacityIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CSIStorageCapacityIndexInformer cache.TypedSharedIndexInformer[*apistoragev1.CSIStorageCapacity] + +// CSIStorageCapacityHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CSIStorageCapacity. +type CSIStorageCapacityHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apistoragev1.CSIStorageCapacity] + +// CSIStorageCapacityDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CSIStorageCapacity. +type CSIStorageCapacityDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apistoragev1.CSIStorageCapacity] + +// CSIStorageCapacityFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CSIStorageCapacity. +type CSIStorageCapacityFilteringHandler = cache.TypedFilteringResourceEventHandler[*apistoragev1.CSIStorageCapacity] + +// CSIStorageCapacityIndexers is a specialization of [cache.TypedIndexers] for CSIStorageCapacity. +type CSIStorageCapacityIndexers = cache.TypedIndexers[*apistoragev1.CSIStorageCapacity] + +// DeletedCSIStorageCapacity is a specialization of [cache.DeletedObject] for CSIStorageCapacity. +type DeletedCSIStorageCapacity = cache.DeletedObject[*apistoragev1.CSIStorageCapacity] + type cSIStorageCapacityInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type cSIStorageCapacityInformer struct { // NewCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCSIStorageCapacityInformer]). func NewCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewCSIStorageCapacityInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers CSIStorageCapacityIndexers) CSIStorageCapacityIndexInformer { + return NewTypedCSIStorageCapacityInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCSIStorageCapacityInformer]). func NewFilteredCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewCSIStorageCapacityInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedCSIStorageCapacityInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers CSIStorageCapacityIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CSIStorageCapacityIndexInformer { + return NewTypedCSIStorageCapacityInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewCSIStorageCapacityInformerWithOptions constructs a new informer for CSIStorageCapacity type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCSIStorageCapacityInformerWithOptions]). func NewCSIStorageCapacityInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCSIStorageCapacityInformerWithOptions(client, namespace, options) +} + +// NewTypedCSIStorageCapacityInformerWithOptions constructs a new informer for CSIStorageCapacity type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCSIStorageCapacityInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) CSIStorageCapacityIndexInformer { gvr := schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1", Resource: "csistoragecapacitys"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apistoragev1.CSIStorageCapacity](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewCSIStorageCapacityInformerWithOptions(client kubernetes.Interface, names Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *cSIStorageCapacityInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewCSIStorageCapacityInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedCSIStorageCapacityInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *cSIStorageCapacityInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apistoragev1.CSIStorageCapacity{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *cSIStorageCapacityInformer) TypedInformer() CSIStorageCapacityIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1.CSIStorageCapacity](f.factory.InformerFor(&apistoragev1.CSIStorageCapacity{}, f.defaultInformer)) } func (f *cSIStorageCapacityInformer) Lister() storagev1.CSIStorageCapacityLister { return storagev1.NewCSIStorageCapacityLister(f.Informer().GetIndexer()) } + +// ToTypedCSIStorageCapacityInformer converts an untyped informer into a TypedCSIStorageCapacityInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CSIStorageCapacity. If that is not the case, calling type-safe methods of the returned +// TypedCSIStorageCapacityInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCSIStorageCapacityInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCSIStorageCapacityInformer(informer CSIStorageCapacityInformer) TypedCSIStorageCapacityInformer { + if informer, ok := informer.(TypedCSIStorageCapacityInformer); ok { + return informer + } + return &cSIStorageCapacityTypedInformerAdapter{informer} +} + +type cSIStorageCapacityTypedInformerAdapter struct { + CSIStorageCapacityInformer +} + +func (a *cSIStorageCapacityTypedInformerAdapter) TypedInformer() CSIStorageCapacityIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1.CSIStorageCapacity](a.Informer()) +} + +// ToCSIStorageCapacityIndexInformer converts an untyped informer into a CSIStorageCapacityIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CSIStorageCapacity. If that is not the case, calling type-safe methods of the returned +// CSIStorageCapacityIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CSIStorageCapacityIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCSIStorageCapacityIndexInformer(informer cache.SharedIndexInformer) CSIStorageCapacityIndexInformer { + if informer, ok := informer.(CSIStorageCapacityIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apistoragev1.CSIStorageCapacity](informer) +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1/interface.go b/vendor/k8s.io/client-go/informers/storage/v1/interface.go index aff778e05c..532e79b5f1 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/storage/v1/interface.go @@ -25,17 +25,17 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // CSIDrivers returns a CSIDriverInformer. - CSIDrivers() CSIDriverInformer + CSIDrivers() TypedCSIDriverInformer // CSINodes returns a CSINodeInformer. - CSINodes() CSINodeInformer + CSINodes() TypedCSINodeInformer // CSIStorageCapacities returns a CSIStorageCapacityInformer. - CSIStorageCapacities() CSIStorageCapacityInformer + CSIStorageCapacities() TypedCSIStorageCapacityInformer // StorageClasses returns a StorageClassInformer. - StorageClasses() StorageClassInformer + StorageClasses() TypedStorageClassInformer // VolumeAttachments returns a VolumeAttachmentInformer. - VolumeAttachments() VolumeAttachmentInformer + VolumeAttachments() TypedVolumeAttachmentInformer // VolumeAttributesClasses returns a VolumeAttributesClassInformer. - VolumeAttributesClasses() VolumeAttributesClassInformer + VolumeAttributesClasses() TypedVolumeAttributesClassInformer } type version struct { @@ -49,32 +49,32 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// CSIDrivers returns a CSIDriverInformer. -func (v *version) CSIDrivers() CSIDriverInformer { +// CSIDrivers returns a TypedCSIDriverInformer. +func (v *version) CSIDrivers() TypedCSIDriverInformer { return &cSIDriverInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// CSINodes returns a CSINodeInformer. -func (v *version) CSINodes() CSINodeInformer { +// CSINodes returns a TypedCSINodeInformer. +func (v *version) CSINodes() TypedCSINodeInformer { return &cSINodeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// CSIStorageCapacities returns a CSIStorageCapacityInformer. -func (v *version) CSIStorageCapacities() CSIStorageCapacityInformer { +// CSIStorageCapacities returns a TypedCSIStorageCapacityInformer. +func (v *version) CSIStorageCapacities() TypedCSIStorageCapacityInformer { return &cSIStorageCapacityInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// StorageClasses returns a StorageClassInformer. -func (v *version) StorageClasses() StorageClassInformer { +// StorageClasses returns a TypedStorageClassInformer. +func (v *version) StorageClasses() TypedStorageClassInformer { return &storageClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// VolumeAttachments returns a VolumeAttachmentInformer. -func (v *version) VolumeAttachments() VolumeAttachmentInformer { +// VolumeAttachments returns a TypedVolumeAttachmentInformer. +func (v *version) VolumeAttachments() TypedVolumeAttachmentInformer { return &volumeAttachmentInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// VolumeAttributesClasses returns a VolumeAttributesClassInformer. -func (v *version) VolumeAttributesClasses() VolumeAttributesClassInformer { +// VolumeAttributesClasses returns a TypedVolumeAttributesClassInformer. +func (v *version) VolumeAttributesClasses() TypedVolumeAttributesClassInformer { return &volumeAttributesClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go b/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go index 533d02fc86..ea123c61a3 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go +++ b/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go @@ -34,12 +34,40 @@ import ( ) // StorageClassInformer provides access to a shared informer and lister for -// StorageClasses. +// StorageClasses. Prefer using the type-safe variant (see [TypedStorageClassInformer]). type StorageClassInformer interface { Informer() cache.SharedIndexInformer Lister() storagev1.StorageClassLister } +// TypedStorageClassInformer provides access to a shared informer and lister for +// StorageClasses, including the type-safe TypedInformer variant. +// It is a superset of StorageClassInformer. +type TypedStorageClassInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() StorageClassIndexInformer + Lister() storagev1.StorageClassLister +} + +// StorageClassIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type StorageClassIndexInformer cache.TypedSharedIndexInformer[*apistoragev1.StorageClass] + +// StorageClassHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for StorageClass. +type StorageClassHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apistoragev1.StorageClass] + +// StorageClassDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for StorageClass. +type StorageClassDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apistoragev1.StorageClass] + +// StorageClassFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for StorageClass. +type StorageClassFilteringHandler = cache.TypedFilteringResourceEventHandler[*apistoragev1.StorageClass] + +// StorageClassIndexers is a specialization of [cache.TypedIndexers] for StorageClass. +type StorageClassIndexers = cache.TypedIndexers[*apistoragev1.StorageClass] + +// DeletedStorageClass is a specialization of [cache.DeletedObject] for StorageClass. +type DeletedStorageClass = cache.DeletedObject[*apistoragev1.StorageClass] + type storageClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type storageClassInformer struct { // NewStorageClassInformer constructs a new informer for StorageClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStorageClassInformer]). func NewStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewStorageClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedStorageClassInformer constructs a new informer for StorageClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers StorageClassIndexers) StorageClassIndexInformer { + return NewTypedStorageClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredStorageClassInformer constructs a new informer for StorageClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredStorageClassInformer]). func NewFilteredStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewStorageClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedStorageClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredStorageClassInformer constructs a new informer for StorageClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers StorageClassIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) StorageClassIndexInformer { + return NewTypedStorageClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewStorageClassInformerWithOptions constructs a new informer for StorageClass type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStorageClassInformerWithOptions]). func NewStorageClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedStorageClassInformerWithOptions(client, options) +} + +// NewTypedStorageClassInformerWithOptions constructs a new informer for StorageClass type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStorageClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) StorageClassIndexInformer { gvr := schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1", Resource: "storageclasss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apistoragev1.StorageClass](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewStorageClassInformerWithOptions(client kubernetes.Interface, options int Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *storageClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewStorageClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedStorageClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *storageClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apistoragev1.StorageClass{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *storageClassInformer) TypedInformer() StorageClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1.StorageClass](f.factory.InformerFor(&apistoragev1.StorageClass{}, f.defaultInformer)) } func (f *storageClassInformer) Lister() storagev1.StorageClassLister { return storagev1.NewStorageClassLister(f.Informer().GetIndexer()) } + +// ToTypedStorageClassInformer converts an untyped informer into a TypedStorageClassInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StorageClass. If that is not the case, calling type-safe methods of the returned +// TypedStorageClassInformer leads to runtime panics. A safer alternative is to pass +// around a TypedStorageClassInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedStorageClassInformer(informer StorageClassInformer) TypedStorageClassInformer { + if informer, ok := informer.(TypedStorageClassInformer); ok { + return informer + } + return &storageClassTypedInformerAdapter{informer} +} + +type storageClassTypedInformerAdapter struct { + StorageClassInformer +} + +func (a *storageClassTypedInformerAdapter) TypedInformer() StorageClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1.StorageClass](a.Informer()) +} + +// ToStorageClassIndexInformer converts an untyped informer into a StorageClassIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StorageClass. If that is not the case, calling type-safe methods of the returned +// StorageClassIndexInformer leads to runtime panics. A safer alternative is to pass +// around a StorageClassIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToStorageClassIndexInformer(informer cache.SharedIndexInformer) StorageClassIndexInformer { + if informer, ok := informer.(StorageClassIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apistoragev1.StorageClass](informer) +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1/volumeattachment.go b/vendor/k8s.io/client-go/informers/storage/v1/volumeattachment.go index 49444340ad..fdd91fd740 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1/volumeattachment.go +++ b/vendor/k8s.io/client-go/informers/storage/v1/volumeattachment.go @@ -34,12 +34,40 @@ import ( ) // VolumeAttachmentInformer provides access to a shared informer and lister for -// VolumeAttachments. +// VolumeAttachments. Prefer using the type-safe variant (see [TypedVolumeAttachmentInformer]). type VolumeAttachmentInformer interface { Informer() cache.SharedIndexInformer Lister() storagev1.VolumeAttachmentLister } +// TypedVolumeAttachmentInformer provides access to a shared informer and lister for +// VolumeAttachments, including the type-safe TypedInformer variant. +// It is a superset of VolumeAttachmentInformer. +type TypedVolumeAttachmentInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() VolumeAttachmentIndexInformer + Lister() storagev1.VolumeAttachmentLister +} + +// VolumeAttachmentIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type VolumeAttachmentIndexInformer cache.TypedSharedIndexInformer[*apistoragev1.VolumeAttachment] + +// VolumeAttachmentHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for VolumeAttachment. +type VolumeAttachmentHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apistoragev1.VolumeAttachment] + +// VolumeAttachmentDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for VolumeAttachment. +type VolumeAttachmentDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apistoragev1.VolumeAttachment] + +// VolumeAttachmentFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for VolumeAttachment. +type VolumeAttachmentFilteringHandler = cache.TypedFilteringResourceEventHandler[*apistoragev1.VolumeAttachment] + +// VolumeAttachmentIndexers is a specialization of [cache.TypedIndexers] for VolumeAttachment. +type VolumeAttachmentIndexers = cache.TypedIndexers[*apistoragev1.VolumeAttachment] + +// DeletedVolumeAttachment is a specialization of [cache.DeletedObject] for VolumeAttachment. +type DeletedVolumeAttachment = cache.DeletedObject[*apistoragev1.VolumeAttachment] + type volumeAttachmentInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type volumeAttachmentInformer struct { // NewVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedVolumeAttachmentInformer]). func NewVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers VolumeAttachmentIndexers) VolumeAttachmentIndexInformer { + return NewTypedVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredVolumeAttachmentInformer]). func NewFilteredVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers VolumeAttachmentIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) VolumeAttachmentIndexInformer { + return NewTypedVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewVolumeAttachmentInformerWithOptions constructs a new informer for VolumeAttachment type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedVolumeAttachmentInformerWithOptions]). func NewVolumeAttachmentInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedVolumeAttachmentInformerWithOptions(client, options) +} + +// NewTypedVolumeAttachmentInformerWithOptions constructs a new informer for VolumeAttachment type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedVolumeAttachmentInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) VolumeAttachmentIndexInformer { gvr := schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1", Resource: "volumeattachments"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apistoragev1.VolumeAttachment](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewVolumeAttachmentInformerWithOptions(client kubernetes.Interface, options Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *volumeAttachmentInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *volumeAttachmentInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apistoragev1.VolumeAttachment{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *volumeAttachmentInformer) TypedInformer() VolumeAttachmentIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1.VolumeAttachment](f.factory.InformerFor(&apistoragev1.VolumeAttachment{}, f.defaultInformer)) } func (f *volumeAttachmentInformer) Lister() storagev1.VolumeAttachmentLister { return storagev1.NewVolumeAttachmentLister(f.Informer().GetIndexer()) } + +// ToTypedVolumeAttachmentInformer converts an untyped informer into a TypedVolumeAttachmentInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *VolumeAttachment. If that is not the case, calling type-safe methods of the returned +// TypedVolumeAttachmentInformer leads to runtime panics. A safer alternative is to pass +// around a TypedVolumeAttachmentInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedVolumeAttachmentInformer(informer VolumeAttachmentInformer) TypedVolumeAttachmentInformer { + if informer, ok := informer.(TypedVolumeAttachmentInformer); ok { + return informer + } + return &volumeAttachmentTypedInformerAdapter{informer} +} + +type volumeAttachmentTypedInformerAdapter struct { + VolumeAttachmentInformer +} + +func (a *volumeAttachmentTypedInformerAdapter) TypedInformer() VolumeAttachmentIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1.VolumeAttachment](a.Informer()) +} + +// ToVolumeAttachmentIndexInformer converts an untyped informer into a VolumeAttachmentIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *VolumeAttachment. If that is not the case, calling type-safe methods of the returned +// VolumeAttachmentIndexInformer leads to runtime panics. A safer alternative is to pass +// around a VolumeAttachmentIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToVolumeAttachmentIndexInformer(informer cache.SharedIndexInformer) VolumeAttachmentIndexInformer { + if informer, ok := informer.(VolumeAttachmentIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apistoragev1.VolumeAttachment](informer) +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1/volumeattributesclass.go b/vendor/k8s.io/client-go/informers/storage/v1/volumeattributesclass.go index fa8acccfbd..e41eafe3ba 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1/volumeattributesclass.go +++ b/vendor/k8s.io/client-go/informers/storage/v1/volumeattributesclass.go @@ -34,12 +34,40 @@ import ( ) // VolumeAttributesClassInformer provides access to a shared informer and lister for -// VolumeAttributesClasses. +// VolumeAttributesClasses. Prefer using the type-safe variant (see [TypedVolumeAttributesClassInformer]). type VolumeAttributesClassInformer interface { Informer() cache.SharedIndexInformer Lister() storagev1.VolumeAttributesClassLister } +// TypedVolumeAttributesClassInformer provides access to a shared informer and lister for +// VolumeAttributesClasses, including the type-safe TypedInformer variant. +// It is a superset of VolumeAttributesClassInformer. +type TypedVolumeAttributesClassInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() VolumeAttributesClassIndexInformer + Lister() storagev1.VolumeAttributesClassLister +} + +// VolumeAttributesClassIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type VolumeAttributesClassIndexInformer cache.TypedSharedIndexInformer[*apistoragev1.VolumeAttributesClass] + +// VolumeAttributesClassHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for VolumeAttributesClass. +type VolumeAttributesClassHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apistoragev1.VolumeAttributesClass] + +// VolumeAttributesClassDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for VolumeAttributesClass. +type VolumeAttributesClassDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apistoragev1.VolumeAttributesClass] + +// VolumeAttributesClassFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for VolumeAttributesClass. +type VolumeAttributesClassFilteringHandler = cache.TypedFilteringResourceEventHandler[*apistoragev1.VolumeAttributesClass] + +// VolumeAttributesClassIndexers is a specialization of [cache.TypedIndexers] for VolumeAttributesClass. +type VolumeAttributesClassIndexers = cache.TypedIndexers[*apistoragev1.VolumeAttributesClass] + +// DeletedVolumeAttributesClass is a specialization of [cache.DeletedObject] for VolumeAttributesClass. +type DeletedVolumeAttributesClass = cache.DeletedObject[*apistoragev1.VolumeAttributesClass] + type volumeAttributesClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type volumeAttributesClassInformer struct { // NewVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedVolumeAttributesClassInformer]). func NewVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers VolumeAttributesClassIndexers) VolumeAttributesClassIndexInformer { + return NewTypedVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredVolumeAttributesClassInformer]). func NewFilteredVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers VolumeAttributesClassIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) VolumeAttributesClassIndexInformer { + return NewTypedVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewVolumeAttributesClassInformerWithOptions constructs a new informer for VolumeAttributesClass type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedVolumeAttributesClassInformerWithOptions]). func NewVolumeAttributesClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedVolumeAttributesClassInformerWithOptions(client, options) +} + +// NewTypedVolumeAttributesClassInformerWithOptions constructs a new informer for VolumeAttributesClass type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedVolumeAttributesClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) VolumeAttributesClassIndexInformer { gvr := schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1", Resource: "volumeattributesclasss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apistoragev1.VolumeAttributesClass](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewVolumeAttributesClassInformerWithOptions(client kubernetes.Interface, op Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *volumeAttributesClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *volumeAttributesClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apistoragev1.VolumeAttributesClass{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *volumeAttributesClassInformer) TypedInformer() VolumeAttributesClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1.VolumeAttributesClass](f.factory.InformerFor(&apistoragev1.VolumeAttributesClass{}, f.defaultInformer)) } func (f *volumeAttributesClassInformer) Lister() storagev1.VolumeAttributesClassLister { return storagev1.NewVolumeAttributesClassLister(f.Informer().GetIndexer()) } + +// ToTypedVolumeAttributesClassInformer converts an untyped informer into a TypedVolumeAttributesClassInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *VolumeAttributesClass. If that is not the case, calling type-safe methods of the returned +// TypedVolumeAttributesClassInformer leads to runtime panics. A safer alternative is to pass +// around a TypedVolumeAttributesClassInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedVolumeAttributesClassInformer(informer VolumeAttributesClassInformer) TypedVolumeAttributesClassInformer { + if informer, ok := informer.(TypedVolumeAttributesClassInformer); ok { + return informer + } + return &volumeAttributesClassTypedInformerAdapter{informer} +} + +type volumeAttributesClassTypedInformerAdapter struct { + VolumeAttributesClassInformer +} + +func (a *volumeAttributesClassTypedInformerAdapter) TypedInformer() VolumeAttributesClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1.VolumeAttributesClass](a.Informer()) +} + +// ToVolumeAttributesClassIndexInformer converts an untyped informer into a VolumeAttributesClassIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *VolumeAttributesClass. If that is not the case, calling type-safe methods of the returned +// VolumeAttributesClassIndexInformer leads to runtime panics. A safer alternative is to pass +// around a VolumeAttributesClassIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToVolumeAttributesClassIndexInformer(informer cache.SharedIndexInformer) VolumeAttributesClassIndexInformer { + if informer, ok := informer.(VolumeAttributesClassIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apistoragev1.VolumeAttributesClass](informer) +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1alpha1/csistoragecapacity.go b/vendor/k8s.io/client-go/informers/storage/v1alpha1/csistoragecapacity.go index 2f7accab3d..bfdcc62e31 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1alpha1/csistoragecapacity.go +++ b/vendor/k8s.io/client-go/informers/storage/v1alpha1/csistoragecapacity.go @@ -34,12 +34,40 @@ import ( ) // CSIStorageCapacityInformer provides access to a shared informer and lister for -// CSIStorageCapacities. +// CSIStorageCapacities. Prefer using the type-safe variant (see [TypedCSIStorageCapacityInformer]). type CSIStorageCapacityInformer interface { Informer() cache.SharedIndexInformer Lister() storagev1alpha1.CSIStorageCapacityLister } +// TypedCSIStorageCapacityInformer provides access to a shared informer and lister for +// CSIStorageCapacities, including the type-safe TypedInformer variant. +// It is a superset of CSIStorageCapacityInformer. +type TypedCSIStorageCapacityInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CSIStorageCapacityIndexInformer + Lister() storagev1alpha1.CSIStorageCapacityLister +} + +// CSIStorageCapacityIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CSIStorageCapacityIndexInformer cache.TypedSharedIndexInformer[*apistoragev1alpha1.CSIStorageCapacity] + +// CSIStorageCapacityHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CSIStorageCapacity. +type CSIStorageCapacityHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apistoragev1alpha1.CSIStorageCapacity] + +// CSIStorageCapacityDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CSIStorageCapacity. +type CSIStorageCapacityDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apistoragev1alpha1.CSIStorageCapacity] + +// CSIStorageCapacityFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CSIStorageCapacity. +type CSIStorageCapacityFilteringHandler = cache.TypedFilteringResourceEventHandler[*apistoragev1alpha1.CSIStorageCapacity] + +// CSIStorageCapacityIndexers is a specialization of [cache.TypedIndexers] for CSIStorageCapacity. +type CSIStorageCapacityIndexers = cache.TypedIndexers[*apistoragev1alpha1.CSIStorageCapacity] + +// DeletedCSIStorageCapacity is a specialization of [cache.DeletedObject] for CSIStorageCapacity. +type DeletedCSIStorageCapacity = cache.DeletedObject[*apistoragev1alpha1.CSIStorageCapacity] + type cSIStorageCapacityInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type cSIStorageCapacityInformer struct { // NewCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCSIStorageCapacityInformer]). func NewCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewCSIStorageCapacityInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers CSIStorageCapacityIndexers) CSIStorageCapacityIndexInformer { + return NewTypedCSIStorageCapacityInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCSIStorageCapacityInformer]). func NewFilteredCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewCSIStorageCapacityInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedCSIStorageCapacityInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers CSIStorageCapacityIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CSIStorageCapacityIndexInformer { + return NewTypedCSIStorageCapacityInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewCSIStorageCapacityInformerWithOptions constructs a new informer for CSIStorageCapacity type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCSIStorageCapacityInformerWithOptions]). func NewCSIStorageCapacityInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCSIStorageCapacityInformerWithOptions(client, namespace, options) +} + +// NewTypedCSIStorageCapacityInformerWithOptions constructs a new informer for CSIStorageCapacity type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCSIStorageCapacityInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) CSIStorageCapacityIndexInformer { gvr := schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1alpha1", Resource: "csistoragecapacitys"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apistoragev1alpha1.CSIStorageCapacity](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewCSIStorageCapacityInformerWithOptions(client kubernetes.Interface, names Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *cSIStorageCapacityInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewCSIStorageCapacityInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedCSIStorageCapacityInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *cSIStorageCapacityInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apistoragev1alpha1.CSIStorageCapacity{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *cSIStorageCapacityInformer) TypedInformer() CSIStorageCapacityIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1alpha1.CSIStorageCapacity](f.factory.InformerFor(&apistoragev1alpha1.CSIStorageCapacity{}, f.defaultInformer)) } func (f *cSIStorageCapacityInformer) Lister() storagev1alpha1.CSIStorageCapacityLister { return storagev1alpha1.NewCSIStorageCapacityLister(f.Informer().GetIndexer()) } + +// ToTypedCSIStorageCapacityInformer converts an untyped informer into a TypedCSIStorageCapacityInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CSIStorageCapacity. If that is not the case, calling type-safe methods of the returned +// TypedCSIStorageCapacityInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCSIStorageCapacityInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCSIStorageCapacityInformer(informer CSIStorageCapacityInformer) TypedCSIStorageCapacityInformer { + if informer, ok := informer.(TypedCSIStorageCapacityInformer); ok { + return informer + } + return &cSIStorageCapacityTypedInformerAdapter{informer} +} + +type cSIStorageCapacityTypedInformerAdapter struct { + CSIStorageCapacityInformer +} + +func (a *cSIStorageCapacityTypedInformerAdapter) TypedInformer() CSIStorageCapacityIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1alpha1.CSIStorageCapacity](a.Informer()) +} + +// ToCSIStorageCapacityIndexInformer converts an untyped informer into a CSIStorageCapacityIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CSIStorageCapacity. If that is not the case, calling type-safe methods of the returned +// CSIStorageCapacityIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CSIStorageCapacityIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCSIStorageCapacityIndexInformer(informer cache.SharedIndexInformer) CSIStorageCapacityIndexInformer { + if informer, ok := informer.(CSIStorageCapacityIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apistoragev1alpha1.CSIStorageCapacity](informer) +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1alpha1/interface.go b/vendor/k8s.io/client-go/informers/storage/v1alpha1/interface.go index bda3b1add9..5ed95b0efc 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1alpha1/interface.go +++ b/vendor/k8s.io/client-go/informers/storage/v1alpha1/interface.go @@ -25,11 +25,11 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // CSIStorageCapacities returns a CSIStorageCapacityInformer. - CSIStorageCapacities() CSIStorageCapacityInformer + CSIStorageCapacities() TypedCSIStorageCapacityInformer // VolumeAttachments returns a VolumeAttachmentInformer. - VolumeAttachments() VolumeAttachmentInformer + VolumeAttachments() TypedVolumeAttachmentInformer // VolumeAttributesClasses returns a VolumeAttributesClassInformer. - VolumeAttributesClasses() VolumeAttributesClassInformer + VolumeAttributesClasses() TypedVolumeAttributesClassInformer } type version struct { @@ -43,17 +43,17 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// CSIStorageCapacities returns a CSIStorageCapacityInformer. -func (v *version) CSIStorageCapacities() CSIStorageCapacityInformer { +// CSIStorageCapacities returns a TypedCSIStorageCapacityInformer. +func (v *version) CSIStorageCapacities() TypedCSIStorageCapacityInformer { return &cSIStorageCapacityInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// VolumeAttachments returns a VolumeAttachmentInformer. -func (v *version) VolumeAttachments() VolumeAttachmentInformer { +// VolumeAttachments returns a TypedVolumeAttachmentInformer. +func (v *version) VolumeAttachments() TypedVolumeAttachmentInformer { return &volumeAttachmentInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// VolumeAttributesClasses returns a VolumeAttributesClassInformer. -func (v *version) VolumeAttributesClasses() VolumeAttributesClassInformer { +// VolumeAttributesClasses returns a TypedVolumeAttributesClassInformer. +func (v *version) VolumeAttributesClasses() TypedVolumeAttributesClassInformer { return &volumeAttributesClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go b/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go index 1ab135906f..f270fecec0 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go +++ b/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go @@ -34,12 +34,40 @@ import ( ) // VolumeAttachmentInformer provides access to a shared informer and lister for -// VolumeAttachments. +// VolumeAttachments. Prefer using the type-safe variant (see [TypedVolumeAttachmentInformer]). type VolumeAttachmentInformer interface { Informer() cache.SharedIndexInformer Lister() storagev1alpha1.VolumeAttachmentLister } +// TypedVolumeAttachmentInformer provides access to a shared informer and lister for +// VolumeAttachments, including the type-safe TypedInformer variant. +// It is a superset of VolumeAttachmentInformer. +type TypedVolumeAttachmentInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() VolumeAttachmentIndexInformer + Lister() storagev1alpha1.VolumeAttachmentLister +} + +// VolumeAttachmentIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type VolumeAttachmentIndexInformer cache.TypedSharedIndexInformer[*apistoragev1alpha1.VolumeAttachment] + +// VolumeAttachmentHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for VolumeAttachment. +type VolumeAttachmentHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apistoragev1alpha1.VolumeAttachment] + +// VolumeAttachmentDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for VolumeAttachment. +type VolumeAttachmentDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apistoragev1alpha1.VolumeAttachment] + +// VolumeAttachmentFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for VolumeAttachment. +type VolumeAttachmentFilteringHandler = cache.TypedFilteringResourceEventHandler[*apistoragev1alpha1.VolumeAttachment] + +// VolumeAttachmentIndexers is a specialization of [cache.TypedIndexers] for VolumeAttachment. +type VolumeAttachmentIndexers = cache.TypedIndexers[*apistoragev1alpha1.VolumeAttachment] + +// DeletedVolumeAttachment is a specialization of [cache.DeletedObject] for VolumeAttachment. +type DeletedVolumeAttachment = cache.DeletedObject[*apistoragev1alpha1.VolumeAttachment] + type volumeAttachmentInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type volumeAttachmentInformer struct { // NewVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedVolumeAttachmentInformer]). func NewVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers VolumeAttachmentIndexers) VolumeAttachmentIndexInformer { + return NewTypedVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredVolumeAttachmentInformer]). func NewFilteredVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers VolumeAttachmentIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) VolumeAttachmentIndexInformer { + return NewTypedVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewVolumeAttachmentInformerWithOptions constructs a new informer for VolumeAttachment type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedVolumeAttachmentInformerWithOptions]). func NewVolumeAttachmentInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedVolumeAttachmentInformerWithOptions(client, options) +} + +// NewTypedVolumeAttachmentInformerWithOptions constructs a new informer for VolumeAttachment type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedVolumeAttachmentInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) VolumeAttachmentIndexInformer { gvr := schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1alpha1", Resource: "volumeattachments"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apistoragev1alpha1.VolumeAttachment](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewVolumeAttachmentInformerWithOptions(client kubernetes.Interface, options Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *volumeAttachmentInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *volumeAttachmentInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apistoragev1alpha1.VolumeAttachment{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *volumeAttachmentInformer) TypedInformer() VolumeAttachmentIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1alpha1.VolumeAttachment](f.factory.InformerFor(&apistoragev1alpha1.VolumeAttachment{}, f.defaultInformer)) } func (f *volumeAttachmentInformer) Lister() storagev1alpha1.VolumeAttachmentLister { return storagev1alpha1.NewVolumeAttachmentLister(f.Informer().GetIndexer()) } + +// ToTypedVolumeAttachmentInformer converts an untyped informer into a TypedVolumeAttachmentInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *VolumeAttachment. If that is not the case, calling type-safe methods of the returned +// TypedVolumeAttachmentInformer leads to runtime panics. A safer alternative is to pass +// around a TypedVolumeAttachmentInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedVolumeAttachmentInformer(informer VolumeAttachmentInformer) TypedVolumeAttachmentInformer { + if informer, ok := informer.(TypedVolumeAttachmentInformer); ok { + return informer + } + return &volumeAttachmentTypedInformerAdapter{informer} +} + +type volumeAttachmentTypedInformerAdapter struct { + VolumeAttachmentInformer +} + +func (a *volumeAttachmentTypedInformerAdapter) TypedInformer() VolumeAttachmentIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1alpha1.VolumeAttachment](a.Informer()) +} + +// ToVolumeAttachmentIndexInformer converts an untyped informer into a VolumeAttachmentIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *VolumeAttachment. If that is not the case, calling type-safe methods of the returned +// VolumeAttachmentIndexInformer leads to runtime panics. A safer alternative is to pass +// around a VolumeAttachmentIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToVolumeAttachmentIndexInformer(informer cache.SharedIndexInformer) VolumeAttachmentIndexInformer { + if informer, ok := informer.(VolumeAttachmentIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apistoragev1alpha1.VolumeAttachment](informer) +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattributesclass.go b/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattributesclass.go index e649c665ee..0ba63295c8 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattributesclass.go +++ b/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattributesclass.go @@ -34,12 +34,40 @@ import ( ) // VolumeAttributesClassInformer provides access to a shared informer and lister for -// VolumeAttributesClasses. +// VolumeAttributesClasses. Prefer using the type-safe variant (see [TypedVolumeAttributesClassInformer]). type VolumeAttributesClassInformer interface { Informer() cache.SharedIndexInformer Lister() storagev1alpha1.VolumeAttributesClassLister } +// TypedVolumeAttributesClassInformer provides access to a shared informer and lister for +// VolumeAttributesClasses, including the type-safe TypedInformer variant. +// It is a superset of VolumeAttributesClassInformer. +type TypedVolumeAttributesClassInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() VolumeAttributesClassIndexInformer + Lister() storagev1alpha1.VolumeAttributesClassLister +} + +// VolumeAttributesClassIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type VolumeAttributesClassIndexInformer cache.TypedSharedIndexInformer[*apistoragev1alpha1.VolumeAttributesClass] + +// VolumeAttributesClassHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for VolumeAttributesClass. +type VolumeAttributesClassHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apistoragev1alpha1.VolumeAttributesClass] + +// VolumeAttributesClassDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for VolumeAttributesClass. +type VolumeAttributesClassDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apistoragev1alpha1.VolumeAttributesClass] + +// VolumeAttributesClassFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for VolumeAttributesClass. +type VolumeAttributesClassFilteringHandler = cache.TypedFilteringResourceEventHandler[*apistoragev1alpha1.VolumeAttributesClass] + +// VolumeAttributesClassIndexers is a specialization of [cache.TypedIndexers] for VolumeAttributesClass. +type VolumeAttributesClassIndexers = cache.TypedIndexers[*apistoragev1alpha1.VolumeAttributesClass] + +// DeletedVolumeAttributesClass is a specialization of [cache.DeletedObject] for VolumeAttributesClass. +type DeletedVolumeAttributesClass = cache.DeletedObject[*apistoragev1alpha1.VolumeAttributesClass] + type volumeAttributesClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type volumeAttributesClassInformer struct { // NewVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedVolumeAttributesClassInformer]). func NewVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers VolumeAttributesClassIndexers) VolumeAttributesClassIndexInformer { + return NewTypedVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredVolumeAttributesClassInformer]). func NewFilteredVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers VolumeAttributesClassIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) VolumeAttributesClassIndexInformer { + return NewTypedVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewVolumeAttributesClassInformerWithOptions constructs a new informer for VolumeAttributesClass type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedVolumeAttributesClassInformerWithOptions]). func NewVolumeAttributesClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedVolumeAttributesClassInformerWithOptions(client, options) +} + +// NewTypedVolumeAttributesClassInformerWithOptions constructs a new informer for VolumeAttributesClass type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedVolumeAttributesClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) VolumeAttributesClassIndexInformer { gvr := schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1alpha1", Resource: "volumeattributesclasss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apistoragev1alpha1.VolumeAttributesClass](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewVolumeAttributesClassInformerWithOptions(client kubernetes.Interface, op Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *volumeAttributesClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *volumeAttributesClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apistoragev1alpha1.VolumeAttributesClass{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *volumeAttributesClassInformer) TypedInformer() VolumeAttributesClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1alpha1.VolumeAttributesClass](f.factory.InformerFor(&apistoragev1alpha1.VolumeAttributesClass{}, f.defaultInformer)) } func (f *volumeAttributesClassInformer) Lister() storagev1alpha1.VolumeAttributesClassLister { return storagev1alpha1.NewVolumeAttributesClassLister(f.Informer().GetIndexer()) } + +// ToTypedVolumeAttributesClassInformer converts an untyped informer into a TypedVolumeAttributesClassInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *VolumeAttributesClass. If that is not the case, calling type-safe methods of the returned +// TypedVolumeAttributesClassInformer leads to runtime panics. A safer alternative is to pass +// around a TypedVolumeAttributesClassInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedVolumeAttributesClassInformer(informer VolumeAttributesClassInformer) TypedVolumeAttributesClassInformer { + if informer, ok := informer.(TypedVolumeAttributesClassInformer); ok { + return informer + } + return &volumeAttributesClassTypedInformerAdapter{informer} +} + +type volumeAttributesClassTypedInformerAdapter struct { + VolumeAttributesClassInformer +} + +func (a *volumeAttributesClassTypedInformerAdapter) TypedInformer() VolumeAttributesClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1alpha1.VolumeAttributesClass](a.Informer()) +} + +// ToVolumeAttributesClassIndexInformer converts an untyped informer into a VolumeAttributesClassIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *VolumeAttributesClass. If that is not the case, calling type-safe methods of the returned +// VolumeAttributesClassIndexInformer leads to runtime panics. A safer alternative is to pass +// around a VolumeAttributesClassIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToVolumeAttributesClassIndexInformer(informer cache.SharedIndexInformer) VolumeAttributesClassIndexInformer { + if informer, ok := informer.(VolumeAttributesClassIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apistoragev1alpha1.VolumeAttributesClass](informer) +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1beta1/csidriver.go b/vendor/k8s.io/client-go/informers/storage/v1beta1/csidriver.go index 283dc6b17c..33c0f5551a 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1beta1/csidriver.go +++ b/vendor/k8s.io/client-go/informers/storage/v1beta1/csidriver.go @@ -34,12 +34,40 @@ import ( ) // CSIDriverInformer provides access to a shared informer and lister for -// CSIDrivers. +// CSIDrivers. Prefer using the type-safe variant (see [TypedCSIDriverInformer]). type CSIDriverInformer interface { Informer() cache.SharedIndexInformer Lister() storagev1beta1.CSIDriverLister } +// TypedCSIDriverInformer provides access to a shared informer and lister for +// CSIDrivers, including the type-safe TypedInformer variant. +// It is a superset of CSIDriverInformer. +type TypedCSIDriverInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CSIDriverIndexInformer + Lister() storagev1beta1.CSIDriverLister +} + +// CSIDriverIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CSIDriverIndexInformer cache.TypedSharedIndexInformer[*apistoragev1beta1.CSIDriver] + +// CSIDriverHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CSIDriver. +type CSIDriverHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apistoragev1beta1.CSIDriver] + +// CSIDriverDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CSIDriver. +type CSIDriverDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apistoragev1beta1.CSIDriver] + +// CSIDriverFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CSIDriver. +type CSIDriverFilteringHandler = cache.TypedFilteringResourceEventHandler[*apistoragev1beta1.CSIDriver] + +// CSIDriverIndexers is a specialization of [cache.TypedIndexers] for CSIDriver. +type CSIDriverIndexers = cache.TypedIndexers[*apistoragev1beta1.CSIDriver] + +// DeletedCSIDriver is a specialization of [cache.DeletedObject] for CSIDriver. +type DeletedCSIDriver = cache.DeletedObject[*apistoragev1beta1.CSIDriver] + type cSIDriverInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type cSIDriverInformer struct { // NewCSIDriverInformer constructs a new informer for CSIDriver type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCSIDriverInformer]). func NewCSIDriverInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewCSIDriverInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedCSIDriverInformer constructs a new informer for CSIDriver type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCSIDriverInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers CSIDriverIndexers) CSIDriverIndexInformer { + return NewTypedCSIDriverInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredCSIDriverInformer constructs a new informer for CSIDriver type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCSIDriverInformer]). func NewFilteredCSIDriverInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewCSIDriverInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedCSIDriverInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCSIDriverInformer constructs a new informer for CSIDriver type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredCSIDriverInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers CSIDriverIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CSIDriverIndexInformer { + return NewTypedCSIDriverInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewCSIDriverInformerWithOptions constructs a new informer for CSIDriver type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCSIDriverInformerWithOptions]). func NewCSIDriverInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCSIDriverInformerWithOptions(client, options) +} + +// NewTypedCSIDriverInformerWithOptions constructs a new informer for CSIDriver type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCSIDriverInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) CSIDriverIndexInformer { gvr := schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1beta1", Resource: "csidrivers"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.CSIDriver](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewCSIDriverInformerWithOptions(client kubernetes.Interface, options intern Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *cSIDriverInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewCSIDriverInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedCSIDriverInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *cSIDriverInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apistoragev1beta1.CSIDriver{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *cSIDriverInformer) TypedInformer() CSIDriverIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.CSIDriver](f.factory.InformerFor(&apistoragev1beta1.CSIDriver{}, f.defaultInformer)) } func (f *cSIDriverInformer) Lister() storagev1beta1.CSIDriverLister { return storagev1beta1.NewCSIDriverLister(f.Informer().GetIndexer()) } + +// ToTypedCSIDriverInformer converts an untyped informer into a TypedCSIDriverInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CSIDriver. If that is not the case, calling type-safe methods of the returned +// TypedCSIDriverInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCSIDriverInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCSIDriverInformer(informer CSIDriverInformer) TypedCSIDriverInformer { + if informer, ok := informer.(TypedCSIDriverInformer); ok { + return informer + } + return &cSIDriverTypedInformerAdapter{informer} +} + +type cSIDriverTypedInformerAdapter struct { + CSIDriverInformer +} + +func (a *cSIDriverTypedInformerAdapter) TypedInformer() CSIDriverIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.CSIDriver](a.Informer()) +} + +// ToCSIDriverIndexInformer converts an untyped informer into a CSIDriverIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CSIDriver. If that is not the case, calling type-safe methods of the returned +// CSIDriverIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CSIDriverIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCSIDriverIndexInformer(informer cache.SharedIndexInformer) CSIDriverIndexInformer { + if informer, ok := informer.(CSIDriverIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.CSIDriver](informer) +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1beta1/csinode.go b/vendor/k8s.io/client-go/informers/storage/v1beta1/csinode.go index f304906ce7..4e7fa6f560 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1beta1/csinode.go +++ b/vendor/k8s.io/client-go/informers/storage/v1beta1/csinode.go @@ -34,12 +34,40 @@ import ( ) // CSINodeInformer provides access to a shared informer and lister for -// CSINodes. +// CSINodes. Prefer using the type-safe variant (see [TypedCSINodeInformer]). type CSINodeInformer interface { Informer() cache.SharedIndexInformer Lister() storagev1beta1.CSINodeLister } +// TypedCSINodeInformer provides access to a shared informer and lister for +// CSINodes, including the type-safe TypedInformer variant. +// It is a superset of CSINodeInformer. +type TypedCSINodeInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CSINodeIndexInformer + Lister() storagev1beta1.CSINodeLister +} + +// CSINodeIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CSINodeIndexInformer cache.TypedSharedIndexInformer[*apistoragev1beta1.CSINode] + +// CSINodeHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CSINode. +type CSINodeHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apistoragev1beta1.CSINode] + +// CSINodeDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CSINode. +type CSINodeDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apistoragev1beta1.CSINode] + +// CSINodeFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CSINode. +type CSINodeFilteringHandler = cache.TypedFilteringResourceEventHandler[*apistoragev1beta1.CSINode] + +// CSINodeIndexers is a specialization of [cache.TypedIndexers] for CSINode. +type CSINodeIndexers = cache.TypedIndexers[*apistoragev1beta1.CSINode] + +// DeletedCSINode is a specialization of [cache.DeletedObject] for CSINode. +type DeletedCSINode = cache.DeletedObject[*apistoragev1beta1.CSINode] + type cSINodeInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type cSINodeInformer struct { // NewCSINodeInformer constructs a new informer for CSINode type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCSINodeInformer]). func NewCSINodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewCSINodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedCSINodeInformer constructs a new informer for CSINode type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCSINodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers CSINodeIndexers) CSINodeIndexInformer { + return NewTypedCSINodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredCSINodeInformer constructs a new informer for CSINode type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCSINodeInformer]). func NewFilteredCSINodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewCSINodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedCSINodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCSINodeInformer constructs a new informer for CSINode type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredCSINodeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers CSINodeIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CSINodeIndexInformer { + return NewTypedCSINodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewCSINodeInformerWithOptions constructs a new informer for CSINode type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCSINodeInformerWithOptions]). func NewCSINodeInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCSINodeInformerWithOptions(client, options) +} + +// NewTypedCSINodeInformerWithOptions constructs a new informer for CSINode type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCSINodeInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) CSINodeIndexInformer { gvr := schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1beta1", Resource: "csinodes"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.CSINode](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewCSINodeInformerWithOptions(client kubernetes.Interface, options internal Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *cSINodeInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewCSINodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedCSINodeInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *cSINodeInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apistoragev1beta1.CSINode{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *cSINodeInformer) TypedInformer() CSINodeIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.CSINode](f.factory.InformerFor(&apistoragev1beta1.CSINode{}, f.defaultInformer)) } func (f *cSINodeInformer) Lister() storagev1beta1.CSINodeLister { return storagev1beta1.NewCSINodeLister(f.Informer().GetIndexer()) } + +// ToTypedCSINodeInformer converts an untyped informer into a TypedCSINodeInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CSINode. If that is not the case, calling type-safe methods of the returned +// TypedCSINodeInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCSINodeInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCSINodeInformer(informer CSINodeInformer) TypedCSINodeInformer { + if informer, ok := informer.(TypedCSINodeInformer); ok { + return informer + } + return &cSINodeTypedInformerAdapter{informer} +} + +type cSINodeTypedInformerAdapter struct { + CSINodeInformer +} + +func (a *cSINodeTypedInformerAdapter) TypedInformer() CSINodeIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.CSINode](a.Informer()) +} + +// ToCSINodeIndexInformer converts an untyped informer into a CSINodeIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CSINode. If that is not the case, calling type-safe methods of the returned +// CSINodeIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CSINodeIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCSINodeIndexInformer(informer cache.SharedIndexInformer) CSINodeIndexInformer { + if informer, ok := informer.(CSINodeIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.CSINode](informer) +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1beta1/csistoragecapacity.go b/vendor/k8s.io/client-go/informers/storage/v1beta1/csistoragecapacity.go index 5b24a8c32b..26c7cdb54d 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1beta1/csistoragecapacity.go +++ b/vendor/k8s.io/client-go/informers/storage/v1beta1/csistoragecapacity.go @@ -34,12 +34,40 @@ import ( ) // CSIStorageCapacityInformer provides access to a shared informer and lister for -// CSIStorageCapacities. +// CSIStorageCapacities. Prefer using the type-safe variant (see [TypedCSIStorageCapacityInformer]). type CSIStorageCapacityInformer interface { Informer() cache.SharedIndexInformer Lister() storagev1beta1.CSIStorageCapacityLister } +// TypedCSIStorageCapacityInformer provides access to a shared informer and lister for +// CSIStorageCapacities, including the type-safe TypedInformer variant. +// It is a superset of CSIStorageCapacityInformer. +type TypedCSIStorageCapacityInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CSIStorageCapacityIndexInformer + Lister() storagev1beta1.CSIStorageCapacityLister +} + +// CSIStorageCapacityIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CSIStorageCapacityIndexInformer cache.TypedSharedIndexInformer[*apistoragev1beta1.CSIStorageCapacity] + +// CSIStorageCapacityHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CSIStorageCapacity. +type CSIStorageCapacityHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apistoragev1beta1.CSIStorageCapacity] + +// CSIStorageCapacityDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CSIStorageCapacity. +type CSIStorageCapacityDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apistoragev1beta1.CSIStorageCapacity] + +// CSIStorageCapacityFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CSIStorageCapacity. +type CSIStorageCapacityFilteringHandler = cache.TypedFilteringResourceEventHandler[*apistoragev1beta1.CSIStorageCapacity] + +// CSIStorageCapacityIndexers is a specialization of [cache.TypedIndexers] for CSIStorageCapacity. +type CSIStorageCapacityIndexers = cache.TypedIndexers[*apistoragev1beta1.CSIStorageCapacity] + +// DeletedCSIStorageCapacity is a specialization of [cache.DeletedObject] for CSIStorageCapacity. +type DeletedCSIStorageCapacity = cache.DeletedObject[*apistoragev1beta1.CSIStorageCapacity] + type cSIStorageCapacityInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -49,25 +77,49 @@ type cSIStorageCapacityInformer struct { // NewCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCSIStorageCapacityInformer]). func NewCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewCSIStorageCapacityInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers CSIStorageCapacityIndexers) CSIStorageCapacityIndexInformer { + return NewTypedCSIStorageCapacityInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCSIStorageCapacityInformer]). func NewFilteredCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewCSIStorageCapacityInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedCSIStorageCapacityInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers CSIStorageCapacityIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CSIStorageCapacityIndexInformer { + return NewTypedCSIStorageCapacityInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewCSIStorageCapacityInformerWithOptions constructs a new informer for CSIStorageCapacity type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCSIStorageCapacityInformerWithOptions]). func NewCSIStorageCapacityInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCSIStorageCapacityInformerWithOptions(client, namespace, options) +} + +// NewTypedCSIStorageCapacityInformerWithOptions constructs a new informer for CSIStorageCapacity type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCSIStorageCapacityInformerWithOptions(client kubernetes.Interface, namespace string, options internalinterfaces.InformerOptions) CSIStorageCapacityIndexInformer { gvr := schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1beta1", Resource: "csistoragecapacitys"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.CSIStorageCapacity](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -100,17 +152,57 @@ func NewCSIStorageCapacityInformerWithOptions(client kubernetes.Interface, names Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *cSIStorageCapacityInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewCSIStorageCapacityInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedCSIStorageCapacityInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *cSIStorageCapacityInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apistoragev1beta1.CSIStorageCapacity{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *cSIStorageCapacityInformer) TypedInformer() CSIStorageCapacityIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.CSIStorageCapacity](f.factory.InformerFor(&apistoragev1beta1.CSIStorageCapacity{}, f.defaultInformer)) } func (f *cSIStorageCapacityInformer) Lister() storagev1beta1.CSIStorageCapacityLister { return storagev1beta1.NewCSIStorageCapacityLister(f.Informer().GetIndexer()) } + +// ToTypedCSIStorageCapacityInformer converts an untyped informer into a TypedCSIStorageCapacityInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CSIStorageCapacity. If that is not the case, calling type-safe methods of the returned +// TypedCSIStorageCapacityInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCSIStorageCapacityInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCSIStorageCapacityInformer(informer CSIStorageCapacityInformer) TypedCSIStorageCapacityInformer { + if informer, ok := informer.(TypedCSIStorageCapacityInformer); ok { + return informer + } + return &cSIStorageCapacityTypedInformerAdapter{informer} +} + +type cSIStorageCapacityTypedInformerAdapter struct { + CSIStorageCapacityInformer +} + +func (a *cSIStorageCapacityTypedInformerAdapter) TypedInformer() CSIStorageCapacityIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.CSIStorageCapacity](a.Informer()) +} + +// ToCSIStorageCapacityIndexInformer converts an untyped informer into a CSIStorageCapacityIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CSIStorageCapacity. If that is not the case, calling type-safe methods of the returned +// CSIStorageCapacityIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CSIStorageCapacityIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCSIStorageCapacityIndexInformer(informer cache.SharedIndexInformer) CSIStorageCapacityIndexInformer { + if informer, ok := informer.(CSIStorageCapacityIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.CSIStorageCapacity](informer) +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/storage/v1beta1/interface.go index 7433951855..a1a312170c 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/storage/v1beta1/interface.go @@ -25,17 +25,17 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // CSIDrivers returns a CSIDriverInformer. - CSIDrivers() CSIDriverInformer + CSIDrivers() TypedCSIDriverInformer // CSINodes returns a CSINodeInformer. - CSINodes() CSINodeInformer + CSINodes() TypedCSINodeInformer // CSIStorageCapacities returns a CSIStorageCapacityInformer. - CSIStorageCapacities() CSIStorageCapacityInformer + CSIStorageCapacities() TypedCSIStorageCapacityInformer // StorageClasses returns a StorageClassInformer. - StorageClasses() StorageClassInformer + StorageClasses() TypedStorageClassInformer // VolumeAttachments returns a VolumeAttachmentInformer. - VolumeAttachments() VolumeAttachmentInformer + VolumeAttachments() TypedVolumeAttachmentInformer // VolumeAttributesClasses returns a VolumeAttributesClassInformer. - VolumeAttributesClasses() VolumeAttributesClassInformer + VolumeAttributesClasses() TypedVolumeAttributesClassInformer } type version struct { @@ -49,32 +49,32 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// CSIDrivers returns a CSIDriverInformer. -func (v *version) CSIDrivers() CSIDriverInformer { +// CSIDrivers returns a TypedCSIDriverInformer. +func (v *version) CSIDrivers() TypedCSIDriverInformer { return &cSIDriverInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// CSINodes returns a CSINodeInformer. -func (v *version) CSINodes() CSINodeInformer { +// CSINodes returns a TypedCSINodeInformer. +func (v *version) CSINodes() TypedCSINodeInformer { return &cSINodeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// CSIStorageCapacities returns a CSIStorageCapacityInformer. -func (v *version) CSIStorageCapacities() CSIStorageCapacityInformer { +// CSIStorageCapacities returns a TypedCSIStorageCapacityInformer. +func (v *version) CSIStorageCapacities() TypedCSIStorageCapacityInformer { return &cSIStorageCapacityInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// StorageClasses returns a StorageClassInformer. -func (v *version) StorageClasses() StorageClassInformer { +// StorageClasses returns a TypedStorageClassInformer. +func (v *version) StorageClasses() TypedStorageClassInformer { return &storageClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// VolumeAttachments returns a VolumeAttachmentInformer. -func (v *version) VolumeAttachments() VolumeAttachmentInformer { +// VolumeAttachments returns a TypedVolumeAttachmentInformer. +func (v *version) VolumeAttachments() TypedVolumeAttachmentInformer { return &volumeAttachmentInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } -// VolumeAttributesClasses returns a VolumeAttributesClassInformer. -func (v *version) VolumeAttributesClasses() VolumeAttributesClassInformer { +// VolumeAttributesClasses returns a TypedVolumeAttributesClassInformer. +func (v *version) VolumeAttributesClasses() TypedVolumeAttributesClassInformer { return &volumeAttributesClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go b/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go index 2052da70e9..55bbe4446b 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go +++ b/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go @@ -34,12 +34,40 @@ import ( ) // StorageClassInformer provides access to a shared informer and lister for -// StorageClasses. +// StorageClasses. Prefer using the type-safe variant (see [TypedStorageClassInformer]). type StorageClassInformer interface { Informer() cache.SharedIndexInformer Lister() storagev1beta1.StorageClassLister } +// TypedStorageClassInformer provides access to a shared informer and lister for +// StorageClasses, including the type-safe TypedInformer variant. +// It is a superset of StorageClassInformer. +type TypedStorageClassInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() StorageClassIndexInformer + Lister() storagev1beta1.StorageClassLister +} + +// StorageClassIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type StorageClassIndexInformer cache.TypedSharedIndexInformer[*apistoragev1beta1.StorageClass] + +// StorageClassHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for StorageClass. +type StorageClassHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apistoragev1beta1.StorageClass] + +// StorageClassDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for StorageClass. +type StorageClassDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apistoragev1beta1.StorageClass] + +// StorageClassFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for StorageClass. +type StorageClassFilteringHandler = cache.TypedFilteringResourceEventHandler[*apistoragev1beta1.StorageClass] + +// StorageClassIndexers is a specialization of [cache.TypedIndexers] for StorageClass. +type StorageClassIndexers = cache.TypedIndexers[*apistoragev1beta1.StorageClass] + +// DeletedStorageClass is a specialization of [cache.DeletedObject] for StorageClass. +type DeletedStorageClass = cache.DeletedObject[*apistoragev1beta1.StorageClass] + type storageClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type storageClassInformer struct { // NewStorageClassInformer constructs a new informer for StorageClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStorageClassInformer]). func NewStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewStorageClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedStorageClassInformer constructs a new informer for StorageClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers StorageClassIndexers) StorageClassIndexInformer { + return NewTypedStorageClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredStorageClassInformer constructs a new informer for StorageClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredStorageClassInformer]). func NewFilteredStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewStorageClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedStorageClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredStorageClassInformer constructs a new informer for StorageClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers StorageClassIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) StorageClassIndexInformer { + return NewTypedStorageClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewStorageClassInformerWithOptions constructs a new informer for StorageClass type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStorageClassInformerWithOptions]). func NewStorageClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedStorageClassInformerWithOptions(client, options) +} + +// NewTypedStorageClassInformerWithOptions constructs a new informer for StorageClass type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStorageClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) StorageClassIndexInformer { gvr := schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1beta1", Resource: "storageclasss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.StorageClass](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewStorageClassInformerWithOptions(client kubernetes.Interface, options int Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *storageClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewStorageClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedStorageClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *storageClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apistoragev1beta1.StorageClass{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *storageClassInformer) TypedInformer() StorageClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.StorageClass](f.factory.InformerFor(&apistoragev1beta1.StorageClass{}, f.defaultInformer)) } func (f *storageClassInformer) Lister() storagev1beta1.StorageClassLister { return storagev1beta1.NewStorageClassLister(f.Informer().GetIndexer()) } + +// ToTypedStorageClassInformer converts an untyped informer into a TypedStorageClassInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StorageClass. If that is not the case, calling type-safe methods of the returned +// TypedStorageClassInformer leads to runtime panics. A safer alternative is to pass +// around a TypedStorageClassInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedStorageClassInformer(informer StorageClassInformer) TypedStorageClassInformer { + if informer, ok := informer.(TypedStorageClassInformer); ok { + return informer + } + return &storageClassTypedInformerAdapter{informer} +} + +type storageClassTypedInformerAdapter struct { + StorageClassInformer +} + +func (a *storageClassTypedInformerAdapter) TypedInformer() StorageClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.StorageClass](a.Informer()) +} + +// ToStorageClassIndexInformer converts an untyped informer into a StorageClassIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StorageClass. If that is not the case, calling type-safe methods of the returned +// StorageClassIndexInformer leads to runtime panics. A safer alternative is to pass +// around a StorageClassIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToStorageClassIndexInformer(informer cache.SharedIndexInformer) StorageClassIndexInformer { + if informer, ok := informer.(StorageClassIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.StorageClass](informer) +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattachment.go b/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattachment.go index 11f9840b04..d288cba131 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattachment.go +++ b/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattachment.go @@ -34,12 +34,40 @@ import ( ) // VolumeAttachmentInformer provides access to a shared informer and lister for -// VolumeAttachments. +// VolumeAttachments. Prefer using the type-safe variant (see [TypedVolumeAttachmentInformer]). type VolumeAttachmentInformer interface { Informer() cache.SharedIndexInformer Lister() storagev1beta1.VolumeAttachmentLister } +// TypedVolumeAttachmentInformer provides access to a shared informer and lister for +// VolumeAttachments, including the type-safe TypedInformer variant. +// It is a superset of VolumeAttachmentInformer. +type TypedVolumeAttachmentInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() VolumeAttachmentIndexInformer + Lister() storagev1beta1.VolumeAttachmentLister +} + +// VolumeAttachmentIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type VolumeAttachmentIndexInformer cache.TypedSharedIndexInformer[*apistoragev1beta1.VolumeAttachment] + +// VolumeAttachmentHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for VolumeAttachment. +type VolumeAttachmentHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apistoragev1beta1.VolumeAttachment] + +// VolumeAttachmentDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for VolumeAttachment. +type VolumeAttachmentDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apistoragev1beta1.VolumeAttachment] + +// VolumeAttachmentFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for VolumeAttachment. +type VolumeAttachmentFilteringHandler = cache.TypedFilteringResourceEventHandler[*apistoragev1beta1.VolumeAttachment] + +// VolumeAttachmentIndexers is a specialization of [cache.TypedIndexers] for VolumeAttachment. +type VolumeAttachmentIndexers = cache.TypedIndexers[*apistoragev1beta1.VolumeAttachment] + +// DeletedVolumeAttachment is a specialization of [cache.DeletedObject] for VolumeAttachment. +type DeletedVolumeAttachment = cache.DeletedObject[*apistoragev1beta1.VolumeAttachment] + type volumeAttachmentInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type volumeAttachmentInformer struct { // NewVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedVolumeAttachmentInformer]). func NewVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers VolumeAttachmentIndexers) VolumeAttachmentIndexInformer { + return NewTypedVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredVolumeAttachmentInformer]). func NewFilteredVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredVolumeAttachmentInformer constructs a new informer for VolumeAttachment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredVolumeAttachmentInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers VolumeAttachmentIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) VolumeAttachmentIndexInformer { + return NewTypedVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewVolumeAttachmentInformerWithOptions constructs a new informer for VolumeAttachment type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedVolumeAttachmentInformerWithOptions]). func NewVolumeAttachmentInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedVolumeAttachmentInformerWithOptions(client, options) +} + +// NewTypedVolumeAttachmentInformerWithOptions constructs a new informer for VolumeAttachment type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedVolumeAttachmentInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) VolumeAttachmentIndexInformer { gvr := schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1beta1", Resource: "volumeattachments"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.VolumeAttachment](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewVolumeAttachmentInformerWithOptions(client kubernetes.Interface, options Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *volumeAttachmentInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedVolumeAttachmentInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *volumeAttachmentInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apistoragev1beta1.VolumeAttachment{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *volumeAttachmentInformer) TypedInformer() VolumeAttachmentIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.VolumeAttachment](f.factory.InformerFor(&apistoragev1beta1.VolumeAttachment{}, f.defaultInformer)) } func (f *volumeAttachmentInformer) Lister() storagev1beta1.VolumeAttachmentLister { return storagev1beta1.NewVolumeAttachmentLister(f.Informer().GetIndexer()) } + +// ToTypedVolumeAttachmentInformer converts an untyped informer into a TypedVolumeAttachmentInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *VolumeAttachment. If that is not the case, calling type-safe methods of the returned +// TypedVolumeAttachmentInformer leads to runtime panics. A safer alternative is to pass +// around a TypedVolumeAttachmentInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedVolumeAttachmentInformer(informer VolumeAttachmentInformer) TypedVolumeAttachmentInformer { + if informer, ok := informer.(TypedVolumeAttachmentInformer); ok { + return informer + } + return &volumeAttachmentTypedInformerAdapter{informer} +} + +type volumeAttachmentTypedInformerAdapter struct { + VolumeAttachmentInformer +} + +func (a *volumeAttachmentTypedInformerAdapter) TypedInformer() VolumeAttachmentIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.VolumeAttachment](a.Informer()) +} + +// ToVolumeAttachmentIndexInformer converts an untyped informer into a VolumeAttachmentIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *VolumeAttachment. If that is not the case, calling type-safe methods of the returned +// VolumeAttachmentIndexInformer leads to runtime panics. A safer alternative is to pass +// around a VolumeAttachmentIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToVolumeAttachmentIndexInformer(informer cache.SharedIndexInformer) VolumeAttachmentIndexInformer { + if informer, ok := informer.(VolumeAttachmentIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.VolumeAttachment](informer) +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattributesclass.go b/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattributesclass.go index c91dfff0d1..c37a0a22d8 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattributesclass.go +++ b/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattributesclass.go @@ -34,12 +34,40 @@ import ( ) // VolumeAttributesClassInformer provides access to a shared informer and lister for -// VolumeAttributesClasses. +// VolumeAttributesClasses. Prefer using the type-safe variant (see [TypedVolumeAttributesClassInformer]). type VolumeAttributesClassInformer interface { Informer() cache.SharedIndexInformer Lister() storagev1beta1.VolumeAttributesClassLister } +// TypedVolumeAttributesClassInformer provides access to a shared informer and lister for +// VolumeAttributesClasses, including the type-safe TypedInformer variant. +// It is a superset of VolumeAttributesClassInformer. +type TypedVolumeAttributesClassInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() VolumeAttributesClassIndexInformer + Lister() storagev1beta1.VolumeAttributesClassLister +} + +// VolumeAttributesClassIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type VolumeAttributesClassIndexInformer cache.TypedSharedIndexInformer[*apistoragev1beta1.VolumeAttributesClass] + +// VolumeAttributesClassHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for VolumeAttributesClass. +type VolumeAttributesClassHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apistoragev1beta1.VolumeAttributesClass] + +// VolumeAttributesClassDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for VolumeAttributesClass. +type VolumeAttributesClassDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apistoragev1beta1.VolumeAttributesClass] + +// VolumeAttributesClassFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for VolumeAttributesClass. +type VolumeAttributesClassFilteringHandler = cache.TypedFilteringResourceEventHandler[*apistoragev1beta1.VolumeAttributesClass] + +// VolumeAttributesClassIndexers is a specialization of [cache.TypedIndexers] for VolumeAttributesClass. +type VolumeAttributesClassIndexers = cache.TypedIndexers[*apistoragev1beta1.VolumeAttributesClass] + +// DeletedVolumeAttributesClass is a specialization of [cache.DeletedObject] for VolumeAttributesClass. +type DeletedVolumeAttributesClass = cache.DeletedObject[*apistoragev1beta1.VolumeAttributesClass] + type volumeAttributesClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type volumeAttributesClassInformer struct { // NewVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedVolumeAttributesClassInformer]). func NewVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers VolumeAttributesClassIndexers) VolumeAttributesClassIndexInformer { + return NewTypedVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredVolumeAttributesClassInformer]). func NewFilteredVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers VolumeAttributesClassIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) VolumeAttributesClassIndexInformer { + return NewTypedVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewVolumeAttributesClassInformerWithOptions constructs a new informer for VolumeAttributesClass type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedVolumeAttributesClassInformerWithOptions]). func NewVolumeAttributesClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedVolumeAttributesClassInformerWithOptions(client, options) +} + +// NewTypedVolumeAttributesClassInformerWithOptions constructs a new informer for VolumeAttributesClass type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedVolumeAttributesClassInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) VolumeAttributesClassIndexInformer { gvr := schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1beta1", Resource: "volumeattributesclasss"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.VolumeAttributesClass](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewVolumeAttributesClassInformerWithOptions(client kubernetes.Interface, op Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *volumeAttributesClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedVolumeAttributesClassInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *volumeAttributesClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apistoragev1beta1.VolumeAttributesClass{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *volumeAttributesClassInformer) TypedInformer() VolumeAttributesClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.VolumeAttributesClass](f.factory.InformerFor(&apistoragev1beta1.VolumeAttributesClass{}, f.defaultInformer)) } func (f *volumeAttributesClassInformer) Lister() storagev1beta1.VolumeAttributesClassLister { return storagev1beta1.NewVolumeAttributesClassLister(f.Informer().GetIndexer()) } + +// ToTypedVolumeAttributesClassInformer converts an untyped informer into a TypedVolumeAttributesClassInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *VolumeAttributesClass. If that is not the case, calling type-safe methods of the returned +// TypedVolumeAttributesClassInformer leads to runtime panics. A safer alternative is to pass +// around a TypedVolumeAttributesClassInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedVolumeAttributesClassInformer(informer VolumeAttributesClassInformer) TypedVolumeAttributesClassInformer { + if informer, ok := informer.(TypedVolumeAttributesClassInformer); ok { + return informer + } + return &volumeAttributesClassTypedInformerAdapter{informer} +} + +type volumeAttributesClassTypedInformerAdapter struct { + VolumeAttributesClassInformer +} + +func (a *volumeAttributesClassTypedInformerAdapter) TypedInformer() VolumeAttributesClassIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.VolumeAttributesClass](a.Informer()) +} + +// ToVolumeAttributesClassIndexInformer converts an untyped informer into a VolumeAttributesClassIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *VolumeAttributesClass. If that is not the case, calling type-safe methods of the returned +// VolumeAttributesClassIndexInformer leads to runtime panics. A safer alternative is to pass +// around a VolumeAttributesClassIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToVolumeAttributesClassIndexInformer(informer cache.SharedIndexInformer) VolumeAttributesClassIndexInformer { + if informer, ok := informer.(VolumeAttributesClassIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apistoragev1beta1.VolumeAttributesClass](informer) +} diff --git a/vendor/k8s.io/client-go/informers/storagemigration/interface.go b/vendor/k8s.io/client-go/informers/storagemigration/interface.go index 426e50fd57..5996e36529 100644 --- a/vendor/k8s.io/client-go/informers/storagemigration/interface.go +++ b/vendor/k8s.io/client-go/informers/storagemigration/interface.go @@ -20,11 +20,14 @@ package storagemigration import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + v1 "k8s.io/client-go/informers/storagemigration/v1" v1beta1 "k8s.io/client-go/informers/storagemigration/v1beta1" ) // Interface provides access to each of this group's versions. type Interface interface { + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface } @@ -40,6 +43,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) +} + // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) diff --git a/vendor/k8s.io/client-go/informers/storagemigration/v1/interface.go b/vendor/k8s.io/client-go/informers/storagemigration/v1/interface.go new file mode 100644 index 0000000000..41854207c1 --- /dev/null +++ b/vendor/k8s.io/client-go/informers/storagemigration/v1/interface.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // StorageVersionMigrations returns a StorageVersionMigrationInformer. + StorageVersionMigrations() TypedStorageVersionMigrationInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// StorageVersionMigrations returns a TypedStorageVersionMigrationInformer. +func (v *version) StorageVersionMigrations() TypedStorageVersionMigrationInformer { + return &storageVersionMigrationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/k8s.io/client-go/informers/storagemigration/v1/storageversionmigration.go b/vendor/k8s.io/client-go/informers/storagemigration/v1/storageversionmigration.go new file mode 100644 index 0000000000..8036df40b2 --- /dev/null +++ b/vendor/k8s.io/client-go/informers/storagemigration/v1/storageversionmigration.go @@ -0,0 +1,207 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + time "time" + + apistoragemigrationv1 "k8s.io/api/storagemigration/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + storagemigrationv1 "k8s.io/client-go/listers/storagemigration/v1" + cache "k8s.io/client-go/tools/cache" +) + +// StorageVersionMigrationInformer provides access to a shared informer and lister for +// StorageVersionMigrations. Prefer using the type-safe variant (see [TypedStorageVersionMigrationInformer]). +type StorageVersionMigrationInformer interface { + Informer() cache.SharedIndexInformer + Lister() storagemigrationv1.StorageVersionMigrationLister +} + +// TypedStorageVersionMigrationInformer provides access to a shared informer and lister for +// StorageVersionMigrations, including the type-safe TypedInformer variant. +// It is a superset of StorageVersionMigrationInformer. +type TypedStorageVersionMigrationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() StorageVersionMigrationIndexInformer + Lister() storagemigrationv1.StorageVersionMigrationLister +} + +// StorageVersionMigrationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type StorageVersionMigrationIndexInformer cache.TypedSharedIndexInformer[*apistoragemigrationv1.StorageVersionMigration] + +// StorageVersionMigrationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for StorageVersionMigration. +type StorageVersionMigrationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apistoragemigrationv1.StorageVersionMigration] + +// StorageVersionMigrationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for StorageVersionMigration. +type StorageVersionMigrationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apistoragemigrationv1.StorageVersionMigration] + +// StorageVersionMigrationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for StorageVersionMigration. +type StorageVersionMigrationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apistoragemigrationv1.StorageVersionMigration] + +// StorageVersionMigrationIndexers is a specialization of [cache.TypedIndexers] for StorageVersionMigration. +type StorageVersionMigrationIndexers = cache.TypedIndexers[*apistoragemigrationv1.StorageVersionMigration] + +// DeletedStorageVersionMigration is a specialization of [cache.DeletedObject] for StorageVersionMigration. +type DeletedStorageVersionMigration = cache.DeletedObject[*apistoragemigrationv1.StorageVersionMigration] + +type storageVersionMigrationInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewStorageVersionMigrationInformer constructs a new informer for StorageVersionMigration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStorageVersionMigrationInformer]). +func NewStorageVersionMigrationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewStorageVersionMigrationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewTypedStorageVersionMigrationInformer constructs a new informer for StorageVersionMigration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStorageVersionMigrationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers StorageVersionMigrationIndexers) StorageVersionMigrationIndexInformer { + return NewTypedStorageVersionMigrationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + +// NewFilteredStorageVersionMigrationInformer constructs a new informer for StorageVersionMigration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredStorageVersionMigrationInformer]). +func NewFilteredStorageVersionMigrationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewTypedStorageVersionMigrationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredStorageVersionMigrationInformer constructs a new informer for StorageVersionMigration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredStorageVersionMigrationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers StorageVersionMigrationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) StorageVersionMigrationIndexInformer { + return NewTypedStorageVersionMigrationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) +} + +// NewStorageVersionMigrationInformerWithOptions constructs a new informer for StorageVersionMigration type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStorageVersionMigrationInformerWithOptions]). +func NewStorageVersionMigrationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedStorageVersionMigrationInformerWithOptions(client, options) +} + +// NewTypedStorageVersionMigrationInformerWithOptions constructs a new informer for StorageVersionMigration type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStorageVersionMigrationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) StorageVersionMigrationIndexInformer { + gvr := schema.GroupVersionResource{Group: "storagemigration.k8s.io", Version: "v1", Resource: "storageversionmigrations"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewTypedSharedIndexInformer[*apistoragemigrationv1.StorageVersionMigration](cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.StoragemigrationV1().StorageVersionMigrations().List(context.Background(), opts) + }, + WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.StoragemigrationV1().StorageVersionMigrations().Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.StoragemigrationV1().StorageVersionMigrations().List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.StoragemigrationV1().StorageVersionMigrations().Watch(ctx, opts) + }, + }, client), + &apistoragemigrationv1.StorageVersionMigration{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + )) +} + +func (f *storageVersionMigrationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewTypedStorageVersionMigrationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *storageVersionMigrationInformer) Informer() cache.SharedIndexInformer { + return f.TypedInformer() +} + +func (f *storageVersionMigrationInformer) TypedInformer() StorageVersionMigrationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragemigrationv1.StorageVersionMigration](f.factory.InformerFor(&apistoragemigrationv1.StorageVersionMigration{}, f.defaultInformer)) +} + +func (f *storageVersionMigrationInformer) Lister() storagemigrationv1.StorageVersionMigrationLister { + return storagemigrationv1.NewStorageVersionMigrationLister(f.Informer().GetIndexer()) +} + +// ToTypedStorageVersionMigrationInformer converts an untyped informer into a TypedStorageVersionMigrationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StorageVersionMigration. If that is not the case, calling type-safe methods of the returned +// TypedStorageVersionMigrationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedStorageVersionMigrationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedStorageVersionMigrationInformer(informer StorageVersionMigrationInformer) TypedStorageVersionMigrationInformer { + if informer, ok := informer.(TypedStorageVersionMigrationInformer); ok { + return informer + } + return &storageVersionMigrationTypedInformerAdapter{informer} +} + +type storageVersionMigrationTypedInformerAdapter struct { + StorageVersionMigrationInformer +} + +func (a *storageVersionMigrationTypedInformerAdapter) TypedInformer() StorageVersionMigrationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragemigrationv1.StorageVersionMigration](a.Informer()) +} + +// ToStorageVersionMigrationIndexInformer converts an untyped informer into a StorageVersionMigrationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StorageVersionMigration. If that is not the case, calling type-safe methods of the returned +// StorageVersionMigrationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a StorageVersionMigrationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToStorageVersionMigrationIndexInformer(informer cache.SharedIndexInformer) StorageVersionMigrationIndexInformer { + if informer, ok := informer.(StorageVersionMigrationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apistoragemigrationv1.StorageVersionMigration](informer) +} diff --git a/vendor/k8s.io/client-go/informers/storagemigration/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/storagemigration/v1beta1/interface.go index 220e1f5c8c..0035d43b1e 100644 --- a/vendor/k8s.io/client-go/informers/storagemigration/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/storagemigration/v1beta1/interface.go @@ -25,7 +25,7 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // StorageVersionMigrations returns a StorageVersionMigrationInformer. - StorageVersionMigrations() StorageVersionMigrationInformer + StorageVersionMigrations() TypedStorageVersionMigrationInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// StorageVersionMigrations returns a StorageVersionMigrationInformer. -func (v *version) StorageVersionMigrations() StorageVersionMigrationInformer { +// StorageVersionMigrations returns a TypedStorageVersionMigrationInformer. +func (v *version) StorageVersionMigrations() TypedStorageVersionMigrationInformer { return &storageVersionMigrationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/vendor/k8s.io/client-go/informers/storagemigration/v1beta1/storageversionmigration.go b/vendor/k8s.io/client-go/informers/storagemigration/v1beta1/storageversionmigration.go index 50e271e6fe..3b8d5f7c9e 100644 --- a/vendor/k8s.io/client-go/informers/storagemigration/v1beta1/storageversionmigration.go +++ b/vendor/k8s.io/client-go/informers/storagemigration/v1beta1/storageversionmigration.go @@ -34,12 +34,40 @@ import ( ) // StorageVersionMigrationInformer provides access to a shared informer and lister for -// StorageVersionMigrations. +// StorageVersionMigrations. Prefer using the type-safe variant (see [TypedStorageVersionMigrationInformer]). type StorageVersionMigrationInformer interface { Informer() cache.SharedIndexInformer Lister() storagemigrationv1beta1.StorageVersionMigrationLister } +// TypedStorageVersionMigrationInformer provides access to a shared informer and lister for +// StorageVersionMigrations, including the type-safe TypedInformer variant. +// It is a superset of StorageVersionMigrationInformer. +type TypedStorageVersionMigrationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() StorageVersionMigrationIndexInformer + Lister() storagemigrationv1beta1.StorageVersionMigrationLister +} + +// StorageVersionMigrationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type StorageVersionMigrationIndexInformer cache.TypedSharedIndexInformer[*apistoragemigrationv1beta1.StorageVersionMigration] + +// StorageVersionMigrationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for StorageVersionMigration. +type StorageVersionMigrationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apistoragemigrationv1beta1.StorageVersionMigration] + +// StorageVersionMigrationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for StorageVersionMigration. +type StorageVersionMigrationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apistoragemigrationv1beta1.StorageVersionMigration] + +// StorageVersionMigrationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for StorageVersionMigration. +type StorageVersionMigrationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apistoragemigrationv1beta1.StorageVersionMigration] + +// StorageVersionMigrationIndexers is a specialization of [cache.TypedIndexers] for StorageVersionMigration. +type StorageVersionMigrationIndexers = cache.TypedIndexers[*apistoragemigrationv1beta1.StorageVersionMigration] + +// DeletedStorageVersionMigration is a specialization of [cache.DeletedObject] for StorageVersionMigration. +type DeletedStorageVersionMigration = cache.DeletedObject[*apistoragemigrationv1beta1.StorageVersionMigration] + type storageVersionMigrationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -48,25 +76,49 @@ type storageVersionMigrationInformer struct { // NewStorageVersionMigrationInformer constructs a new informer for StorageVersionMigration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStorageVersionMigrationInformer]). func NewStorageVersionMigrationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewStorageVersionMigrationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedStorageVersionMigrationInformer constructs a new informer for StorageVersionMigration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStorageVersionMigrationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers StorageVersionMigrationIndexers) StorageVersionMigrationIndexInformer { + return NewTypedStorageVersionMigrationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredStorageVersionMigrationInformer constructs a new informer for StorageVersionMigration type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredStorageVersionMigrationInformer]). func NewFilteredStorageVersionMigrationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewStorageVersionMigrationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedStorageVersionMigrationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredStorageVersionMigrationInformer constructs a new informer for StorageVersionMigration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredStorageVersionMigrationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers StorageVersionMigrationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) StorageVersionMigrationIndexInformer { + return NewTypedStorageVersionMigrationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewStorageVersionMigrationInformerWithOptions constructs a new informer for StorageVersionMigration type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedStorageVersionMigrationInformerWithOptions]). func NewStorageVersionMigrationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedStorageVersionMigrationInformerWithOptions(client, options) +} + +// NewTypedStorageVersionMigrationInformerWithOptions constructs a new informer for StorageVersionMigration type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedStorageVersionMigrationInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) StorageVersionMigrationIndexInformer { gvr := schema.GroupVersionResource{Group: "storagemigration.k8s.io", Version: "v1beta1", Resource: "storageversionmigrations"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apistoragemigrationv1beta1.StorageVersionMigration](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -99,17 +151,57 @@ func NewStorageVersionMigrationInformerWithOptions(client kubernetes.Interface, Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *storageVersionMigrationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewStorageVersionMigrationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedStorageVersionMigrationInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *storageVersionMigrationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apistoragemigrationv1beta1.StorageVersionMigration{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *storageVersionMigrationInformer) TypedInformer() StorageVersionMigrationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragemigrationv1beta1.StorageVersionMigration](f.factory.InformerFor(&apistoragemigrationv1beta1.StorageVersionMigration{}, f.defaultInformer)) } func (f *storageVersionMigrationInformer) Lister() storagemigrationv1beta1.StorageVersionMigrationLister { return storagemigrationv1beta1.NewStorageVersionMigrationLister(f.Informer().GetIndexer()) } + +// ToTypedStorageVersionMigrationInformer converts an untyped informer into a TypedStorageVersionMigrationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StorageVersionMigration. If that is not the case, calling type-safe methods of the returned +// TypedStorageVersionMigrationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedStorageVersionMigrationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedStorageVersionMigrationInformer(informer StorageVersionMigrationInformer) TypedStorageVersionMigrationInformer { + if informer, ok := informer.(TypedStorageVersionMigrationInformer); ok { + return informer + } + return &storageVersionMigrationTypedInformerAdapter{informer} +} + +type storageVersionMigrationTypedInformerAdapter struct { + StorageVersionMigrationInformer +} + +func (a *storageVersionMigrationTypedInformerAdapter) TypedInformer() StorageVersionMigrationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apistoragemigrationv1beta1.StorageVersionMigration](a.Informer()) +} + +// ToStorageVersionMigrationIndexInformer converts an untyped informer into a StorageVersionMigrationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *StorageVersionMigration. If that is not the case, calling type-safe methods of the returned +// StorageVersionMigrationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a StorageVersionMigrationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToStorageVersionMigrationIndexInformer(informer cache.SharedIndexInformer) StorageVersionMigrationIndexInformer { + if informer, ok := informer.(StorageVersionMigrationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apistoragemigrationv1beta1.StorageVersionMigration](informer) +} diff --git a/vendor/k8s.io/client-go/kubernetes/clientset.go b/vendor/k8s.io/client-go/kubernetes/clientset.go index 537609b718..4bc28060ad 100644 --- a/vendor/k8s.io/client-go/kubernetes/clientset.go +++ b/vendor/k8s.io/client-go/kubernetes/clientset.go @@ -55,6 +55,7 @@ import ( flowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1" flowcontrolv1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2" flowcontrolv1beta3 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3" + lifecyclev1alpha1 "k8s.io/client-go/kubernetes/typed/lifecycle/v1alpha1" networkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1" networkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1" nodev1 "k8s.io/client-go/kubernetes/typed/node/v1" @@ -70,18 +71,19 @@ import ( resourcev1beta1 "k8s.io/client-go/kubernetes/typed/resource/v1beta1" resourcev1beta2 "k8s.io/client-go/kubernetes/typed/resource/v1beta2" schedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1" - schedulingv1alpha2 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2" + schedulingv1alpha3 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3" schedulingv1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1" storagev1 "k8s.io/client-go/kubernetes/typed/storage/v1" storagev1alpha1 "k8s.io/client-go/kubernetes/typed/storage/v1alpha1" storagev1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1" + storagemigrationv1 "k8s.io/client-go/kubernetes/typed/storagemigration/v1" storagemigrationv1beta1 "k8s.io/client-go/kubernetes/typed/storagemigration/v1beta1" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" ) type Interface interface { - Discovery() discovery.DiscoveryInterface + Discovery() discovery.DiscoveryInterfaces AdmissionregistrationV1() admissionregistrationv1.AdmissionregistrationV1Interface AdmissionregistrationV1alpha1() admissionregistrationv1alpha1.AdmissionregistrationV1alpha1Interface AdmissionregistrationV1beta1() admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface @@ -114,6 +116,7 @@ type Interface interface { FlowcontrolV1beta1() flowcontrolv1beta1.FlowcontrolV1beta1Interface FlowcontrolV1beta2() flowcontrolv1beta2.FlowcontrolV1beta2Interface FlowcontrolV1beta3() flowcontrolv1beta3.FlowcontrolV1beta3Interface + LifecycleV1alpha1() lifecyclev1alpha1.LifecycleV1alpha1Interface NetworkingV1() networkingv1.NetworkingV1Interface NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Interface NodeV1() nodev1.NodeV1Interface @@ -128,12 +131,13 @@ type Interface interface { ResourceV1beta2() resourcev1beta2.ResourceV1beta2Interface ResourceV1beta1() resourcev1beta1.ResourceV1beta1Interface ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interface - SchedulingV1alpha2() schedulingv1alpha2.SchedulingV1alpha2Interface + SchedulingV1alpha3() schedulingv1alpha3.SchedulingV1alpha3Interface SchedulingV1beta1() schedulingv1beta1.SchedulingV1beta1Interface SchedulingV1() schedulingv1.SchedulingV1Interface StorageV1beta1() storagev1beta1.StorageV1beta1Interface StorageV1() storagev1.StorageV1Interface StorageV1alpha1() storagev1alpha1.StorageV1alpha1Interface + StoragemigrationV1() storagemigrationv1.StoragemigrationV1Interface StoragemigrationV1beta1() storagemigrationv1beta1.StoragemigrationV1beta1Interface } @@ -172,6 +176,7 @@ type Clientset struct { flowcontrolV1beta1 *flowcontrolv1beta1.FlowcontrolV1beta1Client flowcontrolV1beta2 *flowcontrolv1beta2.FlowcontrolV1beta2Client flowcontrolV1beta3 *flowcontrolv1beta3.FlowcontrolV1beta3Client + lifecycleV1alpha1 *lifecyclev1alpha1.LifecycleV1alpha1Client networkingV1 *networkingv1.NetworkingV1Client networkingV1beta1 *networkingv1beta1.NetworkingV1beta1Client nodeV1 *nodev1.NodeV1Client @@ -186,12 +191,13 @@ type Clientset struct { resourceV1beta2 *resourcev1beta2.ResourceV1beta2Client resourceV1beta1 *resourcev1beta1.ResourceV1beta1Client resourceV1alpha3 *resourcev1alpha3.ResourceV1alpha3Client - schedulingV1alpha2 *schedulingv1alpha2.SchedulingV1alpha2Client + schedulingV1alpha3 *schedulingv1alpha3.SchedulingV1alpha3Client schedulingV1beta1 *schedulingv1beta1.SchedulingV1beta1Client schedulingV1 *schedulingv1.SchedulingV1Client storageV1beta1 *storagev1beta1.StorageV1beta1Client storageV1 *storagev1.StorageV1Client storageV1alpha1 *storagev1alpha1.StorageV1alpha1Client + storagemigrationV1 *storagemigrationv1.StoragemigrationV1Client storagemigrationV1beta1 *storagemigrationv1beta1.StoragemigrationV1beta1Client } @@ -355,6 +361,11 @@ func (c *Clientset) FlowcontrolV1beta3() flowcontrolv1beta3.FlowcontrolV1beta3In return c.flowcontrolV1beta3 } +// LifecycleV1alpha1 retrieves the LifecycleV1alpha1Client +func (c *Clientset) LifecycleV1alpha1() lifecyclev1alpha1.LifecycleV1alpha1Interface { + return c.lifecycleV1alpha1 +} + // NetworkingV1 retrieves the NetworkingV1Client func (c *Clientset) NetworkingV1() networkingv1.NetworkingV1Interface { return c.networkingV1 @@ -425,9 +436,9 @@ func (c *Clientset) ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interfac return c.resourceV1alpha3 } -// SchedulingV1alpha2 retrieves the SchedulingV1alpha2Client -func (c *Clientset) SchedulingV1alpha2() schedulingv1alpha2.SchedulingV1alpha2Interface { - return c.schedulingV1alpha2 +// SchedulingV1alpha3 retrieves the SchedulingV1alpha3Client +func (c *Clientset) SchedulingV1alpha3() schedulingv1alpha3.SchedulingV1alpha3Interface { + return c.schedulingV1alpha3 } // SchedulingV1beta1 retrieves the SchedulingV1beta1Client @@ -455,13 +466,18 @@ func (c *Clientset) StorageV1alpha1() storagev1alpha1.StorageV1alpha1Interface { return c.storageV1alpha1 } +// StoragemigrationV1 retrieves the StoragemigrationV1Client +func (c *Clientset) StoragemigrationV1() storagemigrationv1.StoragemigrationV1Interface { + return c.storagemigrationV1 +} + // StoragemigrationV1beta1 retrieves the StoragemigrationV1beta1Client func (c *Clientset) StoragemigrationV1beta1() storagemigrationv1beta1.StoragemigrationV1beta1Interface { return c.storagemigrationV1beta1 } // Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { +func (c *Clientset) Discovery() discovery.DiscoveryInterfaces { if c == nil { return nil } @@ -632,6 +648,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.lifecycleV1alpha1, err = lifecyclev1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.networkingV1, err = networkingv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err @@ -688,7 +708,7 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } - cs.schedulingV1alpha2, err = schedulingv1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.schedulingV1alpha3, err = schedulingv1alpha3.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } @@ -712,6 +732,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.storagemigrationV1, err = storagemigrationv1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.storagemigrationV1beta1, err = storagemigrationv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err @@ -769,6 +793,7 @@ func New(c rest.Interface) *Clientset { cs.flowcontrolV1beta1 = flowcontrolv1beta1.New(c) cs.flowcontrolV1beta2 = flowcontrolv1beta2.New(c) cs.flowcontrolV1beta3 = flowcontrolv1beta3.New(c) + cs.lifecycleV1alpha1 = lifecyclev1alpha1.New(c) cs.networkingV1 = networkingv1.New(c) cs.networkingV1beta1 = networkingv1beta1.New(c) cs.nodeV1 = nodev1.New(c) @@ -783,12 +808,13 @@ func New(c rest.Interface) *Clientset { cs.resourceV1beta2 = resourcev1beta2.New(c) cs.resourceV1beta1 = resourcev1beta1.New(c) cs.resourceV1alpha3 = resourcev1alpha3.New(c) - cs.schedulingV1alpha2 = schedulingv1alpha2.New(c) + cs.schedulingV1alpha3 = schedulingv1alpha3.New(c) cs.schedulingV1beta1 = schedulingv1beta1.New(c) cs.schedulingV1 = schedulingv1.New(c) cs.storageV1beta1 = storagev1beta1.New(c) cs.storageV1 = storagev1.New(c) cs.storageV1alpha1 = storagev1alpha1.New(c) + cs.storagemigrationV1 = storagemigrationv1.New(c) cs.storagemigrationV1beta1 = storagemigrationv1beta1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) diff --git a/vendor/k8s.io/client-go/kubernetes/scheme/register.go b/vendor/k8s.io/client-go/kubernetes/scheme/register.go index c36fe7eda4..d2304c94ff 100644 --- a/vendor/k8s.io/client-go/kubernetes/scheme/register.go +++ b/vendor/k8s.io/client-go/kubernetes/scheme/register.go @@ -51,6 +51,7 @@ import ( flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" flowcontrolv1beta3 "k8s.io/api/flowcontrol/v1beta3" + lifecyclev1alpha1 "k8s.io/api/lifecycle/v1alpha1" networkingv1 "k8s.io/api/networking/v1" networkingv1beta1 "k8s.io/api/networking/v1beta1" nodev1 "k8s.io/api/node/v1" @@ -66,11 +67,12 @@ import ( resourcev1beta1 "k8s.io/api/resource/v1beta1" resourcev1beta2 "k8s.io/api/resource/v1beta2" schedulingv1 "k8s.io/api/scheduling/v1" - schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2" + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" storagev1 "k8s.io/api/storage/v1" storagev1alpha1 "k8s.io/api/storage/v1alpha1" storagev1beta1 "k8s.io/api/storage/v1beta1" + storagemigrationv1 "k8s.io/api/storagemigration/v1" storagemigrationv1beta1 "k8s.io/api/storagemigration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" @@ -115,6 +117,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ flowcontrolv1beta1.AddToScheme, flowcontrolv1beta2.AddToScheme, flowcontrolv1beta3.AddToScheme, + lifecyclev1alpha1.AddToScheme, networkingv1.AddToScheme, networkingv1beta1.AddToScheme, nodev1.AddToScheme, @@ -129,12 +132,13 @@ var localSchemeBuilder = runtime.SchemeBuilder{ resourcev1beta2.AddToScheme, resourcev1beta1.AddToScheme, resourcev1alpha3.AddToScheme, - schedulingv1alpha2.AddToScheme, + schedulingv1alpha3.AddToScheme, schedulingv1beta1.AddToScheme, schedulingv1.AddToScheme, storagev1beta1.AddToScheme, storagev1.AddToScheme, storagev1alpha1.AddToScheme, + storagemigrationv1.AddToScheme, storagemigrationv1beta1.AddToScheme, } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/certificates_client.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/certificates_client.go index a13c3559db..ed84f79e8f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/certificates_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/certificates_client.go @@ -29,6 +29,8 @@ import ( type CertificatesV1Interface interface { RESTClient() rest.Interface CertificateSigningRequestsGetter + ClusterTrustBundlesGetter + PodCertificateRequestsGetter } // CertificatesV1Client is used to interact with features provided by the certificates.k8s.io group. @@ -40,6 +42,14 @@ func (c *CertificatesV1Client) CertificateSigningRequests() CertificateSigningRe return newCertificateSigningRequests(c) } +func (c *CertificatesV1Client) ClusterTrustBundles() ClusterTrustBundleInterface { + return newClusterTrustBundles(c) +} + +func (c *CertificatesV1Client) PodCertificateRequests(namespace string) PodCertificateRequestInterface { + return newPodCertificateRequests(c, namespace) +} + // NewForConfig creates a new CertificatesV1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/clustertrustbundle.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/clustertrustbundle.go new file mode 100644 index 0000000000..23a5c80bac --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/clustertrustbundle.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + certificatesv1 "k8s.io/api/certificates/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscertificatesv1 "k8s.io/client-go/applyconfigurations/certificates/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// ClusterTrustBundlesGetter has a method to return a ClusterTrustBundleInterface. +// A group's client should implement this interface. +type ClusterTrustBundlesGetter interface { + ClusterTrustBundles() ClusterTrustBundleInterface +} + +// ClusterTrustBundleInterface has methods to work with ClusterTrustBundle resources. +type ClusterTrustBundleInterface interface { + Create(ctx context.Context, clusterTrustBundle *certificatesv1.ClusterTrustBundle, opts metav1.CreateOptions) (*certificatesv1.ClusterTrustBundle, error) + Update(ctx context.Context, clusterTrustBundle *certificatesv1.ClusterTrustBundle, opts metav1.UpdateOptions) (*certificatesv1.ClusterTrustBundle, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*certificatesv1.ClusterTrustBundle, error) + List(ctx context.Context, opts metav1.ListOptions) (*certificatesv1.ClusterTrustBundleList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *certificatesv1.ClusterTrustBundle, err error) + Apply(ctx context.Context, clusterTrustBundle *applyconfigurationscertificatesv1.ClusterTrustBundleApplyConfiguration, opts metav1.ApplyOptions) (result *certificatesv1.ClusterTrustBundle, err error) + ClusterTrustBundleExpansion +} + +// clusterTrustBundles implements ClusterTrustBundleInterface +type clusterTrustBundles struct { + *gentype.ClientWithListAndApply[*certificatesv1.ClusterTrustBundle, *certificatesv1.ClusterTrustBundleList, *applyconfigurationscertificatesv1.ClusterTrustBundleApplyConfiguration] +} + +// newClusterTrustBundles returns a ClusterTrustBundles +func newClusterTrustBundles(c *CertificatesV1Client) *clusterTrustBundles { + return &clusterTrustBundles{ + gentype.NewClientWithListAndApply[*certificatesv1.ClusterTrustBundle, *certificatesv1.ClusterTrustBundleList, *applyconfigurationscertificatesv1.ClusterTrustBundleApplyConfiguration]( + "clustertrustbundles", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *certificatesv1.ClusterTrustBundle { return &certificatesv1.ClusterTrustBundle{} }, + func() *certificatesv1.ClusterTrustBundleList { return &certificatesv1.ClusterTrustBundleList{} }, + gentype.PrefersProtobuf[*certificatesv1.ClusterTrustBundle](), + ), + } +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/generated_expansion.go index 95fad02126..9024405353 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/generated_expansion.go @@ -19,3 +19,7 @@ limitations under the License. package v1 type CertificateSigningRequestExpansion interface{} + +type ClusterTrustBundleExpansion interface{} + +type PodCertificateRequestExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/podcertificaterequest.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/podcertificaterequest.go new file mode 100644 index 0000000000..128d1e5ff2 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1/podcertificaterequest.go @@ -0,0 +1,75 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + certificatesv1 "k8s.io/api/certificates/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationscertificatesv1 "k8s.io/client-go/applyconfigurations/certificates/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// PodCertificateRequestsGetter has a method to return a PodCertificateRequestInterface. +// A group's client should implement this interface. +type PodCertificateRequestsGetter interface { + PodCertificateRequests(namespace string) PodCertificateRequestInterface +} + +// PodCertificateRequestInterface has methods to work with PodCertificateRequest resources. +type PodCertificateRequestInterface interface { + Create(ctx context.Context, podCertificateRequest *certificatesv1.PodCertificateRequest, opts metav1.CreateOptions) (*certificatesv1.PodCertificateRequest, error) + Update(ctx context.Context, podCertificateRequest *certificatesv1.PodCertificateRequest, opts metav1.UpdateOptions) (*certificatesv1.PodCertificateRequest, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, podCertificateRequest *certificatesv1.PodCertificateRequest, opts metav1.UpdateOptions) (*certificatesv1.PodCertificateRequest, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*certificatesv1.PodCertificateRequest, error) + List(ctx context.Context, opts metav1.ListOptions) (*certificatesv1.PodCertificateRequestList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *certificatesv1.PodCertificateRequest, err error) + Apply(ctx context.Context, podCertificateRequest *applyconfigurationscertificatesv1.PodCertificateRequestApplyConfiguration, opts metav1.ApplyOptions) (result *certificatesv1.PodCertificateRequest, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, podCertificateRequest *applyconfigurationscertificatesv1.PodCertificateRequestApplyConfiguration, opts metav1.ApplyOptions) (result *certificatesv1.PodCertificateRequest, err error) + PodCertificateRequestExpansion +} + +// podCertificateRequests implements PodCertificateRequestInterface +type podCertificateRequests struct { + *gentype.ClientWithListAndApply[*certificatesv1.PodCertificateRequest, *certificatesv1.PodCertificateRequestList, *applyconfigurationscertificatesv1.PodCertificateRequestApplyConfiguration] +} + +// newPodCertificateRequests returns a PodCertificateRequests +func newPodCertificateRequests(c *CertificatesV1Client, namespace string) *podCertificateRequests { + return &podCertificateRequests{ + gentype.NewClientWithListAndApply[*certificatesv1.PodCertificateRequest, *certificatesv1.PodCertificateRequestList, *applyconfigurationscertificatesv1.PodCertificateRequestApplyConfiguration]( + "podcertificaterequests", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *certificatesv1.PodCertificateRequest { return &certificatesv1.PodCertificateRequest{} }, + func() *certificatesv1.PodCertificateRequestList { return &certificatesv1.PodCertificateRequestList{} }, + gentype.PrefersProtobuf[*certificatesv1.PodCertificateRequest](), + ), + } +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/lifecycle/v1alpha1/doc.go similarity index 97% rename from vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2/doc.go rename to vendor/k8s.io/client-go/kubernetes/typed/lifecycle/v1alpha1/doc.go index baaf2d9853..df51baa4d4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2/doc.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/lifecycle/v1alpha1/doc.go @@ -17,4 +17,4 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. -package v1alpha2 +package v1alpha1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/lifecycle/v1alpha1/eviction.go b/vendor/k8s.io/client-go/kubernetes/typed/lifecycle/v1alpha1/eviction.go new file mode 100644 index 0000000000..10a359c29b --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/lifecycle/v1alpha1/eviction.go @@ -0,0 +1,75 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + lifecyclev1alpha1 "k8s.io/api/lifecycle/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationslifecyclev1alpha1 "k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// EvictionsGetter has a method to return a EvictionInterface. +// A group's client should implement this interface. +type EvictionsGetter interface { + Evictions(namespace string) EvictionInterface +} + +// EvictionInterface has methods to work with Eviction resources. +type EvictionInterface interface { + Create(ctx context.Context, eviction *lifecyclev1alpha1.Eviction, opts v1.CreateOptions) (*lifecyclev1alpha1.Eviction, error) + Update(ctx context.Context, eviction *lifecyclev1alpha1.Eviction, opts v1.UpdateOptions) (*lifecyclev1alpha1.Eviction, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, eviction *lifecyclev1alpha1.Eviction, opts v1.UpdateOptions) (*lifecyclev1alpha1.Eviction, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*lifecyclev1alpha1.Eviction, error) + List(ctx context.Context, opts v1.ListOptions) (*lifecyclev1alpha1.EvictionList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *lifecyclev1alpha1.Eviction, err error) + Apply(ctx context.Context, eviction *applyconfigurationslifecyclev1alpha1.EvictionApplyConfiguration, opts v1.ApplyOptions) (result *lifecyclev1alpha1.Eviction, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, eviction *applyconfigurationslifecyclev1alpha1.EvictionApplyConfiguration, opts v1.ApplyOptions) (result *lifecyclev1alpha1.Eviction, err error) + EvictionExpansion +} + +// evictions implements EvictionInterface +type evictions struct { + *gentype.ClientWithListAndApply[*lifecyclev1alpha1.Eviction, *lifecyclev1alpha1.EvictionList, *applyconfigurationslifecyclev1alpha1.EvictionApplyConfiguration] +} + +// newEvictions returns a Evictions +func newEvictions(c *LifecycleV1alpha1Client, namespace string) *evictions { + return &evictions{ + gentype.NewClientWithListAndApply[*lifecyclev1alpha1.Eviction, *lifecyclev1alpha1.EvictionList, *applyconfigurationslifecyclev1alpha1.EvictionApplyConfiguration]( + "evictions", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *lifecyclev1alpha1.Eviction { return &lifecyclev1alpha1.Eviction{} }, + func() *lifecyclev1alpha1.EvictionList { return &lifecyclev1alpha1.EvictionList{} }, + gentype.PrefersProtobuf[*lifecyclev1alpha1.Eviction](), + ), + } +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/lifecycle/v1alpha1/evictionrequest.go b/vendor/k8s.io/client-go/kubernetes/typed/lifecycle/v1alpha1/evictionrequest.go new file mode 100644 index 0000000000..4a21127bb4 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/lifecycle/v1alpha1/evictionrequest.go @@ -0,0 +1,75 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + lifecyclev1alpha1 "k8s.io/api/lifecycle/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationslifecyclev1alpha1 "k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// EvictionRequestsGetter has a method to return a EvictionRequestInterface. +// A group's client should implement this interface. +type EvictionRequestsGetter interface { + EvictionRequests(namespace string) EvictionRequestInterface +} + +// EvictionRequestInterface has methods to work with EvictionRequest resources. +type EvictionRequestInterface interface { + Create(ctx context.Context, evictionRequest *lifecyclev1alpha1.EvictionRequest, opts v1.CreateOptions) (*lifecyclev1alpha1.EvictionRequest, error) + Update(ctx context.Context, evictionRequest *lifecyclev1alpha1.EvictionRequest, opts v1.UpdateOptions) (*lifecyclev1alpha1.EvictionRequest, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, evictionRequest *lifecyclev1alpha1.EvictionRequest, opts v1.UpdateOptions) (*lifecyclev1alpha1.EvictionRequest, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*lifecyclev1alpha1.EvictionRequest, error) + List(ctx context.Context, opts v1.ListOptions) (*lifecyclev1alpha1.EvictionRequestList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *lifecyclev1alpha1.EvictionRequest, err error) + Apply(ctx context.Context, evictionRequest *applyconfigurationslifecyclev1alpha1.EvictionRequestApplyConfiguration, opts v1.ApplyOptions) (result *lifecyclev1alpha1.EvictionRequest, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, evictionRequest *applyconfigurationslifecyclev1alpha1.EvictionRequestApplyConfiguration, opts v1.ApplyOptions) (result *lifecyclev1alpha1.EvictionRequest, err error) + EvictionRequestExpansion +} + +// evictionRequests implements EvictionRequestInterface +type evictionRequests struct { + *gentype.ClientWithListAndApply[*lifecyclev1alpha1.EvictionRequest, *lifecyclev1alpha1.EvictionRequestList, *applyconfigurationslifecyclev1alpha1.EvictionRequestApplyConfiguration] +} + +// newEvictionRequests returns a EvictionRequests +func newEvictionRequests(c *LifecycleV1alpha1Client, namespace string) *evictionRequests { + return &evictionRequests{ + gentype.NewClientWithListAndApply[*lifecyclev1alpha1.EvictionRequest, *lifecyclev1alpha1.EvictionRequestList, *applyconfigurationslifecyclev1alpha1.EvictionRequestApplyConfiguration]( + "evictionrequests", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *lifecyclev1alpha1.EvictionRequest { return &lifecyclev1alpha1.EvictionRequest{} }, + func() *lifecyclev1alpha1.EvictionRequestList { return &lifecyclev1alpha1.EvictionRequestList{} }, + gentype.PrefersProtobuf[*lifecyclev1alpha1.EvictionRequest](), + ), + } +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/lifecycle/v1alpha1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/lifecycle/v1alpha1/generated_expansion.go new file mode 100644 index 0000000000..4be788fdf2 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/lifecycle/v1alpha1/generated_expansion.go @@ -0,0 +1,23 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type EvictionExpansion interface{} + +type EvictionRequestExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/lifecycle/v1alpha1/lifecycle_client.go b/vendor/k8s.io/client-go/kubernetes/typed/lifecycle/v1alpha1/lifecycle_client.go new file mode 100644 index 0000000000..02c050b829 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/lifecycle/v1alpha1/lifecycle_client.go @@ -0,0 +1,106 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + http "net/http" + + lifecyclev1alpha1 "k8s.io/api/lifecycle/v1alpha1" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +type LifecycleV1alpha1Interface interface { + RESTClient() rest.Interface + EvictionsGetter + EvictionRequestsGetter +} + +// LifecycleV1alpha1Client is used to interact with features provided by the lifecycle.k8s.io group. +type LifecycleV1alpha1Client struct { + restClient rest.Interface +} + +func (c *LifecycleV1alpha1Client) Evictions(namespace string) EvictionInterface { + return newEvictions(c, namespace) +} + +func (c *LifecycleV1alpha1Client) EvictionRequests(namespace string) EvictionRequestInterface { + return newEvictionRequests(c, namespace) +} + +// NewForConfig creates a new LifecycleV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*LifecycleV1alpha1Client, error) { + config := *c + setConfigDefaults(&config) + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new LifecycleV1alpha1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*LifecycleV1alpha1Client, error) { + config := *c + setConfigDefaults(&config) + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &LifecycleV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new LifecycleV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *LifecycleV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new LifecycleV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *LifecycleV1alpha1Client { + return &LifecycleV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) { + gv := lifecyclev1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *LifecycleV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1/devicetaintrule.go b/vendor/k8s.io/client-go/kubernetes/typed/resource/v1/devicetaintrule.go new file mode 100644 index 0000000000..43074f75a7 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/resource/v1/devicetaintrule.go @@ -0,0 +1,75 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + resourcev1 "k8s.io/api/resource/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationsresourcev1 "k8s.io/client-go/applyconfigurations/resource/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// DeviceTaintRulesGetter has a method to return a DeviceTaintRuleInterface. +// A group's client should implement this interface. +type DeviceTaintRulesGetter interface { + DeviceTaintRules() DeviceTaintRuleInterface +} + +// DeviceTaintRuleInterface has methods to work with DeviceTaintRule resources. +type DeviceTaintRuleInterface interface { + Create(ctx context.Context, deviceTaintRule *resourcev1.DeviceTaintRule, opts metav1.CreateOptions) (*resourcev1.DeviceTaintRule, error) + Update(ctx context.Context, deviceTaintRule *resourcev1.DeviceTaintRule, opts metav1.UpdateOptions) (*resourcev1.DeviceTaintRule, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, deviceTaintRule *resourcev1.DeviceTaintRule, opts metav1.UpdateOptions) (*resourcev1.DeviceTaintRule, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*resourcev1.DeviceTaintRule, error) + List(ctx context.Context, opts metav1.ListOptions) (*resourcev1.DeviceTaintRuleList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *resourcev1.DeviceTaintRule, err error) + Apply(ctx context.Context, deviceTaintRule *applyconfigurationsresourcev1.DeviceTaintRuleApplyConfiguration, opts metav1.ApplyOptions) (result *resourcev1.DeviceTaintRule, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, deviceTaintRule *applyconfigurationsresourcev1.DeviceTaintRuleApplyConfiguration, opts metav1.ApplyOptions) (result *resourcev1.DeviceTaintRule, err error) + DeviceTaintRuleExpansion +} + +// deviceTaintRules implements DeviceTaintRuleInterface +type deviceTaintRules struct { + *gentype.ClientWithListAndApply[*resourcev1.DeviceTaintRule, *resourcev1.DeviceTaintRuleList, *applyconfigurationsresourcev1.DeviceTaintRuleApplyConfiguration] +} + +// newDeviceTaintRules returns a DeviceTaintRules +func newDeviceTaintRules(c *ResourceV1Client) *deviceTaintRules { + return &deviceTaintRules{ + gentype.NewClientWithListAndApply[*resourcev1.DeviceTaintRule, *resourcev1.DeviceTaintRuleList, *applyconfigurationsresourcev1.DeviceTaintRuleApplyConfiguration]( + "devicetaintrules", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *resourcev1.DeviceTaintRule { return &resourcev1.DeviceTaintRule{} }, + func() *resourcev1.DeviceTaintRuleList { return &resourcev1.DeviceTaintRuleList{} }, + gentype.PrefersProtobuf[*resourcev1.DeviceTaintRule](), + ), + } +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/resource/v1/generated_expansion.go index ea30968587..6cd11a8051 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/resource/v1/generated_expansion.go @@ -20,6 +20,8 @@ package v1 type DeviceClassExpansion interface{} +type DeviceTaintRuleExpansion interface{} + type ResourceClaimExpansion interface{} type ResourceClaimTemplateExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1/resource_client.go b/vendor/k8s.io/client-go/kubernetes/typed/resource/v1/resource_client.go index e610012dde..0267cb68a8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/resource/v1/resource_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/resource/v1/resource_client.go @@ -29,6 +29,7 @@ import ( type ResourceV1Interface interface { RESTClient() rest.Interface DeviceClassesGetter + DeviceTaintRulesGetter ResourceClaimsGetter ResourceClaimTemplatesGetter ResourceSlicesGetter @@ -43,6 +44,10 @@ func (c *ResourceV1Client) DeviceClasses() DeviceClassInterface { return newDeviceClasses(c) } +func (c *ResourceV1Client) DeviceTaintRules() DeviceTaintRuleInterface { + return newDeviceTaintRules(c) +} + func (c *ResourceV1Client) ResourceClaims(namespace string) ResourceClaimInterface { return newResourceClaims(c, namespace) } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3/compositepodgroup.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3/compositepodgroup.go new file mode 100644 index 0000000000..a301cbd35e --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3/compositepodgroup.go @@ -0,0 +1,75 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + context "context" + + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationsschedulingv1alpha3 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha3" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// CompositePodGroupsGetter has a method to return a CompositePodGroupInterface. +// A group's client should implement this interface. +type CompositePodGroupsGetter interface { + CompositePodGroups(namespace string) CompositePodGroupInterface +} + +// CompositePodGroupInterface has methods to work with CompositePodGroup resources. +type CompositePodGroupInterface interface { + Create(ctx context.Context, compositePodGroup *schedulingv1alpha3.CompositePodGroup, opts v1.CreateOptions) (*schedulingv1alpha3.CompositePodGroup, error) + Update(ctx context.Context, compositePodGroup *schedulingv1alpha3.CompositePodGroup, opts v1.UpdateOptions) (*schedulingv1alpha3.CompositePodGroup, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, compositePodGroup *schedulingv1alpha3.CompositePodGroup, opts v1.UpdateOptions) (*schedulingv1alpha3.CompositePodGroup, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*schedulingv1alpha3.CompositePodGroup, error) + List(ctx context.Context, opts v1.ListOptions) (*schedulingv1alpha3.CompositePodGroupList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *schedulingv1alpha3.CompositePodGroup, err error) + Apply(ctx context.Context, compositePodGroup *applyconfigurationsschedulingv1alpha3.CompositePodGroupApplyConfiguration, opts v1.ApplyOptions) (result *schedulingv1alpha3.CompositePodGroup, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, compositePodGroup *applyconfigurationsschedulingv1alpha3.CompositePodGroupApplyConfiguration, opts v1.ApplyOptions) (result *schedulingv1alpha3.CompositePodGroup, err error) + CompositePodGroupExpansion +} + +// compositePodGroups implements CompositePodGroupInterface +type compositePodGroups struct { + *gentype.ClientWithListAndApply[*schedulingv1alpha3.CompositePodGroup, *schedulingv1alpha3.CompositePodGroupList, *applyconfigurationsschedulingv1alpha3.CompositePodGroupApplyConfiguration] +} + +// newCompositePodGroups returns a CompositePodGroups +func newCompositePodGroups(c *SchedulingV1alpha3Client, namespace string) *compositePodGroups { + return &compositePodGroups{ + gentype.NewClientWithListAndApply[*schedulingv1alpha3.CompositePodGroup, *schedulingv1alpha3.CompositePodGroupList, *applyconfigurationsschedulingv1alpha3.CompositePodGroupApplyConfiguration]( + "compositepodgroups", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *schedulingv1alpha3.CompositePodGroup { return &schedulingv1alpha3.CompositePodGroup{} }, + func() *schedulingv1alpha3.CompositePodGroupList { return &schedulingv1alpha3.CompositePodGroupList{} }, + gentype.PrefersProtobuf[*schedulingv1alpha3.CompositePodGroup](), + ), + } +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3/doc.go new file mode 100644 index 0000000000..fdb23fd37c --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha3 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3/generated_expansion.go similarity index 91% rename from vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2/generated_expansion.go rename to vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3/generated_expansion.go index 60668af04d..a222ec4604 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3/generated_expansion.go @@ -16,7 +16,9 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 + +type CompositePodGroupExpansion interface{} type PodGroupExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2/podgroup.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3/podgroup.go similarity index 59% rename from vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2/podgroup.go rename to vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3/podgroup.go index bbe91d35ab..81024d7e6c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2/podgroup.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3/podgroup.go @@ -16,16 +16,16 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( context "context" - schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2" + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - applyconfigurationsschedulingv1alpha2 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha2" + applyconfigurationsschedulingv1alpha3 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) @@ -38,38 +38,38 @@ type PodGroupsGetter interface { // PodGroupInterface has methods to work with PodGroup resources. type PodGroupInterface interface { - Create(ctx context.Context, podGroup *schedulingv1alpha2.PodGroup, opts v1.CreateOptions) (*schedulingv1alpha2.PodGroup, error) - Update(ctx context.Context, podGroup *schedulingv1alpha2.PodGroup, opts v1.UpdateOptions) (*schedulingv1alpha2.PodGroup, error) + Create(ctx context.Context, podGroup *schedulingv1alpha3.PodGroup, opts v1.CreateOptions) (*schedulingv1alpha3.PodGroup, error) + Update(ctx context.Context, podGroup *schedulingv1alpha3.PodGroup, opts v1.UpdateOptions) (*schedulingv1alpha3.PodGroup, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, podGroup *schedulingv1alpha2.PodGroup, opts v1.UpdateOptions) (*schedulingv1alpha2.PodGroup, error) + UpdateStatus(ctx context.Context, podGroup *schedulingv1alpha3.PodGroup, opts v1.UpdateOptions) (*schedulingv1alpha3.PodGroup, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*schedulingv1alpha2.PodGroup, error) - List(ctx context.Context, opts v1.ListOptions) (*schedulingv1alpha2.PodGroupList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*schedulingv1alpha3.PodGroup, error) + List(ctx context.Context, opts v1.ListOptions) (*schedulingv1alpha3.PodGroupList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *schedulingv1alpha2.PodGroup, err error) - Apply(ctx context.Context, podGroup *applyconfigurationsschedulingv1alpha2.PodGroupApplyConfiguration, opts v1.ApplyOptions) (result *schedulingv1alpha2.PodGroup, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *schedulingv1alpha3.PodGroup, err error) + Apply(ctx context.Context, podGroup *applyconfigurationsschedulingv1alpha3.PodGroupApplyConfiguration, opts v1.ApplyOptions) (result *schedulingv1alpha3.PodGroup, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). - ApplyStatus(ctx context.Context, podGroup *applyconfigurationsschedulingv1alpha2.PodGroupApplyConfiguration, opts v1.ApplyOptions) (result *schedulingv1alpha2.PodGroup, err error) + ApplyStatus(ctx context.Context, podGroup *applyconfigurationsschedulingv1alpha3.PodGroupApplyConfiguration, opts v1.ApplyOptions) (result *schedulingv1alpha3.PodGroup, err error) PodGroupExpansion } // podGroups implements PodGroupInterface type podGroups struct { - *gentype.ClientWithListAndApply[*schedulingv1alpha2.PodGroup, *schedulingv1alpha2.PodGroupList, *applyconfigurationsschedulingv1alpha2.PodGroupApplyConfiguration] + *gentype.ClientWithListAndApply[*schedulingv1alpha3.PodGroup, *schedulingv1alpha3.PodGroupList, *applyconfigurationsschedulingv1alpha3.PodGroupApplyConfiguration] } // newPodGroups returns a PodGroups -func newPodGroups(c *SchedulingV1alpha2Client, namespace string) *podGroups { +func newPodGroups(c *SchedulingV1alpha3Client, namespace string) *podGroups { return &podGroups{ - gentype.NewClientWithListAndApply[*schedulingv1alpha2.PodGroup, *schedulingv1alpha2.PodGroupList, *applyconfigurationsschedulingv1alpha2.PodGroupApplyConfiguration]( + gentype.NewClientWithListAndApply[*schedulingv1alpha3.PodGroup, *schedulingv1alpha3.PodGroupList, *applyconfigurationsschedulingv1alpha3.PodGroupApplyConfiguration]( "podgroups", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *schedulingv1alpha2.PodGroup { return &schedulingv1alpha2.PodGroup{} }, - func() *schedulingv1alpha2.PodGroupList { return &schedulingv1alpha2.PodGroupList{} }, - gentype.PrefersProtobuf[*schedulingv1alpha2.PodGroup](), + func() *schedulingv1alpha3.PodGroup { return &schedulingv1alpha3.PodGroup{} }, + func() *schedulingv1alpha3.PodGroupList { return &schedulingv1alpha3.PodGroupList{} }, + gentype.PrefersProtobuf[*schedulingv1alpha3.PodGroup](), ), } } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2/scheduling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3/scheduling_client.go similarity index 65% rename from vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2/scheduling_client.go rename to vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3/scheduling_client.go index 8ccdc178b9..8c99d51ca5 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2/scheduling_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3/scheduling_client.go @@ -16,39 +16,44 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( http "net/http" - schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2" + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) -type SchedulingV1alpha2Interface interface { +type SchedulingV1alpha3Interface interface { RESTClient() rest.Interface + CompositePodGroupsGetter PodGroupsGetter WorkloadsGetter } -// SchedulingV1alpha2Client is used to interact with features provided by the scheduling.k8s.io group. -type SchedulingV1alpha2Client struct { +// SchedulingV1alpha3Client is used to interact with features provided by the scheduling.k8s.io group. +type SchedulingV1alpha3Client struct { restClient rest.Interface } -func (c *SchedulingV1alpha2Client) PodGroups(namespace string) PodGroupInterface { +func (c *SchedulingV1alpha3Client) CompositePodGroups(namespace string) CompositePodGroupInterface { + return newCompositePodGroups(c, namespace) +} + +func (c *SchedulingV1alpha3Client) PodGroups(namespace string) PodGroupInterface { return newPodGroups(c, namespace) } -func (c *SchedulingV1alpha2Client) Workloads(namespace string) WorkloadInterface { +func (c *SchedulingV1alpha3Client) Workloads(namespace string) WorkloadInterface { return newWorkloads(c, namespace) } -// NewForConfig creates a new SchedulingV1alpha2Client for the given config. +// NewForConfig creates a new SchedulingV1alpha3Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*SchedulingV1alpha2Client, error) { +func NewForConfig(c *rest.Config) (*SchedulingV1alpha3Client, error) { config := *c setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) @@ -58,21 +63,21 @@ func NewForConfig(c *rest.Config) (*SchedulingV1alpha2Client, error) { return NewForConfigAndClient(&config, httpClient) } -// NewForConfigAndClient creates a new SchedulingV1alpha2Client for the given config and http client. +// NewForConfigAndClient creates a new SchedulingV1alpha3Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SchedulingV1alpha2Client, error) { +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SchedulingV1alpha3Client, error) { config := *c setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err } - return &SchedulingV1alpha2Client{client}, nil + return &SchedulingV1alpha3Client{client}, nil } -// NewForConfigOrDie creates a new SchedulingV1alpha2Client for the given config and +// NewForConfigOrDie creates a new SchedulingV1alpha3Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *SchedulingV1alpha2Client { +func NewForConfigOrDie(c *rest.Config) *SchedulingV1alpha3Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -80,13 +85,13 @@ func NewForConfigOrDie(c *rest.Config) *SchedulingV1alpha2Client { return client } -// New creates a new SchedulingV1alpha2Client for the given RESTClient. -func New(c rest.Interface) *SchedulingV1alpha2Client { - return &SchedulingV1alpha2Client{c} +// New creates a new SchedulingV1alpha3Client for the given RESTClient. +func New(c rest.Interface) *SchedulingV1alpha3Client { + return &SchedulingV1alpha3Client{c} } func setConfigDefaults(config *rest.Config) { - gv := schedulingv1alpha2.SchemeGroupVersion + gv := schedulingv1alpha3.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() @@ -98,7 +103,7 @@ func setConfigDefaults(config *rest.Config) { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *SchedulingV1alpha2Client) RESTClient() rest.Interface { +func (c *SchedulingV1alpha3Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2/workload.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3/workload.go similarity index 62% rename from vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2/workload.go rename to vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3/workload.go index 89790940bc..f4c9d7cf68 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2/workload.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3/workload.go @@ -16,16 +16,16 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( context "context" - schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2" + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - applyconfigurationsschedulingv1alpha2 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha2" + applyconfigurationsschedulingv1alpha3 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) @@ -38,34 +38,34 @@ type WorkloadsGetter interface { // WorkloadInterface has methods to work with Workload resources. type WorkloadInterface interface { - Create(ctx context.Context, workload *schedulingv1alpha2.Workload, opts v1.CreateOptions) (*schedulingv1alpha2.Workload, error) - Update(ctx context.Context, workload *schedulingv1alpha2.Workload, opts v1.UpdateOptions) (*schedulingv1alpha2.Workload, error) + Create(ctx context.Context, workload *schedulingv1alpha3.Workload, opts v1.CreateOptions) (*schedulingv1alpha3.Workload, error) + Update(ctx context.Context, workload *schedulingv1alpha3.Workload, opts v1.UpdateOptions) (*schedulingv1alpha3.Workload, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*schedulingv1alpha2.Workload, error) - List(ctx context.Context, opts v1.ListOptions) (*schedulingv1alpha2.WorkloadList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*schedulingv1alpha3.Workload, error) + List(ctx context.Context, opts v1.ListOptions) (*schedulingv1alpha3.WorkloadList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *schedulingv1alpha2.Workload, err error) - Apply(ctx context.Context, workload *applyconfigurationsschedulingv1alpha2.WorkloadApplyConfiguration, opts v1.ApplyOptions) (result *schedulingv1alpha2.Workload, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *schedulingv1alpha3.Workload, err error) + Apply(ctx context.Context, workload *applyconfigurationsschedulingv1alpha3.WorkloadApplyConfiguration, opts v1.ApplyOptions) (result *schedulingv1alpha3.Workload, err error) WorkloadExpansion } // workloads implements WorkloadInterface type workloads struct { - *gentype.ClientWithListAndApply[*schedulingv1alpha2.Workload, *schedulingv1alpha2.WorkloadList, *applyconfigurationsschedulingv1alpha2.WorkloadApplyConfiguration] + *gentype.ClientWithListAndApply[*schedulingv1alpha3.Workload, *schedulingv1alpha3.WorkloadList, *applyconfigurationsschedulingv1alpha3.WorkloadApplyConfiguration] } // newWorkloads returns a Workloads -func newWorkloads(c *SchedulingV1alpha2Client, namespace string) *workloads { +func newWorkloads(c *SchedulingV1alpha3Client, namespace string) *workloads { return &workloads{ - gentype.NewClientWithListAndApply[*schedulingv1alpha2.Workload, *schedulingv1alpha2.WorkloadList, *applyconfigurationsschedulingv1alpha2.WorkloadApplyConfiguration]( + gentype.NewClientWithListAndApply[*schedulingv1alpha3.Workload, *schedulingv1alpha3.WorkloadList, *applyconfigurationsschedulingv1alpha3.WorkloadApplyConfiguration]( "workloads", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *schedulingv1alpha2.Workload { return &schedulingv1alpha2.Workload{} }, - func() *schedulingv1alpha2.WorkloadList { return &schedulingv1alpha2.WorkloadList{} }, - gentype.PrefersProtobuf[*schedulingv1alpha2.Workload](), + func() *schedulingv1alpha3.Workload { return &schedulingv1alpha3.Workload{} }, + func() *schedulingv1alpha3.WorkloadList { return &schedulingv1alpha3.WorkloadList{} }, + gentype.PrefersProtobuf[*schedulingv1alpha3.Workload](), ), } } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/generated_expansion.go index 3bab873e6f..719e1e0e57 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/generated_expansion.go @@ -18,4 +18,8 @@ limitations under the License. package v1beta1 +type PodGroupExpansion interface{} + type PriorityClassExpansion interface{} + +type WorkloadExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/podgroup.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/podgroup.go new file mode 100644 index 0000000000..4eb85b94c7 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/podgroup.go @@ -0,0 +1,75 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + context "context" + + schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationsschedulingv1beta1 "k8s.io/client-go/applyconfigurations/scheduling/v1beta1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// PodGroupsGetter has a method to return a PodGroupInterface. +// A group's client should implement this interface. +type PodGroupsGetter interface { + PodGroups(namespace string) PodGroupInterface +} + +// PodGroupInterface has methods to work with PodGroup resources. +type PodGroupInterface interface { + Create(ctx context.Context, podGroup *schedulingv1beta1.PodGroup, opts v1.CreateOptions) (*schedulingv1beta1.PodGroup, error) + Update(ctx context.Context, podGroup *schedulingv1beta1.PodGroup, opts v1.UpdateOptions) (*schedulingv1beta1.PodGroup, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, podGroup *schedulingv1beta1.PodGroup, opts v1.UpdateOptions) (*schedulingv1beta1.PodGroup, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*schedulingv1beta1.PodGroup, error) + List(ctx context.Context, opts v1.ListOptions) (*schedulingv1beta1.PodGroupList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *schedulingv1beta1.PodGroup, err error) + Apply(ctx context.Context, podGroup *applyconfigurationsschedulingv1beta1.PodGroupApplyConfiguration, opts v1.ApplyOptions) (result *schedulingv1beta1.PodGroup, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, podGroup *applyconfigurationsschedulingv1beta1.PodGroupApplyConfiguration, opts v1.ApplyOptions) (result *schedulingv1beta1.PodGroup, err error) + PodGroupExpansion +} + +// podGroups implements PodGroupInterface +type podGroups struct { + *gentype.ClientWithListAndApply[*schedulingv1beta1.PodGroup, *schedulingv1beta1.PodGroupList, *applyconfigurationsschedulingv1beta1.PodGroupApplyConfiguration] +} + +// newPodGroups returns a PodGroups +func newPodGroups(c *SchedulingV1beta1Client, namespace string) *podGroups { + return &podGroups{ + gentype.NewClientWithListAndApply[*schedulingv1beta1.PodGroup, *schedulingv1beta1.PodGroupList, *applyconfigurationsschedulingv1beta1.PodGroupApplyConfiguration]( + "podgroups", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *schedulingv1beta1.PodGroup { return &schedulingv1beta1.PodGroup{} }, + func() *schedulingv1beta1.PodGroupList { return &schedulingv1beta1.PodGroupList{} }, + gentype.PrefersProtobuf[*schedulingv1beta1.PodGroup](), + ), + } +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/scheduling_client.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/scheduling_client.go index 0b2aa0e1ac..b2d7e6d261 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/scheduling_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/scheduling_client.go @@ -28,7 +28,9 @@ import ( type SchedulingV1beta1Interface interface { RESTClient() rest.Interface + PodGroupsGetter PriorityClassesGetter + WorkloadsGetter } // SchedulingV1beta1Client is used to interact with features provided by the scheduling.k8s.io group. @@ -36,10 +38,18 @@ type SchedulingV1beta1Client struct { restClient rest.Interface } +func (c *SchedulingV1beta1Client) PodGroups(namespace string) PodGroupInterface { + return newPodGroups(c, namespace) +} + func (c *SchedulingV1beta1Client) PriorityClasses() PriorityClassInterface { return newPriorityClasses(c) } +func (c *SchedulingV1beta1Client) Workloads(namespace string) WorkloadInterface { + return newWorkloads(c, namespace) +} + // NewForConfig creates a new SchedulingV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/workload.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/workload.go new file mode 100644 index 0000000000..e5313ab593 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/workload.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + context "context" + + schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationsschedulingv1beta1 "k8s.io/client-go/applyconfigurations/scheduling/v1beta1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// WorkloadsGetter has a method to return a WorkloadInterface. +// A group's client should implement this interface. +type WorkloadsGetter interface { + Workloads(namespace string) WorkloadInterface +} + +// WorkloadInterface has methods to work with Workload resources. +type WorkloadInterface interface { + Create(ctx context.Context, workload *schedulingv1beta1.Workload, opts v1.CreateOptions) (*schedulingv1beta1.Workload, error) + Update(ctx context.Context, workload *schedulingv1beta1.Workload, opts v1.UpdateOptions) (*schedulingv1beta1.Workload, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*schedulingv1beta1.Workload, error) + List(ctx context.Context, opts v1.ListOptions) (*schedulingv1beta1.WorkloadList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *schedulingv1beta1.Workload, err error) + Apply(ctx context.Context, workload *applyconfigurationsschedulingv1beta1.WorkloadApplyConfiguration, opts v1.ApplyOptions) (result *schedulingv1beta1.Workload, err error) + WorkloadExpansion +} + +// workloads implements WorkloadInterface +type workloads struct { + *gentype.ClientWithListAndApply[*schedulingv1beta1.Workload, *schedulingv1beta1.WorkloadList, *applyconfigurationsschedulingv1beta1.WorkloadApplyConfiguration] +} + +// newWorkloads returns a Workloads +func newWorkloads(c *SchedulingV1beta1Client, namespace string) *workloads { + return &workloads{ + gentype.NewClientWithListAndApply[*schedulingv1beta1.Workload, *schedulingv1beta1.WorkloadList, *applyconfigurationsschedulingv1beta1.WorkloadApplyConfiguration]( + "workloads", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *schedulingv1beta1.Workload { return &schedulingv1beta1.Workload{} }, + func() *schedulingv1beta1.WorkloadList { return &schedulingv1beta1.WorkloadList{} }, + gentype.PrefersProtobuf[*schedulingv1beta1.Workload](), + ), + } +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/csinode.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/csinode.go index a4fe6a0ee5..05d7302ba3 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/csinode.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/csinode.go @@ -40,6 +40,8 @@ type CSINodesGetter interface { type CSINodeInterface interface { Create(ctx context.Context, cSINode *storagev1.CSINode, opts metav1.CreateOptions) (*storagev1.CSINode, error) Update(ctx context.Context, cSINode *storagev1.CSINode, opts metav1.UpdateOptions) (*storagev1.CSINode, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, cSINode *storagev1.CSINode, opts metav1.UpdateOptions) (*storagev1.CSINode, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*storagev1.CSINode, error) @@ -47,6 +49,8 @@ type CSINodeInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *storagev1.CSINode, err error) Apply(ctx context.Context, cSINode *applyconfigurationsstoragev1.CSINodeApplyConfiguration, opts metav1.ApplyOptions) (result *storagev1.CSINode, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, cSINode *applyconfigurationsstoragev1.CSINodeApplyConfiguration, opts metav1.ApplyOptions) (result *storagev1.CSINode, err error) CSINodeExpansion } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csinode.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csinode.go index 5e8eb2e376..6009d0d9a9 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csinode.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csinode.go @@ -40,6 +40,8 @@ type CSINodesGetter interface { type CSINodeInterface interface { Create(ctx context.Context, cSINode *storagev1beta1.CSINode, opts v1.CreateOptions) (*storagev1beta1.CSINode, error) Update(ctx context.Context, cSINode *storagev1beta1.CSINode, opts v1.UpdateOptions) (*storagev1beta1.CSINode, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, cSINode *storagev1beta1.CSINode, opts v1.UpdateOptions) (*storagev1beta1.CSINode, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error Get(ctx context.Context, name string, opts v1.GetOptions) (*storagev1beta1.CSINode, error) @@ -47,6 +49,8 @@ type CSINodeInterface interface { Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *storagev1beta1.CSINode, err error) Apply(ctx context.Context, cSINode *applyconfigurationsstoragev1beta1.CSINodeApplyConfiguration, opts v1.ApplyOptions) (result *storagev1beta1.CSINode, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, cSINode *applyconfigurationsstoragev1beta1.CSINodeApplyConfiguration, opts v1.ApplyOptions) (result *storagev1beta1.CSINode, err error) CSINodeExpansion } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1/doc.go b/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1/doc.go new file mode 100644 index 0000000000..3af5d054f1 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1/generated_expansion.go new file mode 100644 index 0000000000..65521b370a --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +type StorageVersionMigrationExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1/storagemigration_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1/storagemigration_client.go new file mode 100644 index 0000000000..600e7904e5 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1/storagemigration_client.go @@ -0,0 +1,101 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + http "net/http" + + storagemigrationv1 "k8s.io/api/storagemigration/v1" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +type StoragemigrationV1Interface interface { + RESTClient() rest.Interface + StorageVersionMigrationsGetter +} + +// StoragemigrationV1Client is used to interact with features provided by the storagemigration.k8s.io group. +type StoragemigrationV1Client struct { + restClient rest.Interface +} + +func (c *StoragemigrationV1Client) StorageVersionMigrations() StorageVersionMigrationInterface { + return newStorageVersionMigrations(c) +} + +// NewForConfig creates a new StoragemigrationV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*StoragemigrationV1Client, error) { + config := *c + setConfigDefaults(&config) + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new StoragemigrationV1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*StoragemigrationV1Client, error) { + config := *c + setConfigDefaults(&config) + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &StoragemigrationV1Client{client}, nil +} + +// NewForConfigOrDie creates a new StoragemigrationV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *StoragemigrationV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new StoragemigrationV1Client for the given RESTClient. +func New(c rest.Interface) *StoragemigrationV1Client { + return &StoragemigrationV1Client{c} +} + +func setConfigDefaults(config *rest.Config) { + gv := storagemigrationv1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *StoragemigrationV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1/storageversionmigration.go b/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1/storageversionmigration.go new file mode 100644 index 0000000000..ecc5658d16 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/storagemigration/v1/storageversionmigration.go @@ -0,0 +1,79 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + context "context" + + storagemigrationv1 "k8s.io/api/storagemigration/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + applyconfigurationsstoragemigrationv1 "k8s.io/client-go/applyconfigurations/storagemigration/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// StorageVersionMigrationsGetter has a method to return a StorageVersionMigrationInterface. +// A group's client should implement this interface. +type StorageVersionMigrationsGetter interface { + StorageVersionMigrations() StorageVersionMigrationInterface +} + +// StorageVersionMigrationInterface has methods to work with StorageVersionMigration resources. +type StorageVersionMigrationInterface interface { + Create(ctx context.Context, storageVersionMigration *storagemigrationv1.StorageVersionMigration, opts metav1.CreateOptions) (*storagemigrationv1.StorageVersionMigration, error) + Update(ctx context.Context, storageVersionMigration *storagemigrationv1.StorageVersionMigration, opts metav1.UpdateOptions) (*storagemigrationv1.StorageVersionMigration, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, storageVersionMigration *storagemigrationv1.StorageVersionMigration, opts metav1.UpdateOptions) (*storagemigrationv1.StorageVersionMigration, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*storagemigrationv1.StorageVersionMigration, error) + List(ctx context.Context, opts metav1.ListOptions) (*storagemigrationv1.StorageVersionMigrationList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *storagemigrationv1.StorageVersionMigration, err error) + Apply(ctx context.Context, storageVersionMigration *applyconfigurationsstoragemigrationv1.StorageVersionMigrationApplyConfiguration, opts metav1.ApplyOptions) (result *storagemigrationv1.StorageVersionMigration, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, storageVersionMigration *applyconfigurationsstoragemigrationv1.StorageVersionMigrationApplyConfiguration, opts metav1.ApplyOptions) (result *storagemigrationv1.StorageVersionMigration, err error) + StorageVersionMigrationExpansion +} + +// storageVersionMigrations implements StorageVersionMigrationInterface +type storageVersionMigrations struct { + *gentype.ClientWithListAndApply[*storagemigrationv1.StorageVersionMigration, *storagemigrationv1.StorageVersionMigrationList, *applyconfigurationsstoragemigrationv1.StorageVersionMigrationApplyConfiguration] +} + +// newStorageVersionMigrations returns a StorageVersionMigrations +func newStorageVersionMigrations(c *StoragemigrationV1Client) *storageVersionMigrations { + return &storageVersionMigrations{ + gentype.NewClientWithListAndApply[*storagemigrationv1.StorageVersionMigration, *storagemigrationv1.StorageVersionMigrationList, *applyconfigurationsstoragemigrationv1.StorageVersionMigrationApplyConfiguration]( + "storageversionmigrations", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *storagemigrationv1.StorageVersionMigration { + return &storagemigrationv1.StorageVersionMigration{} + }, + func() *storagemigrationv1.StorageVersionMigrationList { + return &storagemigrationv1.StorageVersionMigrationList{} + }, + gentype.PrefersProtobuf[*storagemigrationv1.StorageVersionMigration](), + ), + } +} diff --git a/vendor/k8s.io/client-go/listers/certificates/v1/clustertrustbundle.go b/vendor/k8s.io/client-go/listers/certificates/v1/clustertrustbundle.go new file mode 100644 index 0000000000..18f6e15fcb --- /dev/null +++ b/vendor/k8s.io/client-go/listers/certificates/v1/clustertrustbundle.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + certificatesv1 "k8s.io/api/certificates/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// ClusterTrustBundleLister helps list ClusterTrustBundles. +// All objects returned here must be treated as read-only. +type ClusterTrustBundleLister interface { + // List lists all ClusterTrustBundles in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*certificatesv1.ClusterTrustBundle, err error) + // Get retrieves the ClusterTrustBundle from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*certificatesv1.ClusterTrustBundle, error) + ClusterTrustBundleListerExpansion +} + +// clusterTrustBundleLister implements the ClusterTrustBundleLister interface. +type clusterTrustBundleLister struct { + listers.ResourceIndexer[*certificatesv1.ClusterTrustBundle] +} + +// NewClusterTrustBundleLister returns a new ClusterTrustBundleLister. +func NewClusterTrustBundleLister(indexer cache.Indexer) ClusterTrustBundleLister { + return &clusterTrustBundleLister{listers.New[*certificatesv1.ClusterTrustBundle](indexer, certificatesv1.Resource("clustertrustbundle"))} +} diff --git a/vendor/k8s.io/client-go/listers/certificates/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/certificates/v1/expansion_generated.go index 616a1f1a09..36a04381e7 100644 --- a/vendor/k8s.io/client-go/listers/certificates/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/certificates/v1/expansion_generated.go @@ -21,3 +21,15 @@ package v1 // CertificateSigningRequestListerExpansion allows custom methods to be added to // CertificateSigningRequestLister. type CertificateSigningRequestListerExpansion interface{} + +// ClusterTrustBundleListerExpansion allows custom methods to be added to +// ClusterTrustBundleLister. +type ClusterTrustBundleListerExpansion interface{} + +// PodCertificateRequestListerExpansion allows custom methods to be added to +// PodCertificateRequestLister. +type PodCertificateRequestListerExpansion interface{} + +// PodCertificateRequestNamespaceListerExpansion allows custom methods to be added to +// PodCertificateRequestNamespaceLister. +type PodCertificateRequestNamespaceListerExpansion interface{} diff --git a/vendor/k8s.io/client-go/listers/certificates/v1/podcertificaterequest.go b/vendor/k8s.io/client-go/listers/certificates/v1/podcertificaterequest.go new file mode 100644 index 0000000000..71a7a545d8 --- /dev/null +++ b/vendor/k8s.io/client-go/listers/certificates/v1/podcertificaterequest.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + certificatesv1 "k8s.io/api/certificates/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// PodCertificateRequestLister helps list PodCertificateRequests. +// All objects returned here must be treated as read-only. +type PodCertificateRequestLister interface { + // List lists all PodCertificateRequests in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*certificatesv1.PodCertificateRequest, err error) + // PodCertificateRequests returns an object that can list and get PodCertificateRequests. + PodCertificateRequests(namespace string) PodCertificateRequestNamespaceLister + PodCertificateRequestListerExpansion +} + +// podCertificateRequestLister implements the PodCertificateRequestLister interface. +type podCertificateRequestLister struct { + listers.ResourceIndexer[*certificatesv1.PodCertificateRequest] +} + +// NewPodCertificateRequestLister returns a new PodCertificateRequestLister. +func NewPodCertificateRequestLister(indexer cache.Indexer) PodCertificateRequestLister { + return &podCertificateRequestLister{listers.New[*certificatesv1.PodCertificateRequest](indexer, certificatesv1.Resource("podcertificaterequest"))} +} + +// PodCertificateRequests returns an object that can list and get PodCertificateRequests. +func (s *podCertificateRequestLister) PodCertificateRequests(namespace string) PodCertificateRequestNamespaceLister { + return podCertificateRequestNamespaceLister{listers.NewNamespaced[*certificatesv1.PodCertificateRequest](s.ResourceIndexer, namespace)} +} + +// PodCertificateRequestNamespaceLister helps list and get PodCertificateRequests. +// All objects returned here must be treated as read-only. +type PodCertificateRequestNamespaceLister interface { + // List lists all PodCertificateRequests in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*certificatesv1.PodCertificateRequest, err error) + // Get retrieves the PodCertificateRequest from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*certificatesv1.PodCertificateRequest, error) + PodCertificateRequestNamespaceListerExpansion +} + +// podCertificateRequestNamespaceLister implements the PodCertificateRequestNamespaceLister +// interface. +type podCertificateRequestNamespaceLister struct { + listers.ResourceIndexer[*certificatesv1.PodCertificateRequest] +} diff --git a/vendor/k8s.io/client-go/listers/lifecycle/v1alpha1/eviction.go b/vendor/k8s.io/client-go/listers/lifecycle/v1alpha1/eviction.go new file mode 100644 index 0000000000..33f3c663cb --- /dev/null +++ b/vendor/k8s.io/client-go/listers/lifecycle/v1alpha1/eviction.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + lifecyclev1alpha1 "k8s.io/api/lifecycle/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// EvictionLister helps list Evictions. +// All objects returned here must be treated as read-only. +type EvictionLister interface { + // List lists all Evictions in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*lifecyclev1alpha1.Eviction, err error) + // Evictions returns an object that can list and get Evictions. + Evictions(namespace string) EvictionNamespaceLister + EvictionListerExpansion +} + +// evictionLister implements the EvictionLister interface. +type evictionLister struct { + listers.ResourceIndexer[*lifecyclev1alpha1.Eviction] +} + +// NewEvictionLister returns a new EvictionLister. +func NewEvictionLister(indexer cache.Indexer) EvictionLister { + return &evictionLister{listers.New[*lifecyclev1alpha1.Eviction](indexer, lifecyclev1alpha1.Resource("eviction"))} +} + +// Evictions returns an object that can list and get Evictions. +func (s *evictionLister) Evictions(namespace string) EvictionNamespaceLister { + return evictionNamespaceLister{listers.NewNamespaced[*lifecyclev1alpha1.Eviction](s.ResourceIndexer, namespace)} +} + +// EvictionNamespaceLister helps list and get Evictions. +// All objects returned here must be treated as read-only. +type EvictionNamespaceLister interface { + // List lists all Evictions in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*lifecyclev1alpha1.Eviction, err error) + // Get retrieves the Eviction from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*lifecyclev1alpha1.Eviction, error) + EvictionNamespaceListerExpansion +} + +// evictionNamespaceLister implements the EvictionNamespaceLister +// interface. +type evictionNamespaceLister struct { + listers.ResourceIndexer[*lifecyclev1alpha1.Eviction] +} diff --git a/vendor/k8s.io/client-go/listers/lifecycle/v1alpha1/evictionrequest.go b/vendor/k8s.io/client-go/listers/lifecycle/v1alpha1/evictionrequest.go new file mode 100644 index 0000000000..97caab9cd2 --- /dev/null +++ b/vendor/k8s.io/client-go/listers/lifecycle/v1alpha1/evictionrequest.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + lifecyclev1alpha1 "k8s.io/api/lifecycle/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// EvictionRequestLister helps list EvictionRequests. +// All objects returned here must be treated as read-only. +type EvictionRequestLister interface { + // List lists all EvictionRequests in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*lifecyclev1alpha1.EvictionRequest, err error) + // EvictionRequests returns an object that can list and get EvictionRequests. + EvictionRequests(namespace string) EvictionRequestNamespaceLister + EvictionRequestListerExpansion +} + +// evictionRequestLister implements the EvictionRequestLister interface. +type evictionRequestLister struct { + listers.ResourceIndexer[*lifecyclev1alpha1.EvictionRequest] +} + +// NewEvictionRequestLister returns a new EvictionRequestLister. +func NewEvictionRequestLister(indexer cache.Indexer) EvictionRequestLister { + return &evictionRequestLister{listers.New[*lifecyclev1alpha1.EvictionRequest](indexer, lifecyclev1alpha1.Resource("evictionrequest"))} +} + +// EvictionRequests returns an object that can list and get EvictionRequests. +func (s *evictionRequestLister) EvictionRequests(namespace string) EvictionRequestNamespaceLister { + return evictionRequestNamespaceLister{listers.NewNamespaced[*lifecyclev1alpha1.EvictionRequest](s.ResourceIndexer, namespace)} +} + +// EvictionRequestNamespaceLister helps list and get EvictionRequests. +// All objects returned here must be treated as read-only. +type EvictionRequestNamespaceLister interface { + // List lists all EvictionRequests in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*lifecyclev1alpha1.EvictionRequest, err error) + // Get retrieves the EvictionRequest from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*lifecyclev1alpha1.EvictionRequest, error) + EvictionRequestNamespaceListerExpansion +} + +// evictionRequestNamespaceLister implements the EvictionRequestNamespaceLister +// interface. +type evictionRequestNamespaceLister struct { + listers.ResourceIndexer[*lifecyclev1alpha1.EvictionRequest] +} diff --git a/vendor/k8s.io/client-go/listers/lifecycle/v1alpha1/expansion_generated.go b/vendor/k8s.io/client-go/listers/lifecycle/v1alpha1/expansion_generated.go new file mode 100644 index 0000000000..dba8bb0555 --- /dev/null +++ b/vendor/k8s.io/client-go/listers/lifecycle/v1alpha1/expansion_generated.go @@ -0,0 +1,35 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +// EvictionListerExpansion allows custom methods to be added to +// EvictionLister. +type EvictionListerExpansion interface{} + +// EvictionNamespaceListerExpansion allows custom methods to be added to +// EvictionNamespaceLister. +type EvictionNamespaceListerExpansion interface{} + +// EvictionRequestListerExpansion allows custom methods to be added to +// EvictionRequestLister. +type EvictionRequestListerExpansion interface{} + +// EvictionRequestNamespaceListerExpansion allows custom methods to be added to +// EvictionRequestNamespaceLister. +type EvictionRequestNamespaceListerExpansion interface{} diff --git a/vendor/k8s.io/client-go/listers/resource/v1/devicetaintrule.go b/vendor/k8s.io/client-go/listers/resource/v1/devicetaintrule.go new file mode 100644 index 0000000000..150ca4f644 --- /dev/null +++ b/vendor/k8s.io/client-go/listers/resource/v1/devicetaintrule.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + resourcev1 "k8s.io/api/resource/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// DeviceTaintRuleLister helps list DeviceTaintRules. +// All objects returned here must be treated as read-only. +type DeviceTaintRuleLister interface { + // List lists all DeviceTaintRules in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*resourcev1.DeviceTaintRule, err error) + // Get retrieves the DeviceTaintRule from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*resourcev1.DeviceTaintRule, error) + DeviceTaintRuleListerExpansion +} + +// deviceTaintRuleLister implements the DeviceTaintRuleLister interface. +type deviceTaintRuleLister struct { + listers.ResourceIndexer[*resourcev1.DeviceTaintRule] +} + +// NewDeviceTaintRuleLister returns a new DeviceTaintRuleLister. +func NewDeviceTaintRuleLister(indexer cache.Indexer) DeviceTaintRuleLister { + return &deviceTaintRuleLister{listers.New[*resourcev1.DeviceTaintRule](indexer, resourcev1.Resource("devicetaintrule"))} +} diff --git a/vendor/k8s.io/client-go/listers/resource/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/resource/v1/expansion_generated.go index 6e6e22dcd5..53e789fee6 100644 --- a/vendor/k8s.io/client-go/listers/resource/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/resource/v1/expansion_generated.go @@ -22,6 +22,10 @@ package v1 // DeviceClassLister. type DeviceClassListerExpansion interface{} +// DeviceTaintRuleListerExpansion allows custom methods to be added to +// DeviceTaintRuleLister. +type DeviceTaintRuleListerExpansion interface{} + // ResourceClaimListerExpansion allows custom methods to be added to // ResourceClaimLister. type ResourceClaimListerExpansion interface{} diff --git a/vendor/k8s.io/client-go/listers/scheduling/v1alpha3/compositepodgroup.go b/vendor/k8s.io/client-go/listers/scheduling/v1alpha3/compositepodgroup.go new file mode 100644 index 0000000000..b5cfe9752f --- /dev/null +++ b/vendor/k8s.io/client-go/listers/scheduling/v1alpha3/compositepodgroup.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// CompositePodGroupLister helps list CompositePodGroups. +// All objects returned here must be treated as read-only. +type CompositePodGroupLister interface { + // List lists all CompositePodGroups in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*schedulingv1alpha3.CompositePodGroup, err error) + // CompositePodGroups returns an object that can list and get CompositePodGroups. + CompositePodGroups(namespace string) CompositePodGroupNamespaceLister + CompositePodGroupListerExpansion +} + +// compositePodGroupLister implements the CompositePodGroupLister interface. +type compositePodGroupLister struct { + listers.ResourceIndexer[*schedulingv1alpha3.CompositePodGroup] +} + +// NewCompositePodGroupLister returns a new CompositePodGroupLister. +func NewCompositePodGroupLister(indexer cache.Indexer) CompositePodGroupLister { + return &compositePodGroupLister{listers.New[*schedulingv1alpha3.CompositePodGroup](indexer, schedulingv1alpha3.Resource("compositepodgroup"))} +} + +// CompositePodGroups returns an object that can list and get CompositePodGroups. +func (s *compositePodGroupLister) CompositePodGroups(namespace string) CompositePodGroupNamespaceLister { + return compositePodGroupNamespaceLister{listers.NewNamespaced[*schedulingv1alpha3.CompositePodGroup](s.ResourceIndexer, namespace)} +} + +// CompositePodGroupNamespaceLister helps list and get CompositePodGroups. +// All objects returned here must be treated as read-only. +type CompositePodGroupNamespaceLister interface { + // List lists all CompositePodGroups in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*schedulingv1alpha3.CompositePodGroup, err error) + // Get retrieves the CompositePodGroup from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*schedulingv1alpha3.CompositePodGroup, error) + CompositePodGroupNamespaceListerExpansion +} + +// compositePodGroupNamespaceLister implements the CompositePodGroupNamespaceLister +// interface. +type compositePodGroupNamespaceLister struct { + listers.ResourceIndexer[*schedulingv1alpha3.CompositePodGroup] +} diff --git a/vendor/k8s.io/client-go/listers/scheduling/v1alpha2/expansion_generated.go b/vendor/k8s.io/client-go/listers/scheduling/v1alpha3/expansion_generated.go similarity index 77% rename from vendor/k8s.io/client-go/listers/scheduling/v1alpha2/expansion_generated.go rename to vendor/k8s.io/client-go/listers/scheduling/v1alpha3/expansion_generated.go index 3a63d7891c..cd99f2d084 100644 --- a/vendor/k8s.io/client-go/listers/scheduling/v1alpha2/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/scheduling/v1alpha3/expansion_generated.go @@ -16,7 +16,15 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 + +// CompositePodGroupListerExpansion allows custom methods to be added to +// CompositePodGroupLister. +type CompositePodGroupListerExpansion interface{} + +// CompositePodGroupNamespaceListerExpansion allows custom methods to be added to +// CompositePodGroupNamespaceLister. +type CompositePodGroupNamespaceListerExpansion interface{} // PodGroupListerExpansion allows custom methods to be added to // PodGroupLister. diff --git a/vendor/k8s.io/client-go/listers/scheduling/v1alpha2/podgroup.go b/vendor/k8s.io/client-go/listers/scheduling/v1alpha3/podgroup.go similarity index 80% rename from vendor/k8s.io/client-go/listers/scheduling/v1alpha2/podgroup.go rename to vendor/k8s.io/client-go/listers/scheduling/v1alpha3/podgroup.go index 292e5d62be..0215a7e39f 100644 --- a/vendor/k8s.io/client-go/listers/scheduling/v1alpha2/podgroup.go +++ b/vendor/k8s.io/client-go/listers/scheduling/v1alpha3/podgroup.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2" + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" labels "k8s.io/apimachinery/pkg/labels" listers "k8s.io/client-go/listers" cache "k8s.io/client-go/tools/cache" @@ -30,7 +30,7 @@ import ( type PodGroupLister interface { // List lists all PodGroups in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*schedulingv1alpha2.PodGroup, err error) + List(selector labels.Selector) (ret []*schedulingv1alpha3.PodGroup, err error) // PodGroups returns an object that can list and get PodGroups. PodGroups(namespace string) PodGroupNamespaceLister PodGroupListerExpansion @@ -38,17 +38,17 @@ type PodGroupLister interface { // podGroupLister implements the PodGroupLister interface. type podGroupLister struct { - listers.ResourceIndexer[*schedulingv1alpha2.PodGroup] + listers.ResourceIndexer[*schedulingv1alpha3.PodGroup] } // NewPodGroupLister returns a new PodGroupLister. func NewPodGroupLister(indexer cache.Indexer) PodGroupLister { - return &podGroupLister{listers.New[*schedulingv1alpha2.PodGroup](indexer, schedulingv1alpha2.Resource("podgroup"))} + return &podGroupLister{listers.New[*schedulingv1alpha3.PodGroup](indexer, schedulingv1alpha3.Resource("podgroup"))} } // PodGroups returns an object that can list and get PodGroups. func (s *podGroupLister) PodGroups(namespace string) PodGroupNamespaceLister { - return podGroupNamespaceLister{listers.NewNamespaced[*schedulingv1alpha2.PodGroup](s.ResourceIndexer, namespace)} + return podGroupNamespaceLister{listers.NewNamespaced[*schedulingv1alpha3.PodGroup](s.ResourceIndexer, namespace)} } // PodGroupNamespaceLister helps list and get PodGroups. @@ -56,15 +56,15 @@ func (s *podGroupLister) PodGroups(namespace string) PodGroupNamespaceLister { type PodGroupNamespaceLister interface { // List lists all PodGroups in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*schedulingv1alpha2.PodGroup, err error) + List(selector labels.Selector) (ret []*schedulingv1alpha3.PodGroup, err error) // Get retrieves the PodGroup from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*schedulingv1alpha2.PodGroup, error) + Get(name string) (*schedulingv1alpha3.PodGroup, error) PodGroupNamespaceListerExpansion } // podGroupNamespaceLister implements the PodGroupNamespaceLister // interface. type podGroupNamespaceLister struct { - listers.ResourceIndexer[*schedulingv1alpha2.PodGroup] + listers.ResourceIndexer[*schedulingv1alpha3.PodGroup] } diff --git a/vendor/k8s.io/client-go/listers/scheduling/v1alpha2/workload.go b/vendor/k8s.io/client-go/listers/scheduling/v1alpha3/workload.go similarity index 80% rename from vendor/k8s.io/client-go/listers/scheduling/v1alpha2/workload.go rename to vendor/k8s.io/client-go/listers/scheduling/v1alpha3/workload.go index 9526da3b5a..4919ca4ad9 100644 --- a/vendor/k8s.io/client-go/listers/scheduling/v1alpha2/workload.go +++ b/vendor/k8s.io/client-go/listers/scheduling/v1alpha3/workload.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2" + schedulingv1alpha3 "k8s.io/api/scheduling/v1alpha3" labels "k8s.io/apimachinery/pkg/labels" listers "k8s.io/client-go/listers" cache "k8s.io/client-go/tools/cache" @@ -30,7 +30,7 @@ import ( type WorkloadLister interface { // List lists all Workloads in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*schedulingv1alpha2.Workload, err error) + List(selector labels.Selector) (ret []*schedulingv1alpha3.Workload, err error) // Workloads returns an object that can list and get Workloads. Workloads(namespace string) WorkloadNamespaceLister WorkloadListerExpansion @@ -38,17 +38,17 @@ type WorkloadLister interface { // workloadLister implements the WorkloadLister interface. type workloadLister struct { - listers.ResourceIndexer[*schedulingv1alpha2.Workload] + listers.ResourceIndexer[*schedulingv1alpha3.Workload] } // NewWorkloadLister returns a new WorkloadLister. func NewWorkloadLister(indexer cache.Indexer) WorkloadLister { - return &workloadLister{listers.New[*schedulingv1alpha2.Workload](indexer, schedulingv1alpha2.Resource("workload"))} + return &workloadLister{listers.New[*schedulingv1alpha3.Workload](indexer, schedulingv1alpha3.Resource("workload"))} } // Workloads returns an object that can list and get Workloads. func (s *workloadLister) Workloads(namespace string) WorkloadNamespaceLister { - return workloadNamespaceLister{listers.NewNamespaced[*schedulingv1alpha2.Workload](s.ResourceIndexer, namespace)} + return workloadNamespaceLister{listers.NewNamespaced[*schedulingv1alpha3.Workload](s.ResourceIndexer, namespace)} } // WorkloadNamespaceLister helps list and get Workloads. @@ -56,15 +56,15 @@ func (s *workloadLister) Workloads(namespace string) WorkloadNamespaceLister { type WorkloadNamespaceLister interface { // List lists all Workloads in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*schedulingv1alpha2.Workload, err error) + List(selector labels.Selector) (ret []*schedulingv1alpha3.Workload, err error) // Get retrieves the Workload from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*schedulingv1alpha2.Workload, error) + Get(name string) (*schedulingv1alpha3.Workload, error) WorkloadNamespaceListerExpansion } // workloadNamespaceLister implements the WorkloadNamespaceLister // interface. type workloadNamespaceLister struct { - listers.ResourceIndexer[*schedulingv1alpha2.Workload] + listers.ResourceIndexer[*schedulingv1alpha3.Workload] } diff --git a/vendor/k8s.io/client-go/listers/scheduling/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/scheduling/v1beta1/expansion_generated.go index b806e8cf80..449ba455bb 100644 --- a/vendor/k8s.io/client-go/listers/scheduling/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/scheduling/v1beta1/expansion_generated.go @@ -18,6 +18,22 @@ limitations under the License. package v1beta1 +// PodGroupListerExpansion allows custom methods to be added to +// PodGroupLister. +type PodGroupListerExpansion interface{} + +// PodGroupNamespaceListerExpansion allows custom methods to be added to +// PodGroupNamespaceLister. +type PodGroupNamespaceListerExpansion interface{} + // PriorityClassListerExpansion allows custom methods to be added to // PriorityClassLister. type PriorityClassListerExpansion interface{} + +// WorkloadListerExpansion allows custom methods to be added to +// WorkloadLister. +type WorkloadListerExpansion interface{} + +// WorkloadNamespaceListerExpansion allows custom methods to be added to +// WorkloadNamespaceLister. +type WorkloadNamespaceListerExpansion interface{} diff --git a/vendor/k8s.io/client-go/listers/scheduling/v1beta1/podgroup.go b/vendor/k8s.io/client-go/listers/scheduling/v1beta1/podgroup.go new file mode 100644 index 0000000000..32ef1ac6eb --- /dev/null +++ b/vendor/k8s.io/client-go/listers/scheduling/v1beta1/podgroup.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// PodGroupLister helps list PodGroups. +// All objects returned here must be treated as read-only. +type PodGroupLister interface { + // List lists all PodGroups in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*schedulingv1beta1.PodGroup, err error) + // PodGroups returns an object that can list and get PodGroups. + PodGroups(namespace string) PodGroupNamespaceLister + PodGroupListerExpansion +} + +// podGroupLister implements the PodGroupLister interface. +type podGroupLister struct { + listers.ResourceIndexer[*schedulingv1beta1.PodGroup] +} + +// NewPodGroupLister returns a new PodGroupLister. +func NewPodGroupLister(indexer cache.Indexer) PodGroupLister { + return &podGroupLister{listers.New[*schedulingv1beta1.PodGroup](indexer, schedulingv1beta1.Resource("podgroup"))} +} + +// PodGroups returns an object that can list and get PodGroups. +func (s *podGroupLister) PodGroups(namespace string) PodGroupNamespaceLister { + return podGroupNamespaceLister{listers.NewNamespaced[*schedulingv1beta1.PodGroup](s.ResourceIndexer, namespace)} +} + +// PodGroupNamespaceLister helps list and get PodGroups. +// All objects returned here must be treated as read-only. +type PodGroupNamespaceLister interface { + // List lists all PodGroups in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*schedulingv1beta1.PodGroup, err error) + // Get retrieves the PodGroup from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*schedulingv1beta1.PodGroup, error) + PodGroupNamespaceListerExpansion +} + +// podGroupNamespaceLister implements the PodGroupNamespaceLister +// interface. +type podGroupNamespaceLister struct { + listers.ResourceIndexer[*schedulingv1beta1.PodGroup] +} diff --git a/vendor/k8s.io/client-go/listers/scheduling/v1beta1/workload.go b/vendor/k8s.io/client-go/listers/scheduling/v1beta1/workload.go new file mode 100644 index 0000000000..9f20d5a063 --- /dev/null +++ b/vendor/k8s.io/client-go/listers/scheduling/v1beta1/workload.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// WorkloadLister helps list Workloads. +// All objects returned here must be treated as read-only. +type WorkloadLister interface { + // List lists all Workloads in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*schedulingv1beta1.Workload, err error) + // Workloads returns an object that can list and get Workloads. + Workloads(namespace string) WorkloadNamespaceLister + WorkloadListerExpansion +} + +// workloadLister implements the WorkloadLister interface. +type workloadLister struct { + listers.ResourceIndexer[*schedulingv1beta1.Workload] +} + +// NewWorkloadLister returns a new WorkloadLister. +func NewWorkloadLister(indexer cache.Indexer) WorkloadLister { + return &workloadLister{listers.New[*schedulingv1beta1.Workload](indexer, schedulingv1beta1.Resource("workload"))} +} + +// Workloads returns an object that can list and get Workloads. +func (s *workloadLister) Workloads(namespace string) WorkloadNamespaceLister { + return workloadNamespaceLister{listers.NewNamespaced[*schedulingv1beta1.Workload](s.ResourceIndexer, namespace)} +} + +// WorkloadNamespaceLister helps list and get Workloads. +// All objects returned here must be treated as read-only. +type WorkloadNamespaceLister interface { + // List lists all Workloads in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*schedulingv1beta1.Workload, err error) + // Get retrieves the Workload from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*schedulingv1beta1.Workload, error) + WorkloadNamespaceListerExpansion +} + +// workloadNamespaceLister implements the WorkloadNamespaceLister +// interface. +type workloadNamespaceLister struct { + listers.ResourceIndexer[*schedulingv1beta1.Workload] +} diff --git a/vendor/k8s.io/client-go/listers/storagemigration/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/storagemigration/v1/expansion_generated.go new file mode 100644 index 0000000000..324da1ffa6 --- /dev/null +++ b/vendor/k8s.io/client-go/listers/storagemigration/v1/expansion_generated.go @@ -0,0 +1,23 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +// StorageVersionMigrationListerExpansion allows custom methods to be added to +// StorageVersionMigrationLister. +type StorageVersionMigrationListerExpansion interface{} diff --git a/vendor/k8s.io/client-go/listers/storagemigration/v1/storageversionmigration.go b/vendor/k8s.io/client-go/listers/storagemigration/v1/storageversionmigration.go new file mode 100644 index 0000000000..37f7afb073 --- /dev/null +++ b/vendor/k8s.io/client-go/listers/storagemigration/v1/storageversionmigration.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + storagemigrationv1 "k8s.io/api/storagemigration/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// StorageVersionMigrationLister helps list StorageVersionMigrations. +// All objects returned here must be treated as read-only. +type StorageVersionMigrationLister interface { + // List lists all StorageVersionMigrations in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*storagemigrationv1.StorageVersionMigration, err error) + // Get retrieves the StorageVersionMigration from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*storagemigrationv1.StorageVersionMigration, error) + StorageVersionMigrationListerExpansion +} + +// storageVersionMigrationLister implements the StorageVersionMigrationLister interface. +type storageVersionMigrationLister struct { + listers.ResourceIndexer[*storagemigrationv1.StorageVersionMigration] +} + +// NewStorageVersionMigrationLister returns a new StorageVersionMigrationLister. +func NewStorageVersionMigrationLister(indexer cache.Indexer) StorageVersionMigrationLister { + return &storageVersionMigrationLister{listers.New[*storagemigrationv1.StorageVersionMigration](indexer, storagemigrationv1.Resource("storageversionmigration"))} +} diff --git a/vendor/k8s.io/client-go/openapi/OWNERS b/vendor/k8s.io/client-go/openapi/OWNERS index e610094242..8bea129e9a 100644 --- a/vendor/k8s.io/client-go/openapi/OWNERS +++ b/vendor/k8s.io/client-go/openapi/OWNERS @@ -1,4 +1,7 @@ # See the OWNERS docs at https://go.k8s.io/owners approvers: + - jpbetz + - api-approvers +emeritus_approvers: - apelisse diff --git a/vendor/k8s.io/client-go/openapi/cached/client.go b/vendor/k8s.io/client-go/openapi/cached/client.go index 17f63ed267..5ce47af6fb 100644 --- a/vendor/k8s.io/client-go/openapi/cached/client.go +++ b/vendor/k8s.io/client-go/openapi/cached/client.go @@ -17,34 +17,71 @@ limitations under the License. package cached import ( + "context" "sync" "k8s.io/client-go/openapi" ) -type client struct { - delegate openapi.Client +type Client struct { + delegate openapi.ClientWithContext once sync.Once - result map[string]openapi.GroupVersion + result map[string]openapi.GroupVersionWithContext err error } +var ( + //nolint:staticcheck // Intentionally using the old interface here. + _ openapi.Client = &Client{} + _ openapi.ClientWithContext = &Client{} +) + +// NewClientWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use NewClientWithContext instead. func NewClient(other openapi.Client) openapi.Client { - return &client{ + return newClient(openapi.ToClientWithContext(other)) +} + +func NewClientWithContext(other openapi.ClientWithContext) *Client { + return newClient(other) +} + +func newClient(other openapi.ClientWithContext) *Client { + return &Client{ delegate: other, } } -func (c *client) Paths() (map[string]openapi.GroupVersion, error) { +// PathsWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use PathsWithContext instead. +func (c *Client) Paths() (map[string]openapi.GroupVersion, error) { + // For efficiency reasons in the *WithContext case this is a map to + // openapi.GroupVersionWithContext. But we know that all entries + // also implement openapi.GroupVersion. + resultWithContext, err := c.PathsWithContext(context.Background()) + result := make(map[string]openapi.GroupVersion, len(resultWithContext)) + for key, entry := range resultWithContext { + result[key] = entry.(openapi.GroupVersion) + } + return result, err +} + +func (c *Client) PathsWithContext(ctx context.Context) (map[string]openapi.GroupVersionWithContext, error) { + if err := ctx.Err(); err != nil { + return nil, err + } + c.once.Do(func() { - uncached, err := c.delegate.Paths() + uncached, err := c.delegate.PathsWithContext(ctx) if err != nil { c.err = err return } - result := make(map[string]openapi.GroupVersion, len(uncached)) + result := make(map[string]openapi.GroupVersionWithContext, len(uncached)) for k, v := range uncached { result[k] = newGroupVersion(v) } diff --git a/vendor/k8s.io/client-go/openapi/cached/groupversion.go b/vendor/k8s.io/client-go/openapi/cached/groupversion.go index 73730c51be..94fe7f056b 100644 --- a/vendor/k8s.io/client-go/openapi/cached/groupversion.go +++ b/vendor/k8s.io/client-go/openapi/cached/groupversion.go @@ -17,30 +17,48 @@ limitations under the License. package cached import ( + "context" "sync" "k8s.io/client-go/openapi" ) type groupversion struct { - delegate openapi.GroupVersion + delegate openapi.GroupVersionWithContext lock sync.Mutex docs map[string]docInfo } +var ( + //nolint:staticcheck // Intentionally using the old interface here. + _ openapi.GroupVersion = &groupversion{} + _ openapi.GroupVersionWithContext = &groupversion{} +) + type docInfo struct { data []byte err error } -func newGroupVersion(delegate openapi.GroupVersion) *groupversion { +func newGroupVersion(delegate openapi.GroupVersionWithContext) *groupversion { return &groupversion{ delegate: delegate, } } +// SchemaWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use SchemaWithContext instead. func (g *groupversion) Schema(contentType string) ([]byte, error) { + return g.SchemaWithContext(context.Background(), contentType) +} + +func (g *groupversion) SchemaWithContext(ctx context.Context, contentType string) ([]byte, error) { + if err := ctx.Err(); err != nil { + return nil, err + } + g.lock.Lock() defer g.lock.Unlock() @@ -50,7 +68,7 @@ func (g *groupversion) Schema(contentType string) ([]byte, error) { g.docs = make(map[string]docInfo) } - cachedInfo.data, cachedInfo.err = g.delegate.Schema(contentType) + cachedInfo.data, cachedInfo.err = g.delegate.SchemaWithContext(ctx, contentType) g.docs[contentType] = cachedInfo } diff --git a/vendor/k8s.io/client-go/openapi/client.go b/vendor/k8s.io/client-go/openapi/client.go index d32895a2f5..6e9a55e848 100644 --- a/vendor/k8s.io/client-go/openapi/client.go +++ b/vendor/k8s.io/client-go/openapi/client.go @@ -25,25 +25,81 @@ import ( "k8s.io/kube-openapi/pkg/handler3" ) +// ClientWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ClientWithContext instead. type Client interface { Paths() (map[string]GroupVersion, error) } +type ClientWithContext interface { + PathsWithContext(ctx context.Context) (map[string]GroupVersionWithContext, error) +} + +func ToClientWithContext(c Client) ClientWithContext { + if c == nil { + return nil + } + if c, ok := c.(ClientWithContext); ok { + return c + } + return &clientWrapper{ + delegate: c, + } +} + +type clientWrapper struct { + delegate Client +} + +func (c *clientWrapper) PathsWithContext(ctx context.Context) (map[string]GroupVersionWithContext, error) { + resultWithoutContext, err := c.delegate.Paths() + result := make(map[string]GroupVersionWithContext, len(resultWithoutContext)) + for key, entry := range resultWithoutContext { + result[key] = ToGroupVersionWithContext(entry) + } + return result, err +} + type client struct { // URL includes the `hash` query param to take advantage of cache busting restClient rest.Interface } +// NewClientWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use NewClientWithContext instead. func NewClient(restClient rest.Interface) Client { + return newClient(restClient) +} + +func NewClientWithContext(restClient rest.Interface) ClientWithContext { + return newClient(restClient) +} + +func newClient(restClient rest.Interface) *client { return &client{ restClient: restClient, } } +// PathsWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use PathsWithContext instead. func (c *client) Paths() (map[string]GroupVersion, error) { + resultWithContext, err := c.PathsWithContext(context.Background()) + result := make(map[string]GroupVersion, len(resultWithContext)) + for key, entry := range resultWithContext { + // We know that this is a *groupversion which implements GroupVersion. + result[key] = entry.(GroupVersion) + } + return result, err +} + +func (c *client) PathsWithContext(ctx context.Context) (map[string]GroupVersionWithContext, error) { data, err := c.restClient.Get(). AbsPath("/openapi/v3"). - Do(context.TODO()). + Do(ctx). Raw() if err != nil { @@ -59,7 +115,7 @@ func (c *client) Paths() (map[string]GroupVersion, error) { // Calculate the client-side prefix for a "root" request rootPrefix := strings.TrimSuffix(c.restClient.Get().AbsPath("/").URL().Path, "/") // Create GroupVersions for each element of the result - result := map[string]GroupVersion{} + result := make(map[string]GroupVersionWithContext, len(discoMap.Paths)) for k, v := range discoMap.Paths { // Trim off the prefix that will always be added in client-side v.ServerRelativeURL = strings.TrimPrefix(v.ServerRelativeURL, rootPrefix) diff --git a/vendor/k8s.io/client-go/openapi/groupversion.go b/vendor/k8s.io/client-go/openapi/groupversion.go index 40d91b9a53..0e0b593990 100644 --- a/vendor/k8s.io/client-go/openapi/groupversion.go +++ b/vendor/k8s.io/client-go/openapi/groupversion.go @@ -25,6 +25,9 @@ import ( const ContentTypeOpenAPIV3PB = "application/com.github.proto-openapi.spec.v3@v1.0+protobuf" +// GroupVersionWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use GroupVersionWithContext instead. type GroupVersion interface { Schema(contentType string) ([]byte, error) @@ -35,22 +38,61 @@ type GroupVersion interface { ServerRelativeURL() string } +type GroupVersionWithContext interface { + SchemaWithContext(ctx context.Context, contentType string) ([]byte, error) + + // ServerRelativeURL. Returns the path and parameters used to fetch the schema. + // You should use the Schema method to fetch it, but this value can be used + // to key the current version of the schema in a cache since it contains a + // hash string which changes upon schema update. + ServerRelativeURL() string +} + +func ToGroupVersionWithContext(gv GroupVersion) GroupVersionWithContext { + if gv == nil { + return nil + } + if gv, ok := gv.(GroupVersionWithContext); ok { + return gv + } + return &groupVersionWrapper{ + GroupVersion: gv, + } +} + +type groupVersionWrapper struct { + GroupVersion +} + +func (gv *groupVersionWrapper) SchemaWithContext(ctx context.Context, contentType string) ([]byte, error) { + return gv.Schema(contentType) +} + type groupversion struct { client *client item handler3.OpenAPIV3DiscoveryGroupVersion useClientPrefix bool } +var ( + _ GroupVersion = &groupversion{} + _ GroupVersionWithContext = &groupversion{} +) + func newGroupVersion(client *client, item handler3.OpenAPIV3DiscoveryGroupVersion, useClientPrefix bool) *groupversion { return &groupversion{client: client, item: item, useClientPrefix: useClientPrefix} } func (g *groupversion) Schema(contentType string) ([]byte, error) { + return g.SchemaWithContext(context.Background(), contentType) +} + +func (g *groupversion) SchemaWithContext(ctx context.Context, contentType string) ([]byte, error) { if !g.useClientPrefix { return g.client.restClient.Get(). RequestURI(g.item.ServerRelativeURL). SetHeader("Accept", contentType). - Do(context.TODO()). + Do(ctx). Raw() } @@ -72,7 +114,7 @@ func (g *groupversion) Schema(contentType string) ([]byte, error) { } } - return path.Do(context.TODO()).Raw() + return path.Do(ctx).Raw() } // URL used for fetching the schema. The URL includes a hash and can be used diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/types.go b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/types.go index b9082e8145..6e0c84aeab 100644 --- a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/types.go +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/types.go @@ -26,7 +26,7 @@ import ( // ExecCredential is used by exec-based plugins to communicate credentials to // HTTP transports. type ExecCredential struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Spec holds information passed to the plugin by the transport. Spec ExecCredentialSpec `json:"spec,omitempty"` diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/zz_generated.conversion.go b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/zz_generated.conversion.go index 9c3f63fca8..bec865c481 100644 --- a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/zz_generated.conversion.go +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1/zz_generated.conversion.go @@ -24,7 +24,6 @@ package v1 import ( unsafe "unsafe" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" clientauthentication "k8s.io/client-go/pkg/apis/clientauthentication" @@ -181,10 +180,7 @@ func Convert_clientauthentication_ExecCredentialSpec_To_v1_ExecCredentialSpec(in } func autoConvert_v1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus(in *ExecCredentialStatus, out *clientauthentication.ExecCredentialStatus, s conversion.Scope) error { - out.ExpirationTimestamp = (*metav1.Time)(unsafe.Pointer(in.ExpirationTimestamp)) - out.Token = in.Token - out.ClientCertificateData = in.ClientCertificateData - out.ClientKeyData = in.ClientKeyData + *out = *(*clientauthentication.ExecCredentialStatus)(unsafe.Pointer(in)) return nil } @@ -194,10 +190,7 @@ func Convert_v1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatu } func autoConvert_clientauthentication_ExecCredentialStatus_To_v1_ExecCredentialStatus(in *clientauthentication.ExecCredentialStatus, out *ExecCredentialStatus, s conversion.Scope) error { - out.ExpirationTimestamp = (*metav1.Time)(unsafe.Pointer(in.ExpirationTimestamp)) - out.Token = in.Token - out.ClientCertificateData = in.ClientCertificateData - out.ClientKeyData = in.ClientKeyData + *out = *(*ExecCredentialStatus)(unsafe.Pointer(in)) return nil } diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1/types.go b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1/types.go index 918eb11e14..d2f2b50791 100644 --- a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1/types.go +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1/types.go @@ -26,7 +26,7 @@ import ( // ExecCredential is used by exec-based plugins to communicate credentials to // HTTP transports. type ExecCredential struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:""` // Spec holds information passed to the plugin by the transport. Spec ExecCredentialSpec `json:"spec,omitempty"` diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1/zz_generated.conversion.go b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1/zz_generated.conversion.go index 5372da1513..4e7be35154 100644 --- a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1/zz_generated.conversion.go +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1/zz_generated.conversion.go @@ -24,7 +24,6 @@ package v1beta1 import ( unsafe "unsafe" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" clientauthentication "k8s.io/client-go/pkg/apis/clientauthentication" @@ -181,10 +180,7 @@ func Convert_clientauthentication_ExecCredentialSpec_To_v1beta1_ExecCredentialSp } func autoConvert_v1beta1_ExecCredentialStatus_To_clientauthentication_ExecCredentialStatus(in *ExecCredentialStatus, out *clientauthentication.ExecCredentialStatus, s conversion.Scope) error { - out.ExpirationTimestamp = (*v1.Time)(unsafe.Pointer(in.ExpirationTimestamp)) - out.Token = in.Token - out.ClientCertificateData = in.ClientCertificateData - out.ClientKeyData = in.ClientKeyData + *out = *(*clientauthentication.ExecCredentialStatus)(unsafe.Pointer(in)) return nil } @@ -194,10 +190,7 @@ func Convert_v1beta1_ExecCredentialStatus_To_clientauthentication_ExecCredential } func autoConvert_clientauthentication_ExecCredentialStatus_To_v1beta1_ExecCredentialStatus(in *clientauthentication.ExecCredentialStatus, out *ExecCredentialStatus, s conversion.Scope) error { - out.ExpirationTimestamp = (*v1.Time)(unsafe.Pointer(in.ExpirationTimestamp)) - out.Token = in.Token - out.ClientCertificateData = in.ClientCertificateData - out.ClientKeyData = in.ClientKeyData + *out = *(*ExecCredentialStatus)(unsafe.Pointer(in)) return nil } diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go b/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go index b2393f4dd3..60f9da50d8 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go @@ -159,6 +159,7 @@ func (s *sometimes) Do(f func()) { // GetAuthenticator returns an exec-based plugin for providing client credentials. func GetAuthenticator(config *api.ExecConfig, cluster *clientauthentication.Cluster) (*Authenticator, error) { + metrics.EnsureRegistered() return newAuthenticator(globalCache, term.IsTerminal, config, cluster) } diff --git a/vendor/k8s.io/client-go/rest/OWNERS b/vendor/k8s.io/client-go/rest/OWNERS index 7b23294c45..c057852b75 100644 --- a/vendor/k8s.io/client-go/rest/OWNERS +++ b/vendor/k8s.io/client-go/rest/OWNERS @@ -3,7 +3,6 @@ reviewers: - thockin - smarterclayton - - caesarxuchao - wojtek-t - deads2k - liggitt diff --git a/vendor/k8s.io/client-go/rest/client.go b/vendor/k8s.io/client-go/rest/client.go index a085c334f9..d92c1b647e 100644 --- a/vendor/k8s.io/client-go/rest/client.go +++ b/vendor/k8s.io/client-go/rest/client.go @@ -32,6 +32,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" clientfeatures "k8s.io/client-go/features" + "k8s.io/client-go/tools/metrics" "k8s.io/client-go/util/flowcontrol" ) @@ -110,6 +111,8 @@ type RESTClient struct { // NewRESTClient creates a new RESTClient. This client performs generic REST functions // such as Get, Put, Post, and Delete on specified paths. func NewRESTClient(baseURL *url.URL, versionedAPIPath string, config ClientContentConfig, rateLimiter flowcontrol.RateLimiter, client *http.Client) (*RESTClient, error) { + metrics.EnsureRegistered() + base := *baseURL if !strings.HasSuffix(base.Path, "/") { base.Path += "/" diff --git a/vendor/k8s.io/client-go/rest/config.go b/vendor/k8s.io/client-go/rest/config.go index 82d4f7136a..3d4fb720c4 100644 --- a/vendor/k8s.io/client-go/rest/config.go +++ b/vendor/k8s.io/client-go/rest/config.go @@ -37,6 +37,7 @@ import ( "k8s.io/client-go/features" "k8s.io/client-go/pkg/version" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" + "k8s.io/client-go/tools/metrics" "k8s.io/client-go/transport" certutil "k8s.io/client-go/util/cert" "k8s.io/client-go/util/flowcontrol" @@ -355,6 +356,8 @@ func RESTClientFor(config *Config) (*RESTClient, error) { // Note that the http client takes precedence over the transport values configured. // The http client defaults to the `http.DefaultClient` if nil. func RESTClientForConfigAndClient(config *Config, httpClient *http.Client) (*RESTClient, error) { + metrics.EnsureRegistered() + if config.GroupVersion == nil { return nil, fmt.Errorf("GroupVersion is required when initializing a RESTClient") } diff --git a/vendor/k8s.io/client-go/rest/request.go b/vendor/k8s.io/client-go/rest/request.go index fb57216927..fe3c066729 100644 --- a/vendor/k8s.io/client-go/rest/request.go +++ b/vendor/k8s.io/client-go/rest/request.go @@ -20,6 +20,7 @@ import ( "bytes" "context" "encoding/hex" + stderrors "errors" "fmt" "io" "mime" @@ -671,7 +672,8 @@ func (r *Request) tryThrottleWithInfo(ctx context.Context, retryInfo string) err now := time.Now() err := r.rateLimiter.Wait(ctx) - if err != nil { + // Don't wrap context errors as caller initiated ctx cancellations is not a rate limiter error. + if err != nil && !stderrors.Is(err, context.Canceled) && !stderrors.Is(err, context.DeadlineExceeded) { err = fmt.Errorf("client rate limiter Wait returned an error: %w", err) } latency := time.Since(now) diff --git a/vendor/k8s.io/client-go/rest/transport.go b/vendor/k8s.io/client-go/rest/transport.go index 53f986cbf3..c958240401 100644 --- a/vendor/k8s.io/client-go/rest/transport.go +++ b/vendor/k8s.io/client-go/rest/transport.go @@ -23,6 +23,7 @@ import ( "k8s.io/client-go/pkg/apis/clientauthentication" "k8s.io/client-go/plugin/pkg/client/auth/exec" + "k8s.io/client-go/tools/metrics" "k8s.io/client-go/transport" ) @@ -82,6 +83,7 @@ func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTrip // TransportConfig converts a client config to an appropriate transport config. func (c *Config) TransportConfig() (*transport.Config, error) { + metrics.EnsureRegistered() conf := &transport.Config{ UserAgent: c.UserAgent, Transport: c.Transport, diff --git a/vendor/k8s.io/client-go/restmapper/category_expansion.go b/vendor/k8s.io/client-go/restmapper/category_expansion.go index 484e4c8393..265cc7c6a5 100644 --- a/vendor/k8s.io/client-go/restmapper/category_expansion.go +++ b/vendor/k8s.io/client-go/restmapper/category_expansion.go @@ -17,38 +17,97 @@ limitations under the License. package restmapper import ( + "context" + "iter" + "slices" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/discovery" ) // CategoryExpander maps category strings to GroupResources. // Categories are classification or 'tag' of a group of resources. +// +// CategoryExpanderWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use CategoryExpanderWithContext instead. type CategoryExpander interface { Expand(category string) ([]schema.GroupResource, bool) } -// SimpleCategoryExpander implements CategoryExpander interface +// CategoryExpanderWithContext maps category strings to GroupResources. +// Categories are classification or 'tag' of a group of resources. +type CategoryExpanderWithContext interface { + ExpandWithContext(ctx context.Context, category string) ([]schema.GroupResource, bool) +} + +func ToCategoryExpanderWithContext(c CategoryExpander) CategoryExpanderWithContext { + if c == nil { + return nil + } + if c, ok := c.(CategoryExpanderWithContext); ok { + return c + } + return &categoryExpanderWrapper{ + delegate: c, + } +} + +type categoryExpanderWrapper struct { + delegate CategoryExpander +} + +func (c *categoryExpanderWrapper) ExpandWithContext(ctx context.Context, category string) ([]schema.GroupResource, bool) { + return c.delegate.Expand(category) +} + +// SimpleCategoryExpander implements CategoryExpander and CategoryExpanderWithContext interface // using a static mapping of categories to GroupResource mapping. type SimpleCategoryExpander struct { Expansions map[string][]schema.GroupResource } +var ( + _ CategoryExpander = SimpleCategoryExpander{} + _ CategoryExpanderWithContext = SimpleCategoryExpander{} +) + // Expand fulfills CategoryExpander func (e SimpleCategoryExpander) Expand(category string) ([]schema.GroupResource, bool) { ret, ok := e.Expansions[category] return ret, ok } +// ExpandWithContext fulfills CategoryExpanderWithContext +func (e SimpleCategoryExpander) ExpandWithContext(ctx context.Context, category string) ([]schema.GroupResource, bool) { + return e.Expand(category) +} + // discoveryCategoryExpander struct lets a REST Client wrapper (discoveryClient) to retrieve list of APIResourceList, // and then convert to fallbackExpander type discoveryCategoryExpander struct { - discoveryClient discovery.DiscoveryInterface + discoveryClient discovery.DiscoveryInterfaceWithContext } // NewDiscoveryCategoryExpander returns a category expander that makes use of the "categories" fields from // the API, found through the discovery client. In case of any error or no category found (which likely // means we're at a cluster prior to categories support, fallback to the expander provided. +// +// NewDiscoveryCategoryExpanderWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use NewDiscoveryCategoryExpanderWithContext instead. func NewDiscoveryCategoryExpander(client discovery.DiscoveryInterface) CategoryExpander { + return newDiscoveryCategoryExpander(discovery.ToDiscoveryInterfaceWithContext(client)) +} + +// NewDiscoveryCategoryExpanderWithContext returns a category expander that makes use of the "categories" fields from +// the API, found through the discovery client. In case of any error or no category found (which likely +// means we're at a cluster prior to categories support, fallback to the expander provided. +func NewDiscoveryCategoryExpanderWithContext(client discovery.DiscoveryInterfaceWithContext) CategoryExpanderWithContext { + return newDiscoveryCategoryExpander(client) +} + +func newDiscoveryCategoryExpander(client discovery.DiscoveryInterfaceWithContext) discoveryCategoryExpander { if client == nil { panic("Please provide discovery client to shortcut expander") } @@ -56,9 +115,18 @@ func NewDiscoveryCategoryExpander(client discovery.DiscoveryInterface) CategoryE } // Expand fulfills CategoryExpander +// +// ExpandWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ExpandWithContext instead. func (e discoveryCategoryExpander) Expand(category string) ([]schema.GroupResource, bool) { + return e.ExpandWithContext(context.Background(), category) +} + +// ExpandWithContext fulfills CategoryExpanderWithContext +func (e discoveryCategoryExpander) ExpandWithContext(ctx context.Context, category string) ([]schema.GroupResource, bool) { // Get all supported resources for groups and versions from server, if no resource found, fallback anyway. - _, apiResourceLists, _ := e.discoveryClient.ServerGroupsAndResources() + _, apiResourceLists, _ := e.discoveryClient.ServerGroupsAndResourcesWithContext(ctx) if len(apiResourceLists) == 0 { return nil, false } @@ -89,16 +157,43 @@ func (e discoveryCategoryExpander) Expand(category string) ([]schema.GroupResour // UnionCategoryExpander implements CategoryExpander interface. // It maps given category string to union of expansions returned by all the CategoryExpanders in the list. +// +// UnionCategoryExpanderWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use UnionCategoryExpanderWithContext instead. type UnionCategoryExpander []CategoryExpander +var _ CategoryExpander = UnionCategoryExpander{} + // Expand fulfills CategoryExpander func (u UnionCategoryExpander) Expand(category string) ([]schema.GroupResource, bool) { + return unionExpand(context.Background(), func(yield func(i int, expander CategoryExpanderWithContext) bool) { + for i, expander := range u { + if !yield(i, ToCategoryExpanderWithContext(expander)) { + break + } + } + }, category) +} + +// UnionCategoryExpanderWithContext implements CategoryExpanderWithContext interface. +// It maps given category string to union of expansions returned by all the CategoryExpanders in the list. +type UnionCategoryExpanderWithContext []CategoryExpanderWithContext + +var _ CategoryExpanderWithContext = UnionCategoryExpanderWithContext{} + +// ExpandWithContext fulfills CategoryExpanderWithContext +func (u UnionCategoryExpanderWithContext) ExpandWithContext(ctx context.Context, category string) ([]schema.GroupResource, bool) { + return unionExpand(ctx, slices.All(u), category) +} + +func unionExpand(ctx context.Context, expanders iter.Seq2[int, CategoryExpanderWithContext], category string) ([]schema.GroupResource, bool) { ret := []schema.GroupResource{} ok := false // Expand the category for each CategoryExpander in the list and merge/combine the results. - for _, expansion := range u { - curr, currOk := expansion.Expand(category) + for _, expansion := range expanders { + curr, currOk := expansion.ExpandWithContext(ctx, category) for _, currGR := range curr { found := false diff --git a/vendor/k8s.io/client-go/restmapper/discovery.go b/vendor/k8s.io/client-go/restmapper/discovery.go index 3505178b66..9457cccd3f 100644 --- a/vendor/k8s.io/client-go/restmapper/discovery.go +++ b/vendor/k8s.io/client-go/restmapper/discovery.go @@ -17,6 +17,7 @@ limitations under the License. package restmapper import ( + "context" "fmt" "strings" "sync" @@ -40,8 +41,40 @@ type APIGroupResources struct { // NewDiscoveryRESTMapper returns a PriorityRESTMapper based on the discovered // groups and resources passed in. +// +// NewDiscoveryRESTMapperWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use NewDiscoveryRESTMapperWithContext instead. func NewDiscoveryRESTMapper(groupResources []*APIGroupResources) meta.RESTMapper { - unionMapper := meta.MultiRESTMapper{} + mappers, resourcePriority, kindPriority := newDiscoveryRESTMapper(groupResources) + multiMapper := make(meta.MultiRESTMapper, len(mappers)) + for i, m := range mappers { + multiMapper[i] = m + } + return &meta.PriorityRESTMapper{ + Delegate: multiMapper, + ResourcePriority: resourcePriority, + KindPriority: kindPriority, + } +} + +// NewDiscoveryRESTMapperWithContext returns a PriorityRESTMapper based on the discovered +// groups and resources passed in. +func NewDiscoveryRESTMapperWithContext(groupResources []*APIGroupResources) meta.RESTMapperWithContext { + mappers, resourcePriority, kindPriority := newDiscoveryRESTMapper(groupResources) + multiMapper := make(meta.MultiRESTMapperWithContext, len(mappers)) + for i, m := range mappers { + multiMapper[i] = m + } + return &meta.PriorityRESTMapperWithContext{ + Delegate: multiMapper, + ResourcePriority: resourcePriority, + KindPriority: kindPriority, + } +} + +func newDiscoveryRESTMapper(groupResources []*APIGroupResources) ([]*meta.DefaultRESTMapper, []schema.GroupVersionResource, []schema.GroupVersionKind) { + var unionMapper []*meta.DefaultRESTMapper var groupPriority []string // /v1 is special. It should always come first @@ -135,17 +168,23 @@ func NewDiscoveryRESTMapper(groupResources []*APIGroupResources) meta.RESTMapper }) } - return meta.PriorityRESTMapper{ - Delegate: unionMapper, - ResourcePriority: resourcePriority, - KindPriority: kindPriority, - } + return unionMapper, resourcePriority, kindPriority } // GetAPIGroupResources uses the provided discovery client to gather // discovery information and populate a slice of APIGroupResources. +// +// GetAPIGroupResourcesWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use GetAPIGroupResourcesWithContext instead. func GetAPIGroupResources(cl discovery.DiscoveryInterface) ([]*APIGroupResources, error) { - gs, rs, err := cl.ServerGroupsAndResources() + return GetAPIGroupResourcesWithContext(context.Background(), discovery.ToDiscoveryInterfaceWithContext(cl)) +} + +// GetAPIGroupResourcesWithContext uses the provided discovery client to gather +// discovery information and populate a slice of APIGroupResources. +func GetAPIGroupResourcesWithContext(ctx context.Context, cl discovery.DiscoveryInterfaceWithContext) ([]*APIGroupResources, error) { + gs, rs, err := cl.ServerGroupsAndResourcesWithContext(ctx) if rs == nil || gs == nil { return nil, err // TODO track the errors and update callers to handle partial errors. @@ -173,25 +212,45 @@ func GetAPIGroupResources(cl discovery.DiscoveryInterface) ([]*APIGroupResources return result, nil } -// DeferredDiscoveryRESTMapper is a RESTMapper that will defer +// DeferredDiscoveryRESTMapper is a RESTMapper and RESTMapperContext that will defer // initialization of the RESTMapper until the first mapping is // requested. type DeferredDiscoveryRESTMapper struct { initMu sync.Mutex - delegate meta.RESTMapper - cl discovery.CachedDiscoveryInterface + delegate meta.RESTMapperWithContext + cl discovery.CachedDiscoveryInterfaceWithContext } +var ( + //nolint:staticcheck // Intentionally using the old interface here. + _ meta.ResettableRESTMapper = &DeferredDiscoveryRESTMapper{} + _ meta.ResettableRESTMapperWithContext = &DeferredDiscoveryRESTMapper{} + _ fmt.Stringer = &DeferredDiscoveryRESTMapper{} +) + // NewDeferredDiscoveryRESTMapper returns a // DeferredDiscoveryRESTMapper that will lazily query the provided // client for discovery information to do REST mappings. +// +// NewDeferredDiscoveryRESTMapperWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use NewDeferredDiscoveryRESTMapperWithContext instead. NewDeferredDiscoveryRESTMapper will try to convert cl to discovery.CachedDiscoveryInterfaceWithContext and use a wrapper if that is not possible, but NewDeferredDiscoveryRESTMapperWithContext ensures that no such conversion is necessary. func NewDeferredDiscoveryRESTMapper(cl discovery.CachedDiscoveryInterface) *DeferredDiscoveryRESTMapper { + return &DeferredDiscoveryRESTMapper{ + cl: discovery.ToCachedDiscoveryInterfaceWithContext(cl), + } +} + +// NewDeferredDiscoveryRESTMapperWithContext returns a +// DeferredDiscoveryRESTMapper that will lazily query the provided +// client for discovery information to do REST mappings. +func NewDeferredDiscoveryRESTMapperWithContext(cl discovery.CachedDiscoveryInterfaceWithContext) *DeferredDiscoveryRESTMapper { return &DeferredDiscoveryRESTMapper{ cl: cl, } } -func (d *DeferredDiscoveryRESTMapper) getDelegate() (meta.RESTMapper, error) { +func (d *DeferredDiscoveryRESTMapper) getDelegate(ctx context.Context) (meta.RESTMapperWithContext, error) { d.initMu.Lock() defer d.initMu.Unlock() @@ -199,98 +258,154 @@ func (d *DeferredDiscoveryRESTMapper) getDelegate() (meta.RESTMapper, error) { return d.delegate, nil } - groupResources, err := GetAPIGroupResources(d.cl) + groupResources, err := GetAPIGroupResourcesWithContext(ctx, d.cl) if err != nil { return nil, err } - d.delegate = NewDiscoveryRESTMapper(groupResources) + d.delegate = NewDiscoveryRESTMapperWithContext(groupResources) return d.delegate, nil } // Reset resets the internally cached Discovery information and will // cause the next mapping request to re-discover. func (d *DeferredDiscoveryRESTMapper) Reset() { - klog.V(5).Info("Invalidating discovery information") + d.ResetWithContext(context.Background()) +} + +// ResetWithContext resets the internally cached Discovery information and will +// cause the next mapping request to re-discover. +func (d *DeferredDiscoveryRESTMapper) ResetWithContext(ctx context.Context) { + klog.FromContext(ctx).V(5).Info("Invalidating discovery information") d.initMu.Lock() defer d.initMu.Unlock() - d.cl.Invalidate() + d.cl.InvalidateWithContext(ctx) d.delegate = nil } // KindFor takes a partial resource and returns back the single match. // It returns an error if there are multiple matches. +// +// KindForWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use KindForWithContext instead. func (d *DeferredDiscoveryRESTMapper) KindFor(resource schema.GroupVersionResource) (gvk schema.GroupVersionKind, err error) { - del, err := d.getDelegate() + return d.KindForWithContext(context.Background(), resource) +} + +// KindForWithContext takes a partial resource and returns back the single match. +// It returns an error if there are multiple matches. +func (d *DeferredDiscoveryRESTMapper) KindForWithContext(ctx context.Context, resource schema.GroupVersionResource) (gvk schema.GroupVersionKind, err error) { + del, err := d.getDelegate(ctx) if err != nil { return schema.GroupVersionKind{}, err } - gvk, err = del.KindFor(resource) - if err != nil && !d.cl.Fresh() { - d.Reset() - gvk, err = d.KindFor(resource) + gvk, err = del.KindForWithContext(ctx, resource) + if err != nil && !d.cl.FreshWithContext(ctx) { + d.ResetWithContext(ctx) + gvk, err = d.KindForWithContext(ctx, resource) } return } // KindsFor takes a partial resource and returns back the list of // potential kinds in priority order. +// +// KindsForWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use KindsForWithContext instead. func (d *DeferredDiscoveryRESTMapper) KindsFor(resource schema.GroupVersionResource) (gvks []schema.GroupVersionKind, err error) { - del, err := d.getDelegate() + return d.KindsForWithContext(context.Background(), resource) +} + +// KindsForWithContext takes a partial resource and returns back the list of +// potential kinds in priority order. +func (d *DeferredDiscoveryRESTMapper) KindsForWithContext(ctx context.Context, resource schema.GroupVersionResource) (gvks []schema.GroupVersionKind, err error) { + del, err := d.getDelegate(ctx) if err != nil { return nil, err } - gvks, err = del.KindsFor(resource) - if len(gvks) == 0 && !d.cl.Fresh() { - d.Reset() - gvks, err = d.KindsFor(resource) + gvks, err = del.KindsForWithContext(ctx, resource) + if len(gvks) == 0 && !d.cl.FreshWithContext(ctx) { + d.ResetWithContext(ctx) + gvks, err = d.KindsForWithContext(ctx, resource) } return } // ResourceFor takes a partial resource and returns back the single // match. It returns an error if there are multiple matches. +// +// ResourceForWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ResourceForWithContext instead. func (d *DeferredDiscoveryRESTMapper) ResourceFor(input schema.GroupVersionResource) (gvr schema.GroupVersionResource, err error) { - del, err := d.getDelegate() + return d.ResourceForWithContext(context.Background(), input) +} + +// ResourceForWithContext takes a partial resource and returns back the single +// match. It returns an error if there are multiple matches. +func (d *DeferredDiscoveryRESTMapper) ResourceForWithContext(ctx context.Context, input schema.GroupVersionResource) (gvr schema.GroupVersionResource, err error) { + del, err := d.getDelegate(ctx) if err != nil { return schema.GroupVersionResource{}, err } - gvr, err = del.ResourceFor(input) - if err != nil && !d.cl.Fresh() { - d.Reset() - gvr, err = d.ResourceFor(input) + gvr, err = del.ResourceForWithContext(ctx, input) + if err != nil && !d.cl.FreshWithContext(ctx) { + d.ResetWithContext(ctx) + gvr, err = d.ResourceForWithContext(ctx, input) } return } // ResourcesFor takes a partial resource and returns back the list of // potential resource in priority order. +// +// ResourcesForWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ResourcesForWithContext instead. func (d *DeferredDiscoveryRESTMapper) ResourcesFor(input schema.GroupVersionResource) (gvrs []schema.GroupVersionResource, err error) { - del, err := d.getDelegate() + return d.ResourcesForWithContext(context.Background(), input) +} + +// ResourcesForWithContext takes a partial resource and returns back the list of +// potential resource in priority order. +func (d *DeferredDiscoveryRESTMapper) ResourcesForWithContext(ctx context.Context, input schema.GroupVersionResource) (gvrs []schema.GroupVersionResource, err error) { + del, err := d.getDelegate(ctx) if err != nil { return nil, err } - gvrs, err = del.ResourcesFor(input) - if len(gvrs) == 0 && !d.cl.Fresh() { - d.Reset() - gvrs, err = d.ResourcesFor(input) + gvrs, err = del.ResourcesForWithContext(ctx, input) + if len(gvrs) == 0 && !d.cl.FreshWithContext(ctx) { + d.ResetWithContext(ctx) + gvrs, err = d.ResourcesForWithContext(ctx, input) } return } // RESTMapping identifies a preferred resource mapping for the // provided group kind. +// +// RESTMappingWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use RESTMappingWithContext instead. func (d *DeferredDiscoveryRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (m *meta.RESTMapping, err error) { - del, err := d.getDelegate() + return d.RESTMappingWithContext(context.Background(), gk, versions...) +} + +// RESTMappingWithContext identifies a preferred resource mapping for the +// provided group kind. +func (d *DeferredDiscoveryRESTMapper) RESTMappingWithContext(ctx context.Context, gk schema.GroupKind, versions ...string) (m *meta.RESTMapping, err error) { + del, err := d.getDelegate(ctx) if err != nil { return nil, err } - m, err = del.RESTMapping(gk, versions...) - if err != nil && !d.cl.Fresh() { - d.Reset() - m, err = d.RESTMapping(gk, versions...) + m, err = del.RESTMappingWithContext(ctx, gk, versions...) + if err != nil && !d.cl.FreshWithContext(ctx) { + d.ResetWithContext(ctx) + m, err = d.RESTMappingWithContext(ctx, gk, versions...) } return } @@ -298,41 +413,59 @@ func (d *DeferredDiscoveryRESTMapper) RESTMapping(gk schema.GroupKind, versions // RESTMappings returns the RESTMappings for the provided group kind // in a rough internal preferred order. If no kind is found, it will // return a NoResourceMatchError. +// +// RESTMappingsWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use RESTMappingsWithContext instead. func (d *DeferredDiscoveryRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) (ms []*meta.RESTMapping, err error) { - del, err := d.getDelegate() + return d.RESTMappingsWithContext(context.Background(), gk, versions...) +} + +// RESTMappingsWithContext returns the RESTMappings for the provided group kind +// in a rough internal preferred order. If no kind is found, it will +// return a NoResourceMatchError. +func (d *DeferredDiscoveryRESTMapper) RESTMappingsWithContext(ctx context.Context, gk schema.GroupKind, versions ...string) (ms []*meta.RESTMapping, err error) { + del, err := d.getDelegate(ctx) if err != nil { return nil, err } - ms, err = del.RESTMappings(gk, versions...) - if len(ms) == 0 && !d.cl.Fresh() { - d.Reset() - ms, err = d.RESTMappings(gk, versions...) + ms, err = del.RESTMappingsWithContext(ctx, gk, versions...) + if len(ms) == 0 && !d.cl.FreshWithContext(ctx) { + d.ResetWithContext(ctx) + ms, err = d.RESTMappingsWithContext(ctx, gk, versions...) } return } // ResourceSingularizer converts a resource name from plural to // singular (e.g., from pods to pod). +// +// ResourceSingularizerWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ResourceSingularizerWithContext instead. func (d *DeferredDiscoveryRESTMapper) ResourceSingularizer(resource string) (singular string, err error) { - del, err := d.getDelegate() + return d.ResourceSingularizerWithContext(context.Background(), resource) +} + +// ResourceSingularizerWithContext converts a resource name from plural to +// singular (e.g., from pods to pod). +func (d *DeferredDiscoveryRESTMapper) ResourceSingularizerWithContext(ctx context.Context, resource string) (singular string, err error) { + del, err := d.getDelegate(ctx) if err != nil { return resource, err } - singular, err = del.ResourceSingularizer(resource) - if err != nil && !d.cl.Fresh() { - d.Reset() - singular, err = d.ResourceSingularizer(resource) + singular, err = del.ResourceSingularizerWithContext(ctx, resource) + if err != nil && !d.cl.FreshWithContext(ctx) { + d.ResetWithContext(ctx) + singular, err = d.ResourceSingularizerWithContext(ctx, resource) } return } func (d *DeferredDiscoveryRESTMapper) String() string { - del, err := d.getDelegate() + del, err := d.getDelegate(context.Background() /* hopefully we already have a delegate and don't need the context */) if err != nil { return fmt.Sprintf("DeferredDiscoveryRESTMapper{%v}", err) } return fmt.Sprintf("DeferredDiscoveryRESTMapper{\n\t%v\n}", del) } - -// Make sure it satisfies the interface -var _ meta.ResettableRESTMapper = &DeferredDiscoveryRESTMapper{} diff --git a/vendor/k8s.io/client-go/restmapper/shortcut.go b/vendor/k8s.io/client-go/restmapper/shortcut.go index 0afc8689d7..4dbeea07d8 100644 --- a/vendor/k8s.io/client-go/restmapper/shortcut.go +++ b/vendor/k8s.io/client-go/restmapper/shortcut.go @@ -17,6 +17,7 @@ limitations under the License. package restmapper import ( + "context" "fmt" "strings" @@ -30,22 +31,41 @@ import ( // shortcutExpander is a RESTMapper that can be used for Kubernetes resources. It expands the resource first, then invokes the wrapped type shortcutExpander struct { - RESTMapper meta.RESTMapper + RESTMapper meta.RESTMapperWithContext - discoveryClient discovery.DiscoveryInterface + discoveryClient discovery.DiscoveryInterfaceWithContext warningHandler func(string) } var _ meta.ResettableRESTMapper = shortcutExpander{} +var _ meta.ResettableRESTMapperWithContext = shortcutExpander{} // NewShortcutExpander wraps a restmapper in a layer that expands shortcuts found via discovery +// +// NewShortcutExpanderWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use NewShortcutExpanderWithContext instead. func NewShortcutExpander(delegate meta.RESTMapper, client discovery.DiscoveryInterface, warningHandler func(string)) meta.RESTMapper { + return newShortcutExpander(meta.ToRESTMapperWithContext(delegate), discovery.ToDiscoveryInterfaceWithContext(client), warningHandler) +} + +// NewShortcutExpanderWithContext wraps a restmapper in a layer that expands shortcuts found via discovery +func NewShortcutExpanderWithContext(delegate meta.RESTMapperWithContext, client discovery.DiscoveryInterfaceWithContext, warningHandler func(string)) meta.RESTMapperWithContext { + return newShortcutExpander(delegate, client, warningHandler) +} + +func newShortcutExpander(delegate meta.RESTMapperWithContext, client discovery.DiscoveryInterfaceWithContext, warningHandler func(string)) shortcutExpander { return shortcutExpander{RESTMapper: delegate, discoveryClient: client, warningHandler: warningHandler} } // KindFor fulfills meta.RESTMapper func (e shortcutExpander) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) { + return e.KindForWithContext(context.Background(), resource) +} + +// KindForWithContext fulfills meta.RESTMapperWithContext +func (e shortcutExpander) KindForWithContext(ctx context.Context, resource schema.GroupVersionResource) (schema.GroupVersionKind, error) { // expandResourceShortcut works with current API resources as read from discovery cache. // In case of new CRDs this means we potentially don't have current state of discovery. // In the current wiring in k8s.io/cli-runtime/pkg/genericclioptions/config_flags.go#toRESTMapper, @@ -53,59 +73,113 @@ func (e shortcutExpander) KindFor(resource schema.GroupVersionResource) (schema. // cache and fetch all data from a cluster (see k8s.io/client-go/restmapper/discovery.go#KindFor). // Thus another call to expandResourceShortcut, after a NoMatchError should successfully // read Kind to the user or an error. - gvk, err := e.RESTMapper.KindFor(e.expandResourceShortcut(resource)) + gvk, err := e.RESTMapper.KindForWithContext(ctx, e.expandResourceShortcut(ctx, resource)) if meta.IsNoMatchError(err) { - return e.RESTMapper.KindFor(e.expandResourceShortcut(resource)) + return e.RESTMapper.KindForWithContext(ctx, e.expandResourceShortcut(ctx, resource)) } return gvk, err } // KindsFor fulfills meta.RESTMapper +// +// KindsForWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use KindsForWithContext instead. func (e shortcutExpander) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error) { - return e.RESTMapper.KindsFor(e.expandResourceShortcut(resource)) + return e.KindsForWithContext(context.Background(), resource) +} + +// KindsForWithContext fulfills meta.RESTMapperWithContext +func (e shortcutExpander) KindsForWithContext(ctx context.Context, resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error) { + return e.RESTMapper.KindsForWithContext(ctx, e.expandResourceShortcut(ctx, resource)) } // ResourcesFor fulfills meta.RESTMapper +// +// ResourcesForWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ResourcesForWithContext instead. func (e shortcutExpander) ResourcesFor(resource schema.GroupVersionResource) ([]schema.GroupVersionResource, error) { - return e.RESTMapper.ResourcesFor(e.expandResourceShortcut(resource)) + return e.ResourcesForWithContext(context.Background(), resource) +} + +// ResourcesForWithContext fulfills meta.RESTMapperWithContext +func (e shortcutExpander) ResourcesForWithContext(ctx context.Context, resource schema.GroupVersionResource) ([]schema.GroupVersionResource, error) { + return e.RESTMapper.ResourcesForWithContext(ctx, e.expandResourceShortcut(ctx, resource)) } // ResourceFor fulfills meta.RESTMapper +// +// ResourceForWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ResourceForWithContext instead. func (e shortcutExpander) ResourceFor(resource schema.GroupVersionResource) (schema.GroupVersionResource, error) { - return e.RESTMapper.ResourceFor(e.expandResourceShortcut(resource)) + return e.ResourceForWithContext(context.Background(), resource) +} + +// ResourceForWithContext fulfills meta.RESTMapperWithContext +func (e shortcutExpander) ResourceForWithContext(ctx context.Context, resource schema.GroupVersionResource) (schema.GroupVersionResource, error) { + return e.RESTMapper.ResourceForWithContext(ctx, e.expandResourceShortcut(ctx, resource)) } // ResourceSingularizer fulfills meta.RESTMapper +// +// ResourceSingularizerWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ResourceSingularizerWithContext instead. func (e shortcutExpander) ResourceSingularizer(resource string) (string, error) { - return e.RESTMapper.ResourceSingularizer(e.expandResourceShortcut(schema.GroupVersionResource{Resource: resource}).Resource) + return e.ResourceSingularizerWithContext(context.Background(), resource) +} + +// ResourceSingularizerWithContext fulfills meta.RESTMapperWithContext +func (e shortcutExpander) ResourceSingularizerWithContext(ctx context.Context, resource string) (string, error) { + return e.RESTMapper.ResourceSingularizerWithContext(ctx, e.expandResourceShortcut(ctx, schema.GroupVersionResource{Resource: resource}).Resource) } // RESTMapping fulfills meta.RESTMapper +// +// RESTMappingWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use RESTMappingWithContext instead. func (e shortcutExpander) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error) { - return e.RESTMapper.RESTMapping(gk, versions...) + return e.RESTMappingWithContext(context.Background(), gk, versions...) +} + +// RESTMappingWithContext fulfills meta.RESTMapperWithContext +func (e shortcutExpander) RESTMappingWithContext(ctx context.Context, gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error) { + return e.RESTMapper.RESTMappingWithContext(ctx, gk, versions...) } // RESTMappings fulfills meta.RESTMapper +// +// RESTMappingsWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use RESTMappingsWithContext instead. func (e shortcutExpander) RESTMappings(gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error) { - return e.RESTMapper.RESTMappings(gk, versions...) + return e.RESTMappingsWithContext(context.Background(), gk, versions...) +} + +// RESTMappingsWithContext fulfills meta.RESTMapperWithContext +func (e shortcutExpander) RESTMappingsWithContext(ctx context.Context, gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error) { + return e.RESTMapper.RESTMappingsWithContext(ctx, gk, versions...) } // getShortcutMappings returns a set of tuples which holds short names for resources. // First the list of potential resources will be taken from the API server. // Next we will append the hardcoded list of resources - to be backward compatible with old servers. // NOTE that the list is ordered by group priority. -func (e shortcutExpander) getShortcutMappings() ([]*metav1.APIResourceList, []resourceShortcuts, error) { +func (e shortcutExpander) getShortcutMappings(ctx context.Context) ([]*metav1.APIResourceList, []resourceShortcuts, error) { res := []resourceShortcuts{} // get server resources // This can return an error *and* the results it was able to find. We don't need to fail on the error. - _, apiResList, err := e.discoveryClient.ServerGroupsAndResources() + _, apiResList, err := e.discoveryClient.ServerGroupsAndResourcesWithContext(ctx) if err != nil { - klog.V(1).Infof("Error loading discovery information: %v", err) + klog.FromContext(ctx).V(1).Info("Error loading discovery information", "err", err) } for _, apiResources := range apiResList { gv, err := schema.ParseGroupVersion(apiResources.GroupVersion) if err != nil { - klog.V(1).Infof("Unable to parse groupversion = %s due to = %s", apiResources.GroupVersion, err.Error()) + klog.FromContext(ctx).V(1).Info("Unable to parse group/version", "groupVersion", apiResources.GroupVersion, "err", err.Error()) continue } for _, apiRes := range apiResources.APIResources { @@ -126,9 +200,9 @@ func (e shortcutExpander) getShortcutMappings() ([]*metav1.APIResourceList, []re // (something that a pkg/api/meta.RESTMapper can understand), if it is // indeed a shortcut. If no match has been found, we will match on group prefixing. // Lastly we will return resource unmodified. -func (e shortcutExpander) expandResourceShortcut(resource schema.GroupVersionResource) schema.GroupVersionResource { +func (e shortcutExpander) expandResourceShortcut(ctx context.Context, resource schema.GroupVersionResource) schema.GroupVersionResource { // get the shortcut mappings and return on first match. - if allResources, shortcutResources, err := e.getShortcutMappings(); err == nil { + if allResources, shortcutResources, err := e.getShortcutMappings(ctx); err == nil { // avoid expanding if there's an exact match to a full resource name for _, apiResources := range allResources { gv, err := schema.ParseGroupVersion(apiResources.GroupVersion) @@ -199,8 +273,15 @@ func (e shortcutExpander) expandResourceShortcut(resource schema.GroupVersionRes return resource } +// ResetWithContext is a better alternative because it supports contextual logging and cancellation. +// +// Contextual logging: Use ResetWithContext instead. func (e shortcutExpander) Reset() { - meta.MaybeResetRESTMapper(e.RESTMapper) + e.ResetWithContext(context.Background()) +} + +func (e shortcutExpander) ResetWithContext(ctx context.Context) { + meta.MaybeResetRESTMapperWithContext(ctx, e.RESTMapper) } // ResourceShortcuts represents a structure that holds the information how to diff --git a/vendor/k8s.io/client-go/scale/scheme/appsv1beta1/zz_generated.conversion.go b/vendor/k8s.io/client-go/scale/scheme/appsv1beta1/zz_generated.conversion.go index d56861ead5..115fe7d7d5 100644 --- a/vendor/k8s.io/client-go/scale/scheme/appsv1beta1/zz_generated.conversion.go +++ b/vendor/k8s.io/client-go/scale/scheme/appsv1beta1/zz_generated.conversion.go @@ -22,6 +22,8 @@ limitations under the License. package appsv1beta1 import ( + unsafe "unsafe" + v1beta1 "k8s.io/api/apps/v1beta1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" @@ -101,7 +103,7 @@ func Convert_scheme_Scale_To_v1beta1_Scale(in *scheme.Scale, out *v1beta1.Scale, } func autoConvert_v1beta1_ScaleSpec_To_scheme_ScaleSpec(in *v1beta1.ScaleSpec, out *scheme.ScaleSpec, s conversion.Scope) error { - out.Replicas = in.Replicas + *out = *(*scheme.ScaleSpec)(unsafe.Pointer(in)) return nil } @@ -111,7 +113,7 @@ func Convert_v1beta1_ScaleSpec_To_scheme_ScaleSpec(in *v1beta1.ScaleSpec, out *s } func autoConvert_scheme_ScaleSpec_To_v1beta1_ScaleSpec(in *scheme.ScaleSpec, out *v1beta1.ScaleSpec, s conversion.Scope) error { - out.Replicas = in.Replicas + *out = *(*v1beta1.ScaleSpec)(unsafe.Pointer(in)) return nil } diff --git a/vendor/k8s.io/client-go/scale/scheme/appsv1beta2/zz_generated.conversion.go b/vendor/k8s.io/client-go/scale/scheme/appsv1beta2/zz_generated.conversion.go index 09c17420e0..f4190dfa53 100644 --- a/vendor/k8s.io/client-go/scale/scheme/appsv1beta2/zz_generated.conversion.go +++ b/vendor/k8s.io/client-go/scale/scheme/appsv1beta2/zz_generated.conversion.go @@ -22,6 +22,8 @@ limitations under the License. package appsv1beta2 import ( + unsafe "unsafe" + v1beta2 "k8s.io/api/apps/v1beta2" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" @@ -101,7 +103,7 @@ func Convert_scheme_Scale_To_v1beta2_Scale(in *scheme.Scale, out *v1beta2.Scale, } func autoConvert_v1beta2_ScaleSpec_To_scheme_ScaleSpec(in *v1beta2.ScaleSpec, out *scheme.ScaleSpec, s conversion.Scope) error { - out.Replicas = in.Replicas + *out = *(*scheme.ScaleSpec)(unsafe.Pointer(in)) return nil } @@ -111,7 +113,7 @@ func Convert_v1beta2_ScaleSpec_To_scheme_ScaleSpec(in *v1beta2.ScaleSpec, out *s } func autoConvert_scheme_ScaleSpec_To_v1beta2_ScaleSpec(in *scheme.ScaleSpec, out *v1beta2.ScaleSpec, s conversion.Scope) error { - out.Replicas = in.Replicas + *out = *(*v1beta2.ScaleSpec)(unsafe.Pointer(in)) return nil } diff --git a/vendor/k8s.io/client-go/scale/scheme/autoscalingv1/zz_generated.conversion.go b/vendor/k8s.io/client-go/scale/scheme/autoscalingv1/zz_generated.conversion.go index 09e73584eb..d60f80b941 100644 --- a/vendor/k8s.io/client-go/scale/scheme/autoscalingv1/zz_generated.conversion.go +++ b/vendor/k8s.io/client-go/scale/scheme/autoscalingv1/zz_generated.conversion.go @@ -22,6 +22,8 @@ limitations under the License. package autoscalingv1 import ( + unsafe "unsafe" + v1 "k8s.io/api/autoscaling/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" @@ -101,7 +103,7 @@ func Convert_scheme_Scale_To_v1_Scale(in *scheme.Scale, out *v1.Scale, s convers } func autoConvert_v1_ScaleSpec_To_scheme_ScaleSpec(in *v1.ScaleSpec, out *scheme.ScaleSpec, s conversion.Scope) error { - out.Replicas = in.Replicas + *out = *(*scheme.ScaleSpec)(unsafe.Pointer(in)) return nil } @@ -111,7 +113,7 @@ func Convert_v1_ScaleSpec_To_scheme_ScaleSpec(in *v1.ScaleSpec, out *scheme.Scal } func autoConvert_scheme_ScaleSpec_To_v1_ScaleSpec(in *scheme.ScaleSpec, out *v1.ScaleSpec, s conversion.Scope) error { - out.Replicas = in.Replicas + *out = *(*v1.ScaleSpec)(unsafe.Pointer(in)) return nil } diff --git a/vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/zz_generated.conversion.go b/vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/zz_generated.conversion.go index 46b29f171f..74954f1dd9 100644 --- a/vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/zz_generated.conversion.go +++ b/vendor/k8s.io/client-go/scale/scheme/extensionsv1beta1/zz_generated.conversion.go @@ -22,6 +22,8 @@ limitations under the License. package extensionsv1beta1 import ( + unsafe "unsafe" + v1beta1 "k8s.io/api/extensions/v1beta1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" @@ -101,7 +103,7 @@ func Convert_scheme_Scale_To_v1beta1_Scale(in *scheme.Scale, out *v1beta1.Scale, } func autoConvert_v1beta1_ScaleSpec_To_scheme_ScaleSpec(in *v1beta1.ScaleSpec, out *scheme.ScaleSpec, s conversion.Scope) error { - out.Replicas = in.Replicas + *out = *(*scheme.ScaleSpec)(unsafe.Pointer(in)) return nil } @@ -111,7 +113,7 @@ func Convert_v1beta1_ScaleSpec_To_scheme_ScaleSpec(in *v1beta1.ScaleSpec, out *s } func autoConvert_scheme_ScaleSpec_To_v1beta1_ScaleSpec(in *scheme.ScaleSpec, out *v1beta1.ScaleSpec, s conversion.Scope) error { - out.Replicas = in.Replicas + *out = *(*v1beta1.ScaleSpec)(unsafe.Pointer(in)) return nil } diff --git a/vendor/k8s.io/client-go/tools/cache/OWNERS b/vendor/k8s.io/client-go/tools/cache/OWNERS index 77d7e4d28a..f62d5e3c51 100644 --- a/vendor/k8s.io/client-go/tools/cache/OWNERS +++ b/vendor/k8s.io/client-go/tools/cache/OWNERS @@ -5,7 +5,6 @@ approvers: - smarterclayton - wojtek-t - deads2k - - caesarxuchao - liggitt reviewers: - thockin @@ -13,8 +12,6 @@ reviewers: - wojtek-t - deads2k - derekwaynecarr - - caesarxuchao - - mikedanese - liggitt - janetkuo - justinsb @@ -24,5 +21,6 @@ reviewers: - ingvagabund - michaelasp emeritus_approvers: + - caesarxuchao - lavalamp - ncdc diff --git a/vendor/k8s.io/client-go/tools/cache/controller.go b/vendor/k8s.io/client-go/tools/cache/controller.go index b78ed522e2..adb1fb9308 100644 --- a/vendor/k8s.io/client-go/tools/cache/controller.go +++ b/vendor/k8s.io/client-go/tools/cache/controller.go @@ -20,9 +20,11 @@ import ( "context" "errors" "fmt" + "strings" "sync" "time" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" @@ -282,6 +284,126 @@ type ResourceEventHandler interface { OnDelete(obj interface{}) } +// Object is the subset of metav1.Object that is needed to determine the +// name and, if applicable, namespace of an object. All standard Kubernetes +// API types satisfy this interface through their embedded ObjectMeta. +// +// comparable is required so that a zero T can be compared against +// OptionalObj to detect a missing object (e.g. a nil pointer). +type Object interface { + comparable + + GetName() string + GetNamespace() string +} + +// TypedResourceEventHandler is a type-safe variant of ResourceEventHandler. +type TypedResourceEventHandler[T Object] interface { + OnAdd(obj T, isInInitialList bool) + OnUpdate(oldObj, newObj T) + OnDelete(obj DeletedObject[T]) +} + +// DeletedObject provides information about a deleted object. +// +// It implements GetObjectName and GetKey, which replace +// [DeletionHandlingObjectToName] and [DeletionHandlingMetaNamespaceKeyFunc] +// +// It implements the GetName and GetNamespace methods for use +// with klog.KObj: an OnDelete event handler can log +// it's parameter directly and is guaranteed to produce the same +// log output as with klog.KObj applied to the actual object. +// +// All of these methods work regardless whether DeletedObject actually has +// the deleted object. +type DeletedObject[T Object] struct { + // OptionalObj is the deleted object. + // + // It can be: + // - stale: it is some *older* revision, not the one which got deleted + // - nil: the informer noticed a deletion without finding *any* copy of the deleted object + // + // The only guaranteed information is the key under which the deleted + // object was stored in the informer cache. Use [DeletedObject.GetObjectName] + // and [DeletedObject.GetKey] to extract the namespace and name resp. + // the key under which the deleted object was stored. They work in + // all cases. + OptionalObj T + + // FinalStateUnknown is nil if the deleted object is available and up-to-date. + // Otherwise FinalStateUnknown is non-nil to provide the key. + // The untyped object inside it matches OptionalObj. + FinalStateUnknown *DeletedFinalStateUnknown +} + +// GetObjectName returns the object name (= namespace if available and name) +// for the deleted object. Note that this is slightly different from +// GetName which returns just that name without the namespace. +// +// This is a type-safe variant of [DeletionHandlingObjectToName] which +// cannot fail because T is guaranteed to have a name and namespace and +// the key of FinalStateUnknown, if invalid, is simply treated as a +// name without a namespace. +func (d DeletedObject[T]) GetObjectName() ObjectName { + if d.FinalStateUnknown != nil { + // Same splitting as SplitMetaNamespaceKey and ParseObjectName, + // except that a key with more than one "/" is not treated as an error: + // the extra "/" become part of the name. + namespace, name, found := strings.Cut(d.FinalStateUnknown.Key, "/") + if !found { + return ObjectName{Name: namespace} + } + return ObjectName{Namespace: namespace, Name: name} + } + var null T + if d.OptionalObj == null { + // Avoid calling GetName/GetNamespace on a zero OptionalObj (e.g. a + // nil pointer), which could panic. A nil pointer boxed behind a + // further layer of indirection is not detected here and is not + // handled. + return ObjectName{} + } + // Same logic as MetaObjectToName, adapted to use T's own + // GetNamespace and GetName methods instead of going through + // meta.Accessor as ObjectToName does. + if namespace := d.OptionalObj.GetNamespace(); len(namespace) > 0 { + return ObjectName{Namespace: namespace, Name: d.OptionalObj.GetName()} + } + return ObjectName{Name: d.OptionalObj.GetName()} +} + +// GetName returns the name without the namespace. Note that this is slightly +// different from GetObjectName which returns the combination of namespace and name in a +// struct. +func (d DeletedObject[T]) GetName() string { + return d.GetObjectName().Name +} + +// GetNamespace returns the namespace if there is one, otherwise the empty string. +func (d DeletedObject[T]) GetNamespace() string { + return d.GetObjectName().Namespace +} + +// GetKey returns the key under which the deleted object was stored. +// +// This is a type-safe variant of [DeletionHandlingMetaNamespaceKeyFunc] +// which cannot fail because T is guaranteed to have a name and namespace. +func (d DeletedObject[T]) GetKey() string { + if d.FinalStateUnknown != nil { + return d.FinalStateUnknown.Key + } + var null T + if d.OptionalObj == null { + return "" + } + // Same encoding as MetaNamespaceKeyFunc via ObjectName.String, + // adapted to use T's own GetNamespace and GetName methods. + if namespace := d.OptionalObj.GetNamespace(); len(namespace) > 0 { + return namespace + "/" + d.OptionalObj.GetName() + } + return d.OptionalObj.GetName() +} + // ResourceEventHandlerFuncs is an adaptor to let you easily specify as many or // as few of the notification functions as you want while still implementing // ResourceEventHandler. This adapter does not remove the prohibition against @@ -316,6 +438,32 @@ func (r ResourceEventHandlerFuncs) OnDelete(obj interface{}) { } } +type TypedResourceEventHandlerFuncs[T Object] struct { + AddFunc func(obj T) + UpdateFunc func(oldObj, newObj T) + DeleteFunc func(obj DeletedObject[T]) +} + +var _ TypedResourceEventHandler[*metav1.ObjectMeta] = TypedResourceEventHandlerFuncs[*metav1.ObjectMeta]{} + +func (r TypedResourceEventHandlerFuncs[T]) OnAdd(obj T, isInInitialList bool) { + if r.AddFunc != nil { + r.AddFunc(obj) + } +} + +func (r TypedResourceEventHandlerFuncs[T]) OnUpdate(oldObj, newObj T) { + if r.UpdateFunc != nil { + r.UpdateFunc(oldObj, newObj) + } +} + +func (r TypedResourceEventHandlerFuncs[T]) OnDelete(obj DeletedObject[T]) { + if r.DeleteFunc != nil { + r.DeleteFunc(obj) + } +} + // ResourceEventHandlerDetailedFuncs is exactly like ResourceEventHandlerFuncs // except its AddFunc accepts the isInInitialList parameter, for propagating // HasSynced. @@ -346,6 +494,32 @@ func (r ResourceEventHandlerDetailedFuncs) OnDelete(obj interface{}) { } } +type TypedResourceEventHandlerDetailedFuncs[T Object] struct { + AddFunc func(obj T, isInInitialList bool) + UpdateFunc func(oldObj, newObj T) + DeleteFunc func(obj DeletedObject[T]) +} + +var _ TypedResourceEventHandler[*metav1.ObjectMeta] = TypedResourceEventHandlerDetailedFuncs[*metav1.ObjectMeta]{} + +func (r TypedResourceEventHandlerDetailedFuncs[T]) OnAdd(obj T, isInInitialList bool) { + if r.AddFunc != nil { + r.AddFunc(obj, isInInitialList) + } +} + +func (r TypedResourceEventHandlerDetailedFuncs[T]) OnUpdate(oldObj, newObj T) { + if r.UpdateFunc != nil { + r.UpdateFunc(oldObj, newObj) + } +} + +func (r TypedResourceEventHandlerDetailedFuncs[T]) OnDelete(obj DeletedObject[T]) { + if r.DeleteFunc != nil { + r.DeleteFunc(obj) + } +} + // FilteringResourceEventHandler applies the provided filter to all events coming // in, ensuring the appropriate nested handler method is invoked. An object // that starts passing the filter after an update is considered an add, and an @@ -388,6 +562,48 @@ func (r FilteringResourceEventHandler) OnDelete(obj interface{}) { r.Handler.OnDelete(obj) } +// TypedFilteringResourceEventHandler is a type-safe variant of +// [FilteringResourceEventHandler]. +type TypedFilteringResourceEventHandler[T Object] struct { + FilterFunc func(obj T) bool + Handler TypedResourceEventHandler[T] +} + +// OnAdd calls the nested handler only if the filter succeeds +func (r TypedFilteringResourceEventHandler[T]) OnAdd(obj T, isInInitialList bool) { + if !r.FilterFunc(obj) { + return + } + r.Handler.OnAdd(obj, isInInitialList) +} + +// OnUpdate ensures the proper handler is called depending on whether the filter matches +func (r TypedFilteringResourceEventHandler[T]) OnUpdate(oldObj, newObj T) { + newer := r.FilterFunc(newObj) + older := r.FilterFunc(oldObj) + switch { + case newer && older: + r.Handler.OnUpdate(oldObj, newObj) + case newer && !older: + r.Handler.OnAdd(newObj, false) + case !newer && older: + r.Handler.OnDelete(DeletedObject[T]{OptionalObj: oldObj}) + default: + // do nothing + } +} + +// OnDelete calls the nested handler only if the filter succeeds. The filter +// is applied to [DeletedObject.OptionalObj], which may be the zero value of T +// if the deleted object could not be recovered; a FilterFunc that relies on T +// having a valid state must handle that case itself. +func (r TypedFilteringResourceEventHandler[T]) OnDelete(obj DeletedObject[T]) { + if !r.FilterFunc(obj.OptionalObj) { + return + } + r.Handler.OnDelete(obj) +} + // DeletionHandlingMetaNamespaceKeyFunc checks for // DeletedFinalStateUnknown objects before calling // MetaNamespaceKeyFunc. diff --git a/vendor/k8s.io/client-go/tools/cache/index.go b/vendor/k8s.io/client-go/tools/cache/index.go index 395268f68c..ca0d904e65 100644 --- a/vendor/k8s.io/client-go/tools/cache/index.go +++ b/vendor/k8s.io/client-go/tools/cache/index.go @@ -98,3 +98,37 @@ type Indexers map[string]IndexFunc // Indices maps a name to an Index type Indices map[string]index + +type TypedIndexers[T any] map[string]TypedIndexFunc[T] +type TypedIndexFunc[T any] func(obj T) ([]string, error) +type TypedIndexer[T any] interface { + Indexer + + TypedIndex(indexName string, obj T) ([]T, error) + ByTypedIndex(indexName, indexedValue string) ([]T, error) + AddTypedIndexers(newIndexers TypedIndexers[T]) error +} + +// TypedIndexersToIndexers wraps several indexer functions which expect objects +// of a certain type so that they can be used in an [Indexer]. +// This is needed primarily for setting up [SharedIndexInformerOptions.Indexers]. +// When using one of the typed APIs for installing an indexer function +// the conversion is done automatically. +func TypedIndexersToIndexers[T any](indexers TypedIndexers[T]) Indexers { + untyped := make(Indexers, len(indexers)) + for i, indexer := range indexers { + untyped[i] = TypedIndexerFuncToIndexerFunc(indexer) + } + return untyped +} + +// TypedIndexersFuncToIndexerFunc wraps one indexer function which expect objects +// of a certain type so that they can be used in an [Indexer]. +// This is needed primarily for setting up [SharedIndexInformerOptions.Indexers]. +// When using one of the typed APIs for installing an indexer function +// the conversion is done automatically. +func TypedIndexerFuncToIndexerFunc[T any](indexer TypedIndexFunc[T]) IndexFunc { + return func(obj any) ([]string, error) { + return indexer(obj.(T)) + } +} diff --git a/vendor/k8s.io/client-go/tools/cache/fifo_metrics.go b/vendor/k8s.io/client-go/tools/cache/informer_metrics.go similarity index 98% rename from vendor/k8s.io/client-go/tools/cache/fifo_metrics.go rename to vendor/k8s.io/client-go/tools/cache/informer_metrics.go index 7a67817240..e0d3b6e930 100644 --- a/vendor/k8s.io/client-go/tools/cache/fifo_metrics.go +++ b/vendor/k8s.io/client-go/tools/cache/informer_metrics.go @@ -70,7 +70,7 @@ type storeMetrics struct { } // SetInformerMetricsProvider sets the metrics provider for all subsequently created -// FIFOs. Only the first call has an effect. +// informers. Only the first call has an effect. func SetInformerMetricsProvider(metricsProvider InformerMetricsProvider) { setInformerMetricsProviderOnce.Do(func() { globalInformerMetricsProvider = metricsProvider diff --git a/vendor/k8s.io/client-go/tools/cache/mutation_cache.go b/vendor/k8s.io/client-go/tools/cache/mutation_cache.go index 6800a62508..e70b721a83 100644 --- a/vendor/k8s.io/client-go/tools/cache/mutation_cache.go +++ b/vendor/k8s.io/client-go/tools/cache/mutation_cache.go @@ -25,7 +25,10 @@ import ( "k8s.io/klog/v2" "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" utilcache "k8s.io/apimachinery/pkg/util/cache" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/sets" @@ -35,11 +38,19 @@ import ( // that can be used to provide a more current view of a requested object. It requires interpreting // resourceVersions for comparisons. // Implementations must be thread-safe. -// TODO find a way to layer this into an informer/lister +// OnAddOrupdate and OnDelete should be called from informer event handlers to increase +// the accuracy of the cache. type MutationCache interface { GetByKey(key string) (interface{}, bool, error) ByIndex(indexName, indexKey string) ([]interface{}, error) Mutation(interface{}) + OnAddOrUpdate(obj runtime.Object) + OnDelete(obj runtime.Object) + + // This interface is not meant to be implemented elsewhere. + // Marking it as internal enables future changes without + // triggering apidiff. + internal() } // ResourceVersionComparator is able to compare object versions. @@ -47,7 +58,28 @@ type ResourceVersionComparator interface { CompareResourceVersion(lhs, rhs runtime.Object) int } -// NewIntegerResourceVersionMutationCache returns a MutationCache that understands how to +// MutationCacheOptions configures the MutationCache returned by NewIntegerResourceVersionMutationCacheWithOptions. +type MutationCacheOptions struct { + // Indexer is used by ByIndex to look up objects. May be nil, in which case ByIndex returns an error. + Indexer Indexer + + // TTL controls how long an item remains in the mutation cache before it is removed. + // Zero means the default of 5 minutes. + TTL time.Duration + + // IncludeAdds makes the cache return objects even if they don't exist + // in the underlying store. This is only safe if your use of the cache + // can handle mutation entries remaining in the cache for up to TTL + // when mutations and deletes occur very closely in time. + IncludeAdds bool + + // MaxCacheSize limits how many mutated objects are tracked; the least + // recently used entries are evicted once the limit is reached. + // Zero means the default of 100. + MaxCacheSize int +} + +// NewIntegerResourceVersionMutationCacheWithOptions returns a MutationCache that understands how to // deal with objects that have a resource version that: // // - is an integer @@ -60,18 +92,55 @@ type ResourceVersionComparator interface { // If includeAdds is true, objects in the mutation cache will be returned even if they don't exist // in the underlying store. This is only safe if your use of the cache can handle mutation entries // remaining in the cache for up to ttl when mutations and deletes occur very closely in time. -func NewIntegerResourceVersionMutationCache(logger klog.Logger, backingCache Store, indexer Indexer, ttl time.Duration, includeAdds bool) MutationCache { +// +// Note that this also applies to objects updated by the caller, not just +// objects added by it. That's because the MutationCache may hold an updated +// object at a time when the underlying store already removed it because it was +// deleted in the apiserver after the update. To address this, the caller +// can call OnAddOrUpdate and OnDelete from informer event handlers. +// +// This informs the MutationCache about all changes observed by the store +// and enables it to remove a locally added or updated object immediately once +// it appears in the store, which prevents the "stale updated object" problem. +// +// This does not solve the "stale added object" problem reliably because +// the informer might never see the added object when the add is followed +// quickly by a delete. The caller has to handle stale added objects by +// checking whether they still exist once the TTL is over. +func NewIntegerResourceVersionMutationCacheWithOptions(logger klog.Logger, backingCache Store, options MutationCacheOptions) MutationCache { + var ( + maxCacheSize = 100 + ttl = 5 * time.Minute + ) + + if options.MaxCacheSize != 0 { + maxCacheSize = options.MaxCacheSize + } + if options.TTL != 0 { + ttl = options.TTL + } + return &mutationCache{ backingCache: backingCache, - indexer: indexer, - mutationCache: utilcache.NewLRUExpireCache(100), + indexer: options.Indexer, + mutationCache: utilcache.NewLRUExpireCache(maxCacheSize), comparator: etcdObjectVersioner{}, ttl: ttl, - includeAdds: includeAdds, + includeAdds: options.IncludeAdds, logger: logger, } } +// NewIntegerResourceVersionMutationCache is like NewIntegerResourceVersionMutationCacheWithOptions with a fixed cache size of 100. +func NewIntegerResourceVersionMutationCache(logger klog.Logger, backingCache Store, indexer Indexer, ttl time.Duration, includeAdds bool) MutationCache { + return NewIntegerResourceVersionMutationCacheWithOptions(logger, backingCache, MutationCacheOptions{ + TTL: ttl, + Indexer: indexer, + IncludeAdds: includeAdds, + MaxCacheSize: 100, + }) +} + // mutationCache doesn't guarantee that it returns values added via Mutation since they can page out and // since you can't distinguish between, "didn't observe create" and "was deleted after create", // if the key is missing from the backing cache, we always return it as missing @@ -108,11 +177,24 @@ func (c *mutationCache) GetByKey(key string) (interface{}, bool, error) { if !exists { return nil, false, nil } + // Don't return the tombstone. + if _, ok := obj.(*tombstone); ok { + return nil, false, nil + } } objRuntime, ok := obj.(runtime.Object) if !ok { return obj, true, nil } + // If the object is from the store, + // then this will remove the obsolete tombstone. + // + // The newer object can never be the tombstone + // because a) we don't get here if only the tombstone + // exists (early return above) and b) the store's + // object must be more recent than the tombstone + // (the tombstone was created by an earlier store + // deletion). return c.newerObject(key, objRuntime), true, nil } @@ -157,6 +239,9 @@ func (c *mutationCache) ByIndex(name string, indexKey string) ([]interface{}, er if keySet.Has(key.(string)) { continue } + if _, ok := updated.(*tombstone); ok { + continue + } elements, err := fn(updated) if err != nil { c.logger.V(4).Info("Unable to calculate an index entry for mutation cache entry", "key", key, "err", err) @@ -213,15 +298,114 @@ func (c *mutationCache) Mutation(obj interface{}) { if objRuntime, ok := obj.(runtime.Object); ok { if mutatedObj, exists := c.mutationCache.Get(key); exists { if mutatedObjRuntime, ok := mutatedObj.(runtime.Object); ok { - if c.comparator.CompareResourceVersion(objRuntime, mutatedObjRuntime) < 0 { + cmp := c.comparator.CompareResourceVersion(objRuntime, mutatedObjRuntime) + if cmp < 0 { return } + if t, ok := mutatedObj.(*tombstone); ok { + if cmp == 0 { + // Exactly this object instance is known to be deleted. + // Don't store it, keep the tombstone. + return + } + objMeta, err := meta.Accessor(obj) + if err == nil && t.GetUID() == objMeta.GetUID() { + // Some other revision of this object instance + // is known to be deleted. Also don't store it. + return + } + } } } } c.mutationCache.Add(key, obj, c.ttl) } +// OnAddOrUpdate can be called to informer the cache about an object added to +// the store or updated in in. If the object is as recent as the cached object +// or newer, the cached object gets removed because it is no longer +// needed. This keeps the cache smaller. +func (c *mutationCache) OnAddOrUpdate(obj runtime.Object) { + key, err := DeletionHandlingMetaNamespaceKeyFunc(obj) + if err != nil { + // this is a "nice to have", so failures shouldn't do anything weird + utilruntime.HandleErrorWithLogger(c.logger, err, "DeletionHandlingMetaNamespaceKeyFunc") + return + } + + c.lock.Lock() + defer c.lock.Unlock() + + if mutatedObj, exists := c.mutationCache.Get(key); exists { + if mutatedObj, ok := mutatedObj.(runtime.Object); ok { + // No need to compare the UID here: resource versions can be compared + // between different instances. If it's newer or equal, then the mutation + // cache is out-dated. + if c.comparator.CompareResourceVersion(obj, mutatedObj) >= 0 { + c.mutationCache.Remove(key) + } + } + } +} + +// OnDelete can be called to informer the cache about an object deleted in the store. +// If there is a cached object with the same UID or an older RV, it gets removed. +func (c *mutationCache) OnDelete(obj runtime.Object) { + objMeta, err := meta.Accessor(obj) + if err != nil { + return + } + + key, err := DeletionHandlingMetaNamespaceKeyFunc(obj) + if err != nil { + // this is a "nice to have", so failures shouldn't do anything weird + utilruntime.HandleErrorWithLogger(c.logger, err, "DeletionHandlingMetaNamespaceKeyFunc") + return + } + + c.lock.Lock() + defer c.lock.Unlock() + + if mutatedObj, exists := c.mutationCache.Get(key); exists { + if mutatedObj, ok := mutatedObj.(runtime.Object); ok { + mutatedObjMeta, err := meta.Accessor(mutatedObj) + if err != nil { + return + } + // If the deleted object is known to be more recent than the + // mutated one, then the mutated one must have been removed + // because resource versions are incremented by type, not by + // object instance. + // + // If the UID matches, then we can also be sure that it got + // removed. + // + // If neither of this is true, then the caller has added + // a mutated object that may or may not still exist. They + // have to check after the TTL. + if c.comparator.CompareResourceVersion(obj, mutatedObj) >= 0 || + mutatedObjMeta.GetUID() == objMeta.GetUID() { + c.mutationCache.Remove(key) + } else { + return + } + } + } + + // Store a tombstone object in the mutation cache. + // A future Mutation call is outdated if it has a RV + // which is lower or equal or has the same UID. + t := &tombstone{ + namespace: objMeta.GetNamespace(), + name: objMeta.GetName(), + uid: objMeta.GetUID(), + rv: objMeta.GetResourceVersion(), + } + c.mutationCache.Add(key, t, c.ttl) +} + +func (c *mutationCache) internal() {} + // etcdObjectVersioner implements versioning and extracting etcd node information // for objects that have an embedded ObjectMeta or ListMeta field. type etcdObjectVersioner struct{} @@ -262,3 +446,57 @@ func (a etcdObjectVersioner) CompareResourceVersion(lhs, rhs runtime.Object) int return 1 } + +// tombstone is a replacement for a deleted object. It has the same key as it +// and the ResourceVersion at which the deletion was detected. +// +// It implements GetName, GetNamespace, GetResourceVersion and GetUID and thus +// the code above can compare it against other, normal objects. The difference +// is that it never gets returned by ByIndex or GetByKey. +type tombstone struct { + namespace, name, rv string + uid types.UID +} + +var _ metav1.Object = &tombstone{} +var _ runtime.Object = &tombstone{} + +func (t *tombstone) DeepCopyObject() runtime.Object { + clone := *t + return &clone +} + +func (t *tombstone) GetObjectKind() schema.ObjectKind { panic("not implemented") } + +func (t *tombstone) GetNamespace() string { return t.namespace } +func (t *tombstone) SetNamespace(namespace string) { panic("not implemented") } +func (t *tombstone) GetName() string { return t.name } +func (t *tombstone) SetName(name string) { panic("not implemented") } +func (t *tombstone) GetGenerateName() string { panic("not implemented") } +func (t *tombstone) SetGenerateName(name string) { panic("not implemented") } +func (t *tombstone) GetUID() types.UID { return t.uid } +func (t *tombstone) SetUID(uid types.UID) { panic("not implemented") } +func (t *tombstone) GetResourceVersion() string { return t.rv } +func (t *tombstone) SetResourceVersion(version string) { panic("not implemented") } +func (t *tombstone) GetGeneration() int64 { panic("not implemented") } +func (t *tombstone) SetGeneration(generation int64) { panic("not implemented") } +func (t *tombstone) GetSelfLink() string { panic("not implemented") } +func (t *tombstone) SetSelfLink(selfLink string) { panic("not implemented") } +func (t *tombstone) GetCreationTimestamp() metav1.Time { panic("not implemented") } +func (t *tombstone) SetCreationTimestamp(timestamp metav1.Time) { panic("not implemented") } +func (t *tombstone) GetDeletionTimestamp() *metav1.Time { panic("not implemented") } +func (t *tombstone) SetDeletionTimestamp(timestamp *metav1.Time) { panic("not implemented") } +func (t *tombstone) GetDeletionGracePeriodSeconds() *int64 { panic("not implemented") } +func (t *tombstone) SetDeletionGracePeriodSeconds(*int64) { panic("not implemented") } +func (t *tombstone) GetLabels() map[string]string { panic("not implemented") } +func (t *tombstone) SetLabels(labels map[string]string) { panic("not implemented") } +func (t *tombstone) GetAnnotations() map[string]string { panic("not implemented") } +func (t *tombstone) SetAnnotations(annotations map[string]string) { panic("not implemented") } +func (t *tombstone) GetFinalizers() []string { panic("not implemented") } +func (t *tombstone) SetFinalizers(finalizers []string) { panic("not implemented") } +func (t *tombstone) GetOwnerReferences() []metav1.OwnerReference { panic("not implemented") } +func (t *tombstone) SetOwnerReferences([]metav1.OwnerReference) { panic("not implemented") } +func (t *tombstone) GetManagedFields() []metav1.ManagedFieldsEntry { panic("not implemented") } +func (t *tombstone) SetManagedFields(managedFields []metav1.ManagedFieldsEntry) { + panic("not implemented") +} diff --git a/vendor/k8s.io/client-go/tools/cache/reflector.go b/vendor/k8s.io/client-go/tools/cache/reflector.go index a0e3a701cd..82de01f9ae 100644 --- a/vendor/k8s.io/client-go/tools/cache/reflector.go +++ b/vendor/k8s.io/client-go/tools/cache/reflector.go @@ -742,7 +742,7 @@ func (r *Reflector) list(ctx context.Context) error { case <-listCh: } - initTrace.Step("Objects listed", trace.Field{Key: "error", Value: err}) + initTrace.Step("Objects listed", trace.Field{Key: "error", Value: err}, trace.Field{Key: "count", Value: meta.LenList(list)}) if err != nil { return fmt.Errorf("failed to list %v: %w", r.typeDescription, err) } diff --git a/vendor/k8s.io/client-go/tools/cache/shared_informer.go b/vendor/k8s.io/client-go/tools/cache/shared_informer.go index 4cec4283f1..c259cdd9af 100644 --- a/vendor/k8s.io/client-go/tools/cache/shared_informer.go +++ b/vendor/k8s.io/client-go/tools/cache/shared_informer.go @@ -28,6 +28,7 @@ import ( "time" "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" @@ -177,6 +178,15 @@ type SharedInformer interface { // RemoveEventHandler removes a formerly added event handler given by // its registration handle. // This function is guaranteed to be idempotent, and thread-safe. + // + // Note: RemoveEventHandler is asynchronous. It stops queueing new events + // but does not wait for already-queued events to finish executing. + // Goroutines processing the remaining events may still be running and + // invoking callbacks after this function returns. + // + // If the caller needs to wait for all handlers to finish executing (for + // example, to safely close channels or release resources used by the handler), + // they should use [ShutDownEventHandler]. RemoveEventHandler(handle ResourceEventHandlerRegistration) error // GetStore returns the informer's local cache as a Store. GetStore() Store @@ -287,6 +297,118 @@ type SharedIndexInformer interface { GetIndexer() Indexer } +// TypedSharedIndexInformer adds type-safe variants for non-type-safe methods +// in SharedIndexInformer. No type casts are needed when using those variants. +type TypedSharedIndexInformer[T Object] interface { + SharedIndexInformer + + // AddTypedEventHandler is a type-safe replacement for + // SharedIndexInformer.AddEventHandlerWithOptions + // and SharedIndexInformer.AddEventHandler. + // + // Without options, it uses the same defaults as AddEventHandler + // or AddEventHandlerWithOptions with empty HandlerOptions. + // Passing one instance corresponds to AddEventHandlerWithOptions. + // Passing more than one is invalid and returns an error. + AddTypedEventHandler(handler TypedResourceEventHandler[T], options ...HandlerOptions) (ResourceEventHandlerRegistration, error) + AddTypedIndexers(indexers TypedIndexers[T]) error + GetTypedIndexer() TypedIndexer[T] +} + +func NewTypedSharedIndexInformer[T Object](informer SharedIndexInformer) TypedSharedIndexInformer[T] { + return &typedSharedIndexInformer[T]{SharedIndexInformer: informer} +} + +type typedSharedIndexInformer[T Object] struct { + SharedIndexInformer +} + +func (s typedSharedIndexInformer[T]) AddTypedEventHandler(handler TypedResourceEventHandler[T], options ...HandlerOptions) (ResourceEventHandlerRegistration, error) { + var o HandlerOptions + switch len(options) { + case 0: + case 1: + o = options[0] + default: + return nil, fmt.Errorf("at most one HandlerOptions may be passed, got %d", len(options)) + } + return s.AddEventHandlerWithOptions(&typedResourceEventHandler[T]{handler}, o) +} + +func (s typedSharedIndexInformer[T]) AddTypedIndexers(indexers TypedIndexers[T]) error { + return s.AddIndexers(TypedIndexersToIndexers(indexers)) +} + +func (s typedSharedIndexInformer[T]) GetTypedIndexer() TypedIndexer[T] { + return &typedIndexer[T]{s.GetIndexer()} +} + +// typedResourceEventHandler implements the untyped ResourceEventHandler interface +// by invoking the methods of a TypedResourceEventHandler instance. +type typedResourceEventHandler[T Object] struct { + handler TypedResourceEventHandler[T] +} + +var _ ResourceEventHandler = &typedResourceEventHandler[*metav1.ObjectMeta]{} + +func (h *typedResourceEventHandler[T]) OnAdd(obj any, isInitialList bool) { + h.handler.OnAdd(obj.(T), isInitialList) +} + +func (h *typedResourceEventHandler[T]) OnUpdate(oldObj, newObj any) { + h.handler.OnUpdate(oldObj.(T), newObj.(T)) +} + +func (h *typedResourceEventHandler[T]) OnDelete(obj any) { + if tomb, ok := obj.(DeletedFinalStateUnknown); ok { + if tomb.Obj == nil { + h.handler.OnDelete(DeletedObject[T]{FinalStateUnknown: &tomb}) + return + } + h.handler.OnDelete(DeletedObject[T]{OptionalObj: tomb.Obj.(T), FinalStateUnknown: &tomb}) + return + } + h.handler.OnDelete(DeletedObject[T]{OptionalObj: obj.(T)}) +} + +type typedIndexer[T any] struct { + Indexer +} + +func (i typedIndexer[T]) TypedIndex(indexName string, obj T) ([]T, error) { + untyped, err := i.Index(indexName, obj) + if err != nil { + return nil, err + } + typed := make([]T, len(untyped)) + for i, obj := range untyped { + typed[i] = obj.(T) + } + return typed, nil +} + +func (i typedIndexer[T]) ByTypedIndex(indexName, indexedValue string) ([]T, error) { + untyped, err := i.ByIndex(indexName, indexedValue) + if err != nil { + return nil, err + } + typed := make([]T, len(untyped)) + for i, obj := range untyped { + typed[i] = obj.(T) + } + return typed, nil +} + +func (i typedIndexer[T]) AddTypedIndexers(newIndexers TypedIndexers[T]) error { + untyped := make(Indexers, len(newIndexers)) + for i, indexer := range newIndexers { + untyped[i] = func(obj any) ([]string, error) { + return indexer(obj.(T)) + } + } + return i.AddIndexers(untyped) +} + // NewSharedInformer creates a new instance for the ListerWatcher. See NewSharedIndexInformerWithOptions for full details. func NewSharedInformer(lw ListerWatcher, exampleObject runtime.Object, defaultEventHandlerResyncPeriod time.Duration) SharedInformer { return NewSharedIndexInformer(lw, exampleObject, defaultEventHandlerResyncPeriod, Indexers{}) @@ -1014,6 +1136,24 @@ func (s *sharedIndexInformer) RemoveEventHandler(handle ResourceEventHandlerRegi return s.processor.removeListener(handle) } +// ShutDownEventHandler removes the event handler and blocks until it has fully +// stopped processing events. +// +// Like RemoveEventHandler, it is idempotent and thread-safe. However, it MUST NOT +// be called from within the event handler's own callbacks, as that will result +// in a deadlock. +func ShutDownEventHandler(informer SharedInformer, handle ResourceEventHandlerRegistration) error { + if err := informer.RemoveEventHandler(handle); err != nil { + return err + } + if s, ok := handle.(interface{ ShutdownChan() <-chan struct{} }); ok { + <-s.ShutdownChan() + } else { + return fmt.Errorf("handle does not support ShutdownChan()") + } + return nil +} + // sharedProcessor has a collection of processorListener and can // distribute a notification object to its listeners. There are two // kinds of distribute operations. The sync distributions go to a @@ -1086,6 +1226,8 @@ func (p *sharedProcessor) removeListener(handle ResourceEventHandlerRegistration if p.listenersStarted { close(listener.addCh) + } else { + close(listener.runFinished) } return nil @@ -1209,10 +1351,11 @@ func (p *sharedProcessor) resyncCheckPeriodChanged(logger klog.Logger, resyncChe // processorListener also keeps track of the adjusted requested resync // period of the listener. type processorListener struct { - logger klog.Logger - nextCh chan interface{} - addCh chan interface{} - done chan struct{} + logger klog.Logger + nextCh chan interface{} + addCh chan interface{} + done chan struct{} + runFinished chan struct{} handler ResourceEventHandler handlerName string @@ -1265,6 +1408,10 @@ func (p *processorListener) HasSyncedChecker() DoneChecker { return p.syncTracker } +func (p *processorListener) ShutdownChan() <-chan struct{} { + return p.runFinished +} + func newProcessListener(logger klog.Logger, handler ResourceEventHandler, requestedResyncPeriod, resyncPeriod time.Duration, now time.Time, bufferSize int, hasSynced DoneChecker) *processorListener { handlerName := nameForHandler(handler) ret := &processorListener{ @@ -1272,6 +1419,7 @@ func newProcessListener(logger klog.Logger, handler ResourceEventHandler, reques nextCh: make(chan interface{}), addCh: make(chan interface{}), done: make(chan struct{}), + runFinished: make(chan struct{}), upstreamHasSynced: hasSynced, handler: handler, handlerName: handlerName, @@ -1328,6 +1476,7 @@ func (p *processorListener) pop() { } func (p *processorListener) run() { + defer close(p.runFinished) // this call blocks until the channel is closed. When a panic happens during the notification // we will catch it, **the offending item will be skipped!**, and after a short delay (one second) // the next notification will be attempted. This is usually better than the alternative of never diff --git a/vendor/k8s.io/client-go/tools/cache/store.go b/vendor/k8s.io/client-go/tools/cache/store.go index 261ed60d9c..76cb70c569 100644 --- a/vendor/k8s.io/client-go/tools/cache/store.go +++ b/vendor/k8s.io/client-go/tools/cache/store.go @@ -402,6 +402,9 @@ func WithTransformer(transformer TransformFunc) StoreOption { func WithStoreMetrics(identifier InformerNameAndResource, metrics InformerMetricsProvider) StoreOption { return func(c *cache) { c.identifier = identifier + if metrics == nil { + metrics = globalInformerMetricsProvider + } c.metrics = metrics } } diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/doc.go b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/doc.go index 3ccdebc1c3..b5a686a4c1 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/doc.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/doc.go @@ -17,5 +17,6 @@ limitations under the License. // +k8s:conversion-gen=k8s.io/client-go/tools/clientcmd/api // +k8s:deepcopy-gen=package // +k8s:defaulter-gen=Kind +// +k8s:validation-gen=false package v1 diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.conversion.go b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.conversion.go index ef1e9b8eb2..f4a48d071e 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.conversion.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.conversion.go @@ -229,8 +229,7 @@ func Convert_api_AuthInfo_To_v1_AuthInfo(in *api.AuthInfo, out *AuthInfo, s conv } func autoConvert_v1_AuthProviderConfig_To_api_AuthProviderConfig(in *AuthProviderConfig, out *api.AuthProviderConfig, s conversion.Scope) error { - out.Name = in.Name - out.Config = *(*map[string]string)(unsafe.Pointer(&in.Config)) + *out = *(*api.AuthProviderConfig)(unsafe.Pointer(in)) return nil } @@ -240,8 +239,7 @@ func Convert_v1_AuthProviderConfig_To_api_AuthProviderConfig(in *AuthProviderCon } func autoConvert_api_AuthProviderConfig_To_v1_AuthProviderConfig(in *api.AuthProviderConfig, out *AuthProviderConfig, s conversion.Scope) error { - out.Name = in.Name - out.Config = *(*map[string]string)(unsafe.Pointer(&in.Config)) + *out = *(*AuthProviderConfig)(unsafe.Pointer(in)) return nil } @@ -411,8 +409,7 @@ func Convert_api_ExecConfig_To_v1_ExecConfig(in *api.ExecConfig, out *ExecConfig } func autoConvert_v1_ExecEnvVar_To_api_ExecEnvVar(in *ExecEnvVar, out *api.ExecEnvVar, s conversion.Scope) error { - out.Name = in.Name - out.Value = in.Value + *out = *(*api.ExecEnvVar)(unsafe.Pointer(in)) return nil } @@ -422,8 +419,7 @@ func Convert_v1_ExecEnvVar_To_api_ExecEnvVar(in *ExecEnvVar, out *api.ExecEnvVar } func autoConvert_api_ExecEnvVar_To_v1_ExecEnvVar(in *api.ExecEnvVar, out *ExecEnvVar, s conversion.Scope) error { - out.Name = in.Name - out.Value = in.Value + *out = *(*ExecEnvVar)(unsafe.Pointer(in)) return nil } diff --git a/vendor/k8s.io/client-go/tools/clientcmd/loader.go b/vendor/k8s.io/client-go/tools/clientcmd/loader.go index d1d0a82954..e6e35a8abe 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/loader.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/loader.go @@ -300,7 +300,8 @@ func (rules *ClientConfigLoadingRules) Migrate() error { return err } - if sourceInfo, err := os.Stat(source); err != nil { + sourceInfo, err := os.Stat(source) + if err != nil { if os.IsNotExist(err) || os.IsPermission(err) { // if the source file doesn't exist or we can't access it, there's no work to do. continue @@ -316,8 +317,8 @@ func (rules *ClientConfigLoadingRules) Migrate() error { if err != nil { return err } - // destination is created with mode 0666 before umask - err = os.WriteFile(destination, data, 0666) + // destination created with source perm, but never executable, and subject to umask + err = os.WriteFile(destination, data, sourceInfo.Mode().Perm()&0666) if err != nil { return err } @@ -641,7 +642,7 @@ func RelativizePathWithNoBacksteps(refs []*string, base string) error { } // if we have a backstep, don't mess with the path - if strings.HasPrefix(rel, "../") { + if strings.HasPrefix(rel, "../") || strings.HasPrefix(rel, ".."+string(os.PathSeparator)) { if filepath.IsAbs(*ref) { continue } diff --git a/vendor/k8s.io/client-go/tools/events/event_broadcaster.go b/vendor/k8s.io/client-go/tools/events/event_broadcaster.go index ff6b2c4fab..0987523205 100644 --- a/vendor/k8s.io/client-go/tools/events/event_broadcaster.go +++ b/vendor/k8s.io/client-go/tools/events/event_broadcaster.go @@ -328,7 +328,7 @@ func (e *eventBroadcasterImpl) StartStructuredLogging(verbosity klog.Level) func // To adjust verbosity, use the logger's V method (i.e. pass `logger.V(3)` instead of `logger`). // The returned function can be ignored or used to stop recording, if desired. func (e *eventBroadcasterImpl) StartLogging(logger klog.Logger) (func(), error) { - return e.StartEventWatcher( + return e.startEventWatcher(logger, func(obj runtime.Object) { event, ok := obj.(*eventsv1.Event) if !ok { @@ -342,12 +342,16 @@ func (e *eventBroadcasterImpl) StartLogging(logger klog.Logger) (func(), error) // StartEventWatcher starts sending events received from this EventBroadcaster to the given event handler function. // The return value is used to stop recording func (e *eventBroadcasterImpl) StartEventWatcher(eventHandler func(event runtime.Object)) (func(), error) { + return e.startEventWatcher(klog.Background(), eventHandler) +} + +func (e *eventBroadcasterImpl) startEventWatcher(logger klog.Logger, eventHandler func(event runtime.Object)) (func(), error) { watcher, err := e.Watch() if err != nil { return nil, err } go func() { - defer utilruntime.HandleCrash() + defer utilruntime.HandleCrashWithLogger(logger) for { watchEvent, ok := <-watcher.ResultChan() if !ok { @@ -414,7 +418,7 @@ func NewEventBroadcasterAdapter(client clientset.Interface) EventBroadcasterAdap // migration of individual components to the new Event API. func NewEventBroadcasterAdapterWithContext(ctx context.Context, client clientset.Interface) EventBroadcasterAdapter { eventClient := &eventBroadcasterAdapterImpl{} - if _, err := client.Discovery().ServerResourcesForGroupVersion(eventsv1.SchemeGroupVersion.String()); err == nil { + if _, err := client.Discovery().ServerResourcesForGroupVersionWithContext(ctx, eventsv1.SchemeGroupVersion.String()); err == nil { eventClient.eventsv1Client = client.EventsV1() eventClient.eventsv1Broadcaster = NewBroadcaster(&EventSinkImpl{Interface: eventClient.eventsv1Client}) } diff --git a/vendor/k8s.io/client-go/tools/events/event_recorder.go b/vendor/k8s.io/client-go/tools/events/event_recorder.go index ba2ec7be4e..08fa57d9f5 100644 --- a/vendor/k8s.io/client-go/tools/events/event_recorder.go +++ b/vendor/k8s.io/client-go/tools/events/event_recorder.go @@ -41,9 +41,14 @@ type recorderImpl struct { } var _ EventRecorder = &recorderImpl{} +var _ AnnotatedEventRecorder = &recorderImpl{} func (recorder *recorderImpl) Eventf(regarding runtime.Object, related runtime.Object, eventtype, reason, action, note string, args ...interface{}) { - recorder.eventf(klog.Background(), regarding, related, eventtype, reason, action, note, args...) + recorder.eventf(klog.Background(), regarding, related, nil, eventtype, reason, action, note, args...) +} + +func (recorder *recorderImpl) AnnotatedEventf(regarding runtime.Object, related runtime.Object, annotations map[string]string, eventtype, reason, action, note string, args ...interface{}) { + recorder.eventf(klog.Background(), regarding, related, annotations, eventtype, reason, action, note, args...) } type recorderImplLogger struct { @@ -54,14 +59,18 @@ type recorderImplLogger struct { var _ EventRecorderLogger = &recorderImplLogger{} func (recorder *recorderImplLogger) Eventf(regarding runtime.Object, related runtime.Object, eventtype, reason, action, note string, args ...interface{}) { - recorder.eventf(recorder.logger, regarding, related, eventtype, reason, action, note, args...) + recorder.eventf(recorder.logger, regarding, related, nil, eventtype, reason, action, note, args...) +} + +func (recorder *recorderImplLogger) AnnotatedEventf(regarding runtime.Object, related runtime.Object, annotations map[string]string, eventtype, reason, action, note string, args ...interface{}) { + recorder.eventf(recorder.logger, regarding, related, annotations, eventtype, reason, action, note, args...) } func (recorder *recorderImplLogger) WithLogger(logger klog.Logger) EventRecorderLogger { return &recorderImplLogger{recorderImpl: recorder.recorderImpl, logger: logger} } -func (recorder *recorderImpl) eventf(logger klog.Logger, regarding runtime.Object, related runtime.Object, eventtype, reason, action, note string, args ...interface{}) { +func (recorder *recorderImpl) eventf(logger klog.Logger, regarding runtime.Object, related runtime.Object, annotations map[string]string, eventtype, reason, action, note string, args ...interface{}) { timestamp := metav1.MicroTime{Time: time.Now()} message := fmt.Sprintf(note, args...) refRegarding, err := reference.GetReference(recorder.scheme, regarding) @@ -81,14 +90,14 @@ func (recorder *recorderImpl) eventf(logger klog.Logger, regarding runtime.Objec logger.Error(nil, "Unsupported event type", "eventType", eventtype) return } - event := recorder.makeEvent(refRegarding, refRelated, timestamp, eventtype, reason, message, recorder.reportingController, recorder.reportingInstance, action) + event := recorder.makeEvent(refRegarding, refRelated, timestamp, annotations, eventtype, reason, message, recorder.reportingController, recorder.reportingInstance, action) go func() { defer utilruntime.HandleCrash() recorder.Action(watch.Added, event) }() } -func (recorder *recorderImpl) makeEvent(refRegarding *v1.ObjectReference, refRelated *v1.ObjectReference, timestamp metav1.MicroTime, eventtype, reason, message string, reportingController string, reportingInstance string, action string) *eventsv1.Event { +func (recorder *recorderImpl) makeEvent(refRegarding *v1.ObjectReference, refRelated *v1.ObjectReference, timestamp metav1.MicroTime, annotations map[string]string, eventtype, reason, message string, reportingController string, reportingInstance string, action string) *eventsv1.Event { t := metav1.Time{Time: recorder.clock.Now()} namespace := refRegarding.Namespace if namespace == "" { @@ -96,8 +105,9 @@ func (recorder *recorderImpl) makeEvent(refRegarding *v1.ObjectReference, refRel } return &eventsv1.Event{ ObjectMeta: metav1.ObjectMeta{ - Name: util.GenerateEventName(refRegarding.Name, t.UnixNano()), - Namespace: namespace, + Name: util.GenerateEventName(refRegarding.Name, t.UnixNano()), + Namespace: namespace, + Annotations: annotations, }, EventTime: timestamp, Series: nil, diff --git a/vendor/k8s.io/client-go/tools/events/fake.go b/vendor/k8s.io/client-go/tools/events/fake.go index e26826d6c8..5c1892a766 100644 --- a/vendor/k8s.io/client-go/tools/events/fake.go +++ b/vendor/k8s.io/client-go/tools/events/fake.go @@ -27,26 +27,71 @@ import ( // when created manually and not by NewFakeRecorder, however all events may be // thrown away in this case. type FakeRecorder struct { - Events chan string + Events chan string + Verbose bool } var _ EventRecorderLogger = &FakeRecorder{} +var _ AnnotatedEventRecorder = &FakeRecorder{} // Eventf emits an event func (f *FakeRecorder) Eventf(regarding runtime.Object, related runtime.Object, eventtype, reason, action, note string, args ...interface{}) { - if f.Events != nil { - f.Events <- fmt.Sprintf(eventtype+" "+reason+" "+note, args...) - } + f.writeEvent(regarding, related, nil, eventtype, reason, action, note, args...) +} + +// AnnotatedEventf emits an event like Eventf, but with annotations attached +func (f *FakeRecorder) AnnotatedEventf(regarding runtime.Object, related runtime.Object, annotations map[string]string, eventtype, reason, action, note string, args ...interface{}) { + f.writeEvent(regarding, related, annotations, eventtype, reason, action, note, args...) } func (f *FakeRecorder) WithLogger(logger klog.Logger) EventRecorderLogger { return f } +// writeEvent constructs a string from the event parameters and sends +// it to the Events channel +func (f *FakeRecorder) writeEvent(regarding runtime.Object, related runtime.Object, annotations map[string]string, eventtype, reason, action, note string, args ...interface{}) { + if f.Events != nil { + msg := fmt.Sprintf(eventtype+" "+reason+" "+note, args...) + if f.Verbose { + msg = eventtype + " " + reason + " " + action + " " + fmt.Sprintf(note, args...) + + objectString(regarding) + objectString(related) + annotationsString(annotations) + } + f.Events <- msg + } +} + +// annotationsString returns a formatted string of the annotations map, +// or empty string if none +func annotationsString(annotations map[string]string) string { + annotationString := "" + if len(annotations) > 0 { + annotationString = " " + fmt.Sprint(annotations) + } + return annotationString +} + +// objectString returns a formatted string with the object's kind and +// apiVersion +func objectString(object runtime.Object) string { + objectString := "" + if object != nil { + gvk := object.GetObjectKind().GroupVersionKind() + if !gvk.Empty() { + objectString = fmt.Sprintf(" {kind=%s,apiVersion=%s}", + gvk.Kind, + gvk.GroupVersion(), + ) + } + } + return objectString +} + // NewFakeRecorder creates new fake event recorder with event channel with // buffer of given size. func NewFakeRecorder(bufferSize int) *FakeRecorder { return &FakeRecorder{ - Events: make(chan string, bufferSize), + Events: make(chan string, bufferSize), + Verbose: false, } } diff --git a/vendor/k8s.io/client-go/tools/events/interfaces.go b/vendor/k8s.io/client-go/tools/events/interfaces.go index bb6109f623..209b3c0d51 100644 --- a/vendor/k8s.io/client-go/tools/events/interfaces.go +++ b/vendor/k8s.io/client-go/tools/events/interfaces.go @@ -28,6 +28,7 @@ import ( type EventRecorder = internalevents.EventRecorder type EventRecorderLogger = internalevents.EventRecorderLogger +type AnnotatedEventRecorder = internalevents.AnnotatedEventRecorder // EventBroadcaster knows how to receive events and send them to any EventSink, watcher, or log. type EventBroadcaster interface { diff --git a/vendor/k8s.io/client-go/tools/internal/events/interfaces.go b/vendor/k8s.io/client-go/tools/internal/events/interfaces.go index be6261b531..50bb4d2e80 100644 --- a/vendor/k8s.io/client-go/tools/internal/events/interfaces.go +++ b/vendor/k8s.io/client-go/tools/internal/events/interfaces.go @@ -43,6 +43,15 @@ type EventRecorder interface { Eventf(regarding runtime.Object, related runtime.Object, eventtype, reason, action, note string, args ...interface{}) } +// AnnotatedEventRecorder is an optional extension of EventRecorder that +// supports attaching annotations to events at creation time. +// Annotations are intended for low-frequency correlation metadata, not as a general purpose structured-data channel. +// Kubernetes events are best-effort, supplemental observability data and may be dropped, deduped or aggregated at any +// point in pipeline. Do not rely on annotations for event-driven control flow. +type AnnotatedEventRecorder interface { + AnnotatedEventf(regarding runtime.Object, related runtime.Object, annotations map[string]string, eventtype, reason, action, note string, args ...interface{}) +} + // EventRecorderLogger extends EventRecorder such that a logger can // be set for methods in EventRecorder. Normally, those methods // uses the global default logger to record errors and debug messages. diff --git a/vendor/k8s.io/client-go/tools/leaderelection/OWNERS b/vendor/k8s.io/client-go/tools/leaderelection/OWNERS index 70787f2b52..0aa6fd9a44 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/OWNERS +++ b/vendor/k8s.io/client-go/tools/leaderelection/OWNERS @@ -1,13 +1,12 @@ # See the OWNERS docs at https://go.k8s.io/owners approvers: - - mikedanese - jefftree reviewers: - wojtek-t - deads2k - - mikedanese - ingvagabund - jefftree emeritus_approvers: - timothysc + - mikedanese diff --git a/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go b/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go index 00798d82ac..b4e70a6c7a 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go +++ b/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go @@ -312,12 +312,20 @@ func (le *LeaderElector) renew(ctx context.Context) { } // release attempts to release the leader lease if we have acquired it. +// It retries on conflict, which may occur if the context cancellation +// races with an inflight renew() operation. The client will see a ctx +// cancellation error while the apiserver completes the update and bumps +// the resource version. func (le *LeaderElector) release(logger klog.Logger) bool { - ctx := context.Background() + ctx := klog.NewContext(context.Background(), logger) timeoutCtx, timeoutCancel := context.WithTimeout(ctx, le.config.RenewDeadline) defer timeoutCancel() - // update the resourceVersion of lease - oldLeaderElectionRecord, _, err := le.config.Lock.Get(timeoutCtx) + return le.tryRelease(timeoutCtx) +} + +func (le *LeaderElector) tryRelease(ctx context.Context) bool { + logger := klog.FromContext(ctx) + oldLeaderElectionRecord, _, err := le.config.Lock.Get(ctx) if err != nil { if !errors.IsNotFound(err) { logger.Error(err, "error retrieving resource lock", "lock", le.config.Lock.Describe()) @@ -337,7 +345,11 @@ func (le *LeaderElector) release(logger klog.Logger) bool { RenewTime: now, AcquireTime: now, } - if err := le.config.Lock.Update(timeoutCtx, leaderElectionRecord); err != nil { + if err := le.config.Lock.Update(ctx, leaderElectionRecord); err != nil { + if errors.IsConflict(err) { + logger.V(4).Info("Conflict when releasing lease, retrying", "lock", le.config.Lock.Describe()) + return le.tryRelease(ctx) + } logger.Error(err, "Failed to release lease", "lock", le.config.Lock.Describe()) return false } diff --git a/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/multilock.go b/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/multilock.go index 5ee1dcbb50..e2ba21d37e 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/multilock.go +++ b/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/multilock.go @@ -25,10 +25,14 @@ import ( ) const ( + // Deprecated: UnknownLeader is only used by MultiLock, which is deprecated. UnknownLeader = "leaderelection.k8s.io/unknown" ) -// MultiLock is used for lock's migration +// Deprecated: MultiLock was used to facilitate migration from non-lease +// based leader election to lease-based leader election. Support for +// non-lease locks was removed in Kubernetes 1.28, making MultiLock +// non-functional. Use LeaseLock directly instead. type MultiLock struct { Primary Interface Secondary Interface @@ -99,6 +103,7 @@ func (ml *MultiLock) Identity() string { return ml.Primary.Identity() } +// Deprecated: ConcatRawRecord is only used by MultiLock, which is deprecated. func ConcatRawRecord(primaryRaw, secondaryRaw []byte) []byte { return bytes.Join([][]byte{primaryRaw, secondaryRaw}, []byte(",")) } diff --git a/vendor/k8s.io/client-go/tools/metrics/metrics.go b/vendor/k8s.io/client-go/tools/metrics/metrics.go index 2f626475b2..bac15ae140 100644 --- a/vendor/k8s.io/client-go/tools/metrics/metrics.go +++ b/vendor/k8s.io/client-go/tools/metrics/metrics.go @@ -25,7 +25,37 @@ import ( "time" ) -var registerMetrics sync.Once +var ( + registerMetrics sync.Once + ensureRegisteredOnce sync.Once + // ensureRegisteredFn, if set via RegisterOpts.RegisterFn, is invoked + // exactly once before any rest client is constructed. Adapter packages + // (e.g. k8s.io/component-base/metrics/prometheus/restclient) install + // this callback in their init() so that the actual registration with + // legacyregistry — and the metric Create() that reads + // feature-gate-derived options like NativeHistograms — happens at + // runtime rather than at init() time. See EnsureRegistered for the + // caller-side contract. + ensureRegisteredFn func() +) + +// EnsureRegistered invokes the callback installed via RegisterOpts.RegisterFn (if +// any) exactly once. Callers should treat it as idempotent; subsequent calls are +// effectively free. +// +// New public constructors or entry points for packages in client-go that create +// a REST client, HTTP transport, or credential provider should invoke EnsureRegistered() +// at the very beginning of the function. Adapter Observe methods +// also call EnsureRegistered(), so no observations are lost if a constructor +// forgets to invoke it, but if invoked, the entrypoint call shifts registration from +// "first-observation" to "first client construction", meaning the metric +// series is visible to Promteheus scrapes from process startup rather than +// appearing only after the first request. +func EnsureRegistered() { + if ensureRegisteredFn != nil { + ensureRegisteredOnce.Do(ensureRegisteredFn) + } +} // DurationMetric is a measurement of some amount of time. type DurationMetric interface { @@ -163,6 +193,12 @@ type RegisterOpts struct { TransportCAReloads TransportCAReloadsMetric TransportCertRotationGCCalls TransportCertRotationGCCallsMetric TransportCacheGCCalls TransportCacheGCCallsMetric + + // RegisterFn, if non-nil, is invoked exactly once by EnsureRegistered(). + // before the first rest client is constructed. Adapters use this to defer + // registrations that depend on runtime state (eg., feature gates read my metric + // Create() without changing the import side contract of the adapter package.) + RegisterFn func() } // Register registers metrics for the rest client to use. This can @@ -197,7 +233,7 @@ func Register(opts RegisterOpts) { ExecPluginCalls = opts.ExecPluginCalls } if opts.ExecPluginPolicyCalls != nil { - ExecPluginCalls = opts.ExecPluginCalls + ExecPluginPolicyCalls = opts.ExecPluginPolicyCalls } if opts.RequestRetry != nil { RequestRetry = opts.RequestRetry @@ -217,6 +253,9 @@ func Register(opts RegisterOpts) { if opts.TransportCacheGCCalls != nil { TransportCacheGCCalls = opts.TransportCacheGCCalls } + if opts.RegisterFn != nil { + ensureRegisteredFn = opts.RegisterFn + } }) } diff --git a/vendor/k8s.io/client-go/tools/pager/pager.go b/vendor/k8s.io/client-go/tools/pager/pager.go index 3c77cc37fa..500923e28f 100644 --- a/vendor/k8s.io/client-go/tools/pager/pager.go +++ b/vendor/k8s.io/client-go/tools/pager/pager.go @@ -219,7 +219,7 @@ func (p *ListPager) eachListChunkBuffered(ctx context.Context, options metav1.Li chunkC := make(chan runtime.Object, p.PageBufferSize) bgResultC := make(chan error, 1) go func() { - defer utilruntime.HandleCrash() + defer utilruntime.HandleCrashWithContext(ctx) var err error defer func() { diff --git a/vendor/k8s.io/client-go/tools/record/event.go b/vendor/k8s.io/client-go/tools/record/event.go index 305a924388..8f8e3ebf78 100644 --- a/vendor/k8s.io/client-go/tools/record/event.go +++ b/vendor/k8s.io/client-go/tools/record/event.go @@ -176,6 +176,12 @@ func (a *EventRecorderAdapter) Eventf(regarding, _ runtime.Object, eventtype, re a.recorder.Eventf(regarding, eventtype, reason, note, args...) } +// AnnotatedEventf is a wrapper around v1 AnnotatedEventf +func (a *EventRecorderAdapter) AnnotatedEventf(regarding, _ runtime.Object, annotations map[string]string, eventtype, reason, action, note string, args ...interface{}) { + //nolint:forbidigo // Legacy usage + a.recorder.AnnotatedEventf(regarding, annotations, eventtype, reason, note, args...) +} + func (a *EventRecorderAdapter) WithLogger(logger klog.Logger) internalevents.EventRecorderLogger { return &EventRecorderAdapter{ recorder: a.recorder.WithLogger(logger), @@ -292,7 +298,7 @@ func (e *eventBroadcasterImpl) recordToSink(sink EventSink, event *v1.Event, eve event = &eventCopy result, err := eventCorrelator.EventCorrelate(event) if err != nil { - utilruntime.HandleError(err) + utilruntime.HandleErrorWithContext(e.cancelationCtx, err, "Event correlation failed") } if result.Skip { return @@ -402,7 +408,7 @@ func (e *eventBroadcasterImpl) StartEventWatcher(eventHandler func(*v1.Event)) w return watch.NewEmptyWatch() } go func() { - defer utilruntime.HandleCrash() + defer utilruntime.HandleCrashWithContext(e.cancelationCtx) for { select { case <-e.cancelationCtx.Done(): diff --git a/vendor/k8s.io/client-go/tools/record/events_cache.go b/vendor/k8s.io/client-go/tools/record/events_cache.go index 9eae6971c1..4b87383011 100644 --- a/vendor/k8s.io/client-go/tools/record/events_cache.go +++ b/vendor/k8s.io/client-go/tools/record/events_cache.go @@ -48,7 +48,7 @@ const ( defaultSpamQPS = 1. / 300. ) -// getEventKey builds unique event key based on source, involvedObject, reason, message +// getEventKey builds unique event key based on source, involvedObject, reason, message. func getEventKey(event *v1.Event) string { return strings.Join([]string{ event.Source.Component, @@ -66,7 +66,7 @@ func getEventKey(event *v1.Event) string { "") } -// getSpamKey builds unique event key based on source, involvedObject +// getSpamKey builds unique event key based on source, involvedObject. func getSpamKey(event *v1.Event) string { return strings.Join([]string{ event.Source.Component, @@ -124,6 +124,7 @@ type spamRecord struct { } // Filter controls that a given source+object are not exceeding the allowed rate. +// The event parameter must not be nil. func (f *EventSourceObjectSpamFilter) Filter(event *v1.Event) bool { var record spamRecord @@ -157,7 +158,8 @@ func (f *EventSourceObjectSpamFilter) Filter(event *v1.Event) bool { type EventAggregatorKeyFunc func(event *v1.Event) (aggregateKey string, localKey string) // EventAggregatorByReasonFunc aggregates events by exact match on event.Source, event.InvolvedObject, event.Type, -// event.Reason, event.ReportingController and event.ReportingInstance +// event.Reason, event.ReportingController and event.ReportingInstance. +// The event parameter must not be nil. func EventAggregatorByReasonFunc(event *v1.Event) (string, string) { return strings.Join([]string{ event.Source.Component, @@ -235,6 +237,8 @@ type aggregateRecord struct { // - The cache key for the event, for correlation purposes. This will be set to // the full key for normal events, and to the result of // EventAggregatorMessageFunc for aggregate events. +// +// The newEvent parameter must not be nil. func (e *EventAggregator) EventAggregate(newEvent *v1.Event) (*v1.Event, string) { now := metav1.NewTime(e.clock.Now()) var record aggregateRecord @@ -515,7 +519,8 @@ func (c *EventCorrelator) EventCorrelate(newEvent *v1.Event) (*EventCorrelateRes return &EventCorrelateResult{Event: observedEvent, Patch: patch}, err } -// UpdateState based on the latest observed state from server +// UpdateState based on the latest observed state from server. +// The event parameter must not be nil. func (c *EventCorrelator) UpdateState(event *v1.Event) { c.logger.updateState(event) } diff --git a/vendor/k8s.io/client-go/transport/OWNERS b/vendor/k8s.io/client-go/transport/OWNERS index 34adee5ec5..17c96a91ef 100644 --- a/vendor/k8s.io/client-go/transport/OWNERS +++ b/vendor/k8s.io/client-go/transport/OWNERS @@ -5,4 +5,3 @@ reviewers: - wojtek-t - deads2k - liggitt - - caesarxuchao diff --git a/vendor/k8s.io/client-go/transport/transport.go b/vendor/k8s.io/client-go/transport/transport.go index be97b76210..c4595da308 100644 --- a/vendor/k8s.io/client-go/transport/transport.go +++ b/vendor/k8s.io/client-go/transport/transport.go @@ -29,12 +29,14 @@ import ( utilnet "k8s.io/apimachinery/pkg/util/net" clientgofeaturegate "k8s.io/client-go/features" + "k8s.io/client-go/tools/metrics" "k8s.io/klog/v2" ) // New returns an http.RoundTripper that will provide the authentication // or transport level security defined by the provided Config. func New(config *Config) (http.RoundTripper, error) { + metrics.EnsureRegistered() // Set transport level security if config.Transport != nil && (config.HasCA() || config.HasCertAuth() || config.HasCertCallback() || config.TLS.Insecure) { return nil, fmt.Errorf("using a custom transport with TLS certificate options or the insecure flag is not allowed") diff --git a/vendor/k8s.io/client-go/util/consistencydetector/data_consistency_detector.go b/vendor/k8s.io/client-go/util/consistencydetector/data_consistency_detector.go index 72c0124a0f..d46c429e75 100644 --- a/vendor/k8s.io/client-go/util/consistencydetector/data_consistency_detector.go +++ b/vendor/k8s.io/client-go/util/consistencydetector/data_consistency_detector.go @@ -66,12 +66,19 @@ type TransformFunc func(interface{}) (interface{}, error) // it is guarded by an environmental variable. // we cannot manipulate the environmental variable because // it will affect other tests in this package. +// +// The identity string can be left empty if the logger in the context already +// identifies what is being watched. func CheckDataConsistency[T runtime.Object, U any](ctx context.Context, identity string, lastSyncedResourceVersion string, listFn ListFunc[T], listItemTransformFunc TransformFunc, listOptions metav1.ListOptions, retrieveItemsFn RetrieveItemsFunc[U]) { + logger := klog.FromContext(ctx) + if identity != "" { + logger = klog.LoggerWithName(logger, identity) + } if !canFormAdditionalListCall(lastSyncedResourceVersion, listOptions) { - klog.V(4).Infof("data consistency check for %s is enabled but the parameters (RV, ListOptions) doesn't allow for creating a valid LIST request. Skipping the data consistency check.", identity) + logger.V(4).Info("Data consistency check is enabled but the parameters (RV, ListOptions) doesn't allow for creating a valid LIST request. Skipping the data consistency check.") return } - klog.Warningf("data consistency check for %s is enabled, this will result in an additional call to the API server.", identity) + logger.Info("Warning: data consistency check is enabled, this will result in an additional call to the API server.") retrievedItems := toMetaObjectSliceOrDie(retrieveItemsFn()) listOptions = prepareListCallOptions(lastSyncedResourceVersion, listOptions, len(retrievedItems)) @@ -82,13 +89,13 @@ func CheckDataConsistency[T runtime.Object, U any](ctx context.Context, identity // the consistency check will only be enabled in the CI // and LIST calls in general will be retired by the client-go library // if we fail simply log and retry - klog.Errorf("failed to list data from the server, retrying until stopCh is closed, err: %v", err) + logger.Info("Failed to list data from the server, retrying until context is canceled", "err", err) return false, nil } return true, nil }) if err != nil { - klog.Errorf("failed to list data from the server, the data consistency check for %s won't be performed, stopCh was closed, err: %v", identity, err) + logger.Error(err, "Failed to list data from the server, the data consistency check won't be performed, stopCh was closed") return } @@ -111,7 +118,7 @@ func CheckDataConsistency[T runtime.Object, U any](ctx context.Context, identity sort.Sort(byUID(retrievedItems)) if !reflect.DeepEqual(listItems, retrievedItems) { - klog.Infof("previously received data for %s is different than received by the standard list api call against etcd, diff: %v", identity, diff.Diff(listItems, retrievedItems)) + logger.Info("Previously received data is different than received by the standard list api call against etcd", "diff", diff.Diff(listItems, retrievedItems)) msg := fmt.Sprintf("data inconsistency detected for %s, panicking!", identity) panic(msg) } diff --git a/vendor/k8s.io/client-go/util/jsonpath/jsonpath.go b/vendor/k8s.io/client-go/util/jsonpath/jsonpath.go index 86a3d6dde9..91525c0b48 100644 --- a/vendor/k8s.io/client-go/util/jsonpath/jsonpath.go +++ b/vendor/k8s.io/client-go/util/jsonpath/jsonpath.go @@ -361,7 +361,7 @@ func (j *JSONPath) findFieldInValue(value *reflect.Value, node *FieldNode) (refl var inlineValue *reflect.Value for ix := 0; ix < t.NumField(); ix++ { f := t.Field(ix) - jsonTag := f.Tag.Get("json") + jsonTag, _ := f.Tag.Lookup("json") parts := strings.Split(jsonTag, ",") if len(parts) == 0 { continue @@ -369,7 +369,7 @@ func (j *JSONPath) findFieldInValue(value *reflect.Value, node *FieldNode) (refl if parts[0] == node.Value { return value.Field(ix), nil } - if len(parts[0]) == 0 { + if len(parts[0]) == 0 && f.Anonymous { val := value.Field(ix) inlineValue = &val } diff --git a/vendor/k8s.io/client-go/util/retry/OWNERS b/vendor/k8s.io/client-go/util/retry/OWNERS deleted file mode 100644 index 75736b5aac..0000000000 --- a/vendor/k8s.io/client-go/util/retry/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: - - caesarxuchao diff --git a/vendor/k8s.io/client-go/util/retry/util.go b/vendor/k8s.io/client-go/util/retry/util.go index 57d3cd49c1..fd2a959ec6 100644 --- a/vendor/k8s.io/client-go/util/retry/util.go +++ b/vendor/k8s.io/client-go/util/retry/util.go @@ -59,7 +59,7 @@ func OnError(backoff wait.Backoff, retriable func(error) bool, fn func() error) return false, err } }) - if wait.Interrupted(err) { + if wait.Interrupted(err) && lastErr != nil { err = lastErr } return err diff --git a/vendor/k8s.io/component-base/version/base.go b/vendor/k8s.io/component-base/version/base.go index 453b63d82f..6394bc8cfe 100644 --- a/vendor/k8s.io/component-base/version/base.go +++ b/vendor/k8s.io/component-base/version/base.go @@ -60,5 +60,5 @@ const ( // DefaultKubeBinaryVersion is the hard coded k8 binary version based on the latest K8s release. // It is supposed to be consistent with gitMajor and gitMinor, except for local tests, where gitMajor and gitMinor are "". // Should update for each minor release! - DefaultKubeBinaryVersion = "1.36" + DefaultKubeBinaryVersion = "1.37" ) diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/alias.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/alias.go deleted file mode 100644 index fbf256d528..0000000000 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/alias.go +++ /dev/null @@ -1,967 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Code generated by alias_gen.go; DO NOT EDIT. - -//go:build goexperiment.jsonv2 && go1.25 - -// Package json implements semantic processing of JSON as specified in RFC 8259. -// JSON is a simple data interchange format that can represent -// primitive data types such as booleans, strings, and numbers, -// in addition to structured data types such as objects and arrays. -// -// [Marshal] and [Unmarshal] encode and decode Go values -// to/from JSON text contained within a []byte. -// [MarshalWrite] and [UnmarshalRead] operate on JSON text -// by writing to or reading from an [io.Writer] or [io.Reader]. -// [MarshalEncode] and [UnmarshalDecode] operate on JSON text -// by encoding to or decoding from a [jsontext.Encoder] or [jsontext.Decoder]. -// [Options] may be passed to each of the marshal or unmarshal functions -// to configure the semantic behavior of marshaling and unmarshaling -// (i.e., alter how JSON data is understood as Go data and vice versa). -// [jsontext.Options] may also be passed to the marshal or unmarshal functions -// to configure the syntactic behavior of encoding or decoding. -// -// The data types of JSON are mapped to/from the data types of Go based on -// the closest logical equivalent between the two type systems. For example, -// a JSON boolean corresponds with a Go bool, -// a JSON string corresponds with a Go string, -// a JSON number corresponds with a Go int, uint or float, -// a JSON array corresponds with a Go slice or array, and -// a JSON object corresponds with a Go struct or map. -// See the documentation on [Marshal] and [Unmarshal] for a comprehensive list -// of how the JSON and Go type systems correspond. -// -// Arbitrary Go types can customize their JSON representation by implementing -// [Marshaler], [MarshalerTo], [Unmarshaler], or [UnmarshalerFrom]. -// This provides authors of Go types with control over how their types are -// serialized as JSON. Alternatively, users can implement functions that match -// [MarshalFunc], [MarshalToFunc], [UnmarshalFunc], or [UnmarshalFromFunc] -// to specify the JSON representation for arbitrary types. -// This provides callers of JSON functionality with control over -// how any arbitrary type is serialized as JSON. -// -// # JSON Representation of Go structs -// -// A Go struct is naturally represented as a JSON object, -// where each Go struct field corresponds with a JSON object member. -// When marshaling, all Go struct fields are recursively encoded in depth-first -// order as JSON object members except those that are ignored or omitted. -// When unmarshaling, JSON object members are recursively decoded -// into the corresponding Go struct fields. -// Object members that do not match any struct fields, -// also known as “unknown members”, are ignored by default or rejected -// if [RejectUnknownMembers] is specified. -// -// The representation of each struct field can be customized in the -// "json" struct field tag, where the tag is a comma separated list of options. -// As a special case, if the entire tag is `json:"-"`, -// then the field is ignored with regard to its JSON representation. -// Some options also have equivalent behavior controlled by a caller-specified [Options]. -// Field-specified options take precedence over caller-specified options. -// -// The first option is the JSON object name override for the Go struct field. -// If the name is not specified, then the Go struct field name -// is used as the JSON object name. JSON names containing commas or quotes, -// or names identical to "" or "-", can be specified using -// a single-quoted string literal, where the syntax is identical to -// the Go grammar for a double-quoted string literal, -// but instead uses single quotes as the delimiters. -// By default, unmarshaling uses case-sensitive matching to identify -// the Go struct field associated with a JSON object name. -// -// After the name, the following tag options are supported: -// -// - omitzero: When marshaling, the "omitzero" option specifies that -// the struct field should be omitted if the field value is zero -// as determined by the "IsZero() bool" method if present, -// otherwise based on whether the field is the zero Go value. -// This option has no effect when unmarshaling. -// -// - omitempty: When marshaling, the "omitempty" option specifies that -// the struct field should be omitted if the field value would have been -// encoded as a JSON null, empty string, empty object, or empty array. -// This option has no effect when unmarshaling. -// -// - string: The "string" option specifies that [StringifyNumbers] -// be set when marshaling or unmarshaling a struct field value. -// This causes numeric types to be encoded as a JSON number -// within a JSON string, and to be decoded from a JSON string -// containing the JSON number without any surrounding whitespace. -// This extra level of encoding is often necessary since -// many JSON parsers cannot precisely represent 64-bit integers. -// -// - case: When unmarshaling, the "case" option specifies how -// JSON object names are matched with the JSON name for Go struct fields. -// The option is a key-value pair specified as "case:value" where -// the value must either be 'ignore' or 'strict'. -// The 'ignore' value specifies that matching is case-insensitive -// where dashes and underscores are also ignored. If multiple fields match, -// the first declared field in breadth-first order takes precedence. -// The 'strict' value specifies that matching is case-sensitive. -// This takes precedence over the [MatchCaseInsensitiveNames] option. -// -// - inline: The "inline" option specifies that -// the JSON representable content of this field type is to be promoted -// as if they were specified in the parent struct. -// It is the JSON equivalent of Go struct embedding. -// A Go embedded field is implicitly inlined unless an explicit JSON name -// is specified. The inlined field must be a Go struct -// (that does not implement any JSON methods), [jsontext.Value], -// map[~string]T, or an unnamed pointer to such types. When marshaling, -// inlined fields from a pointer type are omitted if it is nil. -// Inlined fields of type [jsontext.Value] and map[~string]T are called -// “inlined fallbacks” as they can represent all possible -// JSON object members not directly handled by the parent struct. -// Only one inlined fallback field may be specified in a struct, -// while many non-fallback fields may be specified. This option -// must not be specified with any other option (including the JSON name). -// -// - unknown: The "unknown" option is a specialized variant -// of the inlined fallback to indicate that this Go struct field -// contains any number of unknown JSON object members. The field type must -// be a [jsontext.Value], map[~string]T, or an unnamed pointer to such types. -// If [DiscardUnknownMembers] is specified when marshaling, -// the contents of this field are ignored. -// If [RejectUnknownMembers] is specified when unmarshaling, -// any unknown object members are rejected regardless of whether -// an inlined fallback with the "unknown" option exists. This option -// must not be specified with any other option (including the JSON name). -// -// - format: The "format" option specifies a format flag -// used to specialize the formatting of the field value. -// The option is a key-value pair specified as "format:value" where -// the value must be either a literal consisting of letters and numbers -// (e.g., "format:RFC3339") or a single-quoted string literal -// (e.g., "format:'2006-01-02'"). The interpretation of the format flag -// is determined by the struct field type. -// -// The "omitzero" and "omitempty" options are mostly semantically identical. -// The former is defined in terms of the Go type system, -// while the latter in terms of the JSON type system. -// Consequently they behave differently in some circumstances. -// For example, only a nil slice or map is omitted under "omitzero", while -// an empty slice or map is omitted under "omitempty" regardless of nilness. -// The "omitzero" option is useful for types with a well-defined zero value -// (e.g., [net/netip.Addr]) or have an IsZero method (e.g., [time.Time.IsZero]). -// -// Every Go struct corresponds to a list of JSON representable fields -// which is constructed by performing a breadth-first search over -// all struct fields (excluding unexported or ignored fields), -// where the search recursively descends into inlined structs. -// The set of non-inlined fields in a struct must have unique JSON names. -// If multiple fields all have the same JSON name, then the one -// at shallowest depth takes precedence and the other fields at deeper depths -// are excluded from the list of JSON representable fields. -// If multiple fields at the shallowest depth have the same JSON name, -// but exactly one is explicitly tagged with a JSON name, -// then that field takes precedence and all others are excluded from the list. -// This is analogous to Go visibility rules for struct field selection -// with embedded struct types. -// -// Marshaling or unmarshaling a non-empty struct -// without any JSON representable fields results in a [SemanticError]. -// Unexported fields must not have any `json` tags except for `json:"-"`. -// -// # Security Considerations -// -// JSON is frequently used as a data interchange format to communicate -// between different systems, possibly implemented in different languages. -// For interoperability and security reasons, it is important that -// all implementations agree upon the semantic meaning of the data. -// -// [For example, suppose we have two micro-services.] -// The first service is responsible for authenticating a JSON request, -// while the second service is responsible for executing the request -// (having assumed that the prior service authenticated the request). -// If an attacker were able to maliciously craft a JSON request such that -// both services believe that the same request is from different users, -// it could bypass the authenticator with valid credentials for one user, -// but maliciously perform an action on behalf of a different user. -// -// According to RFC 8259, there unfortunately exist many JSON texts -// that are syntactically valid but semantically ambiguous. -// For example, the standard does not define how to interpret duplicate -// names within an object. -// -// The v1 [encoding/json] and [encoding/json/v2] packages -// interpret some inputs in different ways. In particular: -// -// - The standard specifies that JSON must be encoded using UTF-8. -// By default, v1 replaces invalid bytes of UTF-8 in JSON strings -// with the Unicode replacement character, -// while v2 rejects inputs with invalid UTF-8. -// To change the default, specify the [jsontext.AllowInvalidUTF8] option. -// The replacement of invalid UTF-8 is a form of data corruption -// that alters the precise meaning of strings. -// -// - The standard does not specify a particular behavior when -// duplicate names are encountered within a JSON object, -// which means that different implementations may behave differently. -// By default, v1 allows for the presence of duplicate names, -// while v2 rejects duplicate names. -// To change the default, specify the [jsontext.AllowDuplicateNames] option. -// If allowed, object members are processed in the order they are observed, -// meaning that later values will replace or be merged into prior values, -// depending on the Go value type. -// -// - The standard defines a JSON object as an unordered collection of name/value pairs. -// While ordering can be observed through the underlying [jsontext] API, -// both v1 and v2 generally avoid exposing the ordering. -// No application should semantically depend on the order of object members. -// Allowing duplicate names is a vector through which ordering of members -// can accidentally be observed and depended upon. -// -// - The standard suggests that JSON object names are typically compared -// based on equality of the sequence of Unicode code points, -// which implies that comparing names is often case-sensitive. -// When unmarshaling a JSON object into a Go struct, -// by default, v1 uses a (loose) case-insensitive match on the name, -// while v2 uses a (strict) case-sensitive match on the name. -// To change the default, specify the [MatchCaseInsensitiveNames] option. -// The use of case-insensitive matching provides another vector through -// which duplicate names can occur. Allowing case-insensitive matching -// means that v1 or v2 might interpret JSON objects differently from most -// other JSON implementations (which typically use a case-sensitive match). -// -// - The standard does not specify a particular behavior when -// an unknown name in a JSON object is encountered. -// When unmarshaling a JSON object into a Go struct, by default -// both v1 and v2 ignore unknown names and their corresponding values. -// To change the default, specify the [RejectUnknownMembers] option. -// -// - The standard suggests that implementations may use a float64 -// to represent a JSON number. Consequently, large JSON integers -// may lose precision when stored as a floating-point type. -// Both v1 and v2 correctly preserve precision when marshaling and -// unmarshaling a concrete integer type. However, even if v1 and v2 -// preserve precision for concrete types, other JSON implementations -// may not be able to preserve precision for outputs produced by v1 or v2. -// The `string` tag option can be used to specify that an integer type -// is to be quoted within a JSON string to avoid loss of precision. -// Furthermore, v1 and v2 may still lose precision when unmarshaling -// into an any interface value, where unmarshal uses a float64 -// by default to represent a JSON number. -// To change the default, specify the [WithUnmarshalers] option -// with a custom unmarshaler that pre-populates the interface value -// with a concrete Go type that can preserve precision. -// -// RFC 8785 specifies a canonical form for any JSON text, -// which explicitly defines specific behaviors that RFC 8259 leaves undefined. -// In theory, if a text can successfully [jsontext.Value.Canonicalize] -// without changing the semantic meaning of the data, then it provides a -// greater degree of confidence that the data is more secure and interoperable. -// -// The v2 API generally chooses more secure defaults than v1, -// but care should still be taken with large integers or unknown members. -// -// [For example, suppose we have two micro-services.]: https://www.youtube.com/watch?v=avilmOcHKHE&t=1057s -package json - -import ( - "encoding/json/jsontext" - "encoding/json/v2" - "io" -) - -// Marshal serializes a Go value as a []byte according to the provided -// marshal and encode options (while ignoring unmarshal or decode options). -// It does not terminate the output with a newline. -// -// Type-specific marshal functions and methods take precedence -// over the default representation of a value. -// Functions or methods that operate on *T are only called when encoding -// a value of type T (by taking its address) or a non-nil value of *T. -// Marshal ensures that a value is always addressable -// (by boxing it on the heap if necessary) so that -// these functions and methods can be consistently called. For performance, -// it is recommended that Marshal be passed a non-nil pointer to the value. -// -// The input value is encoded as JSON according the following rules: -// -// - If any type-specific functions in a [WithMarshalers] option match -// the value type, then those functions are called to encode the value. -// If all applicable functions return [SkipFunc], -// then the value is encoded according to subsequent rules. -// -// - If the value type implements [MarshalerTo], -// then the MarshalJSONTo method is called to encode the value. -// -// - If the value type implements [Marshaler], -// then the MarshalJSON method is called to encode the value. -// -// - If the value type implements [encoding.TextAppender], -// then the AppendText method is called to encode the value and -// subsequently encode its result as a JSON string. -// -// - If the value type implements [encoding.TextMarshaler], -// then the MarshalText method is called to encode the value and -// subsequently encode its result as a JSON string. -// -// - Otherwise, the value is encoded according to the value's type -// as described in detail below. -// -// Most Go types have a default JSON representation. -// Certain types support specialized formatting according to -// a format flag optionally specified in the Go struct tag -// for the struct field that contains the current value -// (see the “JSON Representation of Go structs” section for more details). -// -// The representation of each type is as follows: -// -// - A Go boolean is encoded as a JSON boolean (e.g., true or false). -// It does not support any custom format flags. -// -// - A Go string is encoded as a JSON string. -// It does not support any custom format flags. -// -// - A Go []byte or [N]byte is encoded as a JSON string containing -// the binary value encoded using RFC 4648. -// If the format is "base64" or unspecified, then this uses RFC 4648, section 4. -// If the format is "base64url", then this uses RFC 4648, section 5. -// If the format is "base32", then this uses RFC 4648, section 6. -// If the format is "base32hex", then this uses RFC 4648, section 7. -// If the format is "base16" or "hex", then this uses RFC 4648, section 8. -// If the format is "array", then the bytes value is encoded as a JSON array -// where each byte is recursively JSON-encoded as each JSON array element. -// -// - A Go integer is encoded as a JSON number without fractions or exponents. -// If [StringifyNumbers] is specified or encoding a JSON object name, -// then the JSON number is encoded within a JSON string. -// It does not support any custom format flags. -// -// - A Go float is encoded as a JSON number. -// If [StringifyNumbers] is specified or encoding a JSON object name, -// then the JSON number is encoded within a JSON string. -// If the format is "nonfinite", then NaN, +Inf, and -Inf are encoded as -// the JSON strings "NaN", "Infinity", and "-Infinity", respectively. -// Otherwise, the presence of non-finite numbers results in a [SemanticError]. -// -// - A Go map is encoded as a JSON object, where each Go map key and value -// is recursively encoded as a name and value pair in the JSON object. -// The Go map key must encode as a JSON string, otherwise this results -// in a [SemanticError]. The Go map is traversed in a non-deterministic order. -// For deterministic encoding, consider using the [Deterministic] option. -// If the format is "emitnull", then a nil map is encoded as a JSON null. -// If the format is "emitempty", then a nil map is encoded as an empty JSON object, -// regardless of whether [FormatNilMapAsNull] is specified. -// Otherwise by default, a nil map is encoded as an empty JSON object. -// -// - A Go struct is encoded as a JSON object. -// See the “JSON Representation of Go structs” section -// in the package-level documentation for more details. -// -// - A Go slice is encoded as a JSON array, where each Go slice element -// is recursively JSON-encoded as the elements of the JSON array. -// If the format is "emitnull", then a nil slice is encoded as a JSON null. -// If the format is "emitempty", then a nil slice is encoded as an empty JSON array, -// regardless of whether [FormatNilSliceAsNull] is specified. -// Otherwise by default, a nil slice is encoded as an empty JSON array. -// -// - A Go array is encoded as a JSON array, where each Go array element -// is recursively JSON-encoded as the elements of the JSON array. -// The JSON array length is always identical to the Go array length. -// It does not support any custom format flags. -// -// - A Go pointer is encoded as a JSON null if nil, otherwise it is -// the recursively JSON-encoded representation of the underlying value. -// Format flags are forwarded to the encoding of the underlying value. -// -// - A Go interface is encoded as a JSON null if nil, otherwise it is -// the recursively JSON-encoded representation of the underlying value. -// It does not support any custom format flags. -// -// - A Go [time.Time] is encoded as a JSON string containing the timestamp -// formatted in RFC 3339 with nanosecond precision. -// If the format matches one of the format constants declared -// in the time package (e.g., RFC1123), then that format is used. -// If the format is "unix", "unixmilli", "unixmicro", or "unixnano", -// then the timestamp is encoded as a possibly fractional JSON number -// of the number of seconds (or milliseconds, microseconds, or nanoseconds) -// since the Unix epoch, which is January 1st, 1970 at 00:00:00 UTC. -// To avoid a fractional component, round the timestamp to the relevant unit. -// Otherwise, the format is used as-is with [time.Time.Format] if non-empty. -// -// - A Go [time.Duration] currently has no default representation and -// requires an explicit format to be specified. -// If the format is "sec", "milli", "micro", or "nano", -// then the duration is encoded as a possibly fractional JSON number -// of the number of seconds (or milliseconds, microseconds, or nanoseconds). -// To avoid a fractional component, round the duration to the relevant unit. -// If the format is "units", it is encoded as a JSON string formatted using -// [time.Duration.String] (e.g., "1h30m" for 1 hour 30 minutes). -// If the format is "iso8601", it is encoded as a JSON string using the -// ISO 8601 standard for durations (e.g., "PT1H30M" for 1 hour 30 minutes) -// using only accurate units of hours, minutes, and seconds. -// -// - All other Go types (e.g., complex numbers, channels, and functions) -// have no default representation and result in a [SemanticError]. -// -// JSON cannot represent cyclic data structures and Marshal does not handle them. -// Passing cyclic structures will result in an error. -func Marshal(in any, opts ...Options) (out []byte, err error) { - return json.Marshal(in, opts...) -} - -// MarshalWrite serializes a Go value into an [io.Writer] according to the provided -// marshal and encode options (while ignoring unmarshal or decode options). -// It does not terminate the output with a newline. -// See [Marshal] for details about the conversion of a Go value into JSON. -func MarshalWrite(out io.Writer, in any, opts ...Options) (err error) { - return json.MarshalWrite(out, in, opts...) -} - -// MarshalEncode serializes a Go value into an [jsontext.Encoder] according to -// the provided marshal options (while ignoring unmarshal, encode, or decode options). -// Any marshal-relevant options already specified on the [jsontext.Encoder] -// take lower precedence than the set of options provided by the caller. -// Unlike [Marshal] and [MarshalWrite], encode options are ignored because -// they must have already been specified on the provided [jsontext.Encoder]. -// -// See [Marshal] for details about the conversion of a Go value into JSON. -func MarshalEncode(out *jsontext.Encoder, in any, opts ...Options) (err error) { - return json.MarshalEncode(out, in, opts...) -} - -// Unmarshal decodes a []byte input into a Go value according to the provided -// unmarshal and decode options (while ignoring marshal or encode options). -// The input must be a single JSON value with optional whitespace interspersed. -// The output must be a non-nil pointer. -// -// Type-specific unmarshal functions and methods take precedence -// over the default representation of a value. -// Functions or methods that operate on *T are only called when decoding -// a value of type T (by taking its address) or a non-nil value of *T. -// Unmarshal ensures that a value is always addressable -// (by boxing it on the heap if necessary) so that -// these functions and methods can be consistently called. -// -// The input is decoded into the output according the following rules: -// -// - If any type-specific functions in a [WithUnmarshalers] option match -// the value type, then those functions are called to decode the JSON -// value. If all applicable functions return [SkipFunc], -// then the input is decoded according to subsequent rules. -// -// - If the value type implements [UnmarshalerFrom], -// then the UnmarshalJSONFrom method is called to decode the JSON value. -// -// - If the value type implements [Unmarshaler], -// then the UnmarshalJSON method is called to decode the JSON value. -// -// - If the value type implements [encoding.TextUnmarshaler], -// then the input is decoded as a JSON string and -// the UnmarshalText method is called with the decoded string value. -// This fails with a [SemanticError] if the input is not a JSON string. -// -// - Otherwise, the JSON value is decoded according to the value's type -// as described in detail below. -// -// Most Go types have a default JSON representation. -// Certain types support specialized formatting according to -// a format flag optionally specified in the Go struct tag -// for the struct field that contains the current value -// (see the “JSON Representation of Go structs” section for more details). -// A JSON null may be decoded into every supported Go value where -// it is equivalent to storing the zero value of the Go value. -// If the input JSON kind is not handled by the current Go value type, -// then this fails with a [SemanticError]. Unless otherwise specified, -// the decoded value replaces any pre-existing value. -// -// The representation of each type is as follows: -// -// - A Go boolean is decoded from a JSON boolean (e.g., true or false). -// It does not support any custom format flags. -// -// - A Go string is decoded from a JSON string. -// It does not support any custom format flags. -// -// - A Go []byte or [N]byte is decoded from a JSON string -// containing the binary value encoded using RFC 4648. -// If the format is "base64" or unspecified, then this uses RFC 4648, section 4. -// If the format is "base64url", then this uses RFC 4648, section 5. -// If the format is "base32", then this uses RFC 4648, section 6. -// If the format is "base32hex", then this uses RFC 4648, section 7. -// If the format is "base16" or "hex", then this uses RFC 4648, section 8. -// If the format is "array", then the Go slice or array is decoded from a -// JSON array where each JSON element is recursively decoded for each byte. -// When decoding into a non-nil []byte, the slice length is reset to zero -// and the decoded input is appended to it. -// When decoding into a [N]byte, the input must decode to exactly N bytes, -// otherwise it fails with a [SemanticError]. -// -// - A Go integer is decoded from a JSON number. -// It must be decoded from a JSON string containing a JSON number -// if [StringifyNumbers] is specified or decoding a JSON object name. -// It fails with a [SemanticError] if the JSON number -// has a fractional or exponent component. -// It also fails if it overflows the representation of the Go integer type. -// It does not support any custom format flags. -// -// - A Go float is decoded from a JSON number. -// It must be decoded from a JSON string containing a JSON number -// if [StringifyNumbers] is specified or decoding a JSON object name. -// It fails if it overflows the representation of the Go float type. -// If the format is "nonfinite", then the JSON strings -// "NaN", "Infinity", and "-Infinity" are decoded as NaN, +Inf, and -Inf. -// Otherwise, the presence of such strings results in a [SemanticError]. -// -// - A Go map is decoded from a JSON object, -// where each JSON object name and value pair is recursively decoded -// as the Go map key and value. Maps are not cleared. -// If the Go map is nil, then a new map is allocated to decode into. -// If the decoded key matches an existing Go map entry, the entry value -// is reused by decoding the JSON object value into it. -// The formats "emitnull" and "emitempty" have no effect when decoding. -// -// - A Go struct is decoded from a JSON object. -// See the “JSON Representation of Go structs” section -// in the package-level documentation for more details. -// -// - A Go slice is decoded from a JSON array, where each JSON element -// is recursively decoded and appended to the Go slice. -// Before appending into a Go slice, a new slice is allocated if it is nil, -// otherwise the slice length is reset to zero. -// The formats "emitnull" and "emitempty" have no effect when decoding. -// -// - A Go array is decoded from a JSON array, where each JSON array element -// is recursively decoded as each corresponding Go array element. -// Each Go array element is zeroed before decoding into it. -// It fails with a [SemanticError] if the JSON array does not contain -// the exact same number of elements as the Go array. -// It does not support any custom format flags. -// -// - A Go pointer is decoded based on the JSON kind and underlying Go type. -// If the input is a JSON null, then this stores a nil pointer. -// Otherwise, it allocates a new underlying value if the pointer is nil, -// and recursively JSON decodes into the underlying value. -// Format flags are forwarded to the decoding of the underlying type. -// -// - A Go interface is decoded based on the JSON kind and underlying Go type. -// If the input is a JSON null, then this stores a nil interface value. -// Otherwise, a nil interface value of an empty interface type is initialized -// with a zero Go bool, string, float64, map[string]any, or []any if the -// input is a JSON boolean, string, number, object, or array, respectively. -// If the interface value is still nil, then this fails with a [SemanticError] -// since decoding could not determine an appropriate Go type to decode into. -// For example, unmarshaling into a nil io.Reader fails since -// there is no concrete type to populate the interface value with. -// Otherwise an underlying value exists and it recursively decodes -// the JSON input into it. It does not support any custom format flags. -// -// - A Go [time.Time] is decoded from a JSON string containing the time -// formatted in RFC 3339 with nanosecond precision. -// If the format matches one of the format constants declared in -// the time package (e.g., RFC1123), then that format is used for parsing. -// If the format is "unix", "unixmilli", "unixmicro", or "unixnano", -// then the timestamp is decoded from an optionally fractional JSON number -// of the number of seconds (or milliseconds, microseconds, or nanoseconds) -// since the Unix epoch, which is January 1st, 1970 at 00:00:00 UTC. -// Otherwise, the format is used as-is with [time.Time.Parse] if non-empty. -// -// - A Go [time.Duration] currently has no default representation and -// requires an explicit format to be specified. -// If the format is "sec", "milli", "micro", or "nano", -// then the duration is decoded from an optionally fractional JSON number -// of the number of seconds (or milliseconds, microseconds, or nanoseconds). -// If the format is "units", it is decoded from a JSON string parsed using -// [time.ParseDuration] (e.g., "1h30m" for 1 hour 30 minutes). -// If the format is "iso8601", it is decoded from a JSON string using the -// ISO 8601 standard for durations (e.g., "PT1H30M" for 1 hour 30 minutes) -// accepting only accurate units of hours, minutes, or seconds. -// -// - All other Go types (e.g., complex numbers, channels, and functions) -// have no default representation and result in a [SemanticError]. -// -// In general, unmarshaling follows merge semantics (similar to RFC 7396) -// where the decoded Go value replaces the destination value -// for any JSON kind other than an object. -// For JSON objects, the input object is merged into the destination value -// where matching object members recursively apply merge semantics. -func Unmarshal(in []byte, out any, opts ...Options) (err error) { - return json.Unmarshal(in, out, opts...) -} - -// UnmarshalRead deserializes a Go value from an [io.Reader] according to the -// provided unmarshal and decode options (while ignoring marshal or encode options). -// The input must be a single JSON value with optional whitespace interspersed. -// It consumes the entirety of [io.Reader] until [io.EOF] is encountered, -// without reporting an error for EOF. The output must be a non-nil pointer. -// See [Unmarshal] for details about the conversion of JSON into a Go value. -func UnmarshalRead(in io.Reader, out any, opts ...Options) (err error) { - return json.UnmarshalRead(in, out, opts...) -} - -// UnmarshalDecode deserializes a Go value from a [jsontext.Decoder] according to -// the provided unmarshal options (while ignoring marshal, encode, or decode options). -// Any unmarshal options already specified on the [jsontext.Decoder] -// take lower precedence than the set of options provided by the caller. -// Unlike [Unmarshal] and [UnmarshalRead], decode options are ignored because -// they must have already been specified on the provided [jsontext.Decoder]. -// -// The input may be a stream of one or more JSON values, -// where this only unmarshals the next JSON value in the stream. -// The output must be a non-nil pointer. -// See [Unmarshal] for details about the conversion of JSON into a Go value. -func UnmarshalDecode(in *jsontext.Decoder, out any, opts ...Options) (err error) { - return json.UnmarshalDecode(in, out, opts...) -} - -// Marshalers is a list of functions that may override the marshal behavior -// of specific types. Populate [WithMarshalers] to use it with -// [Marshal], [MarshalWrite], or [MarshalEncode]. -// A nil *Marshalers is equivalent to an empty list. -// There are no exported fields or methods on Marshalers. -type Marshalers = json.Marshalers - -// JoinMarshalers constructs a flattened list of marshal functions. -// If multiple functions in the list are applicable for a value of a given type, -// then those earlier in the list take precedence over those that come later. -// If a function returns [SkipFunc], then the next applicable function is called, -// otherwise the default marshaling behavior is used. -// -// For example: -// -// m1 := JoinMarshalers(f1, f2) -// m2 := JoinMarshalers(f0, m1, f3) // equivalent to m3 -// m3 := JoinMarshalers(f0, f1, f2, f3) // equivalent to m2 -func JoinMarshalers(ms ...*Marshalers) *Marshalers { - return json.JoinMarshalers(ms...) -} - -// Unmarshalers is a list of functions that may override the unmarshal behavior -// of specific types. Populate [WithUnmarshalers] to use it with -// [Unmarshal], [UnmarshalRead], or [UnmarshalDecode]. -// A nil *Unmarshalers is equivalent to an empty list. -// There are no exported fields or methods on Unmarshalers. -type Unmarshalers = json.Unmarshalers - -// JoinUnmarshalers constructs a flattened list of unmarshal functions. -// If multiple functions in the list are applicable for a value of a given type, -// then those earlier in the list take precedence over those that come later. -// If a function returns [SkipFunc], then the next applicable function is called, -// otherwise the default unmarshaling behavior is used. -// -// For example: -// -// u1 := JoinUnmarshalers(f1, f2) -// u2 := JoinUnmarshalers(f0, u1, f3) // equivalent to u3 -// u3 := JoinUnmarshalers(f0, f1, f2, f3) // equivalent to u2 -func JoinUnmarshalers(us ...*Unmarshalers) *Unmarshalers { - return json.JoinUnmarshalers(us...) -} - -// MarshalFunc constructs a type-specific marshaler that -// specifies how to marshal values of type T. -// T can be any type except a named pointer. -// The function is always provided with a non-nil pointer value -// if T is an interface or pointer type. -// -// The function must marshal exactly one JSON value. -// The value of T must not be retained outside the function call. -// It may not return [SkipFunc]. -func MarshalFunc[T any](fn func(T) ([]byte, error)) *Marshalers { - return json.MarshalFunc[T](fn) -} - -// MarshalToFunc constructs a type-specific marshaler that -// specifies how to marshal values of type T. -// T can be any type except a named pointer. -// The function is always provided with a non-nil pointer value -// if T is an interface or pointer type. -// -// The function must marshal exactly one JSON value by calling write methods -// on the provided encoder. It may return [SkipFunc] such that marshaling can -// move on to the next marshal function. However, no mutable method calls may -// be called on the encoder if [SkipFunc] is returned. -// The pointer to [jsontext.Encoder] and the value of T -// must not be retained outside the function call. -func MarshalToFunc[T any](fn func(*jsontext.Encoder, T) error) *Marshalers { - return json.MarshalToFunc[T](fn) -} - -// UnmarshalFunc constructs a type-specific unmarshaler that -// specifies how to unmarshal values of type T. -// T must be an unnamed pointer or an interface type. -// The function is always provided with a non-nil pointer value. -// -// The function must unmarshal exactly one JSON value. -// The input []byte must not be mutated. -// The input []byte and value T must not be retained outside the function call. -// It may not return [SkipFunc]. -func UnmarshalFunc[T any](fn func([]byte, T) error) *Unmarshalers { - return json.UnmarshalFunc[T](fn) -} - -// UnmarshalFromFunc constructs a type-specific unmarshaler that -// specifies how to unmarshal values of type T. -// T must be an unnamed pointer or an interface type. -// The function is always provided with a non-nil pointer value. -// -// The function must unmarshal exactly one JSON value by calling read methods -// on the provided decoder. It may return [SkipFunc] such that unmarshaling can -// move on to the next unmarshal function. However, no mutable method calls may -// be called on the decoder if [SkipFunc] is returned. -// The pointer to [jsontext.Decoder] and the value of T -// must not be retained outside the function call. -func UnmarshalFromFunc[T any](fn func(*jsontext.Decoder, T) error) *Unmarshalers { - return json.UnmarshalFromFunc[T](fn) -} - -// Marshaler is implemented by types that can marshal themselves. -// It is recommended that types implement [MarshalerTo] unless the implementation -// is trying to avoid a hard dependency on the "jsontext" package. -// -// It is recommended that implementations return a buffer that is safe -// for the caller to retain and potentially mutate. -type Marshaler = json.Marshaler - -// MarshalerTo is implemented by types that can marshal themselves. -// It is recommended that types implement MarshalerTo instead of [Marshaler] -// since this is both more performant and flexible. -// If a type implements both Marshaler and MarshalerTo, -// then MarshalerTo takes precedence. In such a case, both implementations -// should aim to have equivalent behavior for the default marshal options. -// -// The implementation must write only one JSON value to the Encoder and -// must not retain the pointer to [jsontext.Encoder]. -type MarshalerTo = json.MarshalerTo - -// Unmarshaler is implemented by types that can unmarshal themselves. -// It is recommended that types implement [UnmarshalerFrom] unless the implementation -// is trying to avoid a hard dependency on the "jsontext" package. -// -// The input can be assumed to be a valid encoding of a JSON value -// if called from unmarshal functionality in this package. -// UnmarshalJSON must copy the JSON data if it is retained after returning. -// It is recommended that UnmarshalJSON implement merge semantics when -// unmarshaling into a pre-populated value. -// -// Implementations must not retain or mutate the input []byte. -type Unmarshaler = json.Unmarshaler - -// UnmarshalerFrom is implemented by types that can unmarshal themselves. -// It is recommended that types implement UnmarshalerFrom instead of [Unmarshaler] -// since this is both more performant and flexible. -// If a type implements both Unmarshaler and UnmarshalerFrom, -// then UnmarshalerFrom takes precedence. In such a case, both implementations -// should aim to have equivalent behavior for the default unmarshal options. -// -// The implementation must read only one JSON value from the Decoder. -// It is recommended that UnmarshalJSONFrom implement merge semantics when -// unmarshaling into a pre-populated value. -// -// Implementations must not retain the pointer to [jsontext.Decoder]. -type UnmarshalerFrom = json.UnmarshalerFrom - -// ErrUnknownName indicates that a JSON object member could not be -// unmarshaled because the name is not known to the target Go struct. -// This error is directly wrapped within a [SemanticError] when produced. -// -// The name of an unknown JSON object member can be extracted as: -// -// err := ... -// var serr json.SemanticError -// if errors.As(err, &serr) && serr.Err == json.ErrUnknownName { -// ptr := serr.JSONPointer // JSON pointer to unknown name -// name := ptr.LastToken() // unknown name itself -// ... -// } -// -// This error is only returned if [RejectUnknownMembers] is true. -var ErrUnknownName = json.ErrUnknownName - -// SemanticError describes an error determining the meaning -// of JSON data as Go data or vice-versa. -// -// The contents of this error as produced by this package may change over time. -type SemanticError = json.SemanticError - -// Options configure [Marshal], [MarshalWrite], [MarshalEncode], -// [Unmarshal], [UnmarshalRead], and [UnmarshalDecode] with specific features. -// Each function takes in a variadic list of options, where properties -// set in later options override the value of previously set properties. -// -// The Options type is identical to [encoding/json.Options] and -// [encoding/json/jsontext.Options]. Options from the other packages can -// be used interchangeably with functionality in this package. -// -// Options represent either a singular option or a set of options. -// It can be functionally thought of as a Go map of option properties -// (even though the underlying implementation avoids Go maps for performance). -// -// The constructors (e.g., [Deterministic]) return a singular option value: -// -// opt := Deterministic(true) -// -// which is analogous to creating a single entry map: -// -// opt := Options{"Deterministic": true} -// -// [JoinOptions] composes multiple options values to together: -// -// out := JoinOptions(opts...) -// -// which is analogous to making a new map and copying the options over: -// -// out := make(Options) -// for _, m := range opts { -// for k, v := range m { -// out[k] = v -// } -// } -// -// [GetOption] looks up the value of options parameter: -// -// v, ok := GetOption(opts, Deterministic) -// -// which is analogous to a Go map lookup: -// -// v, ok := Options["Deterministic"] -// -// There is a single Options type, which is used with both marshal and unmarshal. -// Some options affect both operations, while others only affect one operation: -// -// - [StringifyNumbers] affects marshaling and unmarshaling -// - [Deterministic] affects marshaling only -// - [FormatNilSliceAsNull] affects marshaling only -// - [FormatNilMapAsNull] affects marshaling only -// - [OmitZeroStructFields] affects marshaling only -// - [MatchCaseInsensitiveNames] affects marshaling and unmarshaling -// - [DiscardUnknownMembers] affects marshaling only -// - [RejectUnknownMembers] affects unmarshaling only -// - [WithMarshalers] affects marshaling only -// - [WithUnmarshalers] affects unmarshaling only -// -// Options that do not affect a particular operation are ignored. -type Options = json.Options - -// JoinOptions coalesces the provided list of options into a single Options. -// Properties set in later options override the value of previously set properties. -func JoinOptions(srcs ...Options) Options { - return json.JoinOptions(srcs...) -} - -// GetOption returns the value stored in opts with the provided setter, -// reporting whether the value is present. -// -// Example usage: -// -// v, ok := json.GetOption(opts, json.Deterministic) -// -// Options are most commonly introspected to alter the JSON representation of -// [MarshalerTo.MarshalJSONTo] and [UnmarshalerFrom.UnmarshalJSONFrom] methods, and -// [MarshalToFunc] and [UnmarshalFromFunc] functions. -// In such cases, the presence bit should generally be ignored. -func GetOption[T any](opts Options, setter func(T) Options) (T, bool) { - return json.GetOption[T](opts, setter) -} - -// DefaultOptionsV2 is the full set of all options that define v2 semantics. -// It is equivalent to all options under [Options], [encoding/json.Options], -// and [encoding/json/jsontext.Options] being set to false or the zero value, -// except for the options related to whitespace formatting. -func DefaultOptionsV2() Options { - return json.DefaultOptionsV2() -} - -// StringifyNumbers specifies that numeric Go types should be marshaled -// as a JSON string containing the equivalent JSON number value. -// When unmarshaling, numeric Go types are parsed from a JSON string -// containing the JSON number without any surrounding whitespace. -// -// According to RFC 8259, section 6, a JSON implementation may choose to -// limit the representation of a JSON number to an IEEE 754 binary64 value. -// This may cause decoders to lose precision for int64 and uint64 types. -// Quoting JSON numbers as a JSON string preserves the exact precision. -// -// This affects either marshaling or unmarshaling. -func StringifyNumbers(v bool) Options { - return json.StringifyNumbers(v) -} - -// Deterministic specifies that the same input value will be serialized -// as the exact same output bytes. Different processes of -// the same program will serialize equal values to the same bytes, -// but different versions of the same program are not guaranteed -// to produce the exact same sequence of bytes. -// -// This only affects marshaling and is ignored when unmarshaling. -func Deterministic(v bool) Options { - return json.Deterministic(v) -} - -// FormatNilSliceAsNull specifies that a nil Go slice should marshal as a -// JSON null instead of the default representation as an empty JSON array -// (or an empty JSON string in the case of ~[]byte). -// Slice fields explicitly marked with `format:emitempty` still marshal -// as an empty JSON array. -// -// This only affects marshaling and is ignored when unmarshaling. -func FormatNilSliceAsNull(v bool) Options { - return json.FormatNilSliceAsNull(v) -} - -// FormatNilMapAsNull specifies that a nil Go map should marshal as a -// JSON null instead of the default representation as an empty JSON object. -// Map fields explicitly marked with `format:emitempty` still marshal -// as an empty JSON object. -// -// This only affects marshaling and is ignored when unmarshaling. -func FormatNilMapAsNull(v bool) Options { - return json.FormatNilMapAsNull(v) -} - -// OmitZeroStructFields specifies that a Go struct should marshal in such a way -// that all struct fields that are zero are omitted from the marshaled output -// if the value is zero as determined by the "IsZero() bool" method if present, -// otherwise based on whether the field is the zero Go value. -// This is semantically equivalent to specifying the `omitzero` tag option -// on every field in a Go struct. -// -// This only affects marshaling and is ignored when unmarshaling. -func OmitZeroStructFields(v bool) Options { - return json.OmitZeroStructFields(v) -} - -// MatchCaseInsensitiveNames specifies that JSON object members are matched -// against Go struct fields using a case-insensitive match of the name. -// Go struct fields explicitly marked with `case:strict` or `case:ignore` -// always use case-sensitive (or case-insensitive) name matching, -// regardless of the value of this option. -// -// This affects either marshaling or unmarshaling. -// For marshaling, this option may alter the detection of duplicate names -// (assuming [jsontext.AllowDuplicateNames] is false) from inlined fields -// if it matches one of the declared fields in the Go struct. -func MatchCaseInsensitiveNames(v bool) Options { - return json.MatchCaseInsensitiveNames(v) -} - -// RejectUnknownMembers specifies that unknown members should be rejected -// when unmarshaling a JSON object, regardless of whether there is a field -// to store unknown members. -// -// This only affects unmarshaling and is ignored when marshaling. -func RejectUnknownMembers(v bool) Options { - return json.RejectUnknownMembers(v) -} - -// WithMarshalers specifies a list of type-specific marshalers to use, -// which can be used to override the default marshal behavior for values -// of particular types. -// -// This only affects marshaling and is ignored when unmarshaling. -func WithMarshalers(v *Marshalers) Options { - return json.WithMarshalers(v) -} - -// WithUnmarshalers specifies a list of type-specific unmarshalers to use, -// which can be used to override the default unmarshal behavior for values -// of particular types. -// -// This only affects unmarshaling and is ignored when marshaling. -func WithUnmarshalers(v *Unmarshalers) Options { - return json.WithUnmarshalers(v) -} diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal.go index 85d5303891..dbf92432dd 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package json import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_any.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_any.go index 22ed430fb5..fd034c1a1b 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_any.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_any.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package json import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_default.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_default.go index 64d2b7a9b6..3f21c8d350 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_default.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_default.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package json import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_funcs.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_funcs.go index 1f5d018689..50dca26b88 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_funcs.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_funcs.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package json import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_inlined.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_inlined.go index f73ed32405..4509b87e41 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_inlined.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_inlined.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package json import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_methods.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_methods.go index d6736342ba..42d6ee8762 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_methods.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_methods.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package json import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_time.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_time.go index 4d328ebee3..30dd584d12 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_time.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_time.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package json import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/doc.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/doc.go index a463168589..ff70951ab5 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/doc.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/doc.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - // Package json implements semantic processing of JSON as specified in RFC 8259. // JSON is a simple data interchange format that can represent // primitive data types such as booleans, strings, and numbers, diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/errors.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/errors.go index 5b5d5f93aa..1df765384d 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/errors.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/errors.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package json import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/fields.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/fields.go index 045c6988a6..d539feedd1 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/fields.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/fields.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package json import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/fold.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/fold.go index 973f52e73a..9ab735814c 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/fold.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/fold.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package json import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/intern.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/intern.go index 1bfb8ca633..42fc3d4719 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/intern.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/intern.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package json import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/internal.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/internal.go index 00b43fa307..05801c6b25 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/internal.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/internal.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package internal import "errors" diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonflags/flags.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonflags/flags.go index 36300011e7..810128b516 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonflags/flags.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonflags/flags.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - // jsonflags implements all the optional boolean flags. // These flags are shared across both "json", "jsontext", and "jsonopts". package jsonflags diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonopts/options.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonopts/options.go index c4fc8dba8c..142653518d 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonopts/options.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonopts/options.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package jsonopts import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/decode.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/decode.go index 6a5acb8ec0..02787719ca 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/decode.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/decode.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package jsonwire import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/encode.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/encode.go index e74ed713ea..35b238a2e2 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/encode.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/encode.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package jsonwire import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/wire.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/wire.go index a0622c65b8..1831a66bde 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/wire.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/wire.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - // Package jsonwire implements stateless functionality for handling JSON text. package jsonwire diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/alias.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/alias.go deleted file mode 100644 index dc18d5d55d..0000000000 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/alias.go +++ /dev/null @@ -1,536 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Code generated by alias_gen.go; DO NOT EDIT. - -//go:build goexperiment.jsonv2 && go1.25 - -// Package jsontext implements syntactic processing of JSON -// as specified in RFC 4627, RFC 7159, RFC 7493, RFC 8259, and RFC 8785. -// JSON is a simple data interchange format that can represent -// primitive data types such as booleans, strings, and numbers, -// in addition to structured data types such as objects and arrays. -// -// The [Encoder] and [Decoder] types are used to encode or decode -// a stream of JSON tokens or values. -// -// # Tokens and Values -// -// A JSON token refers to the basic structural elements of JSON: -// -// - a JSON literal (i.e., null, true, or false) -// - a JSON string (e.g., "hello, world!") -// - a JSON number (e.g., 123.456) -// - a begin or end delimiter for a JSON object (i.e., '{' or '}') -// - a begin or end delimiter for a JSON array (i.e., '[' or ']') -// -// A JSON token is represented by the [Token] type in Go. Technically, -// there are two additional structural characters (i.e., ':' and ','), -// but there is no [Token] representation for them since their presence -// can be inferred by the structure of the JSON grammar itself. -// For example, there must always be an implicit colon between -// the name and value of a JSON object member. -// -// A JSON value refers to a complete unit of JSON data: -// -// - a JSON literal, string, or number -// - a JSON object (e.g., `{"name":"value"}`) -// - a JSON array (e.g., `[1,2,3,]`) -// -// A JSON value is represented by the [Value] type in Go and is a []byte -// containing the raw textual representation of the value. There is some overlap -// between tokens and values as both contain literals, strings, and numbers. -// However, only a value can represent the entirety of a JSON object or array. -// -// The [Encoder] and [Decoder] types contain methods to read or write the next -// [Token] or [Value] in a sequence. They maintain a state machine to validate -// whether the sequence of JSON tokens and/or values produces a valid JSON. -// [Options] may be passed to the [NewEncoder] or [NewDecoder] constructors -// to configure the syntactic behavior of encoding and decoding. -// -// # Terminology -// -// The terms "encode" and "decode" are used for syntactic functionality -// that is concerned with processing JSON based on its grammar, and -// the terms "marshal" and "unmarshal" are used for semantic functionality -// that determines the meaning of JSON values as Go values and vice-versa. -// This package (i.e., [jsontext]) deals with JSON at a syntactic layer, -// while [encoding/json/v2] deals with JSON at a semantic layer. -// The goal is to provide a clear distinction between functionality that -// is purely concerned with encoding versus that of marshaling. -// For example, one can directly encode a stream of JSON tokens without -// needing to marshal a concrete Go value representing them. -// Similarly, one can decode a stream of JSON tokens without -// needing to unmarshal them into a concrete Go value. -// -// This package uses JSON terminology when discussing JSON, which may differ -// from related concepts in Go or elsewhere in computing literature. -// -// - a JSON "object" refers to an unordered collection of name/value members. -// - a JSON "array" refers to an ordered sequence of elements. -// - a JSON "value" refers to either a literal (i.e., null, false, or true), -// string, number, object, or array. -// -// See RFC 8259 for more information. -// -// # Specifications -// -// Relevant specifications include RFC 4627, RFC 7159, RFC 7493, RFC 8259, -// and RFC 8785. Each RFC is generally a stricter subset of another RFC. -// In increasing order of strictness: -// -// - RFC 4627 and RFC 7159 do not require (but recommend) the use of UTF-8 -// and also do not require (but recommend) that object names be unique. -// - RFC 8259 requires the use of UTF-8, -// but does not require (but recommends) that object names be unique. -// - RFC 7493 requires the use of UTF-8 -// and also requires that object names be unique. -// - RFC 8785 defines a canonical representation. It requires the use of UTF-8 -// and also requires that object names be unique and in a specific ordering. -// It specifies exactly how strings and numbers must be formatted. -// -// The primary difference between RFC 4627 and RFC 7159 is that the former -// restricted top-level values to only JSON objects and arrays, while -// RFC 7159 and subsequent RFCs permit top-level values to additionally be -// JSON nulls, booleans, strings, or numbers. -// -// By default, this package operates on RFC 7493, but can be configured -// to operate according to the other RFC specifications. -// RFC 7493 is a stricter subset of RFC 8259 and fully compliant with it. -// In particular, it makes specific choices about behavior that RFC 8259 -// leaves as undefined in order to ensure greater interoperability. -// -// # Security Considerations -// -// See the "Security Considerations" section in [encoding/json/v2]. -package jsontext - -import ( - "encoding/json/jsontext" - "io" -) - -// Decoder is a streaming decoder for raw JSON tokens and values. -// It is used to read a stream of top-level JSON values, -// each separated by optional whitespace characters. -// -// [Decoder.ReadToken] and [Decoder.ReadValue] calls may be interleaved. -// For example, the following JSON value: -// -// {"name":"value","array":[null,false,true,3.14159],"object":{"k":"v"}} -// -// can be parsed with the following calls (ignoring errors for brevity): -// -// d.ReadToken() // { -// d.ReadToken() // "name" -// d.ReadToken() // "value" -// d.ReadValue() // "array" -// d.ReadToken() // [ -// d.ReadToken() // null -// d.ReadToken() // false -// d.ReadValue() // true -// d.ReadToken() // 3.14159 -// d.ReadToken() // ] -// d.ReadValue() // "object" -// d.ReadValue() // {"k":"v"} -// d.ReadToken() // } -// -// The above is one of many possible sequence of calls and -// may not represent the most sensible method to call for any given token/value. -// For example, it is probably more common to call [Decoder.ReadToken] to obtain a -// string token for object names. -type Decoder = jsontext.Decoder - -// NewDecoder constructs a new streaming decoder reading from r. -// -// If r is a [bytes.Buffer], then the decoder parses directly from the buffer -// without first copying the contents to an intermediate buffer. -// Additional writes to the buffer must not occur while the decoder is in use. -func NewDecoder(r io.Reader, opts ...Options) *Decoder { - return jsontext.NewDecoder(r, opts...) -} - -// Encoder is a streaming encoder from raw JSON tokens and values. -// It is used to write a stream of top-level JSON values, -// each terminated with a newline character. -// -// [Encoder.WriteToken] and [Encoder.WriteValue] calls may be interleaved. -// For example, the following JSON value: -// -// {"name":"value","array":[null,false,true,3.14159],"object":{"k":"v"}} -// -// can be composed with the following calls (ignoring errors for brevity): -// -// e.WriteToken(BeginObject) // { -// e.WriteToken(String("name")) // "name" -// e.WriteToken(String("value")) // "value" -// e.WriteValue(Value(`"array"`)) // "array" -// e.WriteToken(BeginArray) // [ -// e.WriteToken(Null) // null -// e.WriteToken(False) // false -// e.WriteValue(Value("true")) // true -// e.WriteToken(Float(3.14159)) // 3.14159 -// e.WriteToken(EndArray) // ] -// e.WriteValue(Value(`"object"`)) // "object" -// e.WriteValue(Value(`{"k":"v"}`)) // {"k":"v"} -// e.WriteToken(EndObject) // } -// -// The above is one of many possible sequence of calls and -// may not represent the most sensible method to call for any given token/value. -// For example, it is probably more common to call [Encoder.WriteToken] with a string -// for object names. -type Encoder = jsontext.Encoder - -// NewEncoder constructs a new streaming encoder writing to w -// configured with the provided options. -// It flushes the internal buffer when the buffer is sufficiently full or -// when a top-level value has been written. -// -// If w is a [bytes.Buffer], then the encoder appends directly into the buffer -// without copying the contents from an intermediate buffer. -func NewEncoder(w io.Writer, opts ...Options) *Encoder { - return jsontext.NewEncoder(w, opts...) -} - -// SyntacticError is a description of a syntactic error that occurred when -// encoding or decoding JSON according to the grammar. -// -// The contents of this error as produced by this package may change over time. -type SyntacticError = jsontext.SyntacticError - -// Options configures [NewEncoder], [Encoder.Reset], [NewDecoder], -// and [Decoder.Reset] with specific features. -// Each function takes in a variadic list of options, where properties -// set in latter options override the value of previously set properties. -// -// There is a single Options type, which is used with both encoding and decoding. -// Some options affect both operations, while others only affect one operation: -// -// - [AllowDuplicateNames] affects encoding and decoding -// - [AllowInvalidUTF8] affects encoding and decoding -// - [EscapeForHTML] affects encoding only -// - [EscapeForJS] affects encoding only -// - [PreserveRawStrings] affects encoding only -// - [CanonicalizeRawInts] affects encoding only -// - [CanonicalizeRawFloats] affects encoding only -// - [ReorderRawObjects] affects encoding only -// - [SpaceAfterColon] affects encoding only -// - [SpaceAfterComma] affects encoding only -// - [Multiline] affects encoding only -// - [WithIndent] affects encoding only -// - [WithIndentPrefix] affects encoding only -// -// Options that do not affect a particular operation are ignored. -// -// The Options type is identical to [encoding/json.Options] and -// [encoding/json/v2.Options]. Options from the other packages may -// be passed to functionality in this package, but are ignored. -// Options from this package may be used with the other packages. -type Options = jsontext.Options - -// AllowDuplicateNames specifies that JSON objects may contain -// duplicate member names. Disabling the duplicate name check may provide -// performance benefits, but breaks compliance with RFC 7493, section 2.3. -// The input or output will still be compliant with RFC 8259, -// which leaves the handling of duplicate names as unspecified behavior. -// -// This affects either encoding or decoding. -func AllowDuplicateNames(v bool) Options { - return jsontext.AllowDuplicateNames(v) -} - -// AllowInvalidUTF8 specifies that JSON strings may contain invalid UTF-8, -// which will be mangled as the Unicode replacement character, U+FFFD. -// This causes the encoder or decoder to break compliance with -// RFC 7493, section 2.1, and RFC 8259, section 8.1. -// -// This affects either encoding or decoding. -func AllowInvalidUTF8(v bool) Options { - return jsontext.AllowInvalidUTF8(v) -} - -// EscapeForHTML specifies that '<', '>', and '&' characters within JSON strings -// should be escaped as a hexadecimal Unicode codepoint (e.g., \u003c) so that -// the output is safe to embed within HTML. -// -// This only affects encoding and is ignored when decoding. -func EscapeForHTML(v bool) Options { - return jsontext.EscapeForHTML(v) -} - -// EscapeForJS specifies that U+2028 and U+2029 characters within JSON strings -// should be escaped as a hexadecimal Unicode codepoint (e.g., \u2028) so that -// the output is valid to embed within JavaScript. See RFC 8259, section 12. -// -// This only affects encoding and is ignored when decoding. -func EscapeForJS(v bool) Options { - return jsontext.EscapeForJS(v) -} - -// PreserveRawStrings specifies that when encoding a raw JSON string in a -// [Token] or [Value], pre-escaped sequences -// in a JSON string are preserved to the output. -// However, raw strings still respect [EscapeForHTML] and [EscapeForJS] -// such that the relevant characters are escaped. -// If [AllowInvalidUTF8] is enabled, bytes of invalid UTF-8 -// are preserved to the output. -// -// This only affects encoding and is ignored when decoding. -func PreserveRawStrings(v bool) Options { - return jsontext.PreserveRawStrings(v) -} - -// CanonicalizeRawInts specifies that when encoding a raw JSON -// integer number (i.e., a number without a fraction and exponent) in a -// [Token] or [Value], the number is canonicalized -// according to RFC 8785, section 3.2.2.3. As a special case, -// the number -0 is canonicalized as 0. -// -// JSON numbers are treated as IEEE 754 double precision numbers. -// Any numbers with precision beyond what is representable by that form -// will lose their precision when canonicalized. For example, -// integer values beyond ±2⁵³ will lose their precision. -// For example, 1234567890123456789 is formatted as 1234567890123456800. -// -// This only affects encoding and is ignored when decoding. -func CanonicalizeRawInts(v bool) Options { - return jsontext.CanonicalizeRawInts(v) -} - -// CanonicalizeRawFloats specifies that when encoding a raw JSON -// floating-point number (i.e., a number with a fraction or exponent) in a -// [Token] or [Value], the number is canonicalized -// according to RFC 8785, section 3.2.2.3. As a special case, -// the number -0 is canonicalized as 0. -// -// JSON numbers are treated as IEEE 754 double precision numbers. -// It is safe to canonicalize a serialized single precision number and -// parse it back as a single precision number and expect the same value. -// If a number exceeds ±1.7976931348623157e+308, which is the maximum -// finite number, then it saturated at that value and formatted as such. -// -// This only affects encoding and is ignored when decoding. -func CanonicalizeRawFloats(v bool) Options { - return jsontext.CanonicalizeRawFloats(v) -} - -// ReorderRawObjects specifies that when encoding a raw JSON object in a -// [Value], the object members are reordered according to -// RFC 8785, section 3.2.3. -// -// This only affects encoding and is ignored when decoding. -func ReorderRawObjects(v bool) Options { - return jsontext.ReorderRawObjects(v) -} - -// SpaceAfterColon specifies that the JSON output should emit a space character -// after each colon separator following a JSON object name. -// If false, then no space character appears after the colon separator. -// -// This only affects encoding and is ignored when decoding. -func SpaceAfterColon(v bool) Options { - return jsontext.SpaceAfterColon(v) -} - -// SpaceAfterComma specifies that the JSON output should emit a space character -// after each comma separator following a JSON object value or array element. -// If false, then no space character appears after the comma separator. -// -// This only affects encoding and is ignored when decoding. -func SpaceAfterComma(v bool) Options { - return jsontext.SpaceAfterComma(v) -} - -// Multiline specifies that the JSON output should expand to multiple lines, -// where every JSON object member or JSON array element appears on -// a new, indented line according to the nesting depth. -// -// If [SpaceAfterColon] is not specified, then the default is true. -// If [SpaceAfterComma] is not specified, then the default is false. -// If [WithIndent] is not specified, then the default is "\t". -// -// If set to false, then the output is a single-line, -// where the only whitespace emitted is determined by the current -// values of [SpaceAfterColon] and [SpaceAfterComma]. -// -// This only affects encoding and is ignored when decoding. -func Multiline(v bool) Options { - return jsontext.Multiline(v) -} - -// WithIndent specifies that the encoder should emit multiline output -// where each element in a JSON object or array begins on a new, indented line -// beginning with the indent prefix (see [WithIndentPrefix]) -// followed by one or more copies of indent according to the nesting depth. -// The indent must only be composed of space or tab characters. -// -// If the intent to emit indented output without a preference for -// the particular indent string, then use [Multiline] instead. -// -// This only affects encoding and is ignored when decoding. -// Use of this option implies [Multiline] being set to true. -func WithIndent(indent string) Options { - return jsontext.WithIndent(indent) -} - -// WithIndentPrefix specifies that the encoder should emit multiline output -// where each element in a JSON object or array begins on a new, indented line -// beginning with the indent prefix followed by one or more copies of indent -// (see [WithIndent]) according to the nesting depth. -// The prefix must only be composed of space or tab characters. -// -// This only affects encoding and is ignored when decoding. -// Use of this option implies [Multiline] being set to true. -func WithIndentPrefix(prefix string) Options { - return jsontext.WithIndentPrefix(prefix) -} - -// AppendQuote appends a double-quoted JSON string literal representing src -// to dst and returns the extended buffer. -// It uses the minimal string representation per RFC 8785, section 3.2.2.2. -// Invalid UTF-8 bytes are replaced with the Unicode replacement character -// and an error is returned at the end indicating the presence of invalid UTF-8. -// The dst must not overlap with the src. -func AppendQuote[Bytes ~[]byte | ~string](dst []byte, src Bytes) ([]byte, error) { - return jsontext.AppendQuote[Bytes](dst, src) -} - -// AppendUnquote appends the decoded interpretation of src as a -// double-quoted JSON string literal to dst and returns the extended buffer. -// The input src must be a JSON string without any surrounding whitespace. -// Invalid UTF-8 bytes are replaced with the Unicode replacement character -// and an error is returned at the end indicating the presence of invalid UTF-8. -// Any trailing bytes after the JSON string literal results in an error. -// The dst must not overlap with the src. -func AppendUnquote[Bytes ~[]byte | ~string](dst []byte, src Bytes) ([]byte, error) { - return jsontext.AppendUnquote[Bytes](dst, src) -} - -// ErrDuplicateName indicates that a JSON token could not be -// encoded or decoded because it results in a duplicate JSON object name. -// This error is directly wrapped within a [SyntacticError] when produced. -// -// The name of a duplicate JSON object member can be extracted as: -// -// err := ... -// var serr jsontext.SyntacticError -// if errors.As(err, &serr) && serr.Err == jsontext.ErrDuplicateName { -// ptr := serr.JSONPointer // JSON pointer to duplicate name -// name := ptr.LastToken() // duplicate name itself -// ... -// } -// -// This error is only returned if [AllowDuplicateNames] is false. -var ErrDuplicateName = jsontext.ErrDuplicateName - -// ErrNonStringName indicates that a JSON token could not be -// encoded or decoded because it is not a string, -// as required for JSON object names according to RFC 8259, section 4. -// This error is directly wrapped within a [SyntacticError] when produced. -var ErrNonStringName = jsontext.ErrNonStringName - -// Pointer is a JSON Pointer (RFC 6901) that references a particular JSON value -// relative to the root of the top-level JSON value. -// -// A Pointer is a slash-separated list of tokens, where each token is -// either a JSON object name or an index to a JSON array element -// encoded as a base-10 integer value. -// It is impossible to distinguish between an array index and an object name -// (that happens to be an base-10 encoded integer) without also knowing -// the structure of the top-level JSON value that the pointer refers to. -// -// There is exactly one representation of a pointer to a particular value, -// so comparability of Pointer values is equivalent to checking whether -// they both point to the exact same value. -type Pointer = jsontext.Pointer - -// Token represents a lexical JSON token, which may be one of the following: -// - a JSON literal (i.e., null, true, or false) -// - a JSON string (e.g., "hello, world!") -// - a JSON number (e.g., 123.456) -// - a begin or end delimiter for a JSON object (i.e., { or } ) -// - a begin or end delimiter for a JSON array (i.e., [ or ] ) -// -// A Token cannot represent entire array or object values, while a [Value] can. -// There is no Token to represent commas and colons since -// these structural tokens can be inferred from the surrounding context. -type Token = jsontext.Token - -var ( - Null = jsontext.Null - False = jsontext.False - True = jsontext.True - BeginObject = jsontext.BeginObject - EndObject = jsontext.EndObject - BeginArray = jsontext.BeginArray - EndArray = jsontext.EndArray -) - -// Bool constructs a Token representing a JSON boolean. -func Bool(b bool) Token { - return jsontext.Bool(b) -} - -// String constructs a Token representing a JSON string. -// The provided string should contain valid UTF-8, otherwise invalid characters -// may be mangled as the Unicode replacement character. -func String(s string) Token { - return jsontext.String(s) -} - -// Float constructs a Token representing a JSON number. -// The values NaN, +Inf, and -Inf will be represented -// as a JSON string with the values "NaN", "Infinity", and "-Infinity". -func Float(n float64) Token { - return jsontext.Float(n) -} - -// Int constructs a Token representing a JSON number from an int64. -func Int(n int64) Token { - return jsontext.Int(n) -} - -// Uint constructs a Token representing a JSON number from a uint64. -func Uint(n uint64) Token { - return jsontext.Uint(n) -} - -// Kind represents each possible JSON token kind with a single byte, -// which is conveniently the first byte of that kind's grammar -// with the restriction that numbers always be represented with '0': -// -// - 'n': null -// - 'f': false -// - 't': true -// - '"': string -// - '0': number -// - '{': object begin -// - '}': object end -// - '[': array begin -// - ']': array end -// -// An invalid kind is usually represented using 0, -// but may be non-zero due to invalid JSON data. -type Kind = jsontext.Kind - -// AppendFormat formats the JSON value in src and appends it to dst -// according to the specified options. -// See [Value.Format] for more details about the formatting behavior. -// -// The dst and src may overlap. -// If an error is reported, then the entirety of src is appended to dst. -func AppendFormat(dst, src []byte, opts ...Options) ([]byte, error) { - return jsontext.AppendFormat(dst, src, opts...) -} - -// Value represents a single raw JSON value, which may be one of the following: -// - a JSON literal (i.e., null, true, or false) -// - a JSON string (e.g., "hello, world!") -// - a JSON number (e.g., 123.456) -// - an entire JSON object (e.g., {"fizz":"buzz"} ) -// - an entire JSON array (e.g., [1,2,3] ) -// -// Value can represent entire array or object values, while [Token] cannot. -// Value may contain leading and/or trailing whitespace. -type Value = jsontext.Value diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/decode.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/decode.go index 7e847de373..96fd5c27cf 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/decode.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/decode.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package jsontext import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/doc.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/doc.go index 22081df053..bea3ccd348 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/doc.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/doc.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - // Package jsontext implements syntactic processing of JSON // as specified in RFC 4627, RFC 7159, RFC 7493, RFC 8259, and RFC 8785. // JSON is a simple data interchange format that can represent diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/encode.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/encode.go index c2e88045ad..36bf7efdf1 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/encode.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/encode.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package jsontext import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/errors.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/errors.go index 3c53151b3f..1af86d5b67 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/errors.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/errors.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package jsontext import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/export.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/export.go index 0d6dc58c06..b30bb99edf 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/export.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/export.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package jsontext import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/options.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/options.go index d22d0635d8..e973b58d6a 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/options.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/options.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package jsontext import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/pools.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/pools.go index cf59d99b92..63941baacb 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/pools.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/pools.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package jsontext import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/quote.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/quote.go index a4353be3af..77897b43f5 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/quote.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/quote.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package jsontext import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/state.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/state.go index 6f1aa8e217..fdbfd5d3d0 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/state.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/state.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package jsontext import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/token.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/token.go index 3e87c91402..ea8c30eb5b 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/token.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/token.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package jsontext import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/value.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/value.go index f29f323561..3ea05d3a0f 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/value.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/value.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package jsontext import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/options.go b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/options.go index de401b0de8..2f4744980f 100644 --- a/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/options.go +++ b/vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/options.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !goexperiment.jsonv2 || !go1.25 - package json import ( diff --git a/vendor/k8s.io/kube-openapi/pkg/schemaconv/openapi.go b/vendor/k8s.io/kube-openapi/pkg/schemaconv/openapi.go index 6067ee03d2..06bcf0c37c 100644 --- a/vendor/k8s.io/kube-openapi/pkg/schemaconv/openapi.go +++ b/vendor/k8s.io/kube-openapi/pkg/schemaconv/openapi.go @@ -147,11 +147,13 @@ func (c *convert) makeOpenAPIRef(specSchema *spec.Schema) schema.TypeRef { return schema.TypeRef{ NamedType: &n, ElementRelationship: &mapRelationship, + Nullable: specSchema.Nullable, } } return schema.TypeRef{ NamedType: &n, + Nullable: specSchema.Nullable, } } @@ -164,7 +166,8 @@ func (c *convert) makeOpenAPIRef(specSchema *spec.Schema) schema.TypeRef { c.pop(c2) return schema.TypeRef{ - Inlined: inlined, + Inlined: inlined, + Nullable: specSchema.Nullable, } } diff --git a/vendor/k8s.io/utils/ptr/OWNERS b/vendor/k8s.io/utils/ptr/OWNERS index 0d6392752a..55da8262a0 100644 --- a/vendor/k8s.io/utils/ptr/OWNERS +++ b/vendor/k8s.io/utils/ptr/OWNERS @@ -2,9 +2,11 @@ approvers: - apelisse +- skitt - stewart-yu - thockin reviewers: - apelisse +- skitt - stewart-yu - thockin diff --git a/vendor/modules.txt b/vendor/modules.txt index ebdd5f88db..35e9bc261e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -119,51 +119,52 @@ github.com/go-logr/logr/slogr # github.com/go-logr/zapr v1.3.0 ## explicit; go 1.18 github.com/go-logr/zapr -# github.com/go-openapi/jsonpointer v0.22.4 -## explicit; go 1.24.0 +# github.com/go-openapi/jsonpointer v1.0.0 +## explicit; go 1.25.0 github.com/go-openapi/jsonpointer -# github.com/go-openapi/jsonreference v0.21.4 -## explicit; go 1.24.0 +github.com/go-openapi/jsonpointer/jsonname +# github.com/go-openapi/jsonreference v1.0.0 +## explicit; go 1.25.0 github.com/go-openapi/jsonreference github.com/go-openapi/jsonreference/internal -# github.com/go-openapi/swag v0.25.4 -## explicit; go 1.24.0 +# github.com/go-openapi/swag v0.27.1 +## explicit; go 1.25.0 github.com/go-openapi/swag -# github.com/go-openapi/swag/cmdutils v0.25.4 -## explicit; go 1.24.0 +# github.com/go-openapi/swag/cmdutils v0.27.1 +## explicit; go 1.25.0 github.com/go-openapi/swag/cmdutils -# github.com/go-openapi/swag/conv v0.25.4 -## explicit; go 1.24.0 +# github.com/go-openapi/swag/conv v0.27.1 +## explicit; go 1.25.0 github.com/go-openapi/swag/conv -# github.com/go-openapi/swag/fileutils v0.25.4 -## explicit; go 1.24.0 +# github.com/go-openapi/swag/fileutils v0.27.1 +## explicit; go 1.25.0 github.com/go-openapi/swag/fileutils -# github.com/go-openapi/swag/jsonname v0.25.4 -## explicit; go 1.24.0 -github.com/go-openapi/swag/jsonname -# github.com/go-openapi/swag/jsonutils v0.25.4 -## explicit; go 1.24.0 +# github.com/go-openapi/swag/jsonutils v0.27.1 +## explicit; go 1.25.0 github.com/go-openapi/swag/jsonutils github.com/go-openapi/swag/jsonutils/adapters github.com/go-openapi/swag/jsonutils/adapters/ifaces github.com/go-openapi/swag/jsonutils/adapters/stdlib/json -# github.com/go-openapi/swag/loading v0.25.4 -## explicit; go 1.24.0 +# github.com/go-openapi/swag/loading v0.27.1 +## explicit; go 1.25.0 github.com/go-openapi/swag/loading -# github.com/go-openapi/swag/mangling v0.25.4 -## explicit; go 1.24.0 +# github.com/go-openapi/swag/mangling v0.27.1 +## explicit; go 1.25.0 github.com/go-openapi/swag/mangling -# github.com/go-openapi/swag/netutils v0.25.4 -## explicit; go 1.24.0 +# github.com/go-openapi/swag/netutils v0.27.1 +## explicit; go 1.25.0 github.com/go-openapi/swag/netutils -# github.com/go-openapi/swag/stringutils v0.25.4 -## explicit; go 1.24.0 +# github.com/go-openapi/swag/pools v0.27.1 +## explicit; go 1.25.0 +github.com/go-openapi/swag/pools +# github.com/go-openapi/swag/stringutils v0.27.1 +## explicit; go 1.25.0 github.com/go-openapi/swag/stringutils -# github.com/go-openapi/swag/typeutils v0.25.4 -## explicit; go 1.24.0 +# github.com/go-openapi/swag/typeutils v0.27.1 +## explicit; go 1.25.0 github.com/go-openapi/swag/typeutils -# github.com/go-openapi/swag/yamlutils v0.25.4 -## explicit; go 1.24.0 +# github.com/go-openapi/swag/yamlutils v0.27.1 +## explicit; go 1.25.0 github.com/go-openapi/swag/yamlutils # github.com/go-task/slim-sprig/v3 v3.0.0 ## explicit; go 1.20 @@ -500,8 +501,8 @@ golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm -# golang.org/x/time v0.14.0 -## explicit; go 1.24.0 +# golang.org/x/time v0.15.0 +## explicit; go 1.25.0 golang.org/x/time/rate # golang.org/x/tools v0.49.0 ## explicit; go 1.25.0 @@ -566,7 +567,7 @@ gopkg.in/evanphx/json-patch.v4 # gopkg.in/inf.v0 v0.9.1 ## explicit gopkg.in/inf.v0 -# k8s.io/api v0.36.4 +# k8s.io/api v0.37.0 ## explicit; go 1.26.0 k8s.io/api/admission/v1 k8s.io/api/admission/v1beta1 @@ -574,7 +575,6 @@ k8s.io/api/admissionregistration/v1 k8s.io/api/admissionregistration/v1alpha1 k8s.io/api/admissionregistration/v1beta1 k8s.io/api/apidiscovery/v2 -k8s.io/api/apidiscovery/v2beta1 k8s.io/api/apiserverinternal/v1alpha1 k8s.io/api/apps/v1 k8s.io/api/apps/v1beta1 @@ -605,6 +605,7 @@ k8s.io/api/flowcontrol/v1beta1 k8s.io/api/flowcontrol/v1beta2 k8s.io/api/flowcontrol/v1beta3 k8s.io/api/imagepolicy/v1alpha1 +k8s.io/api/lifecycle/v1alpha1 k8s.io/api/networking/v1 k8s.io/api/networking/v1beta1 k8s.io/api/node/v1 @@ -620,24 +621,26 @@ k8s.io/api/resource/v1alpha3 k8s.io/api/resource/v1beta1 k8s.io/api/resource/v1beta2 k8s.io/api/scheduling/v1 -k8s.io/api/scheduling/v1alpha2 +k8s.io/api/scheduling/v1alpha3 k8s.io/api/scheduling/v1beta1 k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 +k8s.io/api/storagemigration/v1 k8s.io/api/storagemigration/v1beta1 -# k8s.io/apiextensions-apiserver v0.36.4 +# k8s.io/apiextensions-apiserver v0.37.0 ## explicit; go 1.26.0 k8s.io/apiextensions-apiserver/pkg/apis/apiextensions k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1 k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/apiextensions/v1beta1 +k8s.io/apiextensions-apiserver/pkg/client/applyconfiguration/internal k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1 -# k8s.io/apimachinery v0.36.4 +# k8s.io/apimachinery v0.37.0 ## explicit; go 1.26.0 k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors @@ -707,7 +710,7 @@ k8s.io/cli-runtime/pkg/genericclioptions k8s.io/cli-runtime/pkg/genericiooptions k8s.io/cli-runtime/pkg/printers k8s.io/cli-runtime/pkg/resource -# k8s.io/client-go v0.36.4 +# k8s.io/client-go v0.37.0 ## explicit; go 1.26.0 k8s.io/client-go/applyconfigurations k8s.io/client-go/applyconfigurations/admissionregistration/v1 @@ -739,6 +742,7 @@ k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2 k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3 k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1 k8s.io/client-go/applyconfigurations/internal +k8s.io/client-go/applyconfigurations/lifecycle/v1alpha1 k8s.io/client-go/applyconfigurations/meta/v1 k8s.io/client-go/applyconfigurations/networking/v1 k8s.io/client-go/applyconfigurations/networking/v1beta1 @@ -755,11 +759,12 @@ k8s.io/client-go/applyconfigurations/resource/v1alpha3 k8s.io/client-go/applyconfigurations/resource/v1beta1 k8s.io/client-go/applyconfigurations/resource/v1beta2 k8s.io/client-go/applyconfigurations/scheduling/v1 -k8s.io/client-go/applyconfigurations/scheduling/v1alpha2 +k8s.io/client-go/applyconfigurations/scheduling/v1alpha3 k8s.io/client-go/applyconfigurations/scheduling/v1beta1 k8s.io/client-go/applyconfigurations/storage/v1 k8s.io/client-go/applyconfigurations/storage/v1alpha1 k8s.io/client-go/applyconfigurations/storage/v1beta1 +k8s.io/client-go/applyconfigurations/storagemigration/v1 k8s.io/client-go/applyconfigurations/storagemigration/v1beta1 k8s.io/client-go/discovery k8s.io/client-go/discovery/cached/disk @@ -809,6 +814,8 @@ k8s.io/client-go/informers/flowcontrol/v1beta1 k8s.io/client-go/informers/flowcontrol/v1beta2 k8s.io/client-go/informers/flowcontrol/v1beta3 k8s.io/client-go/informers/internalinterfaces +k8s.io/client-go/informers/lifecycle +k8s.io/client-go/informers/lifecycle/v1alpha1 k8s.io/client-go/informers/networking k8s.io/client-go/informers/networking/v1 k8s.io/client-go/informers/networking/v1beta1 @@ -830,13 +837,14 @@ k8s.io/client-go/informers/resource/v1beta1 k8s.io/client-go/informers/resource/v1beta2 k8s.io/client-go/informers/scheduling k8s.io/client-go/informers/scheduling/v1 -k8s.io/client-go/informers/scheduling/v1alpha2 +k8s.io/client-go/informers/scheduling/v1alpha3 k8s.io/client-go/informers/scheduling/v1beta1 k8s.io/client-go/informers/storage k8s.io/client-go/informers/storage/v1 k8s.io/client-go/informers/storage/v1alpha1 k8s.io/client-go/informers/storage/v1beta1 k8s.io/client-go/informers/storagemigration +k8s.io/client-go/informers/storagemigration/v1 k8s.io/client-go/informers/storagemigration/v1beta1 k8s.io/client-go/kubernetes k8s.io/client-go/kubernetes/scheme @@ -872,6 +880,7 @@ k8s.io/client-go/kubernetes/typed/flowcontrol/v1 k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1 k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2 k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3 +k8s.io/client-go/kubernetes/typed/lifecycle/v1alpha1 k8s.io/client-go/kubernetes/typed/networking/v1 k8s.io/client-go/kubernetes/typed/networking/v1beta1 k8s.io/client-go/kubernetes/typed/node/v1 @@ -887,11 +896,12 @@ k8s.io/client-go/kubernetes/typed/resource/v1alpha3 k8s.io/client-go/kubernetes/typed/resource/v1beta1 k8s.io/client-go/kubernetes/typed/resource/v1beta2 k8s.io/client-go/kubernetes/typed/scheduling/v1 -k8s.io/client-go/kubernetes/typed/scheduling/v1alpha2 +k8s.io/client-go/kubernetes/typed/scheduling/v1alpha3 k8s.io/client-go/kubernetes/typed/scheduling/v1beta1 k8s.io/client-go/kubernetes/typed/storage/v1 k8s.io/client-go/kubernetes/typed/storage/v1alpha1 k8s.io/client-go/kubernetes/typed/storage/v1beta1 +k8s.io/client-go/kubernetes/typed/storagemigration/v1 k8s.io/client-go/kubernetes/typed/storagemigration/v1beta1 k8s.io/client-go/listers k8s.io/client-go/listers/admissionregistration/v1 @@ -921,6 +931,7 @@ k8s.io/client-go/listers/flowcontrol/v1 k8s.io/client-go/listers/flowcontrol/v1beta1 k8s.io/client-go/listers/flowcontrol/v1beta2 k8s.io/client-go/listers/flowcontrol/v1beta3 +k8s.io/client-go/listers/lifecycle/v1alpha1 k8s.io/client-go/listers/networking/v1 k8s.io/client-go/listers/networking/v1beta1 k8s.io/client-go/listers/node/v1 @@ -936,11 +947,12 @@ k8s.io/client-go/listers/resource/v1alpha3 k8s.io/client-go/listers/resource/v1beta1 k8s.io/client-go/listers/resource/v1beta2 k8s.io/client-go/listers/scheduling/v1 -k8s.io/client-go/listers/scheduling/v1alpha2 +k8s.io/client-go/listers/scheduling/v1alpha3 k8s.io/client-go/listers/scheduling/v1beta1 k8s.io/client-go/listers/storage/v1 k8s.io/client-go/listers/storage/v1alpha1 k8s.io/client-go/listers/storage/v1beta1 +k8s.io/client-go/listers/storagemigration/v1 k8s.io/client-go/listers/storagemigration/v1beta1 k8s.io/client-go/metadata k8s.io/client-go/openapi @@ -998,7 +1010,7 @@ k8s.io/client-go/util/keyutil k8s.io/client-go/util/retry k8s.io/client-go/util/watchlist k8s.io/client-go/util/workqueue -# k8s.io/component-base v0.36.4 +# k8s.io/component-base v0.37.0 ## explicit; go 1.26.0 k8s.io/component-base/version # k8s.io/klog/v2 v2.140.0 @@ -1012,8 +1024,8 @@ k8s.io/klog/v2/internal/severity k8s.io/klog/v2/internal/sloghandler k8s.io/klog/v2/internal/verbosity k8s.io/klog/v2/textlogger -# k8s.io/kube-openapi v0.0.0-20260603220949-865597e52e25 -## explicit; go 1.24.0 +# k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad +## explicit; go 1.25.0 k8s.io/kube-openapi/pkg/cached k8s.io/kube-openapi/pkg/common k8s.io/kube-openapi/pkg/handler3 @@ -1041,7 +1053,7 @@ k8s.io/kubectl/pkg/util/openapi k8s.io/kubectl/pkg/util/templates k8s.io/kubectl/pkg/util/term k8s.io/kubectl/pkg/validation -# k8s.io/utils v0.0.0-20260507154919-ff6756f316d2 +# k8s.io/utils v0.0.0-20260626114624-be93311217bd ## explicit; go 1.23 k8s.io/utils/buffer k8s.io/utils/clock @@ -1190,7 +1202,7 @@ sigs.k8s.io/kustomize/kyaml/yaml/walk ## explicit; go 1.18 sigs.k8s.io/randfill sigs.k8s.io/randfill/bytesource -# sigs.k8s.io/structured-merge-diff/v6 v6.4.0 +# sigs.k8s.io/structured-merge-diff/v6 v6.4.2 ## explicit; go 1.23 sigs.k8s.io/structured-merge-diff/v6/fieldpath sigs.k8s.io/structured-merge-diff/v6/merge diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v6/fieldpath/serialize-pe.go b/vendor/sigs.k8s.io/structured-merge-diff/v6/fieldpath/serialize-pe.go index f4b00c2ee5..b2f62dc693 100644 --- a/vendor/sigs.k8s.io/structured-merge-diff/v6/fieldpath/serialize-pe.go +++ b/vendor/sigs.k8s.io/structured-merge-diff/v6/fieldpath/serialize-pe.go @@ -97,6 +97,14 @@ func DeserializePathElement(s string) (PathElement, error) { if err != nil { return PathElement{}, err } + // Lookahead validates that there is no unexpected trailing data. + // io.EOF is a successful termination indicator; all other errors or trailing data fail. + if iter.WhatIsNext(); iter.Error != io.EOF { + if iter.Error == nil { + iter.ReportError("managedFields parsing", "unexpected trailing data after JSON object") + } + return PathElement{}, iter.Error + } return PathElement{Value: &v}, nil case peKeySepBytes[0]: iter := readPool.BorrowIterator(b) @@ -112,8 +120,16 @@ func DeserializePathElement(s string) (PathElement, error) { fields = append(fields, value.Field{Name: key, Value: v}) return true }) + // Lookahead validates that there is no unexpected trailing data. + // io.EOF is a successful termination indicator; all other errors or trailing data fail. + if iter.WhatIsNext(); iter.Error != io.EOF { + if iter.Error == nil { + iter.ReportError("managedFields parsing", "unexpected trailing data after JSON object") + } + return PathElement{}, iter.Error + } fields.Sort() - return PathElement{Key: &fields}, iter.Error + return PathElement{Key: &fields}, nil case peIndexSepBytes[0]: i, err := strconv.Atoi(s[2:]) if err != nil { diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v6/fieldpath/serialize.go b/vendor/sigs.k8s.io/structured-merge-diff/v6/fieldpath/serialize.go index b992b93c5f..6701f17ee9 100644 --- a/vendor/sigs.k8s.io/structured-merge-diff/v6/fieldpath/serialize.go +++ b/vendor/sigs.k8s.io/structured-merge-diff/v6/fieldpath/serialize.go @@ -175,6 +175,17 @@ func (s *Set) FromJSON(r io.Reader) error { } else { *s = *found } + if iter.Error != nil { + return iter.Error + } + if iter.WhatIsNext(); iter.Error == nil { + // Piggy back on scanner aware error reporting here. + iter.ReportError("managedFields parsing", "unexpected trailing data after JSON object") + return iter.Error + } + if iter.Error == io.EOF { + return nil + } return iter.Error } diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v6/schema/elements.go b/vendor/sigs.k8s.io/structured-merge-diff/v6/schema/elements.go index c8138a6548..4c0e30b257 100644 --- a/vendor/sigs.k8s.io/structured-merge-diff/v6/schema/elements.go +++ b/vendor/sigs.k8s.io/structured-merge-diff/v6/schema/elements.go @@ -62,6 +62,10 @@ type TypeRef struct { // If this field is nil, then it has no effect. // See `Map` and `List` for more information about `ElementRelationship` ElementRelationship *ElementRelationship `yaml:"elementRelationship,omitempty"` + + // Nullable indicates that an explicit null is a valid value, + // corresponding to OpenAPI's `nullable: true`. + Nullable bool `yaml:"nullable,omitempty"` } // Atom represents the smallest possible pieces of the type system. diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v6/schema/equals.go b/vendor/sigs.k8s.io/structured-merge-diff/v6/schema/equals.go index b668eff833..e1fa5c95dd 100644 --- a/vendor/sigs.k8s.io/structured-merge-diff/v6/schema/equals.go +++ b/vendor/sigs.k8s.io/structured-merge-diff/v6/schema/equals.go @@ -55,6 +55,9 @@ func (a *TypeRef) Equals(b *TypeRef) bool { if a.ElementRelationship != b.ElementRelationship { return false } + if a.Nullable != b.Nullable { + return false + } return a.Inlined.Equals(&b.Inlined) } diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v6/schema/schemaschema.go b/vendor/sigs.k8s.io/structured-merge-diff/v6/schema/schemaschema.go index 6eb6c36df3..4eb367b657 100644 --- a/vendor/sigs.k8s.io/structured-merge-diff/v6/schema/schemaschema.go +++ b/vendor/sigs.k8s.io/structured-merge-diff/v6/schema/schemaschema.go @@ -69,6 +69,9 @@ var SchemaSchemaYAML = `types: - name: elementRelationship type: scalar: string + - name: nullable + type: + scalar: boolean - name: scalar scalar: string - name: map diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v6/typed/remove.go b/vendor/sigs.k8s.io/structured-merge-diff/v6/typed/remove.go index 0db1734f94..78ba6f50d0 100644 --- a/vendor/sigs.k8s.io/structured-merge-diff/v6/typed/remove.go +++ b/vendor/sigs.k8s.io/structured-merge-diff/v6/typed/remove.go @@ -75,7 +75,6 @@ func (w *removingWalker) doList(t *schema.List) (errs ValidationErrors) { } var newItems []interface{} - hadMatches := false iter := l.RangeUsing(w.allocator) defer w.allocator.Free(iter) for iter.Next() { @@ -99,26 +98,12 @@ func (w *removingWalker) doList(t *schema.List) (errs ValidationErrors) { continue } if isPrefixMatch { - // Removing nested items within this list item and preserve if it becomes empty - hadMatches = true - wasMap := item.IsMap() - wasList := item.IsList() item = removeItemsWithSchema(item, w.toRemove.WithPrefix(pe), w.schema, t.ElementType, w.shouldExtract) - // If item returned null but we're removing items within the structure(not the item itself), - // preserve the empty container structure - if item.IsNull() && !w.shouldExtract { - if wasMap { - item = value.NewValueInterface(map[string]interface{}{}) - } else if wasList { - item = value.NewValueInterface([]interface{}{}) - } - } } newItems = append(newItems, item.Unstructured()) } } - // Preserve empty lists (non-nil) instead of converting to null when items were matched and removed - if len(newItems) > 0 || (hadMatches && !w.shouldExtract) { + if len(newItems) > 0 { w.out = newItems } return nil @@ -156,7 +141,6 @@ func (w *removingWalker) doMap(t *schema.Map) ValidationErrors { } newMap := map[string]interface{}{} - hadMatches := false m.Iterate(func(k string, val value.Value) bool { pe := fieldpath.PathElement{FieldName: &k} path, _ := fieldpath.MakePath(pe) @@ -174,19 +158,7 @@ func (w *removingWalker) doMap(t *schema.Map) ValidationErrors { return true } if subset := w.toRemove.WithPrefix(pe); !subset.Empty() { - hadMatches = true - wasMap := val.IsMap() - wasList := val.IsList() val = removeItemsWithSchema(val, subset, w.schema, fieldType, w.shouldExtract) - // If val returned null but we're removing items within the structure (not the field itself), - // preserve the empty container structure - if val.IsNull() && !w.shouldExtract { - if wasMap { - val = value.NewValueInterface(map[string]interface{}{}) - } else if wasList { - val = value.NewValueInterface([]interface{}{}) - } - } } else { // don't save values not on the path when we shouldExtract. if w.shouldExtract { @@ -196,8 +168,7 @@ func (w *removingWalker) doMap(t *schema.Map) ValidationErrors { newMap[k] = val.Unstructured() return true }) - // Preserve empty maps (non-nil) instead of converting to null when items were matched and removed - if len(newMap) > 0 || (hadMatches && !w.shouldExtract) { + if len(newMap) > 0 { w.out = newMap } return nil diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v6/value/reflectcache.go b/vendor/sigs.k8s.io/structured-merge-diff/v6/value/reflectcache.go index 75b7085c3e..f4f4c2b44d 100644 --- a/vendor/sigs.k8s.io/structured-merge-diff/v6/value/reflectcache.go +++ b/vendor/sigs.k8s.io/structured-merge-diff/v6/value/reflectcache.go @@ -39,14 +39,28 @@ type UnstructuredConverter interface { ToUnstructured() interface{} } +// UnstructuredConverterWithError is implemented instead of UnstructuredConverter by types for which +// some, but not all, values can be converted directly to unstructured. If a type implements both +// UnstructuredConverter and UnstructuredConverterWithError, its UnstructuredConverterWithError +// implementation takes precedence during conversion. +type UnstructuredConverterWithError interface { + json.Marshaler // require that json.Marshaler is implemented + + // ToUnstructured returns the unstructured representation, or a non-nil error if the value + // cannot be converted to unstructured. + ToUnstructuredWithError() (any, error) +} + // TypeReflectCacheEntry keeps data gathered using reflection about how a type is converted to/from unstructured. type TypeReflectCacheEntry struct { - isJsonMarshaler bool - ptrIsJsonMarshaler bool - isJsonUnmarshaler bool - ptrIsJsonUnmarshaler bool - isStringConvertable bool - ptrIsStringConvertable bool + isJsonMarshaler bool + ptrIsJsonMarshaler bool + isJsonUnmarshaler bool + ptrIsJsonUnmarshaler bool + isUnstructuredConverter bool + ptrIsUnstructuredConverter bool + isUnstructuredConverterWithError bool + ptrIsUnstructuredConverterWithError bool structFields map[string]*FieldCacheEntry orderedStructFields []*FieldCacheEntry @@ -93,9 +107,10 @@ func (f *FieldCacheEntry) GetFrom(structVal reflect.Value) reflect.Value { return structVal } -var marshalerType = reflect.TypeOf(new(json.Marshaler)).Elem() -var unmarshalerType = reflect.TypeOf(new(json.Unmarshaler)).Elem() -var unstructuredConvertableType = reflect.TypeOf(new(UnstructuredConverter)).Elem() +var marshalerType = reflect.TypeFor[json.Marshaler]() +var unmarshalerType = reflect.TypeFor[json.Unmarshaler]() +var unstructuredConverterType = reflect.TypeFor[UnstructuredConverter]() +var unstructuredConverterWithErrorType = reflect.TypeFor[UnstructuredConverterWithError]() var defaultReflectCache = newReflectCache() // TypeReflectEntryOf returns the TypeReflectCacheEntry of the provided reflect.Type. @@ -122,11 +137,13 @@ func typeReflectEntryOf(cm reflectCacheMap, t reflect.Type, updates reflectCache return record } typeEntry := &TypeReflectCacheEntry{ - isJsonMarshaler: t.Implements(marshalerType), - ptrIsJsonMarshaler: reflect.PtrTo(t).Implements(marshalerType), - isJsonUnmarshaler: reflect.PtrTo(t).Implements(unmarshalerType), - isStringConvertable: t.Implements(unstructuredConvertableType), - ptrIsStringConvertable: reflect.PtrTo(t).Implements(unstructuredConvertableType), + isJsonMarshaler: t.Implements(marshalerType), + ptrIsJsonMarshaler: reflect.PointerTo(t).Implements(marshalerType), + isJsonUnmarshaler: reflect.PointerTo(t).Implements(unmarshalerType), + isUnstructuredConverter: t.Implements(unstructuredConverterType), + ptrIsUnstructuredConverter: reflect.PointerTo(t).Implements(unstructuredConverterType), + isUnstructuredConverterWithError: t.Implements(unstructuredConverterWithErrorType), + ptrIsUnstructuredConverterWithError: reflect.PointerTo(t).Implements(unstructuredConverterWithErrorType), } if t.Kind() == reflect.Struct { fieldEntries := map[string]*FieldCacheEntry{} @@ -190,7 +207,7 @@ func (e TypeReflectCacheEntry) OrderedFields() []*FieldCacheEntry { // CanConvertToUnstructured returns true if this TypeReflectCacheEntry can convert values of its type to unstructured. func (e TypeReflectCacheEntry) CanConvertToUnstructured() bool { - return e.isJsonMarshaler || e.ptrIsJsonMarshaler || e.isStringConvertable || e.ptrIsStringConvertable + return e.isJsonMarshaler || e.ptrIsJsonMarshaler || e.isUnstructuredConverter || e.ptrIsUnstructuredConverter || e.isUnstructuredConverterWithError || e.ptrIsUnstructuredConverterWithError } // ToUnstructured converts the provided value to unstructured and returns it. @@ -206,7 +223,7 @@ func (e TypeReflectCacheEntry) ToUnstructured(sv reflect.Value) (interface{}, er // Check if the object has a custom string converter and use it if available, since it is much more efficient // than round tripping through json. if converter, ok := e.getUnstructuredConverter(sv); ok { - return converter.ToUnstructured(), nil + return converter.ToUnstructuredWithError() } // Check if the object has a custom JSON marshaller/unmarshaller. if marshaler, ok := e.getJsonMarshaler(sv); ok { @@ -318,16 +335,26 @@ func (e TypeReflectCacheEntry) getJsonUnmarshaler(v reflect.Value) (json.Unmarsh return v.Addr().Interface().(json.Unmarshaler), true } -func (e TypeReflectCacheEntry) getUnstructuredConverter(v reflect.Value) (UnstructuredConverter, bool) { - if e.isStringConvertable { - return v.Interface().(UnstructuredConverter), true - } - if e.ptrIsStringConvertable { +type unstructuredConverterWithNilError struct { + UnstructuredConverter +} + +func (c unstructuredConverterWithNilError) ToUnstructuredWithError() (any, error) { + return c.UnstructuredConverter.ToUnstructured(), nil +} + +func (e TypeReflectCacheEntry) getUnstructuredConverter(v reflect.Value) (UnstructuredConverterWithError, bool) { + switch { + case e.isUnstructuredConverterWithError: + return v.Interface().(UnstructuredConverterWithError), true + case e.ptrIsUnstructuredConverterWithError && v.CanAddr(): // Check pointer receivers if v is not a pointer - if v.CanAddr() { - v = v.Addr() - return v.Interface().(UnstructuredConverter), true - } + return v.Addr().Interface().(UnstructuredConverterWithError), true + case e.isUnstructuredConverter: + return unstructuredConverterWithNilError{v.Interface().(UnstructuredConverter)}, true + case e.ptrIsUnstructuredConverter && v.CanAddr(): + // Check pointer receivers if v is not a pointer + return unstructuredConverterWithNilError{v.Addr().Interface().(UnstructuredConverter)}, true } return nil, false } diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v6/value/value.go b/vendor/sigs.k8s.io/structured-merge-diff/v6/value/value.go index 140b99038e..167848ebeb 100644 --- a/vendor/sigs.k8s.io/structured-merge-diff/v6/value/value.go +++ b/vendor/sigs.k8s.io/structured-merge-diff/v6/value/value.go @@ -118,6 +118,11 @@ func readJSONIter(iter *jsoniter.Iterator) (Value, error) { if iter.Error != nil && iter.Error != io.EOF { return nil, iter.Error } + if iter.WhatIsNext(); iter.Error == nil { + // Piggy back on scanner aware error reporting here. + iter.ReportError("managedFields parsing", "unexpected trailing data after JSON object") + return nil, iter.Error + } return NewValueInterface(v), nil }