mirror of
https://github.com/kubernetes/client-go.git
synced 2026-06-13 20:56:36 +00:00
Compare commits
130 Commits
v0.36.0-al
...
v0.36.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
877f535934 | ||
|
|
f22a53e627 | ||
|
|
a948641f81 | ||
|
|
7e44ffcaa9 | ||
|
|
df2d882697 | ||
|
|
4eece5291a | ||
|
|
3d35c51207 | ||
|
|
0434117726 | ||
|
|
ba785be0ac | ||
|
|
4a9c8783a9 | ||
|
|
0131054016 | ||
|
|
9b29e67df1 | ||
|
|
4c2ee9a3e2 | ||
|
|
2fb6b9cac0 | ||
|
|
b2267f3d75 | ||
|
|
382d307f87 | ||
|
|
6c21384776 | ||
|
|
69d2e66589 | ||
|
|
bb93391625 | ||
|
|
828813ca69 | ||
|
|
27bd9ce449 | ||
|
|
15a9dffb52 | ||
|
|
ea7a7e7cf9 | ||
|
|
61a40f5111 | ||
|
|
39f55294aa | ||
|
|
c73e37f377 | ||
|
|
9dc763689d | ||
|
|
c07c271a94 | ||
|
|
2517e8773a | ||
|
|
3505da0deb | ||
|
|
97ac09639d | ||
|
|
9cdd63fee2 | ||
|
|
32a3ac47cf | ||
|
|
e807f52104 | ||
|
|
a179e3b9fb | ||
|
|
4bf554630d | ||
|
|
2e882c6ea6 | ||
|
|
6f2c112d22 | ||
|
|
2f31bfec5d | ||
|
|
88da827ca3 | ||
|
|
c826020ed9 | ||
|
|
c3a1049f7e | ||
|
|
989fb5d38c | ||
|
|
294ecb1d8c | ||
|
|
c7f8506da0 | ||
|
|
78536fe27c | ||
|
|
06163fb266 | ||
|
|
388997a877 | ||
|
|
a72ad3ccbc | ||
|
|
9f41e94324 | ||
|
|
d91024383a | ||
|
|
aae801378e | ||
|
|
3e4de9e6b4 | ||
|
|
e45d8623ff | ||
|
|
187c42c884 | ||
|
|
2dd466fcfe | ||
|
|
486be0fbf9 | ||
|
|
e243a98fa8 | ||
|
|
f6c2d7ca65 | ||
|
|
55e741a004 | ||
|
|
27966b2574 | ||
|
|
8776b282cc | ||
|
|
9926c67348 | ||
|
|
c86837f7ed | ||
|
|
2f21ae3478 | ||
|
|
b59431fbc5 | ||
|
|
54ee8fecae | ||
|
|
f037d681ac | ||
|
|
99791c7452 | ||
|
|
1f07d6645b | ||
|
|
efbad1b7ed | ||
|
|
73f4fa85e7 | ||
|
|
f66040b9dc | ||
|
|
b840391f92 | ||
|
|
1349319d7c | ||
|
|
8a32b4087c | ||
|
|
764b57d771 | ||
|
|
f1d9ba91c7 | ||
|
|
62f2159da2 | ||
|
|
00e45797cb | ||
|
|
e8eab37058 | ||
|
|
efc4692504 | ||
|
|
648a945fad | ||
|
|
6b803d4e11 | ||
|
|
f6cd0c0583 | ||
|
|
67f0d98034 | ||
|
|
100af76fc5 | ||
|
|
97646e5606 | ||
|
|
103162f118 | ||
|
|
78fb6ed2e1 | ||
|
|
59f55827e6 | ||
|
|
70ab833f66 | ||
|
|
1d4002e88b | ||
|
|
a63d33951d | ||
|
|
8304d788bb | ||
|
|
7b594c4c71 | ||
|
|
d6503fcc3e | ||
|
|
80c1d965be | ||
|
|
f5fc1e5f67 | ||
|
|
e924e3f2c5 | ||
|
|
2ca150601d | ||
|
|
e334b2d6e7 | ||
|
|
6cda0df027 | ||
|
|
fd1b7118fd | ||
|
|
ca54862893 | ||
|
|
7aaede7872 | ||
|
|
2c400a844a | ||
|
|
9f57ca57bd | ||
|
|
0efa7daafd | ||
|
|
82ed9ba53e | ||
|
|
07f99e4437 | ||
|
|
b8c6b3c159 | ||
|
|
decb8c0791 | ||
|
|
18a54f0a40 | ||
|
|
b5668cea26 | ||
|
|
3721aecc15 | ||
|
|
139a95c065 | ||
|
|
d883e606da | ||
|
|
1f85fd1a13 | ||
|
|
ff8083eb1d | ||
|
|
e70bc766e0 | ||
|
|
b37e79caad | ||
|
|
1ee3eb7041 | ||
|
|
8fcd3c218f | ||
|
|
c6e2e47b31 | ||
|
|
c02524f944 | ||
|
|
aac099e7c2 | ||
|
|
7bb07cbe8e | ||
|
|
d416af4df4 | ||
|
|
3db82856dc |
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
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
|
||||
|
||||
// ApplyConfigurationApplyConfiguration represents a declarative configuration of the ApplyConfiguration type for use
|
||||
// with apply.
|
||||
//
|
||||
// ApplyConfiguration defines the desired configuration values of an object.
|
||||
type ApplyConfigurationApplyConfiguration struct {
|
||||
// expression will be evaluated by CEL to create an apply configuration.
|
||||
// ref: https://github.com/google/cel-spec
|
||||
//
|
||||
// Apply configurations are declared in CEL using object initialization. For example, this CEL expression
|
||||
// returns an apply configuration to set a single field:
|
||||
//
|
||||
// Object{
|
||||
// spec: Object.spec{
|
||||
// serviceAccountName: "example"
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// Apply configurations may not modify atomic structs, maps or arrays due to the risk of accidental deletion of
|
||||
// values not included in the apply configuration.
|
||||
//
|
||||
// CEL expressions have access to the object types needed to create apply configurations:
|
||||
//
|
||||
// - 'Object' - CEL type of the resource object.
|
||||
// - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec')
|
||||
// - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
|
||||
//
|
||||
// CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
|
||||
//
|
||||
// - 'object' - The object from the incoming request. The value is null for DELETE requests.
|
||||
// - 'oldObject' - The existing object. The value is null for CREATE requests.
|
||||
// - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)).
|
||||
// - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
|
||||
// - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources.
|
||||
// - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
|
||||
// For example, a variable named 'foo' can be accessed as 'variables.foo'.
|
||||
// - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
|
||||
// See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
|
||||
// - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
|
||||
// request resource.
|
||||
//
|
||||
// The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the
|
||||
// object. No other metadata properties are accessible.
|
||||
//
|
||||
// Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
|
||||
// Required.
|
||||
Expression *string `json:"expression,omitempty"`
|
||||
}
|
||||
|
||||
// ApplyConfigurationApplyConfiguration constructs a declarative configuration of the ApplyConfiguration type for use with
|
||||
// apply.
|
||||
func ApplyConfiguration() *ApplyConfigurationApplyConfiguration {
|
||||
return &ApplyConfigurationApplyConfiguration{}
|
||||
}
|
||||
|
||||
// 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 *ApplyConfigurationApplyConfiguration) WithExpression(value string) *ApplyConfigurationApplyConfiguration {
|
||||
b.Expression = &value
|
||||
return b
|
||||
}
|
||||
105
applyconfigurations/admissionregistration/v1/jsonpatch.go
Normal file
105
applyconfigurations/admissionregistration/v1/jsonpatch.go
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
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
|
||||
|
||||
// JSONPatchApplyConfiguration represents a declarative configuration of the JSONPatch type for use
|
||||
// with apply.
|
||||
//
|
||||
// JSONPatch defines a JSON Patch.
|
||||
type JSONPatchApplyConfiguration struct {
|
||||
// expression will be evaluated by CEL to create a [JSON patch](https://jsonpatch.com/).
|
||||
// ref: https://github.com/google/cel-spec
|
||||
//
|
||||
// expression must return an array of JSONPatch values.
|
||||
//
|
||||
// For example, this CEL expression returns a JSON patch to conditionally modify a value:
|
||||
//
|
||||
// [
|
||||
// JSONPatch{op: "test", path: "/spec/example", value: "Red"},
|
||||
// JSONPatch{op: "replace", path: "/spec/example", value: "Green"}
|
||||
// ]
|
||||
//
|
||||
// To define an object for the patch value, use Object types. For example:
|
||||
//
|
||||
// [
|
||||
// JSONPatch{
|
||||
// op: "add",
|
||||
// path: "/spec/selector",
|
||||
// value: Object.spec.selector{matchLabels: {"environment": "test"}}
|
||||
// }
|
||||
// ]
|
||||
//
|
||||
// To use strings containing '/' and '~' as JSONPatch path keys, use "jsonpatch.escapeKey". For example:
|
||||
//
|
||||
// [
|
||||
// JSONPatch{
|
||||
// op: "add",
|
||||
// path: "/metadata/labels/" + jsonpatch.escapeKey("example.com/environment"),
|
||||
// value: "test"
|
||||
// },
|
||||
// ]
|
||||
//
|
||||
// CEL expressions have access to the types needed to create JSON patches and objects:
|
||||
//
|
||||
// - 'JSONPatch' - CEL type of JSON Patch operations. JSONPatch has the fields 'op', 'from', 'path' and 'value'.
|
||||
// See [JSON patch](https://jsonpatch.com/) for more details. The 'value' field may be set to any of: string,
|
||||
// integer, array, map or object. If set, the 'path' and 'from' fields must be set to a
|
||||
// [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901/) string, where the 'jsonpatch.escapeKey()' CEL
|
||||
// function may be used to escape path keys containing '/' and '~'.
|
||||
// - 'Object' - CEL type of the resource object.
|
||||
// - 'Object.<fieldName>' - CEL type of object field (such as 'Object.spec')
|
||||
// - 'Object.<fieldName1>.<fieldName2>...<fieldNameN>` - CEL type of nested field (such as 'Object.spec.containers')
|
||||
//
|
||||
// CEL expressions have access to the contents of the API request, organized into CEL variables as well as some other useful variables:
|
||||
//
|
||||
// - 'object' - The object from the incoming request. The value is null for DELETE requests.
|
||||
// - 'oldObject' - The existing object. The value is null for CREATE requests.
|
||||
// - 'request' - Attributes of the API request([ref](/pkg/apis/admission/types.go#AdmissionRequest)).
|
||||
// - 'params' - Parameter resource referred to by the policy binding being evaluated. Only populated if the policy has a ParamKind.
|
||||
// - 'namespaceObject' - The namespace object that the incoming object belongs to. The value is null for cluster-scoped resources.
|
||||
// - 'variables' - Map of composited variables, from its name to its lazily evaluated value.
|
||||
// For example, a variable named 'foo' can be accessed as 'variables.foo'.
|
||||
// - 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.
|
||||
// See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz
|
||||
// - 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the
|
||||
// request resource.
|
||||
//
|
||||
// CEL expressions have access to [Kubernetes CEL function libraries](https://kubernetes.io/docs/reference/using-api/cel/#cel-options-language-features-and-libraries)
|
||||
// as well as:
|
||||
//
|
||||
// - 'jsonpatch.escapeKey' - Performs JSONPatch key escaping. '~' and '/' are escaped as '~0' and `~1' respectively).
|
||||
//
|
||||
// Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
|
||||
// Required.
|
||||
Expression *string `json:"expression,omitempty"`
|
||||
}
|
||||
|
||||
// JSONPatchApplyConfiguration constructs a declarative configuration of the JSONPatch type for use with
|
||||
// apply.
|
||||
func JSONPatch() *JSONPatchApplyConfiguration {
|
||||
return &JSONPatchApplyConfiguration{}
|
||||
}
|
||||
|
||||
// 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 *JSONPatchApplyConfiguration) WithExpression(value string) *JSONPatchApplyConfiguration {
|
||||
b.Expression = &value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,274 @@
|
||||
/*
|
||||
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 (
|
||||
admissionregistrationv1 "k8s.io/api/admissionregistration/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"
|
||||
)
|
||||
|
||||
// MutatingAdmissionPolicyApplyConfiguration represents a declarative configuration of the MutatingAdmissionPolicy type for use
|
||||
// with apply.
|
||||
//
|
||||
// MutatingAdmissionPolicy describes the definition of an admission mutation policy that mutates the object coming into admission chain.
|
||||
type MutatingAdmissionPolicyApplyConfiguration struct {
|
||||
metav1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
// 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.
|
||||
Spec *MutatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
// MutatingAdmissionPolicy constructs a declarative configuration of the MutatingAdmissionPolicy type for use with
|
||||
// apply.
|
||||
func MutatingAdmissionPolicy(name string) *MutatingAdmissionPolicyApplyConfiguration {
|
||||
b := &MutatingAdmissionPolicyApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithKind("MutatingAdmissionPolicy")
|
||||
b.WithAPIVersion("admissionregistration.k8s.io/v1")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractMutatingAdmissionPolicyFrom extracts the applied configuration owned by fieldManager from
|
||||
// mutatingAdmissionPolicy for the specified subresource. Pass an empty string for subresource to extract
|
||||
// the main resource. Common subresources include "status", "scale", etc.
|
||||
// mutatingAdmissionPolicy must be a unmodified MutatingAdmissionPolicy API object that was retrieved from the Kubernetes API.
|
||||
// ExtractMutatingAdmissionPolicyFrom 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 ExtractMutatingAdmissionPolicyFrom(mutatingAdmissionPolicy *admissionregistrationv1.MutatingAdmissionPolicy, fieldManager string, subresource string) (*MutatingAdmissionPolicyApplyConfiguration, error) {
|
||||
b := &MutatingAdmissionPolicyApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(mutatingAdmissionPolicy, internal.Parser().Type("io.k8s.api.admissionregistration.v1.MutatingAdmissionPolicy"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(mutatingAdmissionPolicy.Name)
|
||||
|
||||
b.WithKind("MutatingAdmissionPolicy")
|
||||
b.WithAPIVersion("admissionregistration.k8s.io/v1")
|
||||
return b, nil
|
||||
}
|
||||
|
||||
// ExtractMutatingAdmissionPolicy extracts the applied configuration owned by fieldManager from
|
||||
// mutatingAdmissionPolicy. If no managedFields are found in mutatingAdmissionPolicy for fieldManager, a
|
||||
// MutatingAdmissionPolicyApplyConfiguration 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.
|
||||
// mutatingAdmissionPolicy must be a unmodified MutatingAdmissionPolicy API object that was retrieved from the Kubernetes API.
|
||||
// ExtractMutatingAdmissionPolicy 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 ExtractMutatingAdmissionPolicy(mutatingAdmissionPolicy *admissionregistrationv1.MutatingAdmissionPolicy, fieldManager string) (*MutatingAdmissionPolicyApplyConfiguration, error) {
|
||||
return ExtractMutatingAdmissionPolicyFrom(mutatingAdmissionPolicy, fieldManager, "")
|
||||
}
|
||||
|
||||
func (b MutatingAdmissionPolicyApplyConfiguration) 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 *MutatingAdmissionPolicyApplyConfiguration) WithKind(value string) *MutatingAdmissionPolicyApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyApplyConfiguration) WithAPIVersion(value string) *MutatingAdmissionPolicyApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyApplyConfiguration) WithName(value string) *MutatingAdmissionPolicyApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyApplyConfiguration) WithGenerateName(value string) *MutatingAdmissionPolicyApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyApplyConfiguration) WithNamespace(value string) *MutatingAdmissionPolicyApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyApplyConfiguration) WithUID(value types.UID) *MutatingAdmissionPolicyApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyApplyConfiguration) WithResourceVersion(value string) *MutatingAdmissionPolicyApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyApplyConfiguration) WithGeneration(value int64) *MutatingAdmissionPolicyApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *MutatingAdmissionPolicyApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *MutatingAdmissionPolicyApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MutatingAdmissionPolicyApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyApplyConfiguration) WithLabels(entries map[string]string) *MutatingAdmissionPolicyApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *MutatingAdmissionPolicyApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *MutatingAdmissionPolicyApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyApplyConfiguration) WithFinalizers(values ...string) *MutatingAdmissionPolicyApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *MutatingAdmissionPolicyApplyConfiguration) 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 *MutatingAdmissionPolicyApplyConfiguration) WithSpec(value *MutatingAdmissionPolicySpecApplyConfiguration) *MutatingAdmissionPolicyApplyConfiguration {
|
||||
b.Spec = value
|
||||
return b
|
||||
}
|
||||
|
||||
// GetKind retrieves the value of the Kind field in the declarative configuration.
|
||||
func (b *MutatingAdmissionPolicyApplyConfiguration) GetKind() *string {
|
||||
return b.TypeMetaApplyConfiguration.Kind
|
||||
}
|
||||
|
||||
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
|
||||
func (b *MutatingAdmissionPolicyApplyConfiguration) GetAPIVersion() *string {
|
||||
return b.TypeMetaApplyConfiguration.APIVersion
|
||||
}
|
||||
|
||||
// GetName retrieves the value of the Name field in the declarative configuration.
|
||||
func (b *MutatingAdmissionPolicyApplyConfiguration) GetName() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.ObjectMetaApplyConfiguration.Name
|
||||
}
|
||||
|
||||
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
|
||||
func (b *MutatingAdmissionPolicyApplyConfiguration) GetNamespace() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.ObjectMetaApplyConfiguration.Namespace
|
||||
}
|
||||
@@ -0,0 +1,284 @@
|
||||
/*
|
||||
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 (
|
||||
admissionregistrationv1 "k8s.io/api/admissionregistration/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"
|
||||
)
|
||||
|
||||
// MutatingAdmissionPolicyBindingApplyConfiguration represents a declarative configuration of the MutatingAdmissionPolicyBinding type for use
|
||||
// with apply.
|
||||
//
|
||||
// MutatingAdmissionPolicyBinding binds the MutatingAdmissionPolicy with parametrized resources.
|
||||
// MutatingAdmissionPolicyBinding and the optional parameter resource together define how cluster administrators
|
||||
// configure policies for clusters.
|
||||
//
|
||||
// For a given admission request, each binding will cause its policy to be
|
||||
// evaluated N times, where N is 1 for policies/bindings that don't use
|
||||
// params, otherwise N is the number of parameters selected by the binding.
|
||||
// Each evaluation is constrained by a [runtime cost budget](https://kubernetes.io/docs/reference/using-api/cel/#runtime-cost-budget).
|
||||
//
|
||||
// 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"`
|
||||
// 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.
|
||||
Spec *MutatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
// MutatingAdmissionPolicyBinding constructs a declarative configuration of the MutatingAdmissionPolicyBinding type for use with
|
||||
// apply.
|
||||
func MutatingAdmissionPolicyBinding(name string) *MutatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b := &MutatingAdmissionPolicyBindingApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithKind("MutatingAdmissionPolicyBinding")
|
||||
b.WithAPIVersion("admissionregistration.k8s.io/v1")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractMutatingAdmissionPolicyBindingFrom extracts the applied configuration owned by fieldManager from
|
||||
// mutatingAdmissionPolicyBinding for the specified subresource. Pass an empty string for subresource to extract
|
||||
// the main resource. Common subresources include "status", "scale", etc.
|
||||
// mutatingAdmissionPolicyBinding must be a unmodified MutatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API.
|
||||
// ExtractMutatingAdmissionPolicyBindingFrom 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 ExtractMutatingAdmissionPolicyBindingFrom(mutatingAdmissionPolicyBinding *admissionregistrationv1.MutatingAdmissionPolicyBinding, fieldManager string, subresource string) (*MutatingAdmissionPolicyBindingApplyConfiguration, error) {
|
||||
b := &MutatingAdmissionPolicyBindingApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(mutatingAdmissionPolicyBinding, internal.Parser().Type("io.k8s.api.admissionregistration.v1.MutatingAdmissionPolicyBinding"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(mutatingAdmissionPolicyBinding.Name)
|
||||
|
||||
b.WithKind("MutatingAdmissionPolicyBinding")
|
||||
b.WithAPIVersion("admissionregistration.k8s.io/v1")
|
||||
return b, nil
|
||||
}
|
||||
|
||||
// ExtractMutatingAdmissionPolicyBinding extracts the applied configuration owned by fieldManager from
|
||||
// mutatingAdmissionPolicyBinding. If no managedFields are found in mutatingAdmissionPolicyBinding for fieldManager, a
|
||||
// MutatingAdmissionPolicyBindingApplyConfiguration 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.
|
||||
// mutatingAdmissionPolicyBinding must be a unmodified MutatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API.
|
||||
// ExtractMutatingAdmissionPolicyBinding 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 ExtractMutatingAdmissionPolicyBinding(mutatingAdmissionPolicyBinding *admissionregistrationv1.MutatingAdmissionPolicyBinding, fieldManager string) (*MutatingAdmissionPolicyBindingApplyConfiguration, error) {
|
||||
return ExtractMutatingAdmissionPolicyBindingFrom(mutatingAdmissionPolicyBinding, fieldManager, "")
|
||||
}
|
||||
|
||||
func (b MutatingAdmissionPolicyBindingApplyConfiguration) 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 *MutatingAdmissionPolicyBindingApplyConfiguration) WithKind(value string) *MutatingAdmissionPolicyBindingApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyBindingApplyConfiguration) WithAPIVersion(value string) *MutatingAdmissionPolicyBindingApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyBindingApplyConfiguration) WithName(value string) *MutatingAdmissionPolicyBindingApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyBindingApplyConfiguration) WithGenerateName(value string) *MutatingAdmissionPolicyBindingApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyBindingApplyConfiguration) WithNamespace(value string) *MutatingAdmissionPolicyBindingApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyBindingApplyConfiguration) WithUID(value types.UID) *MutatingAdmissionPolicyBindingApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyBindingApplyConfiguration) WithResourceVersion(value string) *MutatingAdmissionPolicyBindingApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyBindingApplyConfiguration) WithGeneration(value int64) *MutatingAdmissionPolicyBindingApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyBindingApplyConfiguration) WithCreationTimestamp(value apismetav1.Time) *MutatingAdmissionPolicyBindingApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyBindingApplyConfiguration) WithDeletionTimestamp(value apismetav1.Time) *MutatingAdmissionPolicyBindingApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MutatingAdmissionPolicyBindingApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyBindingApplyConfiguration) WithLabels(entries map[string]string) *MutatingAdmissionPolicyBindingApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyBindingApplyConfiguration) WithAnnotations(entries map[string]string) *MutatingAdmissionPolicyBindingApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyBindingApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *MutatingAdmissionPolicyBindingApplyConfiguration {
|
||||
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 *MutatingAdmissionPolicyBindingApplyConfiguration) WithFinalizers(values ...string) *MutatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) 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 *MutatingAdmissionPolicyBindingApplyConfiguration) WithSpec(value *MutatingAdmissionPolicyBindingSpecApplyConfiguration) *MutatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b.Spec = value
|
||||
return b
|
||||
}
|
||||
|
||||
// GetKind retrieves the value of the Kind field in the declarative configuration.
|
||||
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) GetKind() *string {
|
||||
return b.TypeMetaApplyConfiguration.Kind
|
||||
}
|
||||
|
||||
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
|
||||
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) GetAPIVersion() *string {
|
||||
return b.TypeMetaApplyConfiguration.APIVersion
|
||||
}
|
||||
|
||||
// GetName retrieves the value of the Name field in the declarative configuration.
|
||||
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) GetName() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.ObjectMetaApplyConfiguration.Name
|
||||
}
|
||||
|
||||
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
|
||||
func (b *MutatingAdmissionPolicyBindingApplyConfiguration) GetNamespace() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.ObjectMetaApplyConfiguration.Namespace
|
||||
}
|
||||
@@ -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 v1
|
||||
|
||||
// MutatingAdmissionPolicyBindingSpecApplyConfiguration represents a declarative configuration of the MutatingAdmissionPolicyBindingSpec type for use
|
||||
// with apply.
|
||||
//
|
||||
// MutatingAdmissionPolicyBindingSpec defines the specification of the MutatingAdmissionPolicyBinding.
|
||||
type MutatingAdmissionPolicyBindingSpecApplyConfiguration struct {
|
||||
// policyName references a MutatingAdmissionPolicy name which the MutatingAdmissionPolicyBinding binds to.
|
||||
// If the referenced resource does not exist, this binding is considered invalid and will be ignored
|
||||
// Required.
|
||||
PolicyName *string `json:"policyName,omitempty"`
|
||||
// paramRef specifies the parameter resource used to configure the admission control policy.
|
||||
// It should point to a resource of the type specified in spec.ParamKind of the bound MutatingAdmissionPolicy.
|
||||
// If the policy specifies a ParamKind and the resource referred to by ParamRef does not exist, this binding is considered mis-configured and the FailurePolicy of the MutatingAdmissionPolicy applied.
|
||||
// If the policy does not specify a ParamKind then this field is ignored, and the rules are evaluated without a param.
|
||||
ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"`
|
||||
// matchResources limits what resources match this binding and may be mutated by it.
|
||||
// Note that if matchResources matches a resource, the resource must also match a policy's matchConstraints and
|
||||
// matchConditions before the resource may be mutated.
|
||||
// When matchResources is unset, it does not constrain resource matching, and only the policy's matchConstraints
|
||||
// and matchConditions must match for the resource to be mutated.
|
||||
// Additionally, matchResources.resourceRules are optional and do not constraint matching when unset.
|
||||
// Note that this is differs from MutatingAdmissionPolicy matchConstraints, where resourceRules are required.
|
||||
// The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched.
|
||||
// '*' matches CREATE, UPDATE and CONNECT.
|
||||
MatchResources *MatchResourcesApplyConfiguration `json:"matchResources,omitempty"`
|
||||
}
|
||||
|
||||
// MutatingAdmissionPolicyBindingSpecApplyConfiguration constructs a declarative configuration of the MutatingAdmissionPolicyBindingSpec type for use with
|
||||
// apply.
|
||||
func MutatingAdmissionPolicyBindingSpec() *MutatingAdmissionPolicyBindingSpecApplyConfiguration {
|
||||
return &MutatingAdmissionPolicyBindingSpecApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithPolicyName sets the PolicyName field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the PolicyName field is set to the value of the last call.
|
||||
func (b *MutatingAdmissionPolicyBindingSpecApplyConfiguration) WithPolicyName(value string) *MutatingAdmissionPolicyBindingSpecApplyConfiguration {
|
||||
b.PolicyName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithParamRef sets the ParamRef field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the ParamRef field is set to the value of the last call.
|
||||
func (b *MutatingAdmissionPolicyBindingSpecApplyConfiguration) WithParamRef(value *ParamRefApplyConfiguration) *MutatingAdmissionPolicyBindingSpecApplyConfiguration {
|
||||
b.ParamRef = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithMatchResources sets the MatchResources field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the MatchResources field is set to the value of the last call.
|
||||
func (b *MutatingAdmissionPolicyBindingSpecApplyConfiguration) WithMatchResources(value *MatchResourcesApplyConfiguration) *MutatingAdmissionPolicyBindingSpecApplyConfiguration {
|
||||
b.MatchResources = value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
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 (
|
||||
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||
)
|
||||
|
||||
// MutatingAdmissionPolicySpecApplyConfiguration represents a declarative configuration of the MutatingAdmissionPolicySpec type for use
|
||||
// with apply.
|
||||
//
|
||||
// MutatingAdmissionPolicySpec defines the desired behavior of the admission policy.
|
||||
type MutatingAdmissionPolicySpecApplyConfiguration struct {
|
||||
// paramKind specifies the kind of resources used to parameterize this policy.
|
||||
// If absent, there are no parameters for this policy and the param CEL variable will not be provided to validation expressions.
|
||||
// If paramKind refers to a non-existent kind, this policy definition is mis-configured and the FailurePolicy is applied.
|
||||
// If paramKind is specified but paramRef is unset in MutatingAdmissionPolicyBinding, the params variable will be null.
|
||||
ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"`
|
||||
// matchConstraints specifies what resources this policy is designed to validate.
|
||||
// The MutatingAdmissionPolicy cares about a request if it matches _all_ Constraints.
|
||||
// However, in order to prevent clusters from being put into an unstable state that cannot be recovered from via the API
|
||||
// MutatingAdmissionPolicy cannot match MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding.
|
||||
// The CREATE, UPDATE and CONNECT operations are allowed. The DELETE operation may not be matched.
|
||||
// '*' matches CREATE, UPDATE and CONNECT.
|
||||
// Required.
|
||||
MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"`
|
||||
// variables contain definitions of variables that can be used in composition of other expressions.
|
||||
// Each variable is defined as a named CEL expression.
|
||||
// The variables defined here will be available under `variables` in other expressions of the policy
|
||||
// except matchConditions because matchConditions are evaluated before the rest of the policy.
|
||||
//
|
||||
// The expression of a variable can refer to other variables defined earlier in the list but not those after.
|
||||
// Thus, variables must be sorted by the order of first appearance and acyclic.
|
||||
Variables []VariableApplyConfiguration `json:"variables,omitempty"`
|
||||
// mutations contain operations to perform on matching objects.
|
||||
// mutations may not be empty; a minimum of one mutation is required.
|
||||
// mutations are evaluated in order, and are reinvoked according to
|
||||
// the reinvocationPolicy.
|
||||
// The mutations of a policy are invoked for each binding of this policy
|
||||
// and reinvocation of mutations occurs on a per binding basis.
|
||||
Mutations []MutationApplyConfiguration `json:"mutations,omitempty"`
|
||||
// failurePolicy defines how to handle failures for the admission policy. Failures can
|
||||
// occur from CEL expression parse errors, type check errors, runtime errors and invalid
|
||||
// or mis-configured policy definitions or bindings.
|
||||
//
|
||||
// A policy is invalid if paramKind refers to a non-existent Kind.
|
||||
// A binding is invalid if paramRef.name refers to a non-existent resource.
|
||||
//
|
||||
// failurePolicy does not define how validations that evaluate to false are handled.
|
||||
//
|
||||
// Allowed values are Ignore or Fail. Defaults to Fail.
|
||||
FailurePolicy *admissionregistrationv1.FailurePolicyType `json:"failurePolicy,omitempty"`
|
||||
// matchConditions is a list of conditions that must be met for a request to be validated.
|
||||
// Match conditions filter requests that have already been matched by the matchConstraints.
|
||||
// An empty list of matchConditions matches all requests.
|
||||
// There are a maximum of 64 match conditions allowed.
|
||||
//
|
||||
// If a parameter object is provided, it can be accessed via the `params` handle in the same
|
||||
// manner as validation expressions.
|
||||
//
|
||||
// The exact matching logic is (in order):
|
||||
// 1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
|
||||
// 2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
|
||||
// 3. If any matchCondition evaluates to an error (but none are FALSE):
|
||||
// - If failurePolicy=Fail, reject the request
|
||||
// - If failurePolicy=Ignore, the policy is skipped
|
||||
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
|
||||
// reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding
|
||||
// as part of a single admission evaluation.
|
||||
// Allowed values are "Never" and "IfNeeded".
|
||||
//
|
||||
// Never: These mutations will not be called more than once per binding in a single admission evaluation.
|
||||
//
|
||||
// IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of
|
||||
// order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only
|
||||
// reinvoked when mutations change the object after this mutation is invoked.
|
||||
// Required.
|
||||
ReinvocationPolicy *admissionregistrationv1.ReinvocationPolicyType `json:"reinvocationPolicy,omitempty"`
|
||||
}
|
||||
|
||||
// MutatingAdmissionPolicySpecApplyConfiguration constructs a declarative configuration of the MutatingAdmissionPolicySpec type for use with
|
||||
// apply.
|
||||
func MutatingAdmissionPolicySpec() *MutatingAdmissionPolicySpecApplyConfiguration {
|
||||
return &MutatingAdmissionPolicySpecApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithParamKind sets the ParamKind field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the ParamKind field is set to the value of the last call.
|
||||
func (b *MutatingAdmissionPolicySpecApplyConfiguration) WithParamKind(value *ParamKindApplyConfiguration) *MutatingAdmissionPolicySpecApplyConfiguration {
|
||||
b.ParamKind = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithMatchConstraints sets the MatchConstraints field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the MatchConstraints field is set to the value of the last call.
|
||||
func (b *MutatingAdmissionPolicySpecApplyConfiguration) WithMatchConstraints(value *MatchResourcesApplyConfiguration) *MutatingAdmissionPolicySpecApplyConfiguration {
|
||||
b.MatchConstraints = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithVariables adds the given value to the Variables 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 Variables field.
|
||||
func (b *MutatingAdmissionPolicySpecApplyConfiguration) WithVariables(values ...*VariableApplyConfiguration) *MutatingAdmissionPolicySpecApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithVariables")
|
||||
}
|
||||
b.Variables = append(b.Variables, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithMutations adds the given value to the Mutations 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 Mutations field.
|
||||
func (b *MutatingAdmissionPolicySpecApplyConfiguration) WithMutations(values ...*MutationApplyConfiguration) *MutatingAdmissionPolicySpecApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithMutations")
|
||||
}
|
||||
b.Mutations = append(b.Mutations, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithFailurePolicy sets the FailurePolicy field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the FailurePolicy field is set to the value of the last call.
|
||||
func (b *MutatingAdmissionPolicySpecApplyConfiguration) WithFailurePolicy(value admissionregistrationv1.FailurePolicyType) *MutatingAdmissionPolicySpecApplyConfiguration {
|
||||
b.FailurePolicy = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithMatchConditions adds the given value to the MatchConditions 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 MatchConditions field.
|
||||
func (b *MutatingAdmissionPolicySpecApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *MutatingAdmissionPolicySpecApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithMatchConditions")
|
||||
}
|
||||
b.MatchConditions = append(b.MatchConditions, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithReinvocationPolicy sets the ReinvocationPolicy field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the ReinvocationPolicy field is set to the value of the last call.
|
||||
func (b *MutatingAdmissionPolicySpecApplyConfiguration) WithReinvocationPolicy(value admissionregistrationv1.ReinvocationPolicyType) *MutatingAdmissionPolicySpecApplyConfiguration {
|
||||
b.ReinvocationPolicy = &value
|
||||
return b
|
||||
}
|
||||
72
applyconfigurations/admissionregistration/v1/mutation.go
Normal file
72
applyconfigurations/admissionregistration/v1/mutation.go
Normal file
@@ -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 v1
|
||||
|
||||
import (
|
||||
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||
)
|
||||
|
||||
// MutationApplyConfiguration represents a declarative configuration of the Mutation type for use
|
||||
// with apply.
|
||||
//
|
||||
// Mutation specifies the CEL expression which is used to apply the Mutation.
|
||||
type MutationApplyConfiguration struct {
|
||||
// patchType indicates the patch strategy used.
|
||||
// Allowed values are "ApplyConfiguration" and "JSONPatch".
|
||||
// Required.
|
||||
PatchType *admissionregistrationv1.PatchType `json:"patchType,omitempty"`
|
||||
// applyConfiguration defines the desired configuration values of an object.
|
||||
// The configuration is applied to the admission object using
|
||||
// [structured merge diff](https://github.com/kubernetes-sigs/structured-merge-diff).
|
||||
// A CEL expression is used to create apply configuration.
|
||||
ApplyConfiguration *ApplyConfigurationApplyConfiguration `json:"applyConfiguration,omitempty"`
|
||||
// jsonPatch defines a [JSON patch](https://jsonpatch.com/) operation to perform a mutation to the object.
|
||||
// A CEL expression is used to create the JSON patch.
|
||||
JSONPatch *JSONPatchApplyConfiguration `json:"jsonPatch,omitempty"`
|
||||
}
|
||||
|
||||
// MutationApplyConfiguration constructs a declarative configuration of the Mutation type for use with
|
||||
// apply.
|
||||
func Mutation() *MutationApplyConfiguration {
|
||||
return &MutationApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithPatchType sets the PatchType field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the PatchType field is set to the value of the last call.
|
||||
func (b *MutationApplyConfiguration) WithPatchType(value admissionregistrationv1.PatchType) *MutationApplyConfiguration {
|
||||
b.PatchType = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithApplyConfiguration sets the ApplyConfiguration field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the ApplyConfiguration field is set to the value of the last call.
|
||||
func (b *MutationApplyConfiguration) WithApplyConfiguration(value *ApplyConfigurationApplyConfiguration) *MutationApplyConfiguration {
|
||||
b.ApplyConfiguration = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithJSONPatch sets the JSONPatch field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the JSONPatch field is set to the value of the last call.
|
||||
func (b *MutationApplyConfiguration) WithJSONPatch(value *JSONPatchApplyConfiguration) *MutationApplyConfiguration {
|
||||
b.JSONPatch = value
|
||||
return b
|
||||
}
|
||||
@@ -24,15 +24,16 @@ package v1alpha1
|
||||
// An API server instance reports the version it can decode and the version it
|
||||
// encodes objects to when persisting objects in the backend.
|
||||
type ServerStorageVersionApplyConfiguration struct {
|
||||
// The ID of the reporting API server.
|
||||
// apiServerID is the ID of the reporting API server.
|
||||
APIServerID *string `json:"apiServerID,omitempty"`
|
||||
// The API server encodes the object to this version when persisting it in
|
||||
// encodingVersion the API server encodes the object to when persisting it in
|
||||
// the backend (e.g., etcd).
|
||||
EncodingVersion *string `json:"encodingVersion,omitempty"`
|
||||
// decodableVersions are the encoding versions the API server can handle to decode.
|
||||
// The API server can decode objects encoded in these versions.
|
||||
// The encodingVersion must be included in the decodableVersions.
|
||||
DecodableVersions []string `json:"decodableVersions,omitempty"`
|
||||
// The API server can serve these versions.
|
||||
// servedVersions lists all versions the API server can serve.
|
||||
// DecodableVersions must include all ServedVersions.
|
||||
ServedVersions []string `json:"servedVersions,omitempty"`
|
||||
}
|
||||
|
||||
@@ -33,11 +33,12 @@ import (
|
||||
// Storage version of a specific resource.
|
||||
type StorageVersionApplyConfiguration struct {
|
||||
v1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
// metadata is the standard object metadata.
|
||||
// The name is <group>.<resource>.
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
// Spec is an empty spec. It is here to comply with Kubernetes API style.
|
||||
// spec is an empty spec. It is here to comply with Kubernetes API style.
|
||||
Spec *apiserverinternalv1alpha1.StorageVersionSpec `json:"spec,omitempty"`
|
||||
// API server instances report the version they can decode and the version they
|
||||
// status on the version the API server instance can decode from and
|
||||
// encode objects to when persisting objects in the backend.
|
||||
Status *StorageVersionStatusApplyConfiguration `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
@@ -28,17 +28,17 @@ import (
|
||||
//
|
||||
// Describes the state of the storageVersion at a certain point.
|
||||
type StorageVersionConditionApplyConfiguration struct {
|
||||
// Type of the condition.
|
||||
// type of the condition.
|
||||
Type *apiserverinternalv1alpha1.StorageVersionConditionType `json:"type,omitempty"`
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
// status of the condition, one of True, False, Unknown.
|
||||
Status *apiserverinternalv1alpha1.ConditionStatus `json:"status,omitempty"`
|
||||
// If set, this represents the .metadata.generation that the condition was set based upon.
|
||||
// observedGeneration represents the .metadata.generation that the condition was set based upon, if field is set.
|
||||
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
|
||||
// Last time the condition transitioned from one status to another.
|
||||
// lastTransitionTime is the last time the condition transitioned from one status to another.
|
||||
LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"`
|
||||
// The reason for the condition's last transition.
|
||||
// reason for the condition's last transition.
|
||||
Reason *string `json:"reason,omitempty"`
|
||||
// A human readable message indicating details about the transition.
|
||||
// message is a human readable string indicating details about the transition.
|
||||
Message *string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -24,14 +24,15 @@ package v1alpha1
|
||||
// API server instances report the versions they can decode and the version they
|
||||
// encode objects to when persisting objects in the backend.
|
||||
type StorageVersionStatusApplyConfiguration struct {
|
||||
// The reported versions per API server instance.
|
||||
// storageVersions lists the reported versions per API server instance.
|
||||
StorageVersions []ServerStorageVersionApplyConfiguration `json:"storageVersions,omitempty"`
|
||||
// If all API server instances agree on the same encoding storage version,
|
||||
// then this field is set to that version. Otherwise this field is left empty.
|
||||
// commonEncodingVersion is set to an encoding storage version if all API server
|
||||
// instances share that same version. If they don't share one storage version, this
|
||||
// field is left empty.
|
||||
// API servers should finish updating its storageVersionStatus entry before
|
||||
// serving write operations, so that this field will be in sync with the reality.
|
||||
CommonEncodingVersion *string `json:"commonEncodingVersion,omitempty"`
|
||||
// The latest available observations of the storageVersion's state.
|
||||
// conditions lists the latest available observations of the storageVersion's state.
|
||||
Conditions []StorageVersionConditionApplyConfiguration `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -62,8 +62,7 @@ type PodCertificateRequestSpecApplyConfiguration struct {
|
||||
// `kubernetes.io` signers will never issue certificates with a lifetime
|
||||
// longer than 24 hours.
|
||||
MaxExpirationSeconds *int32 `json:"maxExpirationSeconds,omitempty"`
|
||||
// pkixPublicKey is the PKIX-serialized public key the signer will issue the
|
||||
// certificate to.
|
||||
// The PKIX-serialized public key the signer will issue the certificate to.
|
||||
//
|
||||
// The key must be one of RSA3072, RSA4096, ECDSAP256, ECDSAP384, ECDSAP521,
|
||||
// or ED25519. Note that this list may be expanded in the future.
|
||||
@@ -74,9 +73,14 @@ type PodCertificateRequestSpecApplyConfiguration struct {
|
||||
// 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.
|
||||
//
|
||||
// Deprecated: This field is replaced by StubPKCS10Request. If
|
||||
// StubPKCS10Request is set, this field must be empty. Signer
|
||||
// implementations should extract the public key from the StubPKCS10Request
|
||||
// field.
|
||||
PKIXPublicKey []byte `json:"pkixPublicKey,omitempty"`
|
||||
// proofOfPossession proves that the requesting kubelet holds the private
|
||||
// key corresponding to pkixPublicKey.
|
||||
// A proof that the requesting kubelet holds the private key corresponding
|
||||
// to pkixPublicKey.
|
||||
//
|
||||
// It is contructed by signing the ASCII bytes of the pod's UID using
|
||||
// `pkixPublicKey`.
|
||||
@@ -93,9 +97,31 @@ type PodCertificateRequestSpecApplyConfiguration struct {
|
||||
// golang library function crypto/ecdsa.SignASN1)
|
||||
//
|
||||
// If the key is an ED25519 key, the the signature is as described by the
|
||||
// [ED25519 Specification](https://ed25519.cr.yp.to/) (as implemented by
|
||||
// the golang library crypto/ed25519.Sign).
|
||||
// [ED25519 Specification](https://ed25519.cr.yp.to/) (as implemented by the
|
||||
// golang library crypto/ed25519.Sign).
|
||||
//
|
||||
// Deprecated: This field is replaced by StubPKCS10Request. If
|
||||
// StubPKCS10Request is set, this field must be empty.
|
||||
ProofOfPossession []byte `json:"proofOfPossession,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.
|
||||
@@ -199,6 +225,16 @@ func (b *PodCertificateRequestSpecApplyConfiguration) WithProofOfPossession(valu
|
||||
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,
|
||||
|
||||
@@ -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 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.
|
||||
//
|
||||
// NodeAllocatableResourceClaimStatus describes the status of node allocatable resources allocated via DRA.
|
||||
type NodeAllocatableResourceClaimStatusApplyConfiguration struct {
|
||||
// ResourceClaimName is the resource claim referenced by the pod that resulted in this node allocatable resource allocation.
|
||||
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"`
|
||||
}
|
||||
|
||||
// NodeAllocatableResourceClaimStatusApplyConfiguration constructs a declarative configuration of the NodeAllocatableResourceClaimStatus type for use with
|
||||
// apply.
|
||||
func NodeAllocatableResourceClaimStatus() *NodeAllocatableResourceClaimStatusApplyConfiguration {
|
||||
return &NodeAllocatableResourceClaimStatusApplyConfiguration{}
|
||||
}
|
||||
|
||||
// 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 *NodeAllocatableResourceClaimStatusApplyConfiguration) WithResourceClaimName(value string) *NodeAllocatableResourceClaimStatusApplyConfiguration {
|
||||
b.ResourceClaimName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithContainers adds the given value to the Containers 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 Containers field.
|
||||
func (b *NodeAllocatableResourceClaimStatusApplyConfiguration) WithContainers(values ...string) *NodeAllocatableResourceClaimStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
b.Containers = append(b.Containers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResources puts the entries into the Resources 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))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.Resources[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -32,7 +32,6 @@ type PodConditionApplyConfiguration struct {
|
||||
// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions
|
||||
Type *corev1.PodConditionType `json:"type,omitempty"`
|
||||
// If set, this represents the .metadata.generation that the pod condition was set based upon.
|
||||
// The PodObservedGenerationTracking feature gate must be enabled to use this field.
|
||||
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
|
||||
// Status is the status of the condition.
|
||||
// Can be True, False, Unknown.
|
||||
|
||||
@@ -27,6 +27,14 @@ package v1
|
||||
//
|
||||
// It adds a name to it that uniquely identifies the ResourceClaim inside the Pod.
|
||||
// Containers that need access to the ResourceClaim reference it with this name.
|
||||
//
|
||||
// When the DRAWorkloadResourceClaims feature gate is enabled and this Pod
|
||||
// belongs to a PodGroup, a PodResourceClaim is matched to a
|
||||
// PodGroupResourceClaim if all of their fields are equal (Name,
|
||||
// ResourceClaimName, and ResourceClaimTemplateName). A matched claim references
|
||||
// a single ResourceClaim shared across all Pods in the PodGroup, reserved for
|
||||
// the PodGroup in ResourceClaimStatus.ReservedFor rather than for individual
|
||||
// Pods.
|
||||
type PodResourceClaimApplyConfiguration struct {
|
||||
// Name uniquely identifies this resource claim inside the pod.
|
||||
// This must be a DNS_LABEL.
|
||||
@@ -46,6 +54,16 @@ type PodResourceClaimApplyConfiguration struct {
|
||||
// generated component, will be used to form a unique name for the
|
||||
// ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
|
||||
//
|
||||
// When the DRAWorkloadResourceClaims feature gate is enabled and the pod
|
||||
// belongs to a PodGroup that defines a PodGroupResourceClaim with the same
|
||||
// Name and ResourceClaimTemplateName, this PodResourceClaim resolves to the
|
||||
// ResourceClaim generated for the PodGroup. All pods in the group that
|
||||
// define an equivalent PodResourceClaim matching the
|
||||
// PodGroupResourceClaim's Name and ResourceClaimTemplateName share the same
|
||||
// generated ResourceClaim. ResourceClaims generated for a PodGroup are
|
||||
// owned by the PodGroup and their lifecycles are tied to the PodGroup
|
||||
// instead of any individual pod.
|
||||
//
|
||||
// This field is immutable and no changes will be made to the
|
||||
// corresponding ResourceClaim by the control plane after creating the
|
||||
// ResourceClaim.
|
||||
|
||||
@@ -30,9 +30,16 @@ type PodResourceClaimStatusApplyConfiguration struct {
|
||||
// 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 Pod in the namespace of the Pod. If this is
|
||||
// unset, then generating a ResourceClaim was not necessary. The
|
||||
// pod.spec.resourceClaims entry can be ignored in this case.
|
||||
// generated for the Pod in the namespace of the Pod.
|
||||
//
|
||||
// When the DRAWorkloadResourceClaims feature is enabled and the
|
||||
// corresponding PodResourceClaim matches a PodGroupResourceClaim
|
||||
// made by the Pod's PodGroup, then this is the name of the
|
||||
// ResourceClaim generated and reserved for the PodGroup.
|
||||
//
|
||||
// If this is unset, then generating a ResourceClaim was not
|
||||
// necessary. The pod.spec.resourceClaims entry can be ignored in
|
||||
// this case.
|
||||
ResourceClaimName *string `json:"resourceClaimName,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
46
applyconfigurations/core/v1/podschedulinggroup.go
Normal file
46
applyconfigurations/core/v1/podschedulinggroup.go
Normal file
@@ -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 applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
// PodSchedulingGroupApplyConfiguration represents a declarative configuration of the PodSchedulingGroup type for use
|
||||
// with apply.
|
||||
//
|
||||
// PodSchedulingGroup identifies the runtime scheduling group instance that a Pod belongs to.
|
||||
// The scheduler uses this information to apply workload-aware scheduling semantics.
|
||||
// Exactly one field must be specified.
|
||||
type PodSchedulingGroupApplyConfiguration struct {
|
||||
// PodGroupName specifies the name of the standalone PodGroup object
|
||||
// that represents the runtime instance of this group.
|
||||
// Must be a DNS subdomain.
|
||||
PodGroupName *string `json:"podGroupName,omitempty"`
|
||||
}
|
||||
|
||||
// PodSchedulingGroupApplyConfiguration constructs a declarative configuration of the PodSchedulingGroup type for use with
|
||||
// apply.
|
||||
func PodSchedulingGroup() *PodSchedulingGroupApplyConfiguration {
|
||||
return &PodSchedulingGroupApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithPodGroupName sets the PodGroupName field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the PodGroupName field is set to the value of the last call.
|
||||
func (b *PodSchedulingGroupApplyConfiguration) WithPodGroupName(value string) *PodSchedulingGroupApplyConfiguration {
|
||||
b.PodGroupName = &value
|
||||
return b
|
||||
}
|
||||
@@ -233,7 +233,6 @@ type PodSpecApplyConfiguration 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.
|
||||
// This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature.
|
||||
HostUsers *bool `json:"hostUsers,omitempty"`
|
||||
// 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
|
||||
@@ -273,14 +272,19 @@ type PodSpecApplyConfiguration struct {
|
||||
// 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"`
|
||||
// WorkloadRef provides a reference to the Workload object that this Pod belongs to.
|
||||
// This field is used by the scheduler to identify the PodGroup and apply the
|
||||
// correct group scheduling policies. The Workload object referenced
|
||||
// by this field may not exist at the time the Pod is created.
|
||||
// This field is immutable, but a Workload object with the same name
|
||||
// may be recreated with different policies. Doing this during pod scheduling
|
||||
// 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.
|
||||
WorkloadRef *WorkloadReferenceApplyConfiguration `json:"workloadRef,omitempty"`
|
||||
SchedulingGroup *PodSchedulingGroupApplyConfiguration `json:"schedulingGroup,omitempty"`
|
||||
}
|
||||
|
||||
// PodSpecApplyConfiguration constructs a declarative configuration of the PodSpec type for use with
|
||||
@@ -678,10 +682,10 @@ func (b *PodSpecApplyConfiguration) WithHostnameOverride(value string) *PodSpecA
|
||||
return b
|
||||
}
|
||||
|
||||
// WithWorkloadRef sets the WorkloadRef field in the declarative configuration to the given value
|
||||
// WithSchedulingGroup sets the SchedulingGroup field in the declarative configuration 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 *PodSpecApplyConfiguration) WithWorkloadRef(value *WorkloadReferenceApplyConfiguration) *PodSpecApplyConfiguration {
|
||||
b.WorkloadRef = value
|
||||
// If called multiple times, the SchedulingGroup field is set to the value of the last call.
|
||||
func (b *PodSpecApplyConfiguration) WithSchedulingGroup(value *PodSchedulingGroupApplyConfiguration) *PodSpecApplyConfiguration {
|
||||
b.SchedulingGroup = value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -139,6 +139,12 @@ type PodStatusApplyConfiguration struct {
|
||||
// applied at the pod level if pod-level requests or limits are set in
|
||||
// PodSpec.Resources
|
||||
Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"`
|
||||
// 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.
|
||||
NodeAllocatableResourceClaimStatuses []NodeAllocatableResourceClaimStatusApplyConfiguration `json:"nodeAllocatableResourceClaimStatuses,omitempty"`
|
||||
}
|
||||
|
||||
// PodStatusApplyConfiguration constructs a declarative configuration of the PodStatus type for use with
|
||||
@@ -341,3 +347,16 @@ func (b *PodStatusApplyConfiguration) WithResources(value *ResourceRequirementsA
|
||||
b.Resources = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNodeAllocatableResourceClaimStatuses adds the given value to the NodeAllocatableResourceClaimStatuses 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 NodeAllocatableResourceClaimStatuses field.
|
||||
func (b *PodStatusApplyConfiguration) WithNodeAllocatableResourceClaimStatuses(values ...*NodeAllocatableResourceClaimStatusApplyConfiguration) *PodStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithNodeAllocatableResourceClaimStatuses")
|
||||
}
|
||||
b.NodeAllocatableResourceClaimStatuses = append(b.NodeAllocatableResourceClaimStatuses, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -41,6 +41,9 @@ type ResourceHealthApplyConfiguration struct {
|
||||
//
|
||||
// In future we may want to introduce the PermanentlyUnhealthy Status.
|
||||
Health *corev1.ResourceHealthStatus `json:"health,omitempty"`
|
||||
// Message provides human-readable context for Health (e.g. "ECC error count exceeded threshold").
|
||||
// This field is populated by the kubelet when ResourceHealthStatusMessage is enabled if the DRA plugin returns a message, and is null otherwise.
|
||||
Message *string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceHealthApplyConfiguration constructs a declarative configuration of the ResourceHealth type for use with
|
||||
@@ -64,3 +67,11 @@ func (b *ResourceHealthApplyConfiguration) WithHealth(value corev1.ResourceHealt
|
||||
b.Health = &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 *ResourceHealthApplyConfiguration) WithMessage(value string) *ResourceHealthApplyConfiguration {
|
||||
b.Message = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -83,7 +83,6 @@ type SecurityContextApplyConfiguration struct {
|
||||
// procMount denotes the type of proc mount to use for the containers.
|
||||
// The default value is Default which uses the container runtime defaults for
|
||||
// readonly paths and masked paths.
|
||||
// This requires the ProcMountType feature flag to be enabled.
|
||||
// Note that this field cannot be set when spec.os.name is windows.
|
||||
ProcMount *corev1.ProcMountType `json:"procMount,omitempty"`
|
||||
// The seccomp options to use by this container. If seccomp options are
|
||||
|
||||
@@ -39,7 +39,7 @@ type VolumeMountStatusApplyConfiguration struct {
|
||||
RecursiveReadOnly *corev1.RecursiveReadOnlyMode `json:"recursiveReadOnly,omitempty"`
|
||||
// volumeStatus represents volume-type-specific status about the mounted
|
||||
// volume.
|
||||
*VolumeStatusApplyConfiguration `json:"volumeStatus,omitempty"`
|
||||
VolumeStatus *VolumeStatusApplyConfiguration `json:"volumeStatus,omitempty"`
|
||||
}
|
||||
|
||||
// VolumeMountStatusApplyConfiguration constructs a declarative configuration of the VolumeMountStatus type for use with
|
||||
@@ -80,17 +80,10 @@ func (b *VolumeMountStatusApplyConfiguration) WithRecursiveReadOnly(value corev1
|
||||
return b
|
||||
}
|
||||
|
||||
// WithImage sets the Image field in the declarative configuration to the given value
|
||||
// WithVolumeStatus sets the VolumeStatus field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Image field is set to the value of the last call.
|
||||
func (b *VolumeMountStatusApplyConfiguration) WithImage(value *ImageVolumeStatusApplyConfiguration) *VolumeMountStatusApplyConfiguration {
|
||||
b.ensureVolumeStatusApplyConfigurationExists()
|
||||
b.VolumeStatusApplyConfiguration.Image = value
|
||||
// If called multiple times, the VolumeStatus field is set to the value of the last call.
|
||||
func (b *VolumeMountStatusApplyConfiguration) WithVolumeStatus(value *VolumeStatusApplyConfiguration) *VolumeMountStatusApplyConfiguration {
|
||||
b.VolumeStatus = value
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *VolumeMountStatusApplyConfiguration) ensureVolumeStatusApplyConfigurationExists() {
|
||||
if b.VolumeStatusApplyConfiguration == nil {
|
||||
b.VolumeStatusApplyConfiguration = &VolumeStatusApplyConfiguration{}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ type VolumeSourceApplyConfiguration struct {
|
||||
// A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message.
|
||||
// The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field.
|
||||
// The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images.
|
||||
// The volume will be mounted read-only (ro) and non-executable files (noexec).
|
||||
// The volume will be mounted read-only (ro).
|
||||
// Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33.
|
||||
// The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.
|
||||
Image *ImageVolumeSourceApplyConfiguration `json:"image,omitempty"`
|
||||
|
||||
@@ -1,74 +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
|
||||
|
||||
// WorkloadReferenceApplyConfiguration represents a declarative configuration of the WorkloadReference type for use
|
||||
// with apply.
|
||||
//
|
||||
// WorkloadReference identifies the Workload object and PodGroup membership
|
||||
// that a Pod belongs to. The scheduler uses this information to apply
|
||||
// workload-aware scheduling semantics.
|
||||
type WorkloadReferenceApplyConfiguration struct {
|
||||
// Name defines the name of the Workload object this Pod belongs to.
|
||||
// Workload must be in the same namespace as the Pod.
|
||||
// If it doesn't match any existing Workload, the Pod will remain unschedulable
|
||||
// until a Workload object is created and observed by the kube-scheduler.
|
||||
// It must be a DNS subdomain.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// PodGroup is the name of the PodGroup within the Workload that this Pod
|
||||
// belongs to. If it doesn't match any existing PodGroup within the Workload,
|
||||
// the Pod will remain unschedulable until the Workload object is recreated
|
||||
// and observed by the kube-scheduler. It must be a DNS label.
|
||||
PodGroup *string `json:"podGroup,omitempty"`
|
||||
// PodGroupReplicaKey specifies the replica key of the PodGroup to which this
|
||||
// Pod belongs. It is used to distinguish pods belonging to different replicas
|
||||
// of the same pod group. The pod group policy is applied separately to each replica.
|
||||
// When set, it must be a DNS label.
|
||||
PodGroupReplicaKey *string `json:"podGroupReplicaKey,omitempty"`
|
||||
}
|
||||
|
||||
// WorkloadReferenceApplyConfiguration constructs a declarative configuration of the WorkloadReference type for use with
|
||||
// apply.
|
||||
func WorkloadReference() *WorkloadReferenceApplyConfiguration {
|
||||
return &WorkloadReferenceApplyConfiguration{}
|
||||
}
|
||||
|
||||
// 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 *WorkloadReferenceApplyConfiguration) WithName(value string) *WorkloadReferenceApplyConfiguration {
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPodGroup sets the PodGroup field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the PodGroup field is set to the value of the last call.
|
||||
func (b *WorkloadReferenceApplyConfiguration) WithPodGroup(value string) *WorkloadReferenceApplyConfiguration {
|
||||
b.PodGroup = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPodGroupReplicaKey sets the PodGroupReplicaKey field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the PodGroupReplicaKey field is set to the value of the last call.
|
||||
func (b *WorkloadReferenceApplyConfiguration) WithPodGroupReplicaKey(value string) *WorkloadReferenceApplyConfiguration {
|
||||
b.PodGroupReplicaKey = &value
|
||||
return b
|
||||
}
|
||||
@@ -39,6 +39,12 @@ func Parser() *typed.Parser {
|
||||
var parserOnce sync.Once
|
||||
var parser *typed.Parser
|
||||
var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: io.k8s.api.admissionregistration.v1.ApplyConfiguration
|
||||
map:
|
||||
fields:
|
||||
- name: expression
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.admissionregistration.v1.AuditAnnotation
|
||||
map:
|
||||
fields:
|
||||
@@ -61,6 +67,12 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.admissionregistration.v1.JSONPatch
|
||||
map:
|
||||
fields:
|
||||
- name: expression
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.admissionregistration.v1.MatchCondition
|
||||
map:
|
||||
fields:
|
||||
@@ -97,6 +109,87 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
namedType: io.k8s.api.admissionregistration.v1.NamedRuleWithOperations
|
||||
elementRelationship: atomic
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.admissionregistration.v1.MutatingAdmissionPolicy
|
||||
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.admissionregistration.v1.MutatingAdmissionPolicySpec
|
||||
default: {}
|
||||
- name: io.k8s.api.admissionregistration.v1.MutatingAdmissionPolicyBinding
|
||||
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.admissionregistration.v1.MutatingAdmissionPolicyBindingSpec
|
||||
default: {}
|
||||
- name: io.k8s.api.admissionregistration.v1.MutatingAdmissionPolicyBindingSpec
|
||||
map:
|
||||
fields:
|
||||
- name: matchResources
|
||||
type:
|
||||
namedType: io.k8s.api.admissionregistration.v1.MatchResources
|
||||
- name: paramRef
|
||||
type:
|
||||
namedType: io.k8s.api.admissionregistration.v1.ParamRef
|
||||
- name: policyName
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.admissionregistration.v1.MutatingAdmissionPolicySpec
|
||||
map:
|
||||
fields:
|
||||
- name: failurePolicy
|
||||
type:
|
||||
scalar: string
|
||||
- name: matchConditions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.admissionregistration.v1.MatchCondition
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
- name: matchConstraints
|
||||
type:
|
||||
namedType: io.k8s.api.admissionregistration.v1.MatchResources
|
||||
- name: mutations
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.admissionregistration.v1.Mutation
|
||||
elementRelationship: atomic
|
||||
- name: paramKind
|
||||
type:
|
||||
namedType: io.k8s.api.admissionregistration.v1.ParamKind
|
||||
- name: reinvocationPolicy
|
||||
type:
|
||||
scalar: string
|
||||
- name: variables
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.admissionregistration.v1.Variable
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.admissionregistration.v1.MutatingWebhook
|
||||
map:
|
||||
fields:
|
||||
@@ -170,6 +263,19 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
- name: io.k8s.api.admissionregistration.v1.Mutation
|
||||
map:
|
||||
fields:
|
||||
- name: applyConfiguration
|
||||
type:
|
||||
namedType: io.k8s.api.admissionregistration.v1.ApplyConfiguration
|
||||
- name: jsonPatch
|
||||
type:
|
||||
namedType: io.k8s.api.admissionregistration.v1.JSONPatch
|
||||
- name: patchType
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.admissionregistration.v1.NamedRuleWithOperations
|
||||
map:
|
||||
fields:
|
||||
@@ -3983,6 +4089,9 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: stubPKCS10Request
|
||||
type:
|
||||
scalar: string
|
||||
- name: unverifiedUserAnnotations
|
||||
type:
|
||||
map:
|
||||
@@ -5931,6 +6040,24 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: requiredDuringSchedulingIgnoredDuringExecution
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.NodeSelector
|
||||
- name: io.k8s.api.core.v1.NodeAllocatableResourceClaimStatus
|
||||
map:
|
||||
fields:
|
||||
- name: containers
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: associative
|
||||
- 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:
|
||||
@@ -6764,6 +6891,16 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.core.v1.PodSchedulingGroup
|
||||
map:
|
||||
fields:
|
||||
- name: podGroupName
|
||||
type:
|
||||
scalar: string
|
||||
unions:
|
||||
- fields:
|
||||
- fieldName: podGroupName
|
||||
discriminatorValue: PodGroupName
|
||||
- name: io.k8s.api.core.v1.PodSecurityContext
|
||||
map:
|
||||
fields:
|
||||
@@ -6951,6 +7088,9 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
- name: schedulingGroup
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.PodSchedulingGroup
|
||||
- name: securityContext
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.PodSecurityContext
|
||||
@@ -6995,9 +7135,6 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
- name: workloadRef
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.WorkloadReference
|
||||
- name: io.k8s.api.core.v1.PodStatus
|
||||
map:
|
||||
fields:
|
||||
@@ -7047,6 +7184,12 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: message
|
||||
type:
|
||||
scalar: string
|
||||
- name: nodeAllocatableResourceClaimStatuses
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.core.v1.NodeAllocatableResourceClaimStatus
|
||||
elementRelationship: atomic
|
||||
- name: nominatedNodeName
|
||||
type:
|
||||
scalar: string
|
||||
@@ -7410,6 +7553,9 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: health
|
||||
type:
|
||||
scalar: string
|
||||
- name: message
|
||||
type:
|
||||
scalar: string
|
||||
- name: resourceID
|
||||
type:
|
||||
scalar: string
|
||||
@@ -8301,7 +8447,6 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: volumeStatus
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.VolumeStatus
|
||||
default: {}
|
||||
- name: io.k8s.api.core.v1.VolumeNodeAffinity
|
||||
map:
|
||||
fields:
|
||||
@@ -8390,20 +8535,6 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: runAsUserName
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.core.v1.WorkloadReference
|
||||
map:
|
||||
fields:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: podGroup
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: podGroupReplicaKey
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.discovery.v1.Endpoint
|
||||
map:
|
||||
fields:
|
||||
@@ -12345,6 +12476,11 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: nodeAllocatableResourceMappings
|
||||
type:
|
||||
map:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1.NodeAllocatableResourceMapping
|
||||
- name: nodeName
|
||||
type:
|
||||
scalar: string
|
||||
@@ -12394,15 +12530,39 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: bool
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: bools
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: boolean
|
||||
elementRelationship: atomic
|
||||
- name: int
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: ints
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: numeric
|
||||
elementRelationship: atomic
|
||||
- name: string
|
||||
type:
|
||||
scalar: string
|
||||
- name: strings
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: version
|
||||
type:
|
||||
scalar: string
|
||||
- name: versions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1.DeviceCapacity
|
||||
map:
|
||||
fields:
|
||||
@@ -12697,6 +12857,15 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1.NodeAllocatableResourceMapping
|
||||
map:
|
||||
fields:
|
||||
- name: allocationMultiplier
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.api.resource.Quantity
|
||||
- name: capacityKey
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1.OpaqueDeviceConfiguration
|
||||
map:
|
||||
fields:
|
||||
@@ -12944,6 +13113,94 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: pool
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1alpha3.PoolStatus
|
||||
map:
|
||||
fields:
|
||||
- name: allocatedDevices
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: availableDevices
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: driver
|
||||
type:
|
||||
scalar: string
|
||||
- name: generation
|
||||
type:
|
||||
scalar: numeric
|
||||
default: 0
|
||||
- name: nodeName
|
||||
type:
|
||||
scalar: string
|
||||
- name: poolName
|
||||
type:
|
||||
scalar: string
|
||||
- name: resourceSliceCount
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: totalDevices
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: unavailableDevices
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: validationError
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1alpha3.ResourcePoolStatusRequest
|
||||
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.resource.v1alpha3.ResourcePoolStatusRequestSpec
|
||||
default: {}
|
||||
- name: status
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1alpha3.ResourcePoolStatusRequestStatus
|
||||
- name: io.k8s.api.resource.v1alpha3.ResourcePoolStatusRequestSpec
|
||||
map:
|
||||
fields:
|
||||
- name: driver
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: limit
|
||||
type:
|
||||
scalar: numeric
|
||||
default: 100
|
||||
- name: poolName
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1alpha3.ResourcePoolStatusRequestStatus
|
||||
map:
|
||||
fields:
|
||||
- name: conditions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- type
|
||||
- name: poolCount
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: pools
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1alpha3.PoolStatus
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1beta1.AllocatedDeviceStatus
|
||||
map:
|
||||
fields:
|
||||
@@ -13029,6 +13286,11 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta1.DeviceCounterConsumption
|
||||
elementRelationship: atomic
|
||||
- name: nodeAllocatableResourceMappings
|
||||
type:
|
||||
map:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta1.NodeAllocatableResourceMapping
|
||||
- name: nodeName
|
||||
type:
|
||||
scalar: string
|
||||
@@ -13148,15 +13410,39 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: bool
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: bools
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: boolean
|
||||
elementRelationship: atomic
|
||||
- name: int
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: ints
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: numeric
|
||||
elementRelationship: atomic
|
||||
- name: string
|
||||
type:
|
||||
scalar: string
|
||||
- name: strings
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: version
|
||||
type:
|
||||
scalar: string
|
||||
- name: versions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1beta1.DeviceCapacity
|
||||
map:
|
||||
fields:
|
||||
@@ -13445,6 +13731,15 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1beta1.NodeAllocatableResourceMapping
|
||||
map:
|
||||
fields:
|
||||
- name: allocationMultiplier
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.api.resource.Quantity
|
||||
- name: capacityKey
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1beta1.OpaqueDeviceConfiguration
|
||||
map:
|
||||
fields:
|
||||
@@ -13770,6 +14065,11 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: nodeAllocatableResourceMappings
|
||||
type:
|
||||
map:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta2.NodeAllocatableResourceMapping
|
||||
- name: nodeName
|
||||
type:
|
||||
scalar: string
|
||||
@@ -13819,15 +14119,39 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: bool
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: bools
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: boolean
|
||||
elementRelationship: atomic
|
||||
- name: int
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: ints
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: numeric
|
||||
elementRelationship: atomic
|
||||
- name: string
|
||||
type:
|
||||
scalar: string
|
||||
- name: strings
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: version
|
||||
type:
|
||||
scalar: string
|
||||
- name: versions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1beta2.DeviceCapacity
|
||||
map:
|
||||
fields:
|
||||
@@ -14057,6 +14381,60 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: value
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1beta2.DeviceTaintRule
|
||||
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.resource.v1beta2.DeviceTaintRuleSpec
|
||||
default: {}
|
||||
- name: status
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta2.DeviceTaintRuleStatus
|
||||
default: {}
|
||||
- name: io.k8s.api.resource.v1beta2.DeviceTaintRuleSpec
|
||||
map:
|
||||
fields:
|
||||
- name: deviceSelector
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta2.DeviceTaintSelector
|
||||
- name: taint
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta2.DeviceTaint
|
||||
default: {}
|
||||
- name: io.k8s.api.resource.v1beta2.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.v1beta2.DeviceTaintSelector
|
||||
map:
|
||||
fields:
|
||||
- name: device
|
||||
type:
|
||||
scalar: string
|
||||
- name: driver
|
||||
type:
|
||||
scalar: string
|
||||
- name: pool
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1beta2.DeviceToleration
|
||||
map:
|
||||
fields:
|
||||
@@ -14122,6 +14500,15 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1beta2.NodeAllocatableResourceMapping
|
||||
map:
|
||||
fields:
|
||||
- name: allocationMultiplier
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.api.resource.Quantity
|
||||
- name: capacityKey
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1beta2.OpaqueDeviceConfiguration
|
||||
map:
|
||||
fields:
|
||||
@@ -14324,7 +14711,7 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
type:
|
||||
scalar: numeric
|
||||
default: 0
|
||||
- name: io.k8s.api.scheduling.v1alpha1.BasicSchedulingPolicy
|
||||
- name: io.k8s.api.scheduling.v1alpha2.BasicSchedulingPolicy
|
||||
map:
|
||||
elementType:
|
||||
scalar: untyped
|
||||
@@ -14336,80 +14723,14 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementType:
|
||||
namedType: __untyped_deduced_
|
||||
elementRelationship: separable
|
||||
- name: io.k8s.api.scheduling.v1alpha1.GangSchedulingPolicy
|
||||
- name: io.k8s.api.scheduling.v1alpha2.GangSchedulingPolicy
|
||||
map:
|
||||
fields:
|
||||
- name: minCount
|
||||
type:
|
||||
scalar: numeric
|
||||
default: 0
|
||||
- name: io.k8s.api.scheduling.v1alpha1.PodGroup
|
||||
map:
|
||||
fields:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: policy
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha1.PodGroupPolicy
|
||||
default: {}
|
||||
- name: io.k8s.api.scheduling.v1alpha1.PodGroupPolicy
|
||||
map:
|
||||
fields:
|
||||
- name: basic
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha1.BasicSchedulingPolicy
|
||||
- name: gang
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha1.GangSchedulingPolicy
|
||||
unions:
|
||||
- fields:
|
||||
- fieldName: basic
|
||||
discriminatorValue: Basic
|
||||
- fieldName: gang
|
||||
discriminatorValue: Gang
|
||||
- name: io.k8s.api.scheduling.v1alpha1.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.scheduling.v1alpha1.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.v1alpha1.Workload
|
||||
- name: io.k8s.api.scheduling.v1alpha2.PodGroup
|
||||
map:
|
||||
fields:
|
||||
- name: apiVersion
|
||||
@@ -14424,19 +14745,210 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
default: {}
|
||||
- name: spec
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha1.WorkloadSpec
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSpec
|
||||
default: {}
|
||||
- name: io.k8s.api.scheduling.v1alpha1.WorkloadSpec
|
||||
- name: status
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupStatus
|
||||
default: {}
|
||||
- name: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaim
|
||||
map:
|
||||
fields:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: resourceClaimName
|
||||
type:
|
||||
scalar: string
|
||||
- name: resourceClaimTemplateName
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaimStatus
|
||||
map:
|
||||
fields:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: resourceClaimName
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingConstraints
|
||||
map:
|
||||
fields:
|
||||
- name: topology
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.TopologyConstraint
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingPolicy
|
||||
map:
|
||||
fields:
|
||||
- name: basic
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.BasicSchedulingPolicy
|
||||
- name: gang
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.GangSchedulingPolicy
|
||||
unions:
|
||||
- fields:
|
||||
- fieldName: basic
|
||||
discriminatorValue: Basic
|
||||
- fieldName: gang
|
||||
discriminatorValue: Gang
|
||||
- name: io.k8s.api.scheduling.v1alpha2.PodGroupSpec
|
||||
map:
|
||||
fields:
|
||||
- name: disruptionMode
|
||||
type:
|
||||
scalar: string
|
||||
default: Pod
|
||||
- name: podGroupTemplateRef
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupTemplateReference
|
||||
- name: priority
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: priorityClassName
|
||||
type:
|
||||
scalar: string
|
||||
- name: resourceClaims
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaim
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
- name: schedulingConstraints
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingConstraints
|
||||
- name: schedulingPolicy
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingPolicy
|
||||
default: {}
|
||||
- name: io.k8s.api.scheduling.v1alpha2.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.v1alpha2.PodGroupResourceClaimStatus
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
- name: io.k8s.api.scheduling.v1alpha2.PodGroupTemplate
|
||||
map:
|
||||
fields:
|
||||
- name: disruptionMode
|
||||
type:
|
||||
scalar: string
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: priority
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: priorityClassName
|
||||
type:
|
||||
scalar: string
|
||||
- name: resourceClaims
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaim
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
- name: schedulingConstraints
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingConstraints
|
||||
- name: schedulingPolicy
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingPolicy
|
||||
default: {}
|
||||
- name: io.k8s.api.scheduling.v1alpha2.PodGroupTemplateReference
|
||||
map:
|
||||
fields:
|
||||
- name: workload
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.WorkloadPodGroupTemplateReference
|
||||
unions:
|
||||
- fields:
|
||||
- fieldName: workload
|
||||
discriminatorValue: Workload
|
||||
- name: io.k8s.api.scheduling.v1alpha2.TopologyConstraint
|
||||
map:
|
||||
fields:
|
||||
- name: key
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.scheduling.v1alpha2.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.v1alpha2.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.v1alpha2.WorkloadSpec
|
||||
default: {}
|
||||
- name: io.k8s.api.scheduling.v1alpha2.WorkloadPodGroupTemplateReference
|
||||
map:
|
||||
fields:
|
||||
- name: podGroupTemplateName
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: workloadName
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.scheduling.v1alpha2.WorkloadSpec
|
||||
map:
|
||||
fields:
|
||||
- name: controllerRef
|
||||
type:
|
||||
namedType: io.k8s.api.scheduling.v1alpha1.TypedLocalObjectReference
|
||||
- name: podGroups
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.TypedLocalObjectReference
|
||||
- name: podGroupTemplates
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.scheduling.v1alpha1.PodGroup
|
||||
namedType: io.k8s.api.scheduling.v1alpha2.PodGroupTemplate
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
@@ -14498,6 +15010,9 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: podInfoOnMount
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: preventPodSchedulingIfMissing
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: requiresRepublish
|
||||
type:
|
||||
scalar: boolean
|
||||
@@ -14907,6 +15422,9 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: podInfoOnMount
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: preventPodSchedulingIfMissing
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: requiresRepublish
|
||||
type:
|
||||
scalar: boolean
|
||||
|
||||
@@ -36,7 +36,7 @@ type AllocationResultApplyConfiguration struct {
|
||||
// AllocationTimestamp stores the time when the resources were allocated.
|
||||
// This field is not guaranteed to be set, in which case that time is unknown.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gate.
|
||||
AllocationTimestamp *metav1.Time `json:"allocationTimestamp,omitempty"`
|
||||
}
|
||||
|
||||
@@ -72,6 +72,14 @@ type CELDeviceSelectorApplyConfiguration struct {
|
||||
//
|
||||
// cel.bind(dra, device.attributes["dra.example.com"], dra.someBool && dra.anotherBool)
|
||||
//
|
||||
// When 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:
|
||||
//
|
||||
// device.attributes["dra.example.com"].models.includes("some-model")
|
||||
//
|
||||
// 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.
|
||||
|
||||
@@ -19,6 +19,7 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
import (
|
||||
apicorev1 "k8s.io/api/core/v1"
|
||||
resourcev1 "k8s.io/api/resource/v1"
|
||||
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
|
||||
)
|
||||
@@ -74,7 +75,7 @@ type DeviceApplyConfiguration struct {
|
||||
// any device in a ResourceSlice, then the maximum number of
|
||||
// allowed devices per ResourceSlice is 64 instead of 128.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Taints []DeviceTaintApplyConfiguration `json:"taints,omitempty"`
|
||||
// BindsToNode indicates if the usage of an allocation involving this device
|
||||
@@ -82,7 +83,7 @@ type DeviceApplyConfiguration struct {
|
||||
// If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector
|
||||
// to match the node where the allocation was made.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindsToNode *bool `json:"bindsToNode,omitempty"`
|
||||
// BindingConditions defines the conditions for proceeding with binding.
|
||||
@@ -94,7 +95,7 @@ type DeviceApplyConfiguration struct {
|
||||
//
|
||||
// The conditions must be a valid condition type string.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingConditions []string `json:"bindingConditions,omitempty"`
|
||||
// BindingFailureConditions defines the conditions for binding failure.
|
||||
@@ -105,7 +106,7 @@ type DeviceApplyConfiguration struct {
|
||||
//
|
||||
// The conditions must be a valid condition type string.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingFailureConditions []string `json:"bindingFailureConditions,omitempty"`
|
||||
// AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.
|
||||
@@ -113,6 +114,18 @@ 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
|
||||
// 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.
|
||||
NodeAllocatableResourceMappings map[apicorev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration `json:"nodeAllocatableResourceMappings,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceApplyConfiguration constructs a declarative configuration of the Device type for use with
|
||||
@@ -242,3 +255,17 @@ func (b *DeviceApplyConfiguration) WithAllowMultipleAllocations(value bool) *Dev
|
||||
b.AllowMultipleAllocations = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNodeAllocatableResourceMappings puts the entries into the NodeAllocatableResourceMappings 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))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.NodeAllocatableResourceMappings[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -32,6 +32,22 @@ type DeviceAttributeApplyConfiguration struct {
|
||||
// VersionValue is a semantic version according to semver.org spec 2.0.0.
|
||||
// Must not be longer than 64 characters.
|
||||
VersionValue *string `json:"version,omitempty"`
|
||||
// IntValues is a non-empty list of numbers.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
IntValues []int64 `json:"ints,omitempty"`
|
||||
// BoolValues is a non-empty list of true/false values.
|
||||
BoolValues []bool `json:"bools,omitempty"`
|
||||
// StringValues is a non-empty list of strings.
|
||||
// Each string must not be longer than 64 characters.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
StringValues []string `json:"strings,omitempty"`
|
||||
// VersionValues is a non-empty list of semantic versions according to semver.org spec 2.0.0.
|
||||
// Each version string must not be longer than 64 characters.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
VersionValues []string `json:"versions,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceAttributeApplyConfiguration constructs a declarative configuration of the DeviceAttribute type for use with
|
||||
@@ -71,3 +87,43 @@ func (b *DeviceAttributeApplyConfiguration) WithVersionValue(value string) *Devi
|
||||
b.VersionValue = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithIntValues adds the given value to the IntValues 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 IntValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithIntValues(values ...int64) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.IntValues = append(b.IntValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithBoolValues adds the given value to the BoolValues 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 BoolValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithBoolValues(values ...bool) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.BoolValues = append(b.BoolValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStringValues adds the given value to the StringValues 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 StringValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithStringValues(values ...string) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.StringValues = append(b.StringValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithVersionValues adds the given value to the VersionValues 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 VersionValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithVersionValues(values ...string) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.VersionValues = append(b.VersionValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ type DeviceClassSpecApplyConfiguration struct {
|
||||
// If two classes are created at the same time, then the name of the class
|
||||
// lexicographically sorted first is picked.
|
||||
//
|
||||
// This is an alpha field.
|
||||
// This is a beta field.
|
||||
ExtendedResourceName *string `json:"extendedResourceName,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -48,11 +48,21 @@ type DeviceConstraintApplyConfiguration struct {
|
||||
// its specification, but if one device doesn't, then it also will not be
|
||||
// chosen.
|
||||
//
|
||||
// When the DRAListTypeAttributes feature gate is enabled, comparison uses
|
||||
// set semantics(i.e., element order and duplicates are ignored): list-valued attributes
|
||||
// match when the intersection across all devices is non-empty.
|
||||
// Scalar values are treated as single-element lists for backward compatibility.
|
||||
//
|
||||
// Must include the domain qualifier.
|
||||
MatchAttribute *resourcev1.FullyQualifiedName `json:"matchAttribute,omitempty"`
|
||||
// DistinctAttribute requires that all devices in question have this
|
||||
// attribute and that its type and value are unique across those devices.
|
||||
//
|
||||
// When the DRAListTypeAttributes feature gate is enabled, comparison uses
|
||||
// set semantics (i.e., element order and duplicates are ignored):
|
||||
// list-valued attributes must be pairwise disjoint across devices.
|
||||
// Scalar values are treated as singleton sets for backward compatibility.
|
||||
//
|
||||
// This acts as the inverse of MatchAttribute.
|
||||
//
|
||||
// This constraint is used to avoid allocating multiple requests to the same device
|
||||
|
||||
@@ -57,8 +57,7 @@ type DeviceRequestAllocationResultApplyConfiguration struct {
|
||||
// administrative access. See the corresponding request field
|
||||
// for a definition of mode.
|
||||
//
|
||||
// This is an beta field and requires enabling the DRAAdminAccess
|
||||
// feature gate. Admin access is disabled if this field is unset or
|
||||
// Admin access is disabled if this field is unset or
|
||||
// set to false, otherwise it is enabled.
|
||||
AdminAccess *bool `json:"adminAccess,omitempty"`
|
||||
// A copy of all tolerations specified in the request at the time
|
||||
@@ -66,19 +65,19 @@ type DeviceRequestAllocationResultApplyConfiguration struct {
|
||||
//
|
||||
// The maximum number of tolerations is 16.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
|
||||
// BindingConditions contains a copy of the BindingConditions
|
||||
// from the corresponding ResourceSlice at the time of allocation.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingConditions []string `json:"bindingConditions,omitempty"`
|
||||
// BindingFailureConditions contains a copy of the BindingFailureConditions
|
||||
// from the corresponding ResourceSlice at the time of allocation.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingFailureConditions []string `json:"bindingFailureConditions,omitempty"`
|
||||
// ShareID uniquely identifies an individual allocation share of the device,
|
||||
|
||||
@@ -93,7 +93,7 @@ type DeviceSubRequestApplyConfiguration struct {
|
||||
//
|
||||
// The maximum number of tolerations is 16.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
|
||||
// Capacity define resource requirements against each capacity.
|
||||
|
||||
@@ -43,8 +43,17 @@ type DeviceTaintApplyConfiguration struct {
|
||||
// nodes is not valid here. More effects may get added in the future.
|
||||
// Consumers must treat unknown effects like None.
|
||||
Effect *resourcev1.DeviceTaintEffect `json:"effect,omitempty"`
|
||||
// TimeAdded represents the time at which the taint was added.
|
||||
// TimeAdded represents the time at which the taint was added or
|
||||
// (only in a DeviceTaintRule) the effect was modified.
|
||||
// Added automatically during create or update if not set.
|
||||
//
|
||||
// In addition, in a DeviceTaintRule a value provided during
|
||||
// an update gets replaced with the current time if the provided
|
||||
// value is the same as the old one and the new effect is different.
|
||||
// Changing the key and/or value while keeping the effect unchanged
|
||||
// is possible and does not update the time stamp because the eviction
|
||||
// which uses it is either already started (NoExecute) or
|
||||
// not started yet (NoEffect, NoSchedule).
|
||||
TimeAdded *metav1.Time `json:"timeAdded,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -72,8 +72,7 @@ type ExactDeviceRequestApplyConfiguration struct {
|
||||
// all ordinary claims to the device with respect to access modes and
|
||||
// any resource allocations.
|
||||
//
|
||||
// This is an beta field and requires enabling the DRAAdminAccess
|
||||
// feature gate. Admin access is disabled if this field is unset or
|
||||
// Admin access is disabled if this field is unset or
|
||||
// set to false, otherwise it is enabled.
|
||||
AdminAccess *bool `json:"adminAccess,omitempty"`
|
||||
// If specified, the request's tolerations.
|
||||
@@ -91,7 +90,7 @@ type ExactDeviceRequestApplyConfiguration struct {
|
||||
//
|
||||
// The maximum number of tolerations is 16.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
|
||||
// Capacity define resource requirements against each capacity.
|
||||
|
||||
@@ -29,7 +29,7 @@ type NetworkDeviceDataApplyConfiguration struct {
|
||||
// the allocated device. This might be the name of a physical or virtual
|
||||
// network interface being configured in the pod.
|
||||
//
|
||||
// Must not be longer than 256 characters.
|
||||
// Must not be longer than 256 bytes.
|
||||
InterfaceName *string `json:"interfaceName,omitempty"`
|
||||
// IPs lists the network addresses assigned to the device's network interface.
|
||||
// This can include both IPv4 and IPv6 addresses.
|
||||
@@ -39,7 +39,7 @@ type NetworkDeviceDataApplyConfiguration struct {
|
||||
IPs []string `json:"ips,omitempty"`
|
||||
// HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface.
|
||||
//
|
||||
// Must not be longer than 128 characters.
|
||||
// Must not be longer than 128 bytes.
|
||||
HardwareAddress *string `json:"hardwareAddress,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -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 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
|
||||
}
|
||||
@@ -43,8 +43,17 @@ type DeviceTaintApplyConfiguration struct {
|
||||
// nodes is not valid here. More effects may get added in the future.
|
||||
// Consumers must treat unknown effects like None.
|
||||
Effect *resourcev1alpha3.DeviceTaintEffect `json:"effect,omitempty"`
|
||||
// TimeAdded represents the time at which the taint was added.
|
||||
// TimeAdded represents the time at which the taint was added or
|
||||
// (only in a DeviceTaintRule) the effect was modified.
|
||||
// Added automatically during create or update if not set.
|
||||
//
|
||||
// In addition, in a DeviceTaintRule a value provided during
|
||||
// an update gets replaced with the current time if the provided
|
||||
// value is the same as the old one and the new effect is different.
|
||||
// Changing the key and/or value while keeping the effect unchanged
|
||||
// is possible and does not update the time stamp because the eviction
|
||||
// which uses it is either already started (NoExecute) or
|
||||
// not started yet (NoEffect, NoSchedule).
|
||||
TimeAdded *v1.Time `json:"timeAdded,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
152
applyconfigurations/resource/v1alpha3/poolstatus.go
Normal file
152
applyconfigurations/resource/v1alpha3/poolstatus.go
Normal file
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
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
|
||||
|
||||
// PoolStatusApplyConfiguration represents a declarative configuration of the PoolStatus type for use
|
||||
// with apply.
|
||||
//
|
||||
// PoolStatus contains status information for a single resource pool.
|
||||
type PoolStatusApplyConfiguration struct {
|
||||
// Driver is the DRA driver name for this pool.
|
||||
// Must be a DNS subdomain (e.g., "gpu.example.com").
|
||||
Driver *string `json:"driver,omitempty"`
|
||||
// PoolName is the name of the pool.
|
||||
// Must be a valid resource pool name (DNS subdomains separated by "/").
|
||||
PoolName *string `json:"poolName,omitempty"`
|
||||
// Generation is the pool generation observed across all ResourceSlices
|
||||
// in this pool. Only the latest generation is reported. During a generation
|
||||
// rollout, if not all slices at the latest generation have been published,
|
||||
// the pool is included with a validationError and device counts unset.
|
||||
Generation *int64 `json:"generation,omitempty"`
|
||||
// ResourceSliceCount is the number of ResourceSlices that make up this pool.
|
||||
// May be unset when validationError is set.
|
||||
ResourceSliceCount *int32 `json:"resourceSliceCount,omitempty"`
|
||||
// TotalDevices is the total number of devices in the pool across all slices.
|
||||
// A value of 0 means the pool has no devices.
|
||||
// May be unset when validationError is set.
|
||||
TotalDevices *int32 `json:"totalDevices,omitempty"`
|
||||
// AllocatedDevices is the number of devices currently allocated to claims.
|
||||
// A value of 0 means no devices are allocated.
|
||||
// May be unset when validationError is set.
|
||||
AllocatedDevices *int32 `json:"allocatedDevices,omitempty"`
|
||||
// AvailableDevices is the number of devices available for allocation.
|
||||
// This equals TotalDevices - AllocatedDevices - UnavailableDevices.
|
||||
// A value of 0 means no devices are currently available.
|
||||
// May be unset when validationError is set.
|
||||
AvailableDevices *int32 `json:"availableDevices,omitempty"`
|
||||
// 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.
|
||||
UnavailableDevices *int32 `json:"unavailableDevices,omitempty"`
|
||||
// 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).
|
||||
NodeName *string `json:"nodeName,omitempty"`
|
||||
// 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.
|
||||
ValidationError *string `json:"validationError,omitempty"`
|
||||
}
|
||||
|
||||
// PoolStatusApplyConfiguration constructs a declarative configuration of the PoolStatus type for use with
|
||||
// apply.
|
||||
func PoolStatus() *PoolStatusApplyConfiguration {
|
||||
return &PoolStatusApplyConfiguration{}
|
||||
}
|
||||
|
||||
// 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 *PoolStatusApplyConfiguration) WithDriver(value string) *PoolStatusApplyConfiguration {
|
||||
b.Driver = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPoolName sets the PoolName field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the PoolName field is set to the value of the last call.
|
||||
func (b *PoolStatusApplyConfiguration) WithPoolName(value string) *PoolStatusApplyConfiguration {
|
||||
b.PoolName = &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 *PoolStatusApplyConfiguration) WithGeneration(value int64) *PoolStatusApplyConfiguration {
|
||||
b.Generation = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceSliceCount sets the ResourceSliceCount field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the ResourceSliceCount field is set to the value of the last call.
|
||||
func (b *PoolStatusApplyConfiguration) WithResourceSliceCount(value int32) *PoolStatusApplyConfiguration {
|
||||
b.ResourceSliceCount = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithTotalDevices sets the TotalDevices field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the TotalDevices field is set to the value of the last call.
|
||||
func (b *PoolStatusApplyConfiguration) WithTotalDevices(value int32) *PoolStatusApplyConfiguration {
|
||||
b.TotalDevices = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAllocatedDevices sets the AllocatedDevices field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the AllocatedDevices field is set to the value of the last call.
|
||||
func (b *PoolStatusApplyConfiguration) WithAllocatedDevices(value int32) *PoolStatusApplyConfiguration {
|
||||
b.AllocatedDevices = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAvailableDevices sets the AvailableDevices field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the AvailableDevices field is set to the value of the last call.
|
||||
func (b *PoolStatusApplyConfiguration) WithAvailableDevices(value int32) *PoolStatusApplyConfiguration {
|
||||
b.AvailableDevices = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithUnavailableDevices sets the UnavailableDevices field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the UnavailableDevices field is set to the value of the last call.
|
||||
func (b *PoolStatusApplyConfiguration) WithUnavailableDevices(value int32) *PoolStatusApplyConfiguration {
|
||||
b.UnavailableDevices = &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 *PoolStatusApplyConfiguration) WithNodeName(value string) *PoolStatusApplyConfiguration {
|
||||
b.NodeName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithValidationError sets the ValidationError field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the ValidationError field is set to the value of the last call.
|
||||
func (b *PoolStatusApplyConfiguration) WithValidationError(value string) *PoolStatusApplyConfiguration {
|
||||
b.ValidationError = &value
|
||||
return b
|
||||
}
|
||||
@@ -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 v1alpha3
|
||||
|
||||
import (
|
||||
resourcev1alpha3 "k8s.io/api/resource/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"
|
||||
)
|
||||
|
||||
// ResourcePoolStatusRequestApplyConfiguration represents a declarative configuration of the ResourcePoolStatusRequest type for use
|
||||
// with apply.
|
||||
//
|
||||
// ResourcePoolStatusRequest triggers a one-time calculation of resource pool status
|
||||
// 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"`
|
||||
// Standard object metadata
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
// Spec defines the filters for which pools to include in the status.
|
||||
// The spec is immutable once created.
|
||||
Spec *ResourcePoolStatusRequestSpecApplyConfiguration `json:"spec,omitempty"`
|
||||
// Status is populated by the controller with the calculated pool status.
|
||||
// When status is non-nil, the request is considered complete and the
|
||||
// entire object becomes immutable.
|
||||
Status *ResourcePoolStatusRequestStatusApplyConfiguration `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// ResourcePoolStatusRequest constructs a declarative configuration of the ResourcePoolStatusRequest type for use with
|
||||
// apply.
|
||||
func ResourcePoolStatusRequest(name string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b := &ResourcePoolStatusRequestApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithKind("ResourcePoolStatusRequest")
|
||||
b.WithAPIVersion("resource.k8s.io/v1alpha3")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractResourcePoolStatusRequestFrom extracts the applied configuration owned by fieldManager from
|
||||
// resourcePoolStatusRequest for the specified subresource. Pass an empty string for subresource to extract
|
||||
// the main resource. Common subresources include "status", "scale", etc.
|
||||
// resourcePoolStatusRequest must be a unmodified ResourcePoolStatusRequest API object that was retrieved from the Kubernetes API.
|
||||
// ExtractResourcePoolStatusRequestFrom 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 ExtractResourcePoolStatusRequestFrom(resourcePoolStatusRequest *resourcev1alpha3.ResourcePoolStatusRequest, fieldManager string, subresource string) (*ResourcePoolStatusRequestApplyConfiguration, error) {
|
||||
b := &ResourcePoolStatusRequestApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(resourcePoolStatusRequest, internal.Parser().Type("io.k8s.api.resource.v1alpha3.ResourcePoolStatusRequest"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(resourcePoolStatusRequest.Name)
|
||||
|
||||
b.WithKind("ResourcePoolStatusRequest")
|
||||
b.WithAPIVersion("resource.k8s.io/v1alpha3")
|
||||
return b, nil
|
||||
}
|
||||
|
||||
// ExtractResourcePoolStatusRequest extracts the applied configuration owned by fieldManager from
|
||||
// resourcePoolStatusRequest. If no managedFields are found in resourcePoolStatusRequest for fieldManager, a
|
||||
// ResourcePoolStatusRequestApplyConfiguration 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.
|
||||
// resourcePoolStatusRequest must be a unmodified ResourcePoolStatusRequest API object that was retrieved from the Kubernetes API.
|
||||
// ExtractResourcePoolStatusRequest 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 ExtractResourcePoolStatusRequest(resourcePoolStatusRequest *resourcev1alpha3.ResourcePoolStatusRequest, fieldManager string) (*ResourcePoolStatusRequestApplyConfiguration, error) {
|
||||
return ExtractResourcePoolStatusRequestFrom(resourcePoolStatusRequest, fieldManager, "")
|
||||
}
|
||||
|
||||
// ExtractResourcePoolStatusRequestStatus extracts the applied configuration owned by fieldManager from
|
||||
// resourcePoolStatusRequest for the status subresource.
|
||||
func ExtractResourcePoolStatusRequestStatus(resourcePoolStatusRequest *resourcev1alpha3.ResourcePoolStatusRequest, fieldManager string) (*ResourcePoolStatusRequestApplyConfiguration, error) {
|
||||
return ExtractResourcePoolStatusRequestFrom(resourcePoolStatusRequest, fieldManager, "status")
|
||||
}
|
||||
|
||||
func (b ResourcePoolStatusRequestApplyConfiguration) 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 *ResourcePoolStatusRequestApplyConfiguration) WithKind(value string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
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 *ResourcePoolStatusRequestApplyConfiguration) WithAPIVersion(value string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
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 *ResourcePoolStatusRequestApplyConfiguration) WithName(value string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
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 *ResourcePoolStatusRequestApplyConfiguration) WithGenerateName(value string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
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 *ResourcePoolStatusRequestApplyConfiguration) WithNamespace(value string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
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 *ResourcePoolStatusRequestApplyConfiguration) WithUID(value types.UID) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
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 *ResourcePoolStatusRequestApplyConfiguration) WithResourceVersion(value string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
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 *ResourcePoolStatusRequestApplyConfiguration) WithGeneration(value int64) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
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 *ResourcePoolStatusRequestApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
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 *ResourcePoolStatusRequestApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
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 *ResourcePoolStatusRequestApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
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 *ResourcePoolStatusRequestApplyConfiguration) WithLabels(entries map[string]string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
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 *ResourcePoolStatusRequestApplyConfiguration) WithAnnotations(entries map[string]string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
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 *ResourcePoolStatusRequestApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
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 *ResourcePoolStatusRequestApplyConfiguration) WithFinalizers(values ...string) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) 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 *ResourcePoolStatusRequestApplyConfiguration) WithSpec(value *ResourcePoolStatusRequestSpecApplyConfiguration) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
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 *ResourcePoolStatusRequestApplyConfiguration) WithStatus(value *ResourcePoolStatusRequestStatusApplyConfiguration) *ResourcePoolStatusRequestApplyConfiguration {
|
||||
b.Status = value
|
||||
return b
|
||||
}
|
||||
|
||||
// GetKind retrieves the value of the Kind field in the declarative configuration.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) GetKind() *string {
|
||||
return b.TypeMetaApplyConfiguration.Kind
|
||||
}
|
||||
|
||||
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) GetAPIVersion() *string {
|
||||
return b.TypeMetaApplyConfiguration.APIVersion
|
||||
}
|
||||
|
||||
// GetName retrieves the value of the Name field in the declarative configuration.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) GetName() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.ObjectMetaApplyConfiguration.Name
|
||||
}
|
||||
|
||||
// GetNamespace retrieves the value of the Namespace field in the declarative configuration.
|
||||
func (b *ResourcePoolStatusRequestApplyConfiguration) GetNamespace() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.ObjectMetaApplyConfiguration.Namespace
|
||||
}
|
||||
@@ -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 v1alpha3
|
||||
|
||||
// ResourcePoolStatusRequestSpecApplyConfiguration represents a declarative configuration of the ResourcePoolStatusRequestSpec type for use
|
||||
// with apply.
|
||||
//
|
||||
// ResourcePoolStatusRequestSpec defines the filters for the pool status request.
|
||||
type ResourcePoolStatusRequestSpecApplyConfiguration struct {
|
||||
// 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").
|
||||
Driver *string `json:"driver,omitempty"`
|
||||
// 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 "/").
|
||||
PoolName *string `json:"poolName,omitempty"`
|
||||
// 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).
|
||||
//
|
||||
// Default: 100
|
||||
// Minimum: 1
|
||||
// Maximum: 1000
|
||||
Limit *int32 `json:"limit,omitempty"`
|
||||
}
|
||||
|
||||
// ResourcePoolStatusRequestSpecApplyConfiguration constructs a declarative configuration of the ResourcePoolStatusRequestSpec type for use with
|
||||
// apply.
|
||||
func ResourcePoolStatusRequestSpec() *ResourcePoolStatusRequestSpecApplyConfiguration {
|
||||
return &ResourcePoolStatusRequestSpecApplyConfiguration{}
|
||||
}
|
||||
|
||||
// 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 *ResourcePoolStatusRequestSpecApplyConfiguration) WithDriver(value string) *ResourcePoolStatusRequestSpecApplyConfiguration {
|
||||
b.Driver = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPoolName sets the PoolName field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the PoolName field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestSpecApplyConfiguration) WithPoolName(value string) *ResourcePoolStatusRequestSpecApplyConfiguration {
|
||||
b.PoolName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithLimit sets the Limit field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Limit field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestSpecApplyConfiguration) WithLimit(value int32) *ResourcePoolStatusRequestSpecApplyConfiguration {
|
||||
b.Limit = &value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
// ResourcePoolStatusRequestStatusApplyConfiguration represents a declarative configuration of the ResourcePoolStatusRequestStatus type for use
|
||||
// with apply.
|
||||
//
|
||||
// ResourcePoolStatusRequestStatus contains the calculated pool status information.
|
||||
type ResourcePoolStatusRequestStatusApplyConfiguration struct {
|
||||
// PoolCount is the total number of pools that matched the filter criteria,
|
||||
// regardless of truncation. This helps users understand how many pools exist
|
||||
// even when the response is truncated. A value of 0 means no pools matched
|
||||
// the filter criteria.
|
||||
PoolCount *int32 `json:"poolCount,omitempty"`
|
||||
// Pools contains the first `spec.limit` matching pools, sorted by driver
|
||||
// then pool name. If `len(pools) < poolCount`, the list was truncated.
|
||||
// When omitted, no pools matched the request filters.
|
||||
Pools []PoolStatusApplyConfiguration `json:"pools,omitempty"`
|
||||
// Conditions provide information about the state of the request.
|
||||
// A condition with type=Complete or type=Failed will always be set
|
||||
// when the status is populated.
|
||||
//
|
||||
// Known condition types:
|
||||
// - "Complete": True when the request has been processed successfully
|
||||
// - "Failed": True when the request could not be processed
|
||||
Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
// ResourcePoolStatusRequestStatusApplyConfiguration constructs a declarative configuration of the ResourcePoolStatusRequestStatus type for use with
|
||||
// apply.
|
||||
func ResourcePoolStatusRequestStatus() *ResourcePoolStatusRequestStatusApplyConfiguration {
|
||||
return &ResourcePoolStatusRequestStatusApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithPoolCount sets the PoolCount field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the PoolCount field is set to the value of the last call.
|
||||
func (b *ResourcePoolStatusRequestStatusApplyConfiguration) WithPoolCount(value int32) *ResourcePoolStatusRequestStatusApplyConfiguration {
|
||||
b.PoolCount = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPools adds the given value to the Pools 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 Pools field.
|
||||
func (b *ResourcePoolStatusRequestStatusApplyConfiguration) WithPools(values ...*PoolStatusApplyConfiguration) *ResourcePoolStatusRequestStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithPools")
|
||||
}
|
||||
b.Pools = append(b.Pools, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// 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 *ResourcePoolStatusRequestStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *ResourcePoolStatusRequestStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithConditions")
|
||||
}
|
||||
b.Conditions = append(b.Conditions, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -36,7 +36,7 @@ type AllocationResultApplyConfiguration struct {
|
||||
// AllocationTimestamp stores the time when the resources were allocated.
|
||||
// This field is not guaranteed to be set, in which case that time is unknown.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gate.
|
||||
AllocationTimestamp *metav1.Time `json:"allocationTimestamp,omitempty"`
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
v1 "k8s.io/client-go/applyconfigurations/core/v1"
|
||||
)
|
||||
@@ -70,7 +71,7 @@ type BasicDeviceApplyConfiguration struct {
|
||||
// any device in a ResourceSlice, then the maximum number of
|
||||
// allowed devices per ResourceSlice is 64 instead of 128.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Taints []DeviceTaintApplyConfiguration `json:"taints,omitempty"`
|
||||
// BindsToNode indicates if the usage of an allocation involving this device
|
||||
@@ -78,7 +79,7 @@ type BasicDeviceApplyConfiguration struct {
|
||||
// If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector
|
||||
// to match the node where the allocation was made.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindsToNode *bool `json:"bindsToNode,omitempty"`
|
||||
// BindingConditions defines the conditions for proceeding with binding.
|
||||
@@ -90,7 +91,7 @@ type BasicDeviceApplyConfiguration struct {
|
||||
//
|
||||
// The conditions must be a valid condition type string.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingConditions []string `json:"bindingConditions,omitempty"`
|
||||
// BindingFailureConditions defines the conditions for binding failure.
|
||||
@@ -101,7 +102,7 @@ type BasicDeviceApplyConfiguration struct {
|
||||
//
|
||||
// The conditions must be a valid condition type string.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingFailureConditions []string `json:"bindingFailureConditions,omitempty"`
|
||||
// AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.
|
||||
@@ -109,6 +110,18 @@ 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
|
||||
// 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.
|
||||
NodeAllocatableResourceMappings map[corev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration `json:"nodeAllocatableResourceMappings,omitempty"`
|
||||
}
|
||||
|
||||
// BasicDeviceApplyConfiguration constructs a declarative configuration of the BasicDevice type for use with
|
||||
@@ -230,3 +243,17 @@ func (b *BasicDeviceApplyConfiguration) WithAllowMultipleAllocations(value bool)
|
||||
b.AllowMultipleAllocations = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNodeAllocatableResourceMappings puts the entries into the NodeAllocatableResourceMappings 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))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.NodeAllocatableResourceMappings[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -72,6 +72,14 @@ type CELDeviceSelectorApplyConfiguration struct {
|
||||
//
|
||||
// cel.bind(dra, device.attributes["dra.example.com"], dra.someBool && dra.anotherBool)
|
||||
//
|
||||
// When 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:
|
||||
//
|
||||
// device.attributes["dra.example.com"].models.includes("some-model")
|
||||
//
|
||||
// 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.
|
||||
|
||||
@@ -32,6 +32,22 @@ type DeviceAttributeApplyConfiguration struct {
|
||||
// VersionValue is a semantic version according to semver.org spec 2.0.0.
|
||||
// Must not be longer than 64 characters.
|
||||
VersionValue *string `json:"version,omitempty"`
|
||||
// IntValues is a non-empty list of numbers.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
IntValues []int64 `json:"ints,omitempty"`
|
||||
// BoolValues is a non-empty list of true/false values.
|
||||
BoolValues []bool `json:"bools,omitempty"`
|
||||
// StringValues is a non-empty list of strings.
|
||||
// Each string must not be longer than 64 characters.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
StringValues []string `json:"strings,omitempty"`
|
||||
// VersionValues is a non-empty list of semantic versions according to semver.org spec 2.0.0.
|
||||
// Each version string must not be longer than 64 characters.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
VersionValues []string `json:"versions,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceAttributeApplyConfiguration constructs a declarative configuration of the DeviceAttribute type for use with
|
||||
@@ -71,3 +87,43 @@ func (b *DeviceAttributeApplyConfiguration) WithVersionValue(value string) *Devi
|
||||
b.VersionValue = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithIntValues adds the given value to the IntValues 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 IntValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithIntValues(values ...int64) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.IntValues = append(b.IntValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithBoolValues adds the given value to the BoolValues 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 BoolValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithBoolValues(values ...bool) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.BoolValues = append(b.BoolValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStringValues adds the given value to the StringValues 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 StringValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithStringValues(values ...string) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.StringValues = append(b.StringValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithVersionValues adds the given value to the VersionValues 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 VersionValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithVersionValues(values ...string) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.VersionValues = append(b.VersionValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ type DeviceClassSpecApplyConfiguration struct {
|
||||
// If two classes are created at the same time, then the name of the class
|
||||
// lexicographically sorted first is picked.
|
||||
//
|
||||
// This is an alpha field.
|
||||
// This is a beta field.
|
||||
ExtendedResourceName *string `json:"extendedResourceName,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -48,11 +48,21 @@ type DeviceConstraintApplyConfiguration struct {
|
||||
// its specification, but if one device doesn't, then it also will not be
|
||||
// chosen.
|
||||
//
|
||||
// When the DRAListTypeAttributes feature gate is enabled, comparison uses
|
||||
// set semantics(i.e., element order and duplicates are ignored): list-valued attributes
|
||||
// match when the intersection across all devices is non-empty.
|
||||
// Scalar values are treated as singleton sets for backward compatibility.
|
||||
//
|
||||
// Must include the domain qualifier.
|
||||
MatchAttribute *resourcev1beta1.FullyQualifiedName `json:"matchAttribute,omitempty"`
|
||||
// DistinctAttribute requires that all devices in question have this
|
||||
// attribute and that its type and value are unique across those devices.
|
||||
//
|
||||
// When the DRAListTypeAttributes feature gate is enabled, comparison uses
|
||||
// set semantics (i.e., element order and duplicates are ignored):
|
||||
// list-valued attributes must be pairwise disjoint across devices.
|
||||
// Scalar values are treated as singleton sets for backward compatibility.
|
||||
//
|
||||
// This acts as the inverse of MatchAttribute.
|
||||
//
|
||||
// This constraint is used to avoid allocating multiple requests to the same device
|
||||
|
||||
@@ -133,7 +133,7 @@ type DeviceRequestApplyConfiguration struct {
|
||||
// This field can only be set when deviceClassName is set and no subrequests
|
||||
// are specified in the firstAvailable list.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
|
||||
// Capacity define resource requirements against each capacity.
|
||||
|
||||
@@ -66,19 +66,19 @@ type DeviceRequestAllocationResultApplyConfiguration struct {
|
||||
//
|
||||
// The maximum number of tolerations is 16.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
|
||||
// BindingConditions contains a copy of the BindingConditions
|
||||
// from the corresponding ResourceSlice at the time of allocation.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingConditions []string `json:"bindingConditions,omitempty"`
|
||||
// BindingFailureConditions contains a copy of the BindingFailureConditions
|
||||
// from the corresponding ResourceSlice at the time of allocation.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingFailureConditions []string `json:"bindingFailureConditions,omitempty"`
|
||||
// ShareID uniquely identifies an individual allocation share of the device,
|
||||
|
||||
@@ -94,7 +94,7 @@ type DeviceSubRequestApplyConfiguration struct {
|
||||
//
|
||||
// The maximum number of tolerations is 16.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
|
||||
// Capacity define resource requirements against each capacity.
|
||||
|
||||
@@ -43,8 +43,17 @@ type DeviceTaintApplyConfiguration struct {
|
||||
// nodes is not valid here. More effects may get added in the future.
|
||||
// Consumers must treat unknown effects like None.
|
||||
Effect *resourcev1beta1.DeviceTaintEffect `json:"effect,omitempty"`
|
||||
// TimeAdded represents the time at which the taint was added.
|
||||
// TimeAdded represents the time at which the taint was added or
|
||||
// (only in a DeviceTaintRule) the effect was modified.
|
||||
// Added automatically during create or update if not set.
|
||||
//
|
||||
// In addition, in a DeviceTaintRule a value provided during
|
||||
// an update gets replaced with the current time if the provided
|
||||
// value is the same as the old one and the new effect is different.
|
||||
// Changing the key and/or value while keeping the effect unchanged
|
||||
// is possible and does not update the time stamp because the eviction
|
||||
// which uses it is either already started (NoExecute) or
|
||||
// not started yet (NoEffect, NoSchedule).
|
||||
TimeAdded *v1.Time `json:"timeAdded,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ type NetworkDeviceDataApplyConfiguration struct {
|
||||
// the allocated device. This might be the name of a physical or virtual
|
||||
// network interface being configured in the pod.
|
||||
//
|
||||
// Must not be longer than 256 characters.
|
||||
// Must not be longer than 256 bytes.
|
||||
InterfaceName *string `json:"interfaceName,omitempty"`
|
||||
// IPs lists the network addresses assigned to the device's network interface.
|
||||
// This can include both IPv4 and IPv6 addresses.
|
||||
@@ -41,7 +41,7 @@ type NetworkDeviceDataApplyConfiguration struct {
|
||||
IPs []string `json:"ips,omitempty"`
|
||||
// HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface.
|
||||
//
|
||||
// Must not be longer than 128 characters.
|
||||
// Must not be longer than 128 bytes.
|
||||
HardwareAddress *string `json:"hardwareAddress,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -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 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
|
||||
}
|
||||
@@ -36,7 +36,7 @@ type AllocationResultApplyConfiguration struct {
|
||||
// AllocationTimestamp stores the time when the resources were allocated.
|
||||
// This field is not guaranteed to be set, in which case that time is unknown.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gate.
|
||||
AllocationTimestamp *metav1.Time `json:"allocationTimestamp,omitempty"`
|
||||
}
|
||||
|
||||
@@ -72,6 +72,14 @@ type CELDeviceSelectorApplyConfiguration struct {
|
||||
//
|
||||
// cel.bind(dra, device.attributes["dra.example.com"], dra.someBool && dra.anotherBool)
|
||||
//
|
||||
// When 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:
|
||||
//
|
||||
// device.attributes["dra.example.com"].models.includes("some-model")
|
||||
//
|
||||
// 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.
|
||||
|
||||
@@ -19,6 +19,7 @@ limitations under the License.
|
||||
package v1beta2
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
resourcev1beta2 "k8s.io/api/resource/v1beta2"
|
||||
v1 "k8s.io/client-go/applyconfigurations/core/v1"
|
||||
)
|
||||
@@ -74,7 +75,7 @@ type DeviceApplyConfiguration struct {
|
||||
// any device in a ResourceSlice, then the maximum number of
|
||||
// allowed devices per ResourceSlice is 64 instead of 128.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Taints []DeviceTaintApplyConfiguration `json:"taints,omitempty"`
|
||||
// BindsToNode indicates if the usage of an allocation involving this device
|
||||
@@ -82,7 +83,7 @@ type DeviceApplyConfiguration struct {
|
||||
// If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector
|
||||
// to match the node where the allocation was made.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindsToNode *bool `json:"bindsToNode,omitempty"`
|
||||
// BindingConditions defines the conditions for proceeding with binding.
|
||||
@@ -94,7 +95,7 @@ type DeviceApplyConfiguration struct {
|
||||
//
|
||||
// The conditions must be a valid condition type string.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingConditions []string `json:"bindingConditions,omitempty"`
|
||||
// BindingFailureConditions defines the conditions for binding failure.
|
||||
@@ -105,7 +106,7 @@ type DeviceApplyConfiguration struct {
|
||||
//
|
||||
// The conditions must be a valid condition type string.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingFailureConditions []string `json:"bindingFailureConditions,omitempty"`
|
||||
// AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests.
|
||||
@@ -113,6 +114,18 @@ 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
|
||||
// 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.
|
||||
NodeAllocatableResourceMappings map[corev1.ResourceName]NodeAllocatableResourceMappingApplyConfiguration `json:"nodeAllocatableResourceMappings,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceApplyConfiguration constructs a declarative configuration of the Device type for use with
|
||||
@@ -242,3 +255,17 @@ func (b *DeviceApplyConfiguration) WithAllowMultipleAllocations(value bool) *Dev
|
||||
b.AllowMultipleAllocations = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNodeAllocatableResourceMappings puts the entries into the NodeAllocatableResourceMappings 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))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.NodeAllocatableResourceMappings[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -32,6 +32,22 @@ type DeviceAttributeApplyConfiguration struct {
|
||||
// VersionValue is a semantic version according to semver.org spec 2.0.0.
|
||||
// Must not be longer than 64 characters.
|
||||
VersionValue *string `json:"version,omitempty"`
|
||||
// IntValues is a non-empty list of numbers.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
IntValues []int64 `json:"ints,omitempty"`
|
||||
// BoolValues is a non-empty list of true/false values.
|
||||
BoolValues []bool `json:"bools,omitempty"`
|
||||
// StringValues is a non-empty list of strings.
|
||||
// Each string must not be longer than 64 characters.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
StringValues []string `json:"strings,omitempty"`
|
||||
// VersionValues is a non-empty list of semantic versions according to semver.org spec 2.0.0.
|
||||
// Each version string must not be longer than 64 characters.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRAListTypeAttributes feature gate.
|
||||
VersionValues []string `json:"versions,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceAttributeApplyConfiguration constructs a declarative configuration of the DeviceAttribute type for use with
|
||||
@@ -71,3 +87,43 @@ func (b *DeviceAttributeApplyConfiguration) WithVersionValue(value string) *Devi
|
||||
b.VersionValue = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithIntValues adds the given value to the IntValues 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 IntValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithIntValues(values ...int64) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.IntValues = append(b.IntValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithBoolValues adds the given value to the BoolValues 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 BoolValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithBoolValues(values ...bool) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.BoolValues = append(b.BoolValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStringValues adds the given value to the StringValues 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 StringValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithStringValues(values ...string) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.StringValues = append(b.StringValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithVersionValues adds the given value to the VersionValues 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 VersionValues field.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithVersionValues(values ...string) *DeviceAttributeApplyConfiguration {
|
||||
for i := range values {
|
||||
b.VersionValues = append(b.VersionValues, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ type DeviceClassSpecApplyConfiguration struct {
|
||||
// If two classes are created at the same time, then the name of the class
|
||||
// lexicographically sorted first is picked.
|
||||
//
|
||||
// This is an alpha field.
|
||||
// This is a beta field.
|
||||
ExtendedResourceName *string `json:"extendedResourceName,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -48,11 +48,21 @@ type DeviceConstraintApplyConfiguration struct {
|
||||
// its specification, but if one device doesn't, then it also will not be
|
||||
// chosen.
|
||||
//
|
||||
// When the DRAListTypeAttributes feature gate is enabled, comparison uses
|
||||
// set semantics(i.e., element order and duplicates are ignored): list-valued attributes
|
||||
// match when the intersection across all devices is non-empty.
|
||||
// Scalar values are treated as singleton sets for backward compatibility.
|
||||
//
|
||||
// Must include the domain qualifier.
|
||||
MatchAttribute *resourcev1beta2.FullyQualifiedName `json:"matchAttribute,omitempty"`
|
||||
// DistinctAttribute requires that all devices in question have this
|
||||
// attribute and that its type and value are unique across those devices.
|
||||
//
|
||||
// When the DRAListTypeAttributes feature gate is enabled, comparison uses
|
||||
// set semantics (i.e., element order and duplicates are ignored):
|
||||
// list-valued attributes must be pairwise disjoint across devices.
|
||||
// Scalar values are treated as singleton sets for backward compatibility.
|
||||
//
|
||||
// This acts as the inverse of MatchAttribute.
|
||||
//
|
||||
// This constraint is used to avoid allocating multiple requests to the same device
|
||||
|
||||
@@ -66,19 +66,19 @@ type DeviceRequestAllocationResultApplyConfiguration struct {
|
||||
//
|
||||
// The maximum number of tolerations is 16.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
|
||||
// BindingConditions contains a copy of the BindingConditions
|
||||
// from the corresponding ResourceSlice at the time of allocation.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingConditions []string `json:"bindingConditions,omitempty"`
|
||||
// BindingFailureConditions contains a copy of the BindingFailureConditions
|
||||
// from the corresponding ResourceSlice at the time of allocation.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// This is a beta field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus
|
||||
// feature gates.
|
||||
BindingFailureConditions []string `json:"bindingFailureConditions,omitempty"`
|
||||
// ShareID uniquely identifies an individual allocation share of the device,
|
||||
|
||||
@@ -93,7 +93,7 @@ type DeviceSubRequestApplyConfiguration struct {
|
||||
//
|
||||
// The maximum number of tolerations is 16.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
|
||||
// Capacity define resource requirements against each capacity.
|
||||
|
||||
@@ -43,8 +43,17 @@ type DeviceTaintApplyConfiguration struct {
|
||||
// nodes is not valid here. More effects may get added in the future.
|
||||
// Consumers must treat unknown effects like None.
|
||||
Effect *resourcev1beta2.DeviceTaintEffect `json:"effect,omitempty"`
|
||||
// TimeAdded represents the time at which the taint was added.
|
||||
// TimeAdded represents the time at which the taint was added or
|
||||
// (only in a DeviceTaintRule) the effect was modified.
|
||||
// Added automatically during create or update if not set.
|
||||
//
|
||||
// In addition, in a DeviceTaintRule a value provided during
|
||||
// an update gets replaced with the current time if the provided
|
||||
// value is the same as the old one and the new effect is different.
|
||||
// Changing the key and/or value while keeping the effect unchanged
|
||||
// is possible and does not update the time stamp because the eviction
|
||||
// which uses it is either already started (NoExecute) or
|
||||
// not started yet (NoEffect, NoSchedule).
|
||||
TimeAdded *v1.Time `json:"timeAdded,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
294
applyconfigurations/resource/v1beta2/devicetaintrule.go
Normal file
294
applyconfigurations/resource/v1beta2/devicetaintrule.go
Normal file
@@ -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 v1beta2
|
||||
|
||||
import (
|
||||
resourcev1beta2 "k8s.io/api/resource/v1beta2"
|
||||
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"
|
||||
)
|
||||
|
||||
// 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 {
|
||||
v1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
// Standard object metadata
|
||||
*v1.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/v1beta2")
|
||||
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 *resourcev1beta2.DeviceTaintRule, fieldManager string, subresource string) (*DeviceTaintRuleApplyConfiguration, error) {
|
||||
b := &DeviceTaintRuleApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(deviceTaintRule, internal.Parser().Type("io.k8s.api.resource.v1beta2.DeviceTaintRule"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(deviceTaintRule.Name)
|
||||
|
||||
b.WithKind("DeviceTaintRule")
|
||||
b.WithAPIVersion("resource.k8s.io/v1beta2")
|
||||
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 *resourcev1beta2.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 *resourcev1beta2.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 metav1.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 metav1.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 ...*v1.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 = &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 *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
|
||||
}
|
||||
55
applyconfigurations/resource/v1beta2/devicetaintrulespec.go
Normal file
55
applyconfigurations/resource/v1beta2/devicetaintrulespec.go
Normal file
@@ -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 v1beta2
|
||||
|
||||
// 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
|
||||
}
|
||||
@@ -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 v1beta2
|
||||
|
||||
import (
|
||||
v1 "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 []v1.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 ...*v1.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
|
||||
}
|
||||
76
applyconfigurations/resource/v1beta2/devicetaintselector.go
Normal file
76
applyconfigurations/resource/v1beta2/devicetaintselector.go
Normal file
@@ -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 v1beta2
|
||||
|
||||
// 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
|
||||
}
|
||||
@@ -91,7 +91,7 @@ type ExactDeviceRequestApplyConfiguration struct {
|
||||
//
|
||||
// The maximum number of tolerations is 16.
|
||||
//
|
||||
// This is an alpha field and requires enabling the DRADeviceTaints
|
||||
// This is a beta field and requires enabling the DRADeviceTaints
|
||||
// feature gate.
|
||||
Tolerations []DeviceTolerationApplyConfiguration `json:"tolerations,omitempty"`
|
||||
// Capacity define resource requirements against each capacity.
|
||||
|
||||
@@ -29,7 +29,7 @@ type NetworkDeviceDataApplyConfiguration struct {
|
||||
// the allocated device. This might be the name of a physical or virtual
|
||||
// network interface being configured in the pod.
|
||||
//
|
||||
// Must not be longer than 256 characters.
|
||||
// Must not be longer than 256 bytes.
|
||||
InterfaceName *string `json:"interfaceName,omitempty"`
|
||||
// IPs lists the network addresses assigned to the device's network interface.
|
||||
// This can include both IPv4 and IPv6 addresses.
|
||||
@@ -39,7 +39,7 @@ type NetworkDeviceDataApplyConfiguration struct {
|
||||
IPs []string `json:"ips,omitempty"`
|
||||
// HardwareAddress represents the hardware address (e.g. MAC Address) of the device's network interface.
|
||||
//
|
||||
// Must not be longer than 128 characters.
|
||||
// Must not be longer than 128 bytes.
|
||||
HardwareAddress *string `json:"hardwareAddress,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -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 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
|
||||
}
|
||||
@@ -1,53 +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 v1alpha1
|
||||
|
||||
// PodGroupApplyConfiguration represents a declarative configuration of the PodGroup type for use
|
||||
// with apply.
|
||||
//
|
||||
// PodGroup represents a set of pods with a common scheduling policy.
|
||||
type PodGroupApplyConfiguration struct {
|
||||
// Name is a unique identifier for the PodGroup within the Workload.
|
||||
// It must be a DNS label. This field is immutable.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Policy defines the scheduling policy for this PodGroup.
|
||||
Policy *PodGroupPolicyApplyConfiguration `json:"policy,omitempty"`
|
||||
}
|
||||
|
||||
// PodGroupApplyConfiguration constructs a declarative configuration of the PodGroup type for use with
|
||||
// apply.
|
||||
func PodGroup() *PodGroupApplyConfiguration {
|
||||
return &PodGroupApplyConfiguration{}
|
||||
}
|
||||
|
||||
// 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.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPolicy sets the Policy field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Policy field is set to the value of the last call.
|
||||
func (b *PodGroupApplyConfiguration) WithPolicy(value *PodGroupPolicyApplyConfiguration) *PodGroupApplyConfiguration {
|
||||
b.Policy = value
|
||||
return b
|
||||
}
|
||||
@@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1alpha2
|
||||
|
||||
// GangSchedulingPolicyApplyConfiguration represents a declarative configuration of the GangSchedulingPolicy type for use
|
||||
// with apply.
|
||||
@@ -16,11 +16,10 @@ limitations under the License.
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
|
||||
@@ -28,85 +27,82 @@ import (
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// PriorityClassApplyConfiguration represents a declarative configuration of the PriorityClass type for use
|
||||
// PodGroupApplyConfiguration represents a declarative configuration of the PodGroup type for use
|
||||
// with apply.
|
||||
//
|
||||
// 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.
|
||||
type PriorityClassApplyConfiguration struct {
|
||||
// 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:",inline"`
|
||||
// Standard object's 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
|
||||
// receive when they have the name of this class in their pod spec.
|
||||
Value *int32 `json:"value,omitempty"`
|
||||
// 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.
|
||||
GlobalDefault *bool `json:"globalDefault,omitempty"`
|
||||
// description is an arbitrary string that usually provides guidelines on
|
||||
// when this priority class should be used.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// preemptionPolicy is the Policy for preempting pods with lower priority.
|
||||
// One of Never, PreemptLowerPriority.
|
||||
// Defaults to PreemptLowerPriority if unset.
|
||||
PreemptionPolicy *corev1.PreemptionPolicy `json:"preemptionPolicy,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"`
|
||||
}
|
||||
|
||||
// PriorityClass constructs a declarative configuration of the PriorityClass type for use with
|
||||
// PodGroup constructs a declarative configuration of the PodGroup type for use with
|
||||
// apply.
|
||||
func PriorityClass(name string) *PriorityClassApplyConfiguration {
|
||||
b := &PriorityClassApplyConfiguration{}
|
||||
func PodGroup(name, namespace string) *PodGroupApplyConfiguration {
|
||||
b := &PodGroupApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithKind("PriorityClass")
|
||||
b.WithAPIVersion("scheduling.k8s.io/v1alpha1")
|
||||
b.WithNamespace(namespace)
|
||||
b.WithKind("PodGroup")
|
||||
b.WithAPIVersion("scheduling.k8s.io/v1alpha2")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractPriorityClassFrom extracts the applied configuration owned by fieldManager from
|
||||
// priorityClass for the specified subresource. Pass an empty string for subresource to extract
|
||||
// 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.
|
||||
// priorityClass must be a unmodified PriorityClass API object that was retrieved from the Kubernetes API.
|
||||
// ExtractPriorityClassFrom provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// 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 ExtractPriorityClassFrom(priorityClass *schedulingv1alpha1.PriorityClass, fieldManager string, subresource string) (*PriorityClassApplyConfiguration, error) {
|
||||
b := &PriorityClassApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(priorityClass, internal.Parser().Type("io.k8s.api.scheduling.v1alpha1.PriorityClass"), fieldManager, b, subresource)
|
||||
func ExtractPodGroupFrom(podGroup *schedulingv1alpha2.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)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(priorityClass.Name)
|
||||
b.WithName(podGroup.Name)
|
||||
b.WithNamespace(podGroup.Namespace)
|
||||
|
||||
b.WithKind("PriorityClass")
|
||||
b.WithAPIVersion("scheduling.k8s.io/v1alpha1")
|
||||
b.WithKind("PodGroup")
|
||||
b.WithAPIVersion("scheduling.k8s.io/v1alpha2")
|
||||
return b, nil
|
||||
}
|
||||
|
||||
// ExtractPriorityClass extracts the applied configuration owned by fieldManager from
|
||||
// priorityClass. If no managedFields are found in priorityClass for fieldManager, a
|
||||
// PriorityClassApplyConfiguration is returned with only the Name, Namespace (if applicable),
|
||||
// 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.
|
||||
// priorityClass must be a unmodified PriorityClass API object that was retrieved from the Kubernetes API.
|
||||
// ExtractPriorityClass provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// 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 ExtractPriorityClass(priorityClass *schedulingv1alpha1.PriorityClass, fieldManager string) (*PriorityClassApplyConfiguration, error) {
|
||||
return ExtractPriorityClassFrom(priorityClass, fieldManager, "")
|
||||
func ExtractPodGroup(podGroup *schedulingv1alpha2.PodGroup, fieldManager string) (*PodGroupApplyConfiguration, error) {
|
||||
return ExtractPodGroupFrom(podGroup, fieldManager, "")
|
||||
}
|
||||
|
||||
func (b PriorityClassApplyConfiguration) IsApplyConfiguration() {}
|
||||
// ExtractPodGroupStatus extracts the applied configuration owned by fieldManager from
|
||||
// podGroup for the status subresource.
|
||||
func ExtractPodGroupStatus(podGroup *schedulingv1alpha2.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 *PriorityClassApplyConfiguration) WithKind(value string) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithKind(value string) *PodGroupApplyConfiguration {
|
||||
b.TypeMetaApplyConfiguration.Kind = &value
|
||||
return b
|
||||
}
|
||||
@@ -114,7 +110,7 @@ func (b *PriorityClassApplyConfiguration) WithKind(value string) *PriorityClassA
|
||||
// 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 *PriorityClassApplyConfiguration) WithAPIVersion(value string) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithAPIVersion(value string) *PodGroupApplyConfiguration {
|
||||
b.TypeMetaApplyConfiguration.APIVersion = &value
|
||||
return b
|
||||
}
|
||||
@@ -122,7 +118,7 @@ func (b *PriorityClassApplyConfiguration) WithAPIVersion(value string) *Priority
|
||||
// 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 *PriorityClassApplyConfiguration) WithName(value string) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithName(value string) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.Name = &value
|
||||
return b
|
||||
@@ -131,7 +127,7 @@ func (b *PriorityClassApplyConfiguration) WithName(value string) *PriorityClassA
|
||||
// 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 *PriorityClassApplyConfiguration) WithGenerateName(value string) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithGenerateName(value string) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.GenerateName = &value
|
||||
return b
|
||||
@@ -140,7 +136,7 @@ func (b *PriorityClassApplyConfiguration) WithGenerateName(value string) *Priori
|
||||
// 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 *PriorityClassApplyConfiguration) WithNamespace(value string) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithNamespace(value string) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.Namespace = &value
|
||||
return b
|
||||
@@ -149,7 +145,7 @@ func (b *PriorityClassApplyConfiguration) WithNamespace(value string) *PriorityC
|
||||
// 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 *PriorityClassApplyConfiguration) WithUID(value types.UID) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithUID(value types.UID) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.UID = &value
|
||||
return b
|
||||
@@ -158,7 +154,7 @@ func (b *PriorityClassApplyConfiguration) WithUID(value types.UID) *PriorityClas
|
||||
// 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 *PriorityClassApplyConfiguration) WithResourceVersion(value string) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithResourceVersion(value string) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
|
||||
return b
|
||||
@@ -167,7 +163,7 @@ func (b *PriorityClassApplyConfiguration) WithResourceVersion(value string) *Pri
|
||||
// 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 *PriorityClassApplyConfiguration) WithGeneration(value int64) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithGeneration(value int64) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.Generation = &value
|
||||
return b
|
||||
@@ -176,7 +172,7 @@ func (b *PriorityClassApplyConfiguration) WithGeneration(value int64) *PriorityC
|
||||
// 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 *PriorityClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.CreationTimestamp = &value
|
||||
return b
|
||||
@@ -185,7 +181,7 @@ func (b *PriorityClassApplyConfiguration) WithCreationTimestamp(value metav1.Tim
|
||||
// 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 *PriorityClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
|
||||
return b
|
||||
@@ -194,7 +190,7 @@ func (b *PriorityClassApplyConfiguration) WithDeletionTimestamp(value metav1.Tim
|
||||
// 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 *PriorityClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
|
||||
return b
|
||||
@@ -204,7 +200,7 @@ func (b *PriorityClassApplyConfiguration) WithDeletionGracePeriodSeconds(value i
|
||||
// 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 *PriorityClassApplyConfiguration) WithLabels(entries map[string]string) *PriorityClassApplyConfiguration {
|
||||
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))
|
||||
@@ -219,7 +215,7 @@ func (b *PriorityClassApplyConfiguration) WithLabels(entries map[string]string)
|
||||
// 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 *PriorityClassApplyConfiguration) WithAnnotations(entries map[string]string) *PriorityClassApplyConfiguration {
|
||||
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))
|
||||
@@ -233,7 +229,7 @@ func (b *PriorityClassApplyConfiguration) WithAnnotations(entries map[string]str
|
||||
// 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 *PriorityClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
@@ -247,7 +243,7 @@ func (b *PriorityClassApplyConfiguration) WithOwnerReferences(values ...*v1.Owne
|
||||
// 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 *PriorityClassApplyConfiguration) WithFinalizers(values ...string) *PriorityClassApplyConfiguration {
|
||||
func (b *PodGroupApplyConfiguration) WithFinalizers(values ...string) *PodGroupApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
|
||||
@@ -255,62 +251,46 @@ func (b *PriorityClassApplyConfiguration) WithFinalizers(values ...string) *Prio
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *PriorityClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
|
||||
func (b *PodGroupApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
|
||||
if b.ObjectMetaApplyConfiguration == nil {
|
||||
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
|
||||
}
|
||||
}
|
||||
|
||||
// WithValue sets the Value field in the declarative configuration to the given value
|
||||
// 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 Value field is set to the value of the last call.
|
||||
func (b *PriorityClassApplyConfiguration) WithValue(value int32) *PriorityClassApplyConfiguration {
|
||||
b.Value = &value
|
||||
// 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
|
||||
}
|
||||
|
||||
// WithGlobalDefault sets the GlobalDefault field in the declarative configuration to the given value
|
||||
// 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 GlobalDefault field is set to the value of the last call.
|
||||
func (b *PriorityClassApplyConfiguration) WithGlobalDefault(value bool) *PriorityClassApplyConfiguration {
|
||||
b.GlobalDefault = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDescription sets the Description field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Description field is set to the value of the last call.
|
||||
func (b *PriorityClassApplyConfiguration) WithDescription(value string) *PriorityClassApplyConfiguration {
|
||||
b.Description = &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 *PriorityClassApplyConfiguration) WithPreemptionPolicy(value corev1.PreemptionPolicy) *PriorityClassApplyConfiguration {
|
||||
b.PreemptionPolicy = &value
|
||||
// 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 *PriorityClassApplyConfiguration) GetKind() *string {
|
||||
func (b *PodGroupApplyConfiguration) GetKind() *string {
|
||||
return b.TypeMetaApplyConfiguration.Kind
|
||||
}
|
||||
|
||||
// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration.
|
||||
func (b *PriorityClassApplyConfiguration) GetAPIVersion() *string {
|
||||
func (b *PodGroupApplyConfiguration) GetAPIVersion() *string {
|
||||
return b.TypeMetaApplyConfiguration.APIVersion
|
||||
}
|
||||
|
||||
// GetName retrieves the value of the Name field in the declarative configuration.
|
||||
func (b *PriorityClassApplyConfiguration) GetName() *string {
|
||||
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 *PriorityClassApplyConfiguration) GetNamespace() *string {
|
||||
func (b *PodGroupApplyConfiguration) GetNamespace() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.ObjectMetaApplyConfiguration.Namespace
|
||||
}
|
||||
@@ -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 v1alpha2
|
||||
|
||||
// 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
|
||||
}
|
||||
@@ -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 v1alpha2
|
||||
|
||||
// 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
|
||||
}
|
||||
@@ -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 v1alpha2
|
||||
|
||||
// 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
|
||||
}
|
||||
@@ -16,35 +16,36 @@ limitations under the License.
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2"
|
||||
)
|
||||
|
||||
// PodGroupPolicyApplyConfiguration represents a declarative configuration of the PodGroupPolicy type for use
|
||||
// PodGroupSchedulingPolicyApplyConfiguration represents a declarative configuration of the PodGroupSchedulingPolicy type for use
|
||||
// with apply.
|
||||
//
|
||||
// PodGroupPolicy defines the scheduling configuration for a PodGroup.
|
||||
type PodGroupPolicyApplyConfiguration struct {
|
||||
// PodGroupSchedulingPolicy defines the scheduling configuration for a PodGroup.
|
||||
// Exactly one policy must be set.
|
||||
type PodGroupSchedulingPolicyApplyConfiguration struct {
|
||||
// Basic specifies that the pods in this group should be scheduled using
|
||||
// standard Kubernetes scheduling behavior.
|
||||
Basic *schedulingv1alpha1.BasicSchedulingPolicy `json:"basic,omitempty"`
|
||||
Basic *schedulingv1alpha2.BasicSchedulingPolicy `json:"basic,omitempty"`
|
||||
// Gang specifies that the pods in this group should be scheduled using
|
||||
// all-or-nothing semantics.
|
||||
Gang *GangSchedulingPolicyApplyConfiguration `json:"gang,omitempty"`
|
||||
}
|
||||
|
||||
// PodGroupPolicyApplyConfiguration constructs a declarative configuration of the PodGroupPolicy type for use with
|
||||
// PodGroupSchedulingPolicyApplyConfiguration constructs a declarative configuration of the PodGroupSchedulingPolicy type for use with
|
||||
// apply.
|
||||
func PodGroupPolicy() *PodGroupPolicyApplyConfiguration {
|
||||
return &PodGroupPolicyApplyConfiguration{}
|
||||
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 *PodGroupPolicyApplyConfiguration) WithBasic(value schedulingv1alpha1.BasicSchedulingPolicy) *PodGroupPolicyApplyConfiguration {
|
||||
func (b *PodGroupSchedulingPolicyApplyConfiguration) WithBasic(value schedulingv1alpha2.BasicSchedulingPolicy) *PodGroupSchedulingPolicyApplyConfiguration {
|
||||
b.Basic = &value
|
||||
return b
|
||||
}
|
||||
@@ -52,7 +53,7 @@ func (b *PodGroupPolicyApplyConfiguration) WithBasic(value schedulingv1alpha1.Ba
|
||||
// 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 *PodGroupPolicyApplyConfiguration) WithGang(value *GangSchedulingPolicyApplyConfiguration) *PodGroupPolicyApplyConfiguration {
|
||||
func (b *PodGroupSchedulingPolicyApplyConfiguration) WithGang(value *GangSchedulingPolicyApplyConfiguration) *PodGroupSchedulingPolicyApplyConfiguration {
|
||||
b.Gang = value
|
||||
return b
|
||||
}
|
||||
145
applyconfigurations/scheduling/v1alpha2/podgroupspec.go
Normal file
145
applyconfigurations/scheduling/v1alpha2/podgroupspec.go
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
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
|
||||
|
||||
import (
|
||||
schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2"
|
||||
)
|
||||
|
||||
// PodGroupSpecApplyConfiguration represents a declarative configuration of the PodGroupSpec type for use
|
||||
// with apply.
|
||||
//
|
||||
// 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.
|
||||
// This field is immutable.
|
||||
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 an alpha-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 Pod, PodGroup. Defaults to Pod 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.
|
||||
// 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
|
||||
// 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"`
|
||||
}
|
||||
|
||||
// PodGroupSpecApplyConfiguration constructs a declarative configuration of the PodGroupSpec type for use with
|
||||
// apply.
|
||||
func PodGroupSpec() *PodGroupSpecApplyConfiguration {
|
||||
return &PodGroupSpecApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithPodGroupTemplateRef sets the PodGroupTemplateRef field in the declarative configuration 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
|
||||
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 schedulingv1alpha2.DisruptionMode) *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
|
||||
}
|
||||
81
applyconfigurations/scheduling/v1alpha2/podgroupstatus.go
Normal file
81
applyconfigurations/scheduling/v1alpha2/podgroupstatus.go
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
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
|
||||
|
||||
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:
|
||||
// - "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.
|
||||
Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
|
||||
// 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
|
||||
}
|
||||
136
applyconfigurations/scheduling/v1alpha2/podgrouptemplate.go
Normal file
136
applyconfigurations/scheduling/v1alpha2/podgrouptemplate.go
Normal file
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
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
|
||||
|
||||
import (
|
||||
schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2"
|
||||
)
|
||||
|
||||
// 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.
|
||||
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 an alpha-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.
|
||||
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.
|
||||
// The higher the value, the higher the priority.
|
||||
// This field is available only when the WorkloadAwarePreemption feature gate
|
||||
// is enabled.
|
||||
Priority *int32 `json:"priority,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 schedulingv1alpha2.DisruptionMode) *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
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
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
|
||||
}
|
||||
@@ -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 v1alpha2
|
||||
|
||||
// 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
|
||||
}
|
||||
@@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1alpha2
|
||||
|
||||
// TypedLocalObjectReferenceApplyConfiguration represents a declarative configuration of the TypedLocalObjectReference type for use
|
||||
// with apply.
|
||||
@@ -16,10 +16,10 @@ limitations under the License.
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
|
||||
@@ -31,12 +31,13 @@ import (
|
||||
// with apply.
|
||||
//
|
||||
// Workload allows for expressing scheduling constraints that should be used
|
||||
// when managing lifecycle of workloads from scheduling perspective,
|
||||
// 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:",inline"`
|
||||
// Standard object's metadata.
|
||||
// Name must be a DNS subdomain.
|
||||
// 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"`
|
||||
@@ -49,7 +50,7 @@ func Workload(name, namespace string) *WorkloadApplyConfiguration {
|
||||
b.WithName(name)
|
||||
b.WithNamespace(namespace)
|
||||
b.WithKind("Workload")
|
||||
b.WithAPIVersion("scheduling.k8s.io/v1alpha1")
|
||||
b.WithAPIVersion("scheduling.k8s.io/v1alpha2")
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -60,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 *schedulingv1alpha1.Workload, fieldManager string, subresource string) (*WorkloadApplyConfiguration, error) {
|
||||
func ExtractWorkloadFrom(workload *schedulingv1alpha2.Workload, fieldManager string, subresource string) (*WorkloadApplyConfiguration, error) {
|
||||
b := &WorkloadApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(workload, internal.Parser().Type("io.k8s.api.scheduling.v1alpha1.Workload"), fieldManager, b, subresource)
|
||||
err := managedfields.ExtractInto(workload, internal.Parser().Type("io.k8s.api.scheduling.v1alpha2.Workload"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -70,7 +71,7 @@ func ExtractWorkloadFrom(workload *schedulingv1alpha1.Workload, fieldManager str
|
||||
b.WithNamespace(workload.Namespace)
|
||||
|
||||
b.WithKind("Workload")
|
||||
b.WithAPIVersion("scheduling.k8s.io/v1alpha1")
|
||||
b.WithAPIVersion("scheduling.k8s.io/v1alpha2")
|
||||
return b, nil
|
||||
}
|
||||
|
||||
@@ -84,7 +85,7 @@ func ExtractWorkloadFrom(workload *schedulingv1alpha1.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 *schedulingv1alpha1.Workload, fieldManager string) (*WorkloadApplyConfiguration, error) {
|
||||
func ExtractWorkload(workload *schedulingv1alpha2.Workload, fieldManager string) (*WorkloadApplyConfiguration, error) {
|
||||
return ExtractWorkloadFrom(workload, fieldManager, "")
|
||||
}
|
||||
|
||||
@@ -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 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
|
||||
}
|
||||
@@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1alpha2
|
||||
|
||||
// WorkloadSpecApplyConfiguration represents a declarative configuration of the WorkloadSpec type for use
|
||||
// with apply.
|
||||
@@ -26,11 +26,11 @@ 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.
|
||||
// When set, it cannot be changed.
|
||||
// This field is immutable.
|
||||
ControllerRef *TypedLocalObjectReferenceApplyConfiguration `json:"controllerRef,omitempty"`
|
||||
// PodGroups is the list of pod groups that make up the Workload.
|
||||
// The maximum number of pod groups is 8. This field is immutable.
|
||||
PodGroups []PodGroupApplyConfiguration `json:"podGroups,omitempty"`
|
||||
// PodGroupTemplates is the list of templates that make up the Workload.
|
||||
// The maximum number of templates is 8. This field is immutable.
|
||||
PodGroupTemplates []PodGroupTemplateApplyConfiguration `json:"podGroupTemplates,omitempty"`
|
||||
}
|
||||
|
||||
// WorkloadSpecApplyConfiguration constructs a declarative configuration of the WorkloadSpec type for use with
|
||||
@@ -47,15 +47,15 @@ func (b *WorkloadSpecApplyConfiguration) WithControllerRef(value *TypedLocalObje
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPodGroups adds the given value to the PodGroups field in the declarative configuration
|
||||
// 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 PodGroups field.
|
||||
func (b *WorkloadSpecApplyConfiguration) WithPodGroups(values ...*PodGroupApplyConfiguration) *WorkloadSpecApplyConfiguration {
|
||||
// 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 WithPodGroups")
|
||||
panic("nil value passed to WithPodGroupTemplates")
|
||||
}
|
||||
b.PodGroups = append(b.PodGroups, *values[i])
|
||||
b.PodGroupTemplates = append(b.PodGroupTemplates, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -154,7 +154,7 @@ type CSIDriverSpecApplyConfiguration struct {
|
||||
// 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.
|
||||
//
|
||||
// This is a beta feature and requires the MutableCSINodeAllocatableCount feature gate to be enabled.
|
||||
// This feature requires the MutableCSINodeAllocatableCount feature gate to be enabled.
|
||||
//
|
||||
// This field is mutable.
|
||||
NodeAllocatableUpdatePeriodSeconds *int64 `json:"nodeAllocatableUpdatePeriodSeconds,omitempty"`
|
||||
@@ -178,6 +178,24 @@ 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
|
||||
// scheduling if the CSI driver on the node is missing.
|
||||
//
|
||||
// Enabling 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.
|
||||
//
|
||||
// For 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.
|
||||
//
|
||||
// This is an alpha feature and requires the VolumeLimitScaling feature gate to be enabled.
|
||||
// Default is "false".
|
||||
PreventPodSchedulingIfMissing *bool `json:"preventPodSchedulingIfMissing,omitempty"`
|
||||
}
|
||||
|
||||
// CSIDriverSpecApplyConfiguration constructs a declarative configuration of the CSIDriverSpec type for use with
|
||||
@@ -272,3 +290,11 @@ func (b *CSIDriverSpecApplyConfiguration) WithServiceAccountTokenInSecrets(value
|
||||
b.ServiceAccountTokenInSecrets = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPreventPodSchedulingIfMissing sets the PreventPodSchedulingIfMissing field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the PreventPodSchedulingIfMissing field is set to the value of the last call.
|
||||
func (b *CSIDriverSpecApplyConfiguration) WithPreventPodSchedulingIfMissing(value bool) *CSIDriverSpecApplyConfiguration {
|
||||
b.PreventPodSchedulingIfMissing = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ type VolumeErrorApplyConfiguration struct {
|
||||
Message *string `json:"message,omitempty"`
|
||||
// errorCode is a numeric gRPC code representing the error encountered during Attach or Detach operations.
|
||||
//
|
||||
// This is an optional, beta field that requires the MutableCSINodeAllocatableCount feature gate being enabled to be set.
|
||||
// This field requires the MutableCSINodeAllocatableCount feature gate being enabled to be set.
|
||||
ErrorCode *int32 `json:"errorCode,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -178,6 +178,24 @@ 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
|
||||
// scheduling if the CSI driver on the node is missing.
|
||||
//
|
||||
// Enabling 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.
|
||||
//
|
||||
// For 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.
|
||||
//
|
||||
// This is an alpha feature and requires the VolumeLimitScaling feature gate to be enabled.
|
||||
// Default is "false".
|
||||
PreventPodSchedulingIfMissing *bool `json:"preventPodSchedulingIfMissing,omitempty"`
|
||||
}
|
||||
|
||||
// CSIDriverSpecApplyConfiguration constructs a declarative configuration of the CSIDriverSpec type for use with
|
||||
@@ -272,3 +290,11 @@ func (b *CSIDriverSpecApplyConfiguration) WithServiceAccountTokenInSecrets(value
|
||||
b.ServiceAccountTokenInSecrets = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPreventPodSchedulingIfMissing sets the PreventPodSchedulingIfMissing field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the PreventPodSchedulingIfMissing field is set to the value of the last call.
|
||||
func (b *CSIDriverSpecApplyConfiguration) WithPreventPodSchedulingIfMissing(value bool) *CSIDriverSpecApplyConfiguration {
|
||||
b.PreventPodSchedulingIfMissing = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ import (
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
resourcev1beta2 "k8s.io/api/resource/v1beta2"
|
||||
schedulingv1 "k8s.io/api/scheduling/v1"
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2"
|
||||
schedulingv1beta1 "k8s.io/api/scheduling/v1beta1"
|
||||
storagev1 "k8s.io/api/storage/v1"
|
||||
storagev1alpha1 "k8s.io/api/storage/v1alpha1"
|
||||
@@ -117,7 +117,7 @@ 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"
|
||||
applyconfigurationsschedulingv1alpha1 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha1"
|
||||
applyconfigurationsschedulingv1alpha2 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha2"
|
||||
applyconfigurationsschedulingv1beta1 "k8s.io/client-go/applyconfigurations/scheduling/v1beta1"
|
||||
applyconfigurationsstoragev1 "k8s.io/client-go/applyconfigurations/storage/v1"
|
||||
applyconfigurationsstoragev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1"
|
||||
@@ -130,18 +130,32 @@ import (
|
||||
func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
switch kind {
|
||||
// Group=admissionregistration.k8s.io, Version=v1
|
||||
case v1.SchemeGroupVersion.WithKind("ApplyConfiguration"):
|
||||
return &admissionregistrationv1.ApplyConfigurationApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("AuditAnnotation"):
|
||||
return &admissionregistrationv1.AuditAnnotationApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("ExpressionWarning"):
|
||||
return &admissionregistrationv1.ExpressionWarningApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("JSONPatch"):
|
||||
return &admissionregistrationv1.JSONPatchApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("MatchCondition"):
|
||||
return &admissionregistrationv1.MatchConditionApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("MatchResources"):
|
||||
return &admissionregistrationv1.MatchResourcesApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("MutatingAdmissionPolicy"):
|
||||
return &admissionregistrationv1.MutatingAdmissionPolicyApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("MutatingAdmissionPolicyBinding"):
|
||||
return &admissionregistrationv1.MutatingAdmissionPolicyBindingApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("MutatingAdmissionPolicyBindingSpec"):
|
||||
return &admissionregistrationv1.MutatingAdmissionPolicyBindingSpecApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("MutatingAdmissionPolicySpec"):
|
||||
return &admissionregistrationv1.MutatingAdmissionPolicySpecApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("MutatingWebhook"):
|
||||
return &admissionregistrationv1.MutatingWebhookApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("MutatingWebhookConfiguration"):
|
||||
return &admissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("Mutation"):
|
||||
return &admissionregistrationv1.MutationApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("NamedRuleWithOperations"):
|
||||
return &admissionregistrationv1.NamedRuleWithOperationsApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("ParamKind"):
|
||||
@@ -776,6 +790,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &applyconfigurationscorev1.NodeAddressApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("NodeAffinity"):
|
||||
return &applyconfigurationscorev1.NodeAffinityApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("NodeAllocatableResourceClaimStatus"):
|
||||
return &applyconfigurationscorev1.NodeAllocatableResourceClaimStatusApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("NodeCondition"):
|
||||
return &applyconfigurationscorev1.NodeConditionApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("NodeConfigSource"):
|
||||
@@ -860,6 +876,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &applyconfigurationscorev1.PodResourceClaimStatusApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("PodSchedulingGate"):
|
||||
return &applyconfigurationscorev1.PodSchedulingGateApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("PodSchedulingGroup"):
|
||||
return &applyconfigurationscorev1.PodSchedulingGroupApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("PodSecurityContext"):
|
||||
return &applyconfigurationscorev1.PodSecurityContextApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("PodSpec"):
|
||||
@@ -1000,8 +1018,6 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &applyconfigurationscorev1.WeightedPodAffinityTermApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("WindowsSecurityContextOptions"):
|
||||
return &applyconfigurationscorev1.WindowsSecurityContextOptionsApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("WorkloadReference"):
|
||||
return &applyconfigurationscorev1.WorkloadReferenceApplyConfiguration{}
|
||||
|
||||
// Group=discovery.k8s.io, Version=v1
|
||||
case discoveryv1.SchemeGroupVersion.WithKind("Endpoint"):
|
||||
@@ -1606,6 +1622,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &applyconfigurationsresourcev1.ExactDeviceRequestApplyConfiguration{}
|
||||
case resourcev1.SchemeGroupVersion.WithKind("NetworkDeviceData"):
|
||||
return &applyconfigurationsresourcev1.NetworkDeviceDataApplyConfiguration{}
|
||||
case resourcev1.SchemeGroupVersion.WithKind("NodeAllocatableResourceMapping"):
|
||||
return &applyconfigurationsresourcev1.NodeAllocatableResourceMappingApplyConfiguration{}
|
||||
case resourcev1.SchemeGroupVersion.WithKind("OpaqueDeviceConfiguration"):
|
||||
return &applyconfigurationsresourcev1.OpaqueDeviceConfigurationApplyConfiguration{}
|
||||
case resourcev1.SchemeGroupVersion.WithKind("ResourceClaim"):
|
||||
@@ -1638,6 +1656,14 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &resourcev1alpha3.DeviceTaintRuleStatusApplyConfiguration{}
|
||||
case v1alpha3.SchemeGroupVersion.WithKind("DeviceTaintSelector"):
|
||||
return &resourcev1alpha3.DeviceTaintSelectorApplyConfiguration{}
|
||||
case v1alpha3.SchemeGroupVersion.WithKind("PoolStatus"):
|
||||
return &resourcev1alpha3.PoolStatusApplyConfiguration{}
|
||||
case v1alpha3.SchemeGroupVersion.WithKind("ResourcePoolStatusRequest"):
|
||||
return &resourcev1alpha3.ResourcePoolStatusRequestApplyConfiguration{}
|
||||
case v1alpha3.SchemeGroupVersion.WithKind("ResourcePoolStatusRequestSpec"):
|
||||
return &resourcev1alpha3.ResourcePoolStatusRequestSpecApplyConfiguration{}
|
||||
case v1alpha3.SchemeGroupVersion.WithKind("ResourcePoolStatusRequestStatus"):
|
||||
return &resourcev1alpha3.ResourcePoolStatusRequestStatusApplyConfiguration{}
|
||||
|
||||
// Group=resource.k8s.io, Version=v1beta1
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("AllocatedDeviceStatus"):
|
||||
@@ -1698,6 +1724,8 @@ 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("OpaqueDeviceConfiguration"):
|
||||
return &applyconfigurationsresourcev1beta1.OpaqueDeviceConfigurationApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("ResourceClaim"):
|
||||
@@ -1772,12 +1800,22 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &applyconfigurationsresourcev1beta2.DeviceSubRequestApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceTaint"):
|
||||
return &applyconfigurationsresourcev1beta2.DeviceTaintApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceTaintRule"):
|
||||
return &applyconfigurationsresourcev1beta2.DeviceTaintRuleApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceTaintRuleSpec"):
|
||||
return &applyconfigurationsresourcev1beta2.DeviceTaintRuleSpecApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceTaintRuleStatus"):
|
||||
return &applyconfigurationsresourcev1beta2.DeviceTaintRuleStatusApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceTaintSelector"):
|
||||
return &applyconfigurationsresourcev1beta2.DeviceTaintSelectorApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("DeviceToleration"):
|
||||
return &applyconfigurationsresourcev1beta2.DeviceTolerationApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("ExactDeviceRequest"):
|
||||
return &applyconfigurationsresourcev1beta2.ExactDeviceRequestApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("NetworkDeviceData"):
|
||||
return &applyconfigurationsresourcev1beta2.NetworkDeviceDataApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("NodeAllocatableResourceMapping"):
|
||||
return &applyconfigurationsresourcev1beta2.NodeAllocatableResourceMappingApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("OpaqueDeviceConfiguration"):
|
||||
return &applyconfigurationsresourcev1beta2.OpaqueDeviceConfigurationApplyConfiguration{}
|
||||
case resourcev1beta2.SchemeGroupVersion.WithKind("ResourceClaim"):
|
||||
@@ -1803,21 +1841,37 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
case schedulingv1.SchemeGroupVersion.WithKind("PriorityClass"):
|
||||
return &applyconfigurationsschedulingv1.PriorityClassApplyConfiguration{}
|
||||
|
||||
// Group=scheduling.k8s.io, Version=v1alpha1
|
||||
case schedulingv1alpha1.SchemeGroupVersion.WithKind("GangSchedulingPolicy"):
|
||||
return &applyconfigurationsschedulingv1alpha1.GangSchedulingPolicyApplyConfiguration{}
|
||||
case schedulingv1alpha1.SchemeGroupVersion.WithKind("PodGroup"):
|
||||
return &applyconfigurationsschedulingv1alpha1.PodGroupApplyConfiguration{}
|
||||
case schedulingv1alpha1.SchemeGroupVersion.WithKind("PodGroupPolicy"):
|
||||
return &applyconfigurationsschedulingv1alpha1.PodGroupPolicyApplyConfiguration{}
|
||||
case schedulingv1alpha1.SchemeGroupVersion.WithKind("PriorityClass"):
|
||||
return &applyconfigurationsschedulingv1alpha1.PriorityClassApplyConfiguration{}
|
||||
case schedulingv1alpha1.SchemeGroupVersion.WithKind("TypedLocalObjectReference"):
|
||||
return &applyconfigurationsschedulingv1alpha1.TypedLocalObjectReferenceApplyConfiguration{}
|
||||
case schedulingv1alpha1.SchemeGroupVersion.WithKind("Workload"):
|
||||
return &applyconfigurationsschedulingv1alpha1.WorkloadApplyConfiguration{}
|
||||
case schedulingv1alpha1.SchemeGroupVersion.WithKind("WorkloadSpec"):
|
||||
return &applyconfigurationsschedulingv1alpha1.WorkloadSpecApplyConfiguration{}
|
||||
// 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=v1beta1
|
||||
case schedulingv1beta1.SchemeGroupVersion.WithKind("PriorityClass"):
|
||||
|
||||
@@ -157,6 +157,13 @@ func (f *envVarFeatureGates) set(featureName Feature, featureValue bool, allowCh
|
||||
// read from the corresponding environmental variable.
|
||||
func (f *envVarFeatureGates) getEnabledMapFromEnvVar() map[Feature]bool {
|
||||
f.readEnvVarsOnce.Do(func() {
|
||||
// This code does not really support contextual logging. Making it do so has huge
|
||||
// implications for several call chains because the Enabled call then needs
|
||||
// a `*WithLogger` variant. This does not matter in Kubernetes itself because
|
||||
// all Kubernetes components replace the feature gate implementation used
|
||||
// by client-go, but it might matter elsewhere.
|
||||
logger := klog.Background()
|
||||
|
||||
featureGatesState := map[Feature]bool{}
|
||||
for feature, featureSpec := range f.known {
|
||||
featureState, featureStateSet := os.LookupEnv(fmt.Sprintf("KUBE_FEATURE_%s", feature))
|
||||
@@ -166,10 +173,10 @@ func (f *envVarFeatureGates) getEnabledMapFromEnvVar() map[Feature]bool {
|
||||
boolVal, boolErr := strconv.ParseBool(featureState)
|
||||
switch {
|
||||
case boolErr != nil:
|
||||
utilruntime.HandleError(fmt.Errorf("cannot set feature gate %q to %q, due to %v", feature, featureState, boolErr))
|
||||
utilruntime.HandleErrorWithLogger(logger, boolErr, "Could not set feature gate", "feature", feature, "desiredState", featureState)
|
||||
case featureSpec.LockToDefault:
|
||||
if boolVal != featureSpec.Default {
|
||||
utilruntime.HandleError(fmt.Errorf("cannot set feature gate %q to %q, feature is locked to %v", feature, featureState, featureSpec.Default))
|
||||
utilruntime.HandleErrorWithLogger(logger, nil, "Could not set feature gate, feature is locked", "feature", feature, "desiredState", featureState, "lockedState", featureSpec.Default)
|
||||
break
|
||||
}
|
||||
featureGatesState[feature] = featureSpec.Default
|
||||
@@ -182,10 +189,10 @@ func (f *envVarFeatureGates) getEnabledMapFromEnvVar() map[Feature]bool {
|
||||
|
||||
for feature, featureSpec := range f.known {
|
||||
if featureState, ok := featureGatesState[feature]; ok {
|
||||
klog.V(1).InfoS("Feature gate updated state", "feature", feature, "enabled", featureState)
|
||||
logger.V(1).Info("Feature gate updated state", "feature", feature, "enabled", featureState)
|
||||
continue
|
||||
}
|
||||
klog.V(1).InfoS("Feature gate default state", "feature", feature, "enabled", featureSpec.Default)
|
||||
logger.V(1).Info("Feature gate default state", "feature", feature, "enabled", featureSpec.Default)
|
||||
}
|
||||
})
|
||||
return f.enabledViaEnvVar.Load().(map[Feature]bool)
|
||||
|
||||
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package features
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"context"
|
||||
"sync/atomic"
|
||||
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
@@ -127,7 +127,9 @@ func AddVersionedFeaturesToExistingFeatureGates(registry VersionedRegistry) erro
|
||||
// clientgofeaturegate.ReplaceFeatureGates(utilfeature.DefaultMutableFeatureGate)
|
||||
func ReplaceFeatureGates(newFeatureGates Gates) {
|
||||
if replaceFeatureGatesWithWarningIndicator(newFeatureGates) {
|
||||
utilruntime.HandleError(errors.New("the default feature gates implementation has already been used and now it's being overwritten. This might lead to unexpected behaviour. Check your initialization order"))
|
||||
// TODO (?): A new API would be needed where callers pass in a context or logger.
|
||||
// Probably not worth it.
|
||||
utilruntime.HandleErrorWithContext(context.TODO(), nil, "The default feature gates implementation has already been used and now it's being overwritten. This might lead to unexpected behaviour. Check your initialization order.")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,13 @@ const (
|
||||
// events for items popped off the FIFO.
|
||||
AtomicFIFO Feature = "AtomicFIFO"
|
||||
|
||||
// owner: @yt2985
|
||||
// beta: 1.36
|
||||
//
|
||||
// If enabled, allows clients to gracefully handle Certificate Authority (CA)
|
||||
// rotations without dropping connections or requiring a restart.
|
||||
ClientsAllowCARotation Feature = "ClientsAllowCARotation"
|
||||
|
||||
// owner: @benluddy
|
||||
// kep: https://kep.k8s.io/4222
|
||||
// alpha: 1.32
|
||||
@@ -48,6 +55,13 @@ const (
|
||||
// "application/json" or "application/apply-patch+yaml", respectively.
|
||||
ClientsAllowCBOR Feature = "ClientsAllowCBOR"
|
||||
|
||||
// owner: @enj
|
||||
// beta: v1.36
|
||||
//
|
||||
// If enabled, the client-go TLS transport cache uses weak pointers to allow
|
||||
// garbage collection of unused transports, preventing unbounded cache growth.
|
||||
ClientsAllowTLSCacheGC Feature = "ClientsAllowTLSCacheGC"
|
||||
|
||||
// owner: @benluddy
|
||||
// kep: https://kep.k8s.io/4222
|
||||
// alpha: 1.32
|
||||
@@ -98,9 +112,15 @@ var defaultVersionedKubernetesFeatureGates = map[Feature]VersionedSpecs{
|
||||
AtomicFIFO: {
|
||||
{Version: version.MustParse("1.36"), Default: true, PreRelease: Beta},
|
||||
},
|
||||
ClientsAllowCARotation: {
|
||||
{Version: version.MustParse("1.36"), Default: true, PreRelease: Beta},
|
||||
},
|
||||
ClientsAllowCBOR: {
|
||||
{Version: version.MustParse("1.32"), Default: false, PreRelease: Alpha},
|
||||
},
|
||||
ClientsAllowTLSCacheGC: {
|
||||
{Version: version.MustParse("1.36"), Default: true, PreRelease: Beta},
|
||||
},
|
||||
ClientsPreferCBOR: {
|
||||
{Version: version.MustParse("1.32"), Default: false, PreRelease: Alpha},
|
||||
},
|
||||
|
||||
24
go.mod
24
go.mod
@@ -2,9 +2,9 @@
|
||||
|
||||
module k8s.io/client-go
|
||||
|
||||
go 1.25.0
|
||||
go 1.26.0
|
||||
|
||||
godebug default=go1.25
|
||||
godebug default=go1.26
|
||||
|
||||
require (
|
||||
github.com/go-logr/logr v1.4.3
|
||||
@@ -21,21 +21,21 @@ require (
|
||||
golang.org/x/oauth2 v0.34.0
|
||||
golang.org/x/term v0.39.0
|
||||
golang.org/x/time v0.14.0
|
||||
google.golang.org/protobuf v1.36.11
|
||||
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af
|
||||
gopkg.in/evanphx/json-patch.v4 v4.13.0
|
||||
k8s.io/api v0.0.0-20260205193817-6f99b47a2bbd
|
||||
k8s.io/apimachinery v0.0.0-20260205233455-f12546b4989d
|
||||
k8s.io/klog/v2 v2.130.1
|
||||
k8s.io/kube-openapi v0.0.0-20260127142750-a19766b6e2d4
|
||||
k8s.io/utils v0.0.0-20260108192941-914a6e750570
|
||||
k8s.io/api v0.36.2
|
||||
k8s.io/apimachinery v0.36.2
|
||||
k8s.io/klog/v2 v2.140.0
|
||||
k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a
|
||||
k8s.io/streaming v0.36.2
|
||||
k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2
|
||||
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730
|
||||
sigs.k8s.io/randfill v1.0.0
|
||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.1
|
||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.2
|
||||
sigs.k8s.io/yaml v1.6.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/Masterminds/semver/v3 v3.4.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.13.0 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
|
||||
@@ -43,14 +43,12 @@ require (
|
||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||
github.com/go-openapi/swag v0.23.0 // indirect
|
||||
github.com/google/btree v1.1.3 // indirect
|
||||
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/moby/spdystream v0.5.0 // indirect
|
||||
github.com/moby/spdystream v0.5.1 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/stretchr/objx v0.5.2 // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
|
||||
52
go.sum
52
go.sum
@@ -1,5 +1,3 @@
|
||||
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
|
||||
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
|
||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
|
||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
@@ -21,8 +19,6 @@ github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En
|
||||
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||
github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
|
||||
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
|
||||
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
|
||||
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
|
||||
github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg=
|
||||
github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
|
||||
github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo=
|
||||
@@ -30,8 +26,6 @@ github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7O
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8=
|
||||
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo=
|
||||
@@ -49,8 +43,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
|
||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||
github.com/moby/spdystream v0.5.0 h1:7r0J1Si3QO/kjRitvSLVVFUjxMEb/YLj6S9FF62JBCU=
|
||||
github.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=
|
||||
github.com/moby/spdystream v0.5.1 h1:9sNYeYZUcci9R6/w7KDaFWEWeV4LStVG78Mpyq/Zm/Y=
|
||||
github.com/moby/spdystream v0.5.1/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
@@ -59,12 +53,6 @@ github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFd
|
||||
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
|
||||
github.com/onsi/ginkgo/v2 v2.27.4 h1:fcEcQW/A++6aZAZQNUmNjvA9PSOzefMJBerHJ4t8v8Y=
|
||||
github.com/onsi/ginkgo/v2 v2.27.4/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
|
||||
github.com/onsi/gomega v1.39.0 h1:y2ROC3hKFmQZJNFeGAMeHZKkjBL65mIZcvrLQBF9k6Q=
|
||||
github.com/onsi/gomega v1.39.0/go.mod h1:ZCU1pkQcXDO5Sl9/VVEGlDyp+zm0m1cmeG5TOzLgdh4=
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
@@ -93,14 +81,10 @@ go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
|
||||
go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
|
||||
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
|
||||
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
|
||||
golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c=
|
||||
golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU=
|
||||
golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o=
|
||||
golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8=
|
||||
golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw=
|
||||
golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
|
||||
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
|
||||
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
||||
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
|
||||
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY=
|
||||
@@ -109,10 +93,8 @@ golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE=
|
||||
golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8=
|
||||
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/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA=
|
||||
golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc=
|
||||
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
||||
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af h1:+5/Sw3GsDNlEmu7TfklWKPdQ0Ykja5VEmq2i817+jbI=
|
||||
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
@@ -123,21 +105,23 @@ 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.0.0-20260205193817-6f99b47a2bbd h1:tgzQul+6n5AQYpFcrhpV9fn7dLVlLG7J+7GkXPe8LOg=
|
||||
k8s.io/api v0.0.0-20260205193817-6f99b47a2bbd/go.mod h1:GZUpeSi8zsYiS/GDA9jMt0/+n6PAFNj8Z/eK2Rd/IvQ=
|
||||
k8s.io/apimachinery v0.0.0-20260205233455-f12546b4989d h1:bxuu4ynFTom/p7dq3+D7rcM500tuOXgMoEY7OqtmboE=
|
||||
k8s.io/apimachinery v0.0.0-20260205233455-f12546b4989d/go.mod h1:hQkG060WLAG1TIkYsu5lj3tb6YdNpKe5Zrr2UPGg+/k=
|
||||
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
|
||||
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
|
||||
k8s.io/kube-openapi v0.0.0-20260127142750-a19766b6e2d4 h1:HhDfevmPS+OalTjQRKbTHppRIz01AWi8s45TMXStgYY=
|
||||
k8s.io/kube-openapi v0.0.0-20260127142750-a19766b6e2d4/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ=
|
||||
k8s.io/utils v0.0.0-20260108192941-914a6e750570 h1:JT4W8lsdrGENg9W+YwwdLJxklIuKWdRm+BC+xt33FOY=
|
||||
k8s.io/utils v0.0.0-20260108192941-914a6e750570/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk=
|
||||
k8s.io/api v0.36.2 h1:TF6YDLIzKfccK7cq9YpTcGX8TJmEkHVRv78DM51fRYY=
|
||||
k8s.io/api v0.36.2/go.mod h1:F4LbMO4brjZYh7yFkXWhynSvtB7YauxV4c+HHkNRGNg=
|
||||
k8s.io/apimachinery v0.36.2 h1:0PE/W/WNy1UX61NLbXY5TMbJ6UwLL6E6lAPkYrKFxbQ=
|
||||
k8s.io/apimachinery v0.36.2/go.mod h1:fvf/HOLXq9RId0rnDIbN1OEBvHXdQbLMM8nu0LcBUf4=
|
||||
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-20260317180543-43fb72c5454a h1:xCeOEAOoGYl2jnJoHkC3hkbPJgdATINPMAxaynU2Ovg=
|
||||
k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a/go.mod h1:uGBT7iTA6c6MvqUvSXIaYZo9ukscABYi2btjhvgKGZ0=
|
||||
k8s.io/streaming v0.36.2 h1:NSKthPPg9UFSKsRauVJUVGH2Dvn8fhKmY4qrMkw/p98=
|
||||
k8s.io/streaming v0.36.2/go.mod h1:z6fV3D+NVkoeqRMtWwlUZK6U17SY/LqNzOxWL6GyR/s=
|
||||
k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2 h1:AZYQSJemyQB5eRxqcPky+/7EdBj0xi3g0ZcxxJ7vbWU=
|
||||
k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk=
|
||||
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg=
|
||||
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
|
||||
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.3.1 h1:JrhdFMqOd/+3ByqlP2I45kTOZmTRLBUm5pvRjeheg7E=
|
||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.1/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE=
|
||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.2 h1:kwVWMx5yS1CrnFWA/2QHyRVJ8jM6dBA80uLmm0wJkk8=
|
||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.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=
|
||||
|
||||
@@ -24,6 +24,10 @@ import (
|
||||
|
||||
// Interface provides access to all the informers in this group version.
|
||||
type Interface interface {
|
||||
// MutatingAdmissionPolicies returns a MutatingAdmissionPolicyInformer.
|
||||
MutatingAdmissionPolicies() MutatingAdmissionPolicyInformer
|
||||
// MutatingAdmissionPolicyBindings returns a MutatingAdmissionPolicyBindingInformer.
|
||||
MutatingAdmissionPolicyBindings() MutatingAdmissionPolicyBindingInformer
|
||||
// MutatingWebhookConfigurations returns a MutatingWebhookConfigurationInformer.
|
||||
MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer
|
||||
// ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyInformer.
|
||||
@@ -45,6 +49,16 @@ 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 {
|
||||
return &mutatingAdmissionPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// MutatingAdmissionPolicyBindings returns a MutatingAdmissionPolicyBindingInformer.
|
||||
func (v *version) MutatingAdmissionPolicyBindings() MutatingAdmissionPolicyBindingInformer {
|
||||
return &mutatingAdmissionPolicyBindingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// MutatingWebhookConfigurations returns a MutatingWebhookConfigurationInformer.
|
||||
func (v *version) MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer {
|
||||
return &mutatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
|
||||
115
informers/admissionregistration/v1/mutatingadmissionpolicy.go
Normal file
115
informers/admissionregistration/v1/mutatingadmissionpolicy.go
Normal file
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
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"
|
||||
|
||||
apiadmissionregistrationv1 "k8s.io/api/admissionregistration/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"
|
||||
admissionregistrationv1 "k8s.io/client-go/listers/admissionregistration/v1"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// MutatingAdmissionPolicyInformer provides access to a shared informer and lister for
|
||||
// MutatingAdmissionPolicies.
|
||||
type MutatingAdmissionPolicyInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() admissionregistrationv1.MutatingAdmissionPolicyLister
|
||||
}
|
||||
|
||||
type mutatingAdmissionPolicyInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// 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.
|
||||
func NewMutatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewMutatingAdmissionPolicyInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: 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.
|
||||
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})
|
||||
}
|
||||
|
||||
// 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.
|
||||
func NewMutatingAdmissionPolicyInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer {
|
||||
gvr := schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1", Resource: "mutatingadmissionpolicys"}
|
||||
identifier := options.InformerName.WithResource(gvr)
|
||||
tweakListOptions := options.TweakListOptions
|
||||
return cache.NewSharedIndexInformerWithOptions(
|
||||
cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{
|
||||
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.AdmissionregistrationV1().MutatingAdmissionPolicies().List(context.Background(), opts)
|
||||
},
|
||||
WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.AdmissionregistrationV1().MutatingAdmissionPolicies().Watch(context.Background(), opts)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, opts metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.AdmissionregistrationV1().MutatingAdmissionPolicies().List(ctx, opts)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.AdmissionregistrationV1().MutatingAdmissionPolicies().Watch(ctx, opts)
|
||||
},
|
||||
}, client),
|
||||
&apiadmissionregistrationv1.MutatingAdmissionPolicy{},
|
||||
cache.SharedIndexInformerOptions{
|
||||
ResyncPeriod: options.ResyncPeriod,
|
||||
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})
|
||||
}
|
||||
|
||||
func (f *mutatingAdmissionPolicyInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&apiadmissionregistrationv1.MutatingAdmissionPolicy{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *mutatingAdmissionPolicyInformer) Lister() admissionregistrationv1.MutatingAdmissionPolicyLister {
|
||||
return admissionregistrationv1.NewMutatingAdmissionPolicyLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
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"
|
||||
|
||||
apiadmissionregistrationv1 "k8s.io/api/admissionregistration/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"
|
||||
admissionregistrationv1 "k8s.io/client-go/listers/admissionregistration/v1"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// MutatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for
|
||||
// MutatingAdmissionPolicyBindings.
|
||||
type MutatingAdmissionPolicyBindingInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() admissionregistrationv1.MutatingAdmissionPolicyBindingLister
|
||||
}
|
||||
|
||||
type mutatingAdmissionPolicyBindingInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// 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.
|
||||
func NewMutatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewMutatingAdmissionPolicyBindingInformerWithOptions(client, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: 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.
|
||||
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})
|
||||
}
|
||||
|
||||
// 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.
|
||||
func NewMutatingAdmissionPolicyBindingInformerWithOptions(client kubernetes.Interface, options internalinterfaces.InformerOptions) cache.SharedIndexInformer {
|
||||
gvr := schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1", Resource: "mutatingadmissionpolicybindings"}
|
||||
identifier := options.InformerName.WithResource(gvr)
|
||||
tweakListOptions := options.TweakListOptions
|
||||
return cache.NewSharedIndexInformerWithOptions(
|
||||
cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{
|
||||
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.AdmissionregistrationV1().MutatingAdmissionPolicyBindings().List(context.Background(), opts)
|
||||
},
|
||||
WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.AdmissionregistrationV1().MutatingAdmissionPolicyBindings().Watch(context.Background(), opts)
|
||||
},
|
||||
ListWithContextFunc: func(ctx context.Context, opts metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.AdmissionregistrationV1().MutatingAdmissionPolicyBindings().List(ctx, opts)
|
||||
},
|
||||
WatchFuncWithContext: func(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&opts)
|
||||
}
|
||||
return client.AdmissionregistrationV1().MutatingAdmissionPolicyBindings().Watch(ctx, opts)
|
||||
},
|
||||
}, client),
|
||||
&apiadmissionregistrationv1.MutatingAdmissionPolicyBinding{},
|
||||
cache.SharedIndexInformerOptions{
|
||||
ResyncPeriod: options.ResyncPeriod,
|
||||
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})
|
||||
}
|
||||
|
||||
func (f *mutatingAdmissionPolicyBindingInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&apiadmissionregistrationv1.MutatingAdmissionPolicyBinding{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *mutatingAdmissionPolicyBindingInformer) Lister() admissionregistrationv1.MutatingAdmissionPolicyBindingLister {
|
||||
return admissionregistrationv1.NewMutatingAdmissionPolicyBindingLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -19,6 +19,7 @@ limitations under the License.
|
||||
package informers
|
||||
|
||||
import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
time "time"
|
||||
@@ -26,6 +27,7 @@ import (
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
wait "k8s.io/apimachinery/pkg/util/wait"
|
||||
admissionregistration "k8s.io/client-go/informers/admissionregistration"
|
||||
apiserverinternal "k8s.io/client-go/informers/apiserverinternal"
|
||||
apps "k8s.io/client-go/informers/apps"
|
||||
@@ -158,6 +160,10 @@ func NewSharedInformerFactoryWithOptions(client kubernetes.Interface, defaultRes
|
||||
}
|
||||
|
||||
func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) {
|
||||
f.StartWithContext(wait.ContextForChannel(stopCh))
|
||||
}
|
||||
|
||||
func (f *sharedInformerFactory) StartWithContext(ctx context.Context) {
|
||||
f.lock.Lock()
|
||||
defer f.lock.Unlock()
|
||||
|
||||
@@ -167,15 +173,9 @@ func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) {
|
||||
|
||||
for informerType, informer := range f.informers {
|
||||
if !f.startedInformers[informerType] {
|
||||
f.wg.Add(1)
|
||||
// We need a new variable in each loop iteration,
|
||||
// otherwise the goroutine would use the loop variable
|
||||
// and that keeps changing.
|
||||
informer := informer
|
||||
go func() {
|
||||
defer f.wg.Done()
|
||||
informer.Run(stopCh)
|
||||
}()
|
||||
f.wg.Go(func() {
|
||||
informer.RunWithContext(ctx)
|
||||
})
|
||||
f.startedInformers[informerType] = true
|
||||
}
|
||||
}
|
||||
@@ -192,6 +192,11 @@ func (f *sharedInformerFactory) Shutdown() {
|
||||
}
|
||||
|
||||
func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool {
|
||||
result := f.WaitForCacheSyncWithContext(wait.ContextForChannel(stopCh))
|
||||
return result.Synced
|
||||
}
|
||||
|
||||
func (f *sharedInformerFactory) WaitForCacheSyncWithContext(ctx context.Context) cache.SyncResult {
|
||||
informers := func() map[reflect.Type]cache.SharedIndexInformer {
|
||||
f.lock.Lock()
|
||||
defer f.lock.Unlock()
|
||||
@@ -205,10 +210,31 @@ func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[ref
|
||||
return informers
|
||||
}()
|
||||
|
||||
res := map[reflect.Type]bool{}
|
||||
for informType, informer := range informers {
|
||||
res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced)
|
||||
// Wait for informers to sync, without polling.
|
||||
cacheSyncs := make([]cache.DoneChecker, 0, len(informers))
|
||||
for _, informer := range informers {
|
||||
cacheSyncs = append(cacheSyncs, informer.HasSyncedChecker())
|
||||
}
|
||||
cache.WaitFor(ctx, "" /* no logging */, cacheSyncs...)
|
||||
|
||||
res := cache.SyncResult{
|
||||
Synced: make(map[reflect.Type]bool, len(informers)),
|
||||
}
|
||||
failed := false
|
||||
for informType, informer := range informers {
|
||||
hasSynced := informer.HasSynced()
|
||||
if !hasSynced {
|
||||
failed = true
|
||||
}
|
||||
res.Synced[informType] = hasSynced
|
||||
}
|
||||
if failed {
|
||||
// context.Cause is more informative than ctx.Err().
|
||||
// This must be non-nil, otherwise WaitFor wouldn't have stopped
|
||||
// prematurely.
|
||||
res.Err = context.Cause(ctx)
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
@@ -230,7 +256,9 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal
|
||||
}
|
||||
|
||||
informer = newFunc(f.client, resyncPeriod)
|
||||
informer.SetTransform(f.transform)
|
||||
if f.transform != nil {
|
||||
informer.SetTransform(f.transform)
|
||||
}
|
||||
f.informers[informerType] = informer
|
||||
|
||||
return informer
|
||||
@@ -247,27 +275,46 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal
|
||||
// defer factory.WaitForStop() // Returns immediately if nothing was started.
|
||||
// genericInformer := factory.ForResource(resource)
|
||||
// typedInformer := factory.SomeAPIGroup().V1().SomeType()
|
||||
// factory.Start(ctx.Done()) // Start processing these informers.
|
||||
// synced := factory.WaitForCacheSync(ctx.Done())
|
||||
// for v, ok := range synced {
|
||||
// if !ok {
|
||||
// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v)
|
||||
// return
|
||||
// }
|
||||
// handle, err := typeInformer.Informer().AddEventHandler(...)
|
||||
// if err != nil {
|
||||
// return fmt.Errorf("register event handler: %v", err)
|
||||
// }
|
||||
// defer typeInformer.Informer().RemoveEventHandler(handle) // Avoids leaking goroutines.
|
||||
// factory.StartWithContext(ctx) // Start processing these informers.
|
||||
// synced := factory.WaitForCacheSyncWithContext(ctx)
|
||||
// if err := synced.AsError(); err != nil {
|
||||
// return err
|
||||
// }
|
||||
// for v := range synced {
|
||||
// // Only if desired log some information similar to this.
|
||||
// fmt.Fprintf(os.Stdout, "cache synced: %s", v)
|
||||
// }
|
||||
//
|
||||
// // Also make sure that all of the initial cache events have been delivered.
|
||||
// if !WaitFor(ctx, "event handler sync", handle.HasSyncedChecker()) {
|
||||
// // Must have failed because of context.
|
||||
// return fmt.Errorf("sync event handler: %w", context.Cause(ctx))
|
||||
// }
|
||||
//
|
||||
// // Creating informers can also be created after Start, but then
|
||||
// // Start must be called again:
|
||||
// anotherGenericInformer := factory.ForResource(resource)
|
||||
// factory.Start(ctx.Done())
|
||||
// factory.StartWithContext(ctx)
|
||||
type SharedInformerFactory interface {
|
||||
internalinterfaces.SharedInformerFactory
|
||||
|
||||
// Start initializes all requested informers. They are handled in goroutines
|
||||
// which run until the stop channel gets closed.
|
||||
// Warning: Start does not block. When run in a go-routine, it will race with a later WaitForCacheSync.
|
||||
//
|
||||
// Contextual logging: StartWithContext should be used instead of Start in code which supports contextual logging.
|
||||
Start(stopCh <-chan struct{})
|
||||
|
||||
// StartWithContext initializes all requested informers. They are handled in goroutines
|
||||
// which run until the context gets canceled.
|
||||
// Warning: StartWithContext does not block. When run in a go-routine, it will race with a later WaitForCacheSync.
|
||||
StartWithContext(ctx context.Context)
|
||||
|
||||
// Shutdown marks a factory as shutting down. At that point no new
|
||||
// informers can be started anymore and Start will return without
|
||||
// doing anything.
|
||||
@@ -282,8 +329,14 @@ 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.
|
||||
WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool
|
||||
|
||||
// WaitForCacheSyncWithContext blocks until all started informers' caches were synced
|
||||
// or the context gets canceled.
|
||||
WaitForCacheSyncWithContext(ctx context.Context) cache.SyncResult
|
||||
|
||||
// ForResource gives generic access to a shared informer of the matching type.
|
||||
ForResource(resource schema.GroupVersionResource) (GenericInformer, error)
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ import (
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
resourcev1beta2 "k8s.io/api/resource/v1beta2"
|
||||
schedulingv1 "k8s.io/api/scheduling/v1"
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
schedulingv1alpha2 "k8s.io/api/scheduling/v1alpha2"
|
||||
schedulingv1beta1 "k8s.io/api/scheduling/v1beta1"
|
||||
storagev1 "k8s.io/api/storage/v1"
|
||||
storagev1alpha1 "k8s.io/api/storage/v1alpha1"
|
||||
@@ -100,6 +100,10 @@ func (f *genericInformer) Lister() cache.GenericLister {
|
||||
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
|
||||
switch resource {
|
||||
// Group=admissionregistration.k8s.io, Version=v1
|
||||
case v1.SchemeGroupVersion.WithResource("mutatingadmissionpolicies"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().MutatingAdmissionPolicies().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("mutatingadmissionpolicybindings"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().MutatingAdmissionPolicyBindings().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().MutatingWebhookConfigurations().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("validatingadmissionpolicies"):
|
||||
@@ -388,6 +392,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||
// Group=resource.k8s.io, Version=v1alpha3
|
||||
case v1alpha3.SchemeGroupVersion.WithResource("devicetaintrules"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().DeviceTaintRules().Informer()}, nil
|
||||
case v1alpha3.SchemeGroupVersion.WithResource("resourcepoolstatusrequests"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourcePoolStatusRequests().Informer()}, nil
|
||||
|
||||
// Group=resource.k8s.io, Version=v1beta1
|
||||
case resourcev1beta1.SchemeGroupVersion.WithResource("deviceclasses"):
|
||||
@@ -402,6 +408,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||
// Group=resource.k8s.io, Version=v1beta2
|
||||
case resourcev1beta2.SchemeGroupVersion.WithResource("deviceclasses"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1beta2().DeviceClasses().Informer()}, nil
|
||||
case resourcev1beta2.SchemeGroupVersion.WithResource("devicetaintrules"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1beta2().DeviceTaintRules().Informer()}, nil
|
||||
case resourcev1beta2.SchemeGroupVersion.WithResource("resourceclaims"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1beta2().ResourceClaims().Informer()}, nil
|
||||
case resourcev1beta2.SchemeGroupVersion.WithResource("resourceclaimtemplates"):
|
||||
@@ -413,11 +421,11 @@ 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=v1alpha1
|
||||
case schedulingv1alpha1.SchemeGroupVersion.WithResource("priorityclasses"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1alpha1().PriorityClasses().Informer()}, nil
|
||||
case schedulingv1alpha1.SchemeGroupVersion.WithResource("workloads"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1alpha1().Workloads().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=v1beta1
|
||||
case schedulingv1beta1.SchemeGroupVersion.WithResource("priorityclasses"):
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user