runtimeclassspec.go 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. Copyright The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // Code generated by applyconfiguration-gen. DO NOT EDIT.
  14. package v1alpha1
  15. // RuntimeClassSpecApplyConfiguration represents a declarative configuration of the RuntimeClassSpec type for use
  16. // with apply.
  17. //
  18. // RuntimeClassSpec is a specification of a RuntimeClass. It contains parameters
  19. // that are required to describe the RuntimeClass to the Container Runtime
  20. // Interface (CRI) implementation, as well as any other components that need to
  21. // understand how the pod will be run. The RuntimeClassSpec is immutable.
  22. type RuntimeClassSpecApplyConfiguration struct {
  23. // runtimeHandler specifies the underlying runtime and configuration that the
  24. // CRI implementation will use to handle pods of this class. The possible
  25. // values are specific to the node & CRI configuration. It is assumed that
  26. // all handlers are available on every node, and handlers of the same name are
  27. // equivalent on every node.
  28. // For example, a handler called "runc" might specify that the runc OCI
  29. // runtime (using native Linux containers) will be used to run the containers
  30. // in a pod.
  31. // The runtimeHandler must be lowercase, conform to the DNS Label (RFC 1123)
  32. // requirements, and is immutable.
  33. RuntimeHandler *string `json:"runtimeHandler,omitempty"`
  34. // overhead represents the resource overhead associated with running a pod for a
  35. // given RuntimeClass. For more details, see
  36. // https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md
  37. Overhead *OverheadApplyConfiguration `json:"overhead,omitempty"`
  38. // scheduling holds the scheduling constraints to ensure that pods running
  39. // with this RuntimeClass are scheduled to nodes that support it.
  40. // If scheduling is nil, this RuntimeClass is assumed to be supported by all
  41. // nodes.
  42. Scheduling *SchedulingApplyConfiguration `json:"scheduling,omitempty"`
  43. }
  44. // RuntimeClassSpecApplyConfiguration constructs a declarative configuration of the RuntimeClassSpec type for use with
  45. // apply.
  46. func RuntimeClassSpec() *RuntimeClassSpecApplyConfiguration {
  47. return &RuntimeClassSpecApplyConfiguration{}
  48. }
  49. // WithRuntimeHandler sets the RuntimeHandler field in the declarative configuration to the given value
  50. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  51. // If called multiple times, the RuntimeHandler field is set to the value of the last call.
  52. func (b *RuntimeClassSpecApplyConfiguration) WithRuntimeHandler(value string) *RuntimeClassSpecApplyConfiguration {
  53. b.RuntimeHandler = &value
  54. return b
  55. }
  56. // WithOverhead sets the Overhead field in the declarative configuration to the given value
  57. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  58. // If called multiple times, the Overhead field is set to the value of the last call.
  59. func (b *RuntimeClassSpecApplyConfiguration) WithOverhead(value *OverheadApplyConfiguration) *RuntimeClassSpecApplyConfiguration {
  60. b.Overhead = value
  61. return b
  62. }
  63. // WithScheduling sets the Scheduling field in the declarative configuration to the given value
  64. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  65. // If called multiple times, the Scheduling field is set to the value of the last call.
  66. func (b *RuntimeClassSpecApplyConfiguration) WithScheduling(value *SchedulingApplyConfiguration) *RuntimeClassSpecApplyConfiguration {
  67. b.Scheduling = value
  68. return b
  69. }