diff --git a/applyconfigurations/core/v1/container.go b/applyconfigurations/core/v1/container.go index eed5f7d0..4694b12f 100644 --- a/applyconfigurations/core/v1/container.go +++ b/applyconfigurations/core/v1/container.go @@ -36,6 +36,7 @@ type ContainerApplyConfiguration struct { Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"` ResizePolicy []ContainerResizePolicyApplyConfiguration `json:"resizePolicy,omitempty"` RestartPolicy *corev1.ContainerRestartPolicy `json:"restartPolicy,omitempty"` + RestartPolicyRules []ContainerRestartRuleApplyConfiguration `json:"restartPolicyRules,omitempty"` VolumeMounts []VolumeMountApplyConfiguration `json:"volumeMounts,omitempty"` VolumeDevices []VolumeDeviceApplyConfiguration `json:"volumeDevices,omitempty"` LivenessProbe *ProbeApplyConfiguration `json:"livenessProbe,omitempty"` @@ -169,6 +170,19 @@ func (b *ContainerApplyConfiguration) WithRestartPolicy(value corev1.ContainerRe return b } +// WithRestartPolicyRules adds the given value to the RestartPolicyRules 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 RestartPolicyRules field. +func (b *ContainerApplyConfiguration) WithRestartPolicyRules(values ...*ContainerRestartRuleApplyConfiguration) *ContainerApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRestartPolicyRules") + } + b.RestartPolicyRules = append(b.RestartPolicyRules, *values[i]) + } + return b +} + // WithVolumeMounts adds the given value to the VolumeMounts 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 VolumeMounts field. diff --git a/applyconfigurations/core/v1/containerrestartrule.go b/applyconfigurations/core/v1/containerrestartrule.go new file mode 100644 index 00000000..6ec09000 --- /dev/null +++ b/applyconfigurations/core/v1/containerrestartrule.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// ContainerRestartRuleApplyConfiguration represents a declarative configuration of the ContainerRestartRule type for use +// with apply. +type ContainerRestartRuleApplyConfiguration struct { + Action *corev1.ContainerRestartRuleAction `json:"action,omitempty"` + ExitCodes *ContainerRestartRuleOnExitCodesApplyConfiguration `json:"exitCodes,omitempty"` +} + +// ContainerRestartRuleApplyConfiguration constructs a declarative configuration of the ContainerRestartRule type for use with +// apply. +func ContainerRestartRule() *ContainerRestartRuleApplyConfiguration { + return &ContainerRestartRuleApplyConfiguration{} +} + +// WithAction sets the Action field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Action field is set to the value of the last call. +func (b *ContainerRestartRuleApplyConfiguration) WithAction(value corev1.ContainerRestartRuleAction) *ContainerRestartRuleApplyConfiguration { + b.Action = &value + return b +} + +// WithExitCodes sets the ExitCodes field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExitCodes field is set to the value of the last call. +func (b *ContainerRestartRuleApplyConfiguration) WithExitCodes(value *ContainerRestartRuleOnExitCodesApplyConfiguration) *ContainerRestartRuleApplyConfiguration { + b.ExitCodes = value + return b +} diff --git a/applyconfigurations/core/v1/containerrestartruleonexitcodes.go b/applyconfigurations/core/v1/containerrestartruleonexitcodes.go new file mode 100644 index 00000000..6bfd9619 --- /dev/null +++ b/applyconfigurations/core/v1/containerrestartruleonexitcodes.go @@ -0,0 +1,54 @@ +/* +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" +) + +// ContainerRestartRuleOnExitCodesApplyConfiguration represents a declarative configuration of the ContainerRestartRuleOnExitCodes type for use +// with apply. +type ContainerRestartRuleOnExitCodesApplyConfiguration struct { + Operator *corev1.ContainerRestartRuleOnExitCodesOperator `json:"operator,omitempty"` + Values []int32 `json:"values,omitempty"` +} + +// ContainerRestartRuleOnExitCodesApplyConfiguration constructs a declarative configuration of the ContainerRestartRuleOnExitCodes type for use with +// apply. +func ContainerRestartRuleOnExitCodes() *ContainerRestartRuleOnExitCodesApplyConfiguration { + return &ContainerRestartRuleOnExitCodesApplyConfiguration{} +} + +// WithOperator sets the Operator field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Operator field is set to the value of the last call. +func (b *ContainerRestartRuleOnExitCodesApplyConfiguration) WithOperator(value corev1.ContainerRestartRuleOnExitCodesOperator) *ContainerRestartRuleOnExitCodesApplyConfiguration { + b.Operator = &value + return b +} + +// WithValues adds the given value to the Values 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 Values field. +func (b *ContainerRestartRuleOnExitCodesApplyConfiguration) WithValues(values ...int32) *ContainerRestartRuleOnExitCodesApplyConfiguration { + for i := range values { + b.Values = append(b.Values, values[i]) + } + return b +} diff --git a/applyconfigurations/core/v1/ephemeralcontainer.go b/applyconfigurations/core/v1/ephemeralcontainer.go index 4b74439f..d41c9853 100644 --- a/applyconfigurations/core/v1/ephemeralcontainer.go +++ b/applyconfigurations/core/v1/ephemeralcontainer.go @@ -147,6 +147,19 @@ func (b *EphemeralContainerApplyConfiguration) WithRestartPolicy(value corev1.Co return b } +// WithRestartPolicyRules adds the given value to the RestartPolicyRules 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 RestartPolicyRules field. +func (b *EphemeralContainerApplyConfiguration) WithRestartPolicyRules(values ...*ContainerRestartRuleApplyConfiguration) *EphemeralContainerApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRestartPolicyRules") + } + b.EphemeralContainerCommonApplyConfiguration.RestartPolicyRules = append(b.EphemeralContainerCommonApplyConfiguration.RestartPolicyRules, *values[i]) + } + return b +} + // WithVolumeMounts adds the given value to the VolumeMounts 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 VolumeMounts field. diff --git a/applyconfigurations/core/v1/ephemeralcontainercommon.go b/applyconfigurations/core/v1/ephemeralcontainercommon.go index d5d13d27..cd9bf08f 100644 --- a/applyconfigurations/core/v1/ephemeralcontainercommon.go +++ b/applyconfigurations/core/v1/ephemeralcontainercommon.go @@ -36,6 +36,7 @@ type EphemeralContainerCommonApplyConfiguration struct { Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"` ResizePolicy []ContainerResizePolicyApplyConfiguration `json:"resizePolicy,omitempty"` RestartPolicy *corev1.ContainerRestartPolicy `json:"restartPolicy,omitempty"` + RestartPolicyRules []ContainerRestartRuleApplyConfiguration `json:"restartPolicyRules,omitempty"` VolumeMounts []VolumeMountApplyConfiguration `json:"volumeMounts,omitempty"` VolumeDevices []VolumeDeviceApplyConfiguration `json:"volumeDevices,omitempty"` LivenessProbe *ProbeApplyConfiguration `json:"livenessProbe,omitempty"` @@ -169,6 +170,19 @@ func (b *EphemeralContainerCommonApplyConfiguration) WithRestartPolicy(value cor return b } +// WithRestartPolicyRules adds the given value to the RestartPolicyRules 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 RestartPolicyRules field. +func (b *EphemeralContainerCommonApplyConfiguration) WithRestartPolicyRules(values ...*ContainerRestartRuleApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRestartPolicyRules") + } + b.RestartPolicyRules = append(b.RestartPolicyRules, *values[i]) + } + return b +} + // WithVolumeMounts adds the given value to the VolumeMounts 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 VolumeMounts field. diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index cd102bab..20d28dad 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -5333,6 +5333,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: restartPolicy type: scalar: string + - name: restartPolicyRules + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ContainerRestartRule + elementRelationship: atomic - name: securityContext type: namedType: io.k8s.api.core.v1.SecurityContext @@ -5416,6 +5422,27 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" +- name: io.k8s.api.core.v1.ContainerRestartRule + map: + fields: + - name: action + type: + scalar: string + - name: exitCodes + type: + namedType: io.k8s.api.core.v1.ContainerRestartRuleOnExitCodes +- name: io.k8s.api.core.v1.ContainerRestartRuleOnExitCodes + map: + fields: + - name: operator + type: + scalar: string + - name: values + type: + list: + elementType: + scalar: numeric + elementRelationship: associative - name: io.k8s.api.core.v1.ContainerState map: fields: @@ -5781,6 +5808,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: restartPolicy type: scalar: string + - name: restartPolicyRules + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ContainerRestartRule + elementRelationship: atomic - name: securityContext type: namedType: io.k8s.api.core.v1.SecurityContext diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 0087977a..6c5959d9 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -726,6 +726,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.ContainerPortApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ContainerResizePolicy"): return &applyconfigurationscorev1.ContainerResizePolicyApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ContainerRestartRule"): + return &applyconfigurationscorev1.ContainerRestartRuleApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ContainerRestartRuleOnExitCodes"): + return &applyconfigurationscorev1.ContainerRestartRuleOnExitCodesApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ContainerState"): return &applyconfigurationscorev1.ContainerStateApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ContainerStateRunning"): diff --git a/go.mod b/go.mod index a7529601..86146eb7 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( golang.org/x/time v0.9.0 google.golang.org/protobuf v1.36.5 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20250725024533-ed2eb37e36f7 + k8s.io/api v0.0.0-20250725024534-53dd5462e729 k8s.io/apimachinery v0.0.0-20250724224258-50e39b11cd32 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b diff --git a/go.sum b/go.sum index f49d15b2..c24237aa 100644 --- a/go.sum +++ b/go.sum @@ -150,8 +150,8 @@ 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-20250725024533-ed2eb37e36f7 h1:pignGgNAV6vmwxzdSNqBSbV5Z/ZGZSmQ9rdKwM9tgvU= -k8s.io/api v0.0.0-20250725024533-ed2eb37e36f7/go.mod h1:h7pQu2oCQ3ccFA95Gaxuu7JO+0gHm6uxdKA4dLNL3Y8= +k8s.io/api v0.0.0-20250725024534-53dd5462e729 h1:raeWWJ+/+yxrpn2KAvZgxic537l2Ejpa8nnLaCO7+7Y= +k8s.io/api v0.0.0-20250725024534-53dd5462e729/go.mod h1:h7pQu2oCQ3ccFA95Gaxuu7JO+0gHm6uxdKA4dLNL3Y8= k8s.io/apimachinery v0.0.0-20250724224258-50e39b11cd32 h1:XbDM37tJSNp0ga7QZkizY+qxKJEA0DFe+nqssKruths= k8s.io/apimachinery v0.0.0-20250724224258-50e39b11cd32/go.mod h1:mjSAX6740hY31nMwwbFVIcjVaXzV46iZzqDA+UfugZ8= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=