Add ImageVolumeSource API

Adding the required Kubernetes API so that the kubelet can start using
it. This patch also adds the corresponding alpha feature gate as
outlined in KEP 4639.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>

Kubernetes-commit: f7ca3131e0922563a561134b4ed9eed8d2bdd2c4
This commit is contained in:
Sascha Grunert 2024-06-24 10:34:43 +02:00 committed by Kubernetes Publisher
parent 5742b23135
commit 485ae13a58
5 changed files with 83 additions and 0 deletions

View File

@ -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 (
v1 "k8s.io/api/core/v1"
)
// ImageVolumeSourceApplyConfiguration represents a declarative configuration of the ImageVolumeSource type for use
// with apply.
type ImageVolumeSourceApplyConfiguration struct {
Reference *string `json:"reference,omitempty"`
PullPolicy *v1.PullPolicy `json:"pullPolicy,omitempty"`
}
// ImageVolumeSourceApplyConfiguration constructs a declarative configuration of the ImageVolumeSource type for use with
// apply.
func ImageVolumeSource() *ImageVolumeSourceApplyConfiguration {
return &ImageVolumeSourceApplyConfiguration{}
}
// WithReference sets the Reference field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Reference field is set to the value of the last call.
func (b *ImageVolumeSourceApplyConfiguration) WithReference(value string) *ImageVolumeSourceApplyConfiguration {
b.Reference = &value
return b
}
// WithPullPolicy sets the PullPolicy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the PullPolicy field is set to the value of the last call.
func (b *ImageVolumeSourceApplyConfiguration) WithPullPolicy(value v1.PullPolicy) *ImageVolumeSourceApplyConfiguration {
b.PullPolicy = &value
return b
}

View File

@ -270,3 +270,11 @@ func (b *VolumeApplyConfiguration) WithEphemeral(value *EphemeralVolumeSourceApp
b.Ephemeral = value
return b
}
// WithImage sets the Image field in the declarative configuration 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 *VolumeApplyConfiguration) WithImage(value *ImageVolumeSourceApplyConfiguration) *VolumeApplyConfiguration {
b.Image = value
return b
}

View File

@ -50,6 +50,7 @@ type VolumeSourceApplyConfiguration struct {
StorageOS *StorageOSVolumeSourceApplyConfiguration `json:"storageos,omitempty"`
CSI *CSIVolumeSourceApplyConfiguration `json:"csi,omitempty"`
Ephemeral *EphemeralVolumeSourceApplyConfiguration `json:"ephemeral,omitempty"`
Image *ImageVolumeSourceApplyConfiguration `json:"image,omitempty"`
}
// VolumeSourceApplyConfiguration constructs a declarative configuration of the VolumeSource type for use with
@ -289,3 +290,11 @@ func (b *VolumeSourceApplyConfiguration) WithEphemeral(value *EphemeralVolumeSou
b.Ephemeral = value
return b
}
// WithImage sets the Image field in the declarative configuration 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 *VolumeSourceApplyConfiguration) WithImage(value *ImageVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration {
b.Image = value
return b
}

View File

@ -5762,6 +5762,15 @@ var schemaYAML = typed.YAMLObject(`types:
type:
scalar: string
default: ""
- name: io.k8s.api.core.v1.ImageVolumeSource
map:
fields:
- name: pullPolicy
type:
scalar: string
- name: reference
type:
scalar: string
- name: io.k8s.api.core.v1.KeyToPath
map:
fields:
@ -8209,6 +8218,9 @@ var schemaYAML = typed.YAMLObject(`types:
- name: hostPath
type:
namedType: io.k8s.api.core.v1.HostPathVolumeSource
- name: image
type:
namedType: io.k8s.api.core.v1.ImageVolumeSource
- name: iscsi
type:
namedType: io.k8s.api.core.v1.ISCSIVolumeSource

View File

@ -754,6 +754,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &applyconfigurationscorev1.HTTPGetActionApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("HTTPHeader"):
return &applyconfigurationscorev1.HTTPHeaderApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("ImageVolumeSource"):
return &applyconfigurationscorev1.ImageVolumeSourceApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("ISCSIPersistentVolumeSource"):
return &applyconfigurationscorev1.ISCSIPersistentVolumeSourceApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("ISCSIVolumeSource"):