diff --git a/api/hypershift/v1beta1/kubevirt.go b/api/hypershift/v1beta1/kubevirt.go index cc83e14d45bc..7a6a46500640 100644 --- a/api/hypershift/v1beta1/kubevirt.go +++ b/api/hypershift/v1beta1/kubevirt.go @@ -191,6 +191,12 @@ type KubevirtNodePoolPlatform struct { // +optional // +kubebuilder:validation:MaxItems=10 KubevirtHostDevices []KubevirtHostDevice `json:"hostDevices,omitempty"` + + // hosts specifies a list of hosts with their network configurations + // for the nodepool nodes + // +optional + // +kubebuilder:validation:MaxItems=100 + Hosts []KubevirtHost `json:"hosts,omitempty"` } // KubevirtNetwork specifies the configuration for a virtual machine @@ -221,6 +227,19 @@ type KubevirtHostDevice struct { Count int `json:"count,omitempty"` } +// KubevirtHost represents a host configuration with network settings +type KubevirtHost struct { + // name is the identifier for the host + // +kubebuilder:validation:MaxLength=255 + // +required + Name string `json:"name"` + + // networkConfig contains the network configuration for the host + // +kubebuilder:validation:MaxLength=4096 + // +optional + NetworkConfig string `json:"networkConfig,omitempty"` +} + // KubeVirtNodePoolStatus contains the KubeVirt platform statuses type KubeVirtNodePoolStatus struct { // cacheName holds the name of the cache DataVolume, if exists diff --git a/api/hypershift/v1beta1/zz_generated.deepcopy.go b/api/hypershift/v1beta1/zz_generated.deepcopy.go index 41a13b0ab84e..bafcbe7c772d 100644 --- a/api/hypershift/v1beta1/zz_generated.deepcopy.go +++ b/api/hypershift/v1beta1/zz_generated.deepcopy.go @@ -2201,6 +2201,21 @@ func (in *KubevirtDiskImage) DeepCopy() *KubevirtDiskImage { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubevirtHost) DeepCopyInto(out *KubevirtHost) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtHost. +func (in *KubevirtHost) DeepCopy() *KubevirtHost { + if in == nil { + return nil + } + out := new(KubevirtHost) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KubevirtHostDevice) DeepCopyInto(out *KubevirtHostDevice) { *out = *in @@ -2296,6 +2311,11 @@ func (in *KubevirtNodePoolPlatform) DeepCopyInto(out *KubevirtNodePoolPlatform) *out = make([]KubevirtHostDevice, len(*in)) copy(*out, *in) } + if in.Hosts != nil { + in, out := &in.Hosts, &out.Hosts + *out = make([]KubevirtHost, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtNodePoolPlatform. diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/nodepools.hypershift.openshift.io/AAA_ungated.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/nodepools.hypershift.openshift.io/AAA_ungated.yaml index 964e6078ae7f..8241a16fbc73 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/nodepools.hypershift.openshift.io/AAA_ungated.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/nodepools.hypershift.openshift.io/AAA_ungated.yaml @@ -1064,6 +1064,28 @@ spec: type: object maxItems: 10 type: array + hosts: + description: |- + hosts specifies a list of hosts with their network configurations + for the nodepool nodes + items: + description: KubevirtHost represents a host configuration + with network settings + properties: + name: + description: name is the identifier for the host + maxLength: 255 + type: string + networkConfig: + description: networkConfig contains the network configuration + for the host + maxLength: 4096 + type: string + required: + - name + type: object + maxItems: 100 + type: array networkInterfaceMultiqueue: default: Enable description: |- diff --git a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/nodepools.hypershift.openshift.io/OpenStack.yaml b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/nodepools.hypershift.openshift.io/OpenStack.yaml index dca58a275dee..4239342087a5 100644 --- a/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/nodepools.hypershift.openshift.io/OpenStack.yaml +++ b/api/hypershift/v1beta1/zz_generated.featuregated-crd-manifests/nodepools.hypershift.openshift.io/OpenStack.yaml @@ -1064,6 +1064,28 @@ spec: type: object maxItems: 10 type: array + hosts: + description: |- + hosts specifies a list of hosts with their network configurations + for the nodepool nodes + items: + description: KubevirtHost represents a host configuration + with network settings + properties: + name: + description: name is the identifier for the host + maxLength: 255 + type: string + networkConfig: + description: networkConfig contains the network configuration + for the host + maxLength: 4096 + type: string + required: + - name + type: object + maxItems: 100 + type: array networkInterfaceMultiqueue: default: Enable description: |- diff --git a/cmd/install/assets/cluster-api-provider-kubevirt/infrastructure.cluster.x-k8s.io_kubevirtclustertemplates.yaml b/cmd/install/assets/cluster-api-provider-kubevirt/infrastructure.cluster.x-k8s.io_kubevirtclustertemplates.yaml index 44cde61716e6..efceb8e83089 100644 --- a/cmd/install/assets/cluster-api-provider-kubevirt/infrastructure.cluster.x-k8s.io_kubevirtclustertemplates.yaml +++ b/cmd/install/assets/cluster-api-provider-kubevirt/infrastructure.cluster.x-k8s.io_kubevirtclustertemplates.yaml @@ -247,9 +247,9 @@ spec: required: - template type: object + x-kubernetes-validations: + - message: KubevirtClusterTemplate Spec is immutable + rule: self == oldSelf type: object - x-kubernetes-validations: - - message: KubevirtClusterTemplate is immutable - rule: self == oldSelf served: true storage: true diff --git a/cmd/install/assets/cluster-api-provider-kubevirt/infrastructure.cluster.x-k8s.io_kubevirtmachines.yaml b/cmd/install/assets/cluster-api-provider-kubevirt/infrastructure.cluster.x-k8s.io_kubevirtmachines.yaml index 2f1256d8d4b1..7b3819331916 100644 --- a/cmd/install/assets/cluster-api-provider-kubevirt/infrastructure.cluster.x-k8s.io_kubevirtmachines.yaml +++ b/cmd/install/assets/cluster-api-provider-kubevirt/infrastructure.cluster.x-k8s.io_kubevirtmachines.yaml @@ -4456,6 +4456,8 @@ spec: default: false description: Ready denotes that the machine is ready type: boolean + virtualMachine: + type: string required: - ready type: object diff --git a/cmd/install/assets/cluster-api-provider-kubevirt/infrastructure.cluster.x-k8s.io_kubevirtmachinetemplates.yaml b/cmd/install/assets/cluster-api-provider-kubevirt/infrastructure.cluster.x-k8s.io_kubevirtmachinetemplates.yaml index 1fe9b1d9f00b..0174ec2d6a2f 100644 --- a/cmd/install/assets/cluster-api-provider-kubevirt/infrastructure.cluster.x-k8s.io_kubevirtmachinetemplates.yaml +++ b/cmd/install/assets/cluster-api-provider-kubevirt/infrastructure.cluster.x-k8s.io_kubevirtmachinetemplates.yaml @@ -4480,6 +4480,32 @@ spec: required: - spec type: object + virtualMachinePool: + description: |- + VirtualMachinePool defines a pool of pre-configured virtual machines with specific names and cloud-init configs. + When specified, the controller will use VMs from this pool for scaling operations instead of generating new ones. + items: + description: VirtualMachinePoolEntry defines a single virtual machine + entry in the pool with a specific name and cloud-init configuration. + properties: + cloudInitNetworkData: + description: |- + CloudInitNetworkData contains the cloud-init network data configuration for this specific VM. + This data will be used to customize the network configuration of the VM during boot. + type: string + name: + description: |- + Name specifies the desired name for this virtual machine. + This name will be used as the VM name when creating the virtual machine. + maxLength: 253 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + required: + - name + type: object + maxItems: 100 + type: array required: - template type: object diff --git a/cmd/install/assets/hypershift-operator/zz_generated.crd-manifests/nodepools-CustomNoUpgrade.crd.yaml b/cmd/install/assets/hypershift-operator/zz_generated.crd-manifests/nodepools-CustomNoUpgrade.crd.yaml index aa67e0117888..547bd3e44aaf 100644 --- a/cmd/install/assets/hypershift-operator/zz_generated.crd-manifests/nodepools-CustomNoUpgrade.crd.yaml +++ b/cmd/install/assets/hypershift-operator/zz_generated.crd-manifests/nodepools-CustomNoUpgrade.crd.yaml @@ -1067,6 +1067,28 @@ spec: type: object maxItems: 10 type: array + hosts: + description: |- + hosts specifies a list of hosts with their network configurations + for the nodepool nodes + items: + description: KubevirtHost represents a host configuration + with network settings + properties: + name: + description: name is the identifier for the host + maxLength: 255 + type: string + networkConfig: + description: networkConfig contains the network configuration + for the host + maxLength: 4096 + type: string + required: + - name + type: object + maxItems: 100 + type: array networkInterfaceMultiqueue: default: Enable description: |- diff --git a/cmd/install/assets/hypershift-operator/zz_generated.crd-manifests/nodepools-Default.crd.yaml b/cmd/install/assets/hypershift-operator/zz_generated.crd-manifests/nodepools-Default.crd.yaml index 113376752663..87764fbadad3 100644 --- a/cmd/install/assets/hypershift-operator/zz_generated.crd-manifests/nodepools-Default.crd.yaml +++ b/cmd/install/assets/hypershift-operator/zz_generated.crd-manifests/nodepools-Default.crd.yaml @@ -1067,6 +1067,28 @@ spec: type: object maxItems: 10 type: array + hosts: + description: |- + hosts specifies a list of hosts with their network configurations + for the nodepool nodes + items: + description: KubevirtHost represents a host configuration + with network settings + properties: + name: + description: name is the identifier for the host + maxLength: 255 + type: string + networkConfig: + description: networkConfig contains the network configuration + for the host + maxLength: 4096 + type: string + required: + - name + type: object + maxItems: 100 + type: array networkInterfaceMultiqueue: default: Enable description: |- diff --git a/cmd/install/assets/hypershift-operator/zz_generated.crd-manifests/nodepools-TechPreviewNoUpgrade.crd.yaml b/cmd/install/assets/hypershift-operator/zz_generated.crd-manifests/nodepools-TechPreviewNoUpgrade.crd.yaml index 080cbaff9c46..e64794bc3dc3 100644 --- a/cmd/install/assets/hypershift-operator/zz_generated.crd-manifests/nodepools-TechPreviewNoUpgrade.crd.yaml +++ b/cmd/install/assets/hypershift-operator/zz_generated.crd-manifests/nodepools-TechPreviewNoUpgrade.crd.yaml @@ -1067,6 +1067,28 @@ spec: type: object maxItems: 10 type: array + hosts: + description: |- + hosts specifies a list of hosts with their network configurations + for the nodepool nodes + items: + description: KubevirtHost represents a host configuration + with network settings + properties: + name: + description: name is the identifier for the host + maxLength: 255 + type: string + networkConfig: + description: networkConfig contains the network configuration + for the host + maxLength: 4096 + type: string + required: + - name + type: object + maxItems: 100 + type: array networkInterfaceMultiqueue: default: Enable description: |- diff --git a/cmd/nodepool/kubevirt/create.go b/cmd/nodepool/kubevirt/create.go index 55c955e168b3..24c03468ed40 100644 --- a/cmd/nodepool/kubevirt/create.go +++ b/cmd/nodepool/kubevirt/create.go @@ -328,5 +328,120 @@ func (o *KubevirtPlatformCreateOptions) NodePoolPlatform() *hyperv1.KubevirtNode if len(o.KubevirtHostDevices) > 0 { platform.KubevirtHostDevices = o.KubevirtHostDevices } + + platform.NetworkDataTemplate = + Subnet: []string{"192.168.123.3/24-192.168.123.10/24"} + ExcludedSubnet: []string{"192.168.123.5/24"} + Template := ` +{ + "version": 1, + "config": [ + { + "type": "physical", + "name": "enp1s0", + "subnets": [ + { + "type": "static", + "address": "{{ .Subnet }}", + "netmask": "255.255.255.0", + "gateway": "192.168.123.1" + } + ] + }, + { + "type": "nameserver", + "address": [ + "192.168.123.1" + ] + } + ] +} + ` + //TODO: Add a knob for this + platform.Hosts = []hyperv1.KubevirtHost{ + { + Name: "worker1", + NetworkConfig: ` +{ + "version": 1, + "config": [ + { + "type": "physical", + "name": "enp1s0", + "subnets": [ + { + "type": "static", + "address": "192.168.123.101", + "netmask": "255.255.255.0", + "gateway": "192.168.123.1" + } + ] + }, + { + "type": "nameserver", + "address": [ + "192.168.123.1" + ] + } + ] +}`, + }, + { + Name: "worker2", + NetworkConfig: ` +{ + "version": 1, + "config": [ + { + "type": "physical", + "name": "enp1s0", + "subnets": [ + { + "type": "static", + "address": "192.168.123.102", + "netmask": "255.255.255.0", + "gateway": "192.168.123.1" + } + ] + }, + { + "type": "nameserver", + "address": [ + "192.168.123.1" + ] + } + ] +} +`, + }, + { + Name: "worker3", + NetworkConfig: ` +{ + "version": 1, + "config": [ + { + "type": "physical", + "name": "enp1s0", + "subnets": [ + { + "type": "static", + "address": "192.168.123.103", + "netmask": "255.255.255.0", + "gateway": "192.168.123.1" + } + ] + }, + { + "type": "nameserver", + "address": [ + "192.168.123.1" + ] + } + ] +} +`, + }, + } return platform } diff --git a/control-plane-operator/controllers/hostedcontrolplane/ignition/reconcile.go b/control-plane-operator/controllers/hostedcontrolplane/ignition/reconcile.go index 3827133959a4..3dfc8af72abe 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/ignition/reconcile.go +++ b/control-plane-operator/controllers/hostedcontrolplane/ignition/reconcile.go @@ -62,10 +62,15 @@ func ReconcileImageSourceMirrorsIgnitionConfigFromIDMS(cm *corev1.ConfigMap, own func workerSSHConfig(sshKey string) ([]byte, error) { config := &igntypes.Config{} config.Ignition.Version = ignitionVersion + + // Set password hash for core user to enable console login + passwordHash := "$y$j9T$E8ZAQHg0JKcyOpIjkvKVV.$OR8gi4uUvM44Gd9ZAbt47zXas5/1fi.fijVwK8/A84B" // hypershift + config.Passwd = igntypes.Passwd{ Users: []igntypes.PasswdUser{ { - Name: "core", + Name: "core", + PasswordHash: &passwordHash, }, }, } diff --git a/docs/content/reference/api.md b/docs/content/reference/api.md index 1444c968c877..f7db0eca8f51 100644 --- a/docs/content/reference/api.md +++ b/docs/content/reference/api.md @@ -7791,6 +7791,47 @@ string +###KubevirtHost { #hypershift.openshift.io/v1beta1.KubevirtHost } +

+(Appears on: +KubevirtNodePoolPlatform) +

+

+

KubevirtHost represents a host configuration with network settings

+

+ + + + + + + + + + + + + + + + + +
FieldDescription
+name
+ +string + +
+

name is the identifier for the host

+
+networkConfig
+ +string + +
+(Optional) +

networkConfig contains the network configuration for the host

+
###KubevirtHostDevice { #hypershift.openshift.io/v1beta1.KubevirtHostDevice }

(Appears on: @@ -8032,6 +8073,21 @@ Selector which must match a node’s labels for the VM to be scheduled on th from the management cluster, to the nodepool nodes

+ + +hosts
+ + +[]KubevirtHost + + + + +(Optional) +

hosts specifies a list of hosts with their network configurations +for the nodepool nodes

+ + ###KubevirtPersistentVolume { #hypershift.openshift.io/v1beta1.KubevirtPersistentVolume } diff --git a/go.mod b/go.mod index 7bd910744996..c14f284195bc 100644 --- a/go.mod +++ b/go.mod @@ -113,7 +113,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.3.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.1.1 // indirect - github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect + github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect @@ -195,7 +195,7 @@ require ( github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/spdystream v0.5.0 // indirect - github.com/moby/term v0.5.0 // indirect + github.com/moby/term v0.5.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect @@ -254,12 +254,12 @@ require ( k8s.io/kms v0.32.3 // indirect k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect k8s.io/kubelet v0.31.1 // indirect - kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90 // indirect + kubevirt.io/controller-lifecycle-operator-sdk/api v0.2.4 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.32.0 // indirect sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 // indirect - sigs.k8s.io/kustomize/api v0.18.0 // indirect - sigs.k8s.io/kustomize/kyaml v0.18.1 // indirect + sigs.k8s.io/kustomize/api v0.19.0 // indirect + sigs.k8s.io/kustomize/kyaml v0.19.0 // indirect sigs.k8s.io/randfill v1.0.0 // indirect ) @@ -283,3 +283,5 @@ replace github.com/aws/karpenter-provider-aws => github.com/openshift/karpenter- // k8s.io/apiserver => k8s.io/apiserver v0.32.3 // k8s.io/client-go => k8s.io/client-go v0.32.3 // ) +// Use qinqon's fork with vm-name-format branch +replace sigs.k8s.io/cluster-api-provider-kubevirt => github.com/qinqon/cluster-api-provider-kubevirt v0.1.0-rc.0.0.20250917091729-5e26499ae6d2 diff --git a/go.sum b/go.sum index bb4d5275d6be..1d235242fbf3 100644 --- a/go.sum +++ b/go.sum @@ -42,8 +42,8 @@ github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.0 h1:UXT0o77lXQrikd1kg github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.0/go.mod h1:cTvi54pg19DoT07ekoeMgE/taAwNtCShVeZqA+Iv2xI= github.com/Azure/azure-service-operator/v2 v2.13.0 h1:24xDkuGOjSDKKkthECRo/I76slmlt3u0buYQ4rvX3pQ= github.com/Azure/azure-service-operator/v2 v2.13.0/go.mod h1:3xfZMZm4yjdcjr3lh1kWqP2dtvZS/nCy7wpNERYDatg= -github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= -github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/msi-dataplane v0.4.3 h1:dWPWzY4b54tLIR9T1Q014Xxd/1DxOsMIp6EjRFAJlQY= github.com/Azure/msi-dataplane v0.4.3/go.mod h1:yAfxdJyvcnvSDfSyOFV9qm4fReEQDl+nZLGeH2ZWSmw= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= @@ -463,8 +463,8 @@ github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= 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/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= -github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ= +github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc= 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= @@ -576,6 +576,8 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg= github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= +github.com/qinqon/cluster-api-provider-kubevirt v0.1.0-rc.0.0.20250917091729-5e26499ae6d2 h1:JHzumOz4evjTv9wpu/vXyVHxqWI8m612/pmdujys3X0= +github.com/qinqon/cluster-api-provider-kubevirt v0.1.0-rc.0.0.20250917091729-5e26499ae6d2/go.mod h1:tdJgCEpKOd6kM7roefJYOXt4MADxeojGYU5bQBKjqQ8= github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ= github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= @@ -980,8 +982,8 @@ kubevirt.io/api v1.4.0 h1:dDLyQLSp9obzsDrv3cyL1olIc/66IWVaGiR3gfPfgT0= kubevirt.io/api v1.4.0/go.mod h1:qcnumjJeOCo+qdYXf0OjpHGMhad0SAn4i0h6IAP+6Eg= kubevirt.io/containerized-data-importer-api v1.61.1 h1:MoFyh6ryfT78y345rMe7PvZU/R30ZSMMPvvdjTZ/SMU= kubevirt.io/containerized-data-importer-api v1.61.1/go.mod h1:SDJjLGhbPyayDqAqawcGmVNapBp0KodOQvhKPLVGCQU= -kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90 h1:QMrd0nKP0BGbnxTqakhDZAUhGKxPiPiN5gSDqKUmGGc= -kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90/go.mod h1:018lASpFYBsYN6XwmA2TIrPCx6e0gviTd/ZNtSitKgc= +kubevirt.io/controller-lifecycle-operator-sdk/api v0.2.4 h1:fZYvD3/Vnitfkx6IJxjLAk8ugnZQ7CXVYcRfkSKmuZY= +kubevirt.io/controller-lifecycle-operator-sdk/api v0.2.4/go.mod h1:018lASpFYBsYN6XwmA2TIrPCx6e0gviTd/ZNtSitKgc= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.32.0 h1:XotDXzqvJ8Nx5eiZZueLpTuafJz8SiodgOemI+w87QU= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.32.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= sigs.k8s.io/cluster-api v1.10.4 h1:5mdyWLGbbwOowWrjqM/J9N600QnxTohu5J1/1YR6g7c= @@ -992,8 +994,6 @@ sigs.k8s.io/cluster-api-provider-azure v1.21.0 h1:8SYwQX4ANgy2CAa2NEk41mqBZrmyAH sigs.k8s.io/cluster-api-provider-azure v1.21.0/go.mod h1:NJMrRzRf/Ua5Uhm9qmuK4M/4Jl/f74jBpkgPqJN0vQQ= sigs.k8s.io/cluster-api-provider-ibmcloud v0.11.0 h1:aunR3nnDzQ5x1Qj1hJbR3Xq4SCZth4XyTWAyUCN46kE= sigs.k8s.io/cluster-api-provider-ibmcloud v0.11.0/go.mod h1:9yPLATyiqLx4crMzbX11YQU+GuR5txjtiCt8z9sxDfM= -sigs.k8s.io/cluster-api-provider-kubevirt v0.1.9 h1:hQO7Y5GP7FMnH6Aono9WVE90I3vRLBxw/48iKHerjtg= -sigs.k8s.io/cluster-api-provider-kubevirt v0.1.9/go.mod h1:RlF7CASVT4vaBRLu45Y2dprAnEPoDGvMaImXz13Ntks= sigs.k8s.io/cluster-api-provider-openstack v0.12.1 h1:IK8GRmQKTwgft6PwaLC4r69O5hV7ykr4l7eJ8pQ3EIU= sigs.k8s.io/cluster-api-provider-openstack v0.12.1/go.mod h1:lm2AXy1bfJEVKU4RfxwPdJgPbJDNiUAfva+IIf8Gqzo= sigs.k8s.io/cluster-api-provider-openstack/orc v0.0.0-20241018150903-d5cd16872111 h1:mwwJEMTJb90p0UPXs42jNHuiPKqhRFqH8eXYfpzlBr8= @@ -1007,10 +1007,10 @@ sigs.k8s.io/karpenter v1.2.1-0.20250212185021-45f73ec7a790 h1:FXm0rL9jchktDDEqJ9 sigs.k8s.io/karpenter v1.2.1-0.20250212185021-45f73ec7a790/go.mod h1:R6cr2+SbbgXtKtiuyRFdZCbqWN2kNTduqshnQRoyOr8= sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 h1:PFWFSkpArPNJxFX4ZKWAk9NSeRoZaXschn+ULa4xVek= sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96/go.mod h1:EOBQyBowOUsd7U4CJnMHNE0ri+zCXyouGdLwC/jZU+I= -sigs.k8s.io/kustomize/api v0.18.0 h1:hTzp67k+3NEVInwz5BHyzc9rGxIauoXferXyjv5lWPo= -sigs.k8s.io/kustomize/api v0.18.0/go.mod h1:f8isXnX+8b+SGLHQ6yO4JG1rdkZlvhaCf/uZbLVMb0U= -sigs.k8s.io/kustomize/kyaml v0.18.1 h1:WvBo56Wzw3fjS+7vBjN6TeivvpbW9GmRaWZ9CIVmt4E= -sigs.k8s.io/kustomize/kyaml v0.18.1/go.mod h1:C3L2BFVU1jgcddNBE1TxuVLgS46TjObMwW5FT9FcjYo= +sigs.k8s.io/kustomize/api v0.19.0 h1:F+2HB2mU1MSiR9Hp1NEgoU2q9ItNOaBJl0I4Dlus5SQ= +sigs.k8s.io/kustomize/api v0.19.0/go.mod h1:/BbwnivGVcBh1r+8m3tH1VNxJmHSk1PzP5fkP6lbL1o= +sigs.k8s.io/kustomize/kyaml v0.19.0 h1:RFge5qsO1uHhwJsu3ipV7RNolC7Uozc0jUBC/61XSlA= +sigs.k8s.io/kustomize/kyaml v0.19.0/go.mod h1:FeKD5jEOH+FbZPpqUghBP8mrLjJ3+zD3/rf9NNu1cwY= sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= diff --git a/hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go b/hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go index 7804b9896d9c..e7ce31e5a8a6 100644 --- a/hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go +++ b/hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go @@ -340,6 +340,17 @@ func shouldAttachDefaultNetwork(kvPlatform *hyperv1.KubevirtNodePoolPlatform) bo return kvPlatform.AttachDefaultNetwork == nil || *kvPlatform.AttachDefaultNetwork } +func virtualMachinePool(kvPlatform *hyperv1.KubevirtNodePoolPlatform) []capikubevirt.VirtualMachinePoolEntry { + virtualMachinePoolSlice := []capikubevirt.VirtualMachinePoolEntry{} + for _, host := range kvPlatform.Hosts { + virtualMachinePoolSlice = append(virtualMachinePoolSlice, capikubevirt.VirtualMachinePoolEntry{ + Name: host.Name, + CloudInitNetworkData: &host.NetworkConfig, + }) + } + return virtualMachinePoolSlice +} + func MachineTemplateSpec(nodePool *hyperv1.NodePool, hcluster *hyperv1.HostedCluster, releaseImage *releaseinfo.ReleaseImage, bootImage BootImage) (*capikubevirt.KubevirtMachineTemplateSpec, error) { if bootImage == nil { infraNS := manifests.HostedControlPlaneNamespace(hcluster.Namespace, hcluster.Name) @@ -444,6 +455,7 @@ func MachineTemplateSpec(nodePool *hyperv1.NodePool, hcluster *hyperv1.HostedClu BootstrapCheckSpec: capikubevirt.VirtualMachineBootstrapCheckSpec{CheckStrategy: "none"}, }, }, + VirtualMachinePool: virtualMachinePool(nodePool.Spec.Platform.Kubevirt), }, nil } diff --git a/vendor/github.com/Azure/go-ansiterm/osc_string_state.go b/vendor/github.com/Azure/go-ansiterm/osc_string_state.go index 593b10ab6963..194d5e9c94d3 100644 --- a/vendor/github.com/Azure/go-ansiterm/osc_string_state.go +++ b/vendor/github.com/Azure/go-ansiterm/osc_string_state.go @@ -11,21 +11,13 @@ func (oscState oscStringState) Handle(b byte) (s state, e error) { return nextState, err } - switch { - case isOscStringTerminator(b): + // There are several control characters and sequences which can + // terminate an OSC string. Most of them are handled by the baseState + // handler. The ANSI_BEL character is a special case which behaves as a + // terminator only for an OSC string. + if b == ANSI_BEL { return oscState.parser.ground, nil } return oscState, nil } - -// See below for OSC string terminators for linux -// http://man7.org/linux/man-pages/man4/console_codes.4.html -func isOscStringTerminator(b byte) bool { - - if b == ANSI_BEL || b == 0x5C { - return true - } - - return false -} diff --git a/vendor/github.com/moby/term/term_unix.go b/vendor/github.com/moby/term/term_unix.go index 2ec7706a16a3..579ce5530a7e 100644 --- a/vendor/github.com/moby/term/term_unix.go +++ b/vendor/github.com/moby/term/term_unix.go @@ -81,7 +81,7 @@ func setRawTerminal(fd uintptr) (*State, error) { return makeRaw(fd) } -func setRawTerminalOutput(fd uintptr) (*State, error) { +func setRawTerminalOutput(uintptr) (*State, error) { return nil, nil } diff --git a/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/kubevirt.go b/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/kubevirt.go index cc83e14d45bc..7a6a46500640 100644 --- a/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/kubevirt.go +++ b/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/kubevirt.go @@ -191,6 +191,12 @@ type KubevirtNodePoolPlatform struct { // +optional // +kubebuilder:validation:MaxItems=10 KubevirtHostDevices []KubevirtHostDevice `json:"hostDevices,omitempty"` + + // hosts specifies a list of hosts with their network configurations + // for the nodepool nodes + // +optional + // +kubebuilder:validation:MaxItems=100 + Hosts []KubevirtHost `json:"hosts,omitempty"` } // KubevirtNetwork specifies the configuration for a virtual machine @@ -221,6 +227,19 @@ type KubevirtHostDevice struct { Count int `json:"count,omitempty"` } +// KubevirtHost represents a host configuration with network settings +type KubevirtHost struct { + // name is the identifier for the host + // +kubebuilder:validation:MaxLength=255 + // +required + Name string `json:"name"` + + // networkConfig contains the network configuration for the host + // +kubebuilder:validation:MaxLength=4096 + // +optional + NetworkConfig string `json:"networkConfig,omitempty"` +} + // KubeVirtNodePoolStatus contains the KubeVirt platform statuses type KubeVirtNodePoolStatus struct { // cacheName holds the name of the cache DataVolume, if exists diff --git a/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/zz_generated.deepcopy.go b/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/zz_generated.deepcopy.go index 41a13b0ab84e..bafcbe7c772d 100644 --- a/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/zz_generated.deepcopy.go @@ -2201,6 +2201,21 @@ func (in *KubevirtDiskImage) DeepCopy() *KubevirtDiskImage { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubevirtHost) DeepCopyInto(out *KubevirtHost) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtHost. +func (in *KubevirtHost) DeepCopy() *KubevirtHost { + if in == nil { + return nil + } + out := new(KubevirtHost) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KubevirtHostDevice) DeepCopyInto(out *KubevirtHostDevice) { *out = *in @@ -2296,6 +2311,11 @@ func (in *KubevirtNodePoolPlatform) DeepCopyInto(out *KubevirtNodePoolPlatform) *out = make([]KubevirtHostDevice, len(*in)) copy(*out, *in) } + if in.Hosts != nil { + in, out := &in.Hosts, &out.Hosts + *out = make([]KubevirtHost, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtNodePoolPlatform. diff --git a/vendor/modules.txt b/vendor/modules.txt index ee4e14912c48..03a39e2e8b23 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -80,7 +80,7 @@ github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/shared github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/pageblob github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/sas -# github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 +# github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c ## explicit; go 1.16 github.com/Azure/go-ansiterm github.com/Azure/go-ansiterm/winterm @@ -766,7 +766,7 @@ github.com/mitchellh/mapstructure ## explicit; go 1.13 github.com/moby/spdystream github.com/moby/spdystream/spdy -# github.com/moby/term v0.5.0 +# github.com/moby/term v0.5.2 ## explicit; go 1.18 github.com/moby/term github.com/moby/term/windows @@ -2315,7 +2315,7 @@ kubevirt.io/api/core/v1 ## explicit; go 1.22.0 kubevirt.io/containerized-data-importer-api/pkg/apis/core kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1 -# kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90 +# kubevirt.io/controller-lifecycle-operator-sdk/api v0.2.4 ## explicit; go 1.17 kubevirt.io/controller-lifecycle-operator-sdk/api # sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.32.0 @@ -2364,8 +2364,8 @@ sigs.k8s.io/cluster-api-provider-azure/util/webhook ## explicit; go 1.23.2 sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1 sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2 -# sigs.k8s.io/cluster-api-provider-kubevirt v0.1.9 -## explicit; go 1.22.0 +# sigs.k8s.io/cluster-api-provider-kubevirt v0.1.9 => github.com/qinqon/cluster-api-provider-kubevirt v0.1.0-rc.0.0.20250917091729-5e26499ae6d2 +## explicit; go 1.23.0 sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1 # sigs.k8s.io/cluster-api-provider-openstack v0.12.1 ## explicit; go 1.23.0 @@ -2434,7 +2434,7 @@ sigs.k8s.io/kube-storage-version-migrator/pkg/apis/migration/v1alpha1 sigs.k8s.io/kube-storage-version-migrator/pkg/clients/clientset sigs.k8s.io/kube-storage-version-migrator/pkg/clients/clientset/scheme sigs.k8s.io/kube-storage-version-migrator/pkg/clients/clientset/typed/migration/v1alpha1 -# sigs.k8s.io/kustomize/api v0.18.0 +# sigs.k8s.io/kustomize/api v0.19.0 ## explicit; go 1.22.7 sigs.k8s.io/kustomize/api/filters/annotations sigs.k8s.io/kustomize/api/filters/fieldspec @@ -2480,7 +2480,7 @@ sigs.k8s.io/kustomize/api/provider sigs.k8s.io/kustomize/api/resmap sigs.k8s.io/kustomize/api/resource sigs.k8s.io/kustomize/api/types -# sigs.k8s.io/kustomize/kyaml v0.18.1 +# sigs.k8s.io/kustomize/kyaml v0.19.0 ## explicit; go 1.22.7 sigs.k8s.io/kustomize/kyaml/comments sigs.k8s.io/kustomize/kyaml/errors @@ -2536,3 +2536,4 @@ sigs.k8s.io/yaml/goyaml.v3 # github.com/golang-jwt/jwt/v4 => github.com/golang-jwt/jwt/v4 v4.5.2 # sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.19.7 # github.com/aws/karpenter-provider-aws => github.com/openshift/karpenter-provider-aws v0.0.0-20250409201301-54ec662a99e7 +# sigs.k8s.io/cluster-api-provider-kubevirt => github.com/qinqon/cluster-api-provider-kubevirt v0.1.0-rc.0.0.20250917091729-5e26499ae6d2 diff --git a/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/kubevirtclustertemplate_types.go b/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/kubevirtclustertemplate_types.go index bf0b9c70adbb..75f9115df75e 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/kubevirtclustertemplate_types.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/kubevirtclustertemplate_types.go @@ -34,13 +34,13 @@ type KubevirtClusterTemplateSpec struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=kubevirtclustertemplates,scope=Namespaced,categories=cluster-api,shortName=kct -// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="KubevirtClusterTemplate is immutable" // KubevirtClusterTemplate is the Schema for the kubevirtclustertemplates API. type KubevirtClusterTemplate struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - Spec KubevirtClusterTemplateSpec `json:"spec,omitempty"` + // +kubebuilder:validation:XValidation:rule="self == oldSelf", message="KubevirtClusterTemplate Spec is immutable" + Spec KubevirtClusterTemplateSpec `json:"spec,omitempty"` } // +kubebuilder:object:root=true diff --git a/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/kubevirtmachine_types.go b/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/kubevirtmachine_types.go index 94e2bcf9257f..5c637c80d1d4 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/kubevirtmachine_types.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/kubevirtmachine_types.go @@ -128,6 +128,8 @@ type KubevirtMachineStatus struct { // controller's output. // +optional FailureMessage *string `json:"failureMessage,omitempty"` + + VirtualMachine *string `json:"virtualMachine,omitempty"` } // +kubebuilder:resource:path=kubevirtmachines,scope=Namespaced,categories=cluster-api diff --git a/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/kubevirtmachinetemplate_types.go b/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/kubevirtmachinetemplate_types.go index 49a269ed7abb..7314f45479df 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/kubevirtmachinetemplate_types.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/kubevirtmachinetemplate_types.go @@ -23,6 +23,12 @@ import ( // KubevirtMachineTemplateSpec defines the desired state of KubevirtMachineTemplate. type KubevirtMachineTemplateSpec struct { Template KubevirtMachineTemplateResource `json:"template"` + + // VirtualMachinePool defines a pool of pre-configured virtual machines with specific names and cloud-init configs. + // When specified, the controller will use VMs from this pool for scaling operations instead of generating new ones. + // +optional + // +kubebuilder:validation:MaxItems=100 + VirtualMachinePool []VirtualMachinePoolEntry `json:"virtualMachinePool,omitempty"` } // +kubebuilder:object:root=true @@ -50,6 +56,22 @@ func init() { SchemeBuilder.Register(&KubevirtMachineTemplate{}, &KubevirtMachineTemplateList{}) } +// VirtualMachinePoolEntry defines a single virtual machine entry in the pool with a specific name and cloud-init configuration. +type VirtualMachinePoolEntry struct { + // Name specifies the desired name for this virtual machine. + // This name will be used as the VM name when creating the virtual machine. + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` + Name string `json:"name"` + + // CloudInitNetworkData contains the cloud-init network data configuration for this specific VM. + // This data will be used to customize the network configuration of the VM during boot. + // +optional + CloudInitNetworkData *string `json:"cloudInitNetworkData,omitempty"` +} + // KubevirtMachineTemplateResource describes the data needed to create a KubevirtMachine from a template. type KubevirtMachineTemplateResource struct { // Spec is the specification of the desired behavior of the machine. diff --git a/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/zz_generated.deepcopy.go index 930b4d4f1a99..97379225ab61 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1/zz_generated.deepcopy.go @@ -372,6 +372,11 @@ func (in *KubevirtMachineStatus) DeepCopyInto(out *KubevirtMachineStatus) { *out = new(string) **out = **in } + if in.VirtualMachine != nil { + in, out := &in.VirtualMachine, &out.VirtualMachine + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtMachineStatus. @@ -462,6 +467,13 @@ func (in *KubevirtMachineTemplateResource) DeepCopy() *KubevirtMachineTemplateRe func (in *KubevirtMachineTemplateSpec) DeepCopyInto(out *KubevirtMachineTemplateSpec) { *out = *in in.Template.DeepCopyInto(&out.Template) + if in.VirtualMachinePool != nil { + in, out := &in.VirtualMachinePool, &out.VirtualMachinePool + *out = make([]VirtualMachinePoolEntry, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtMachineTemplateSpec. @@ -529,6 +541,26 @@ func (in *VirtualMachineBootstrapCheckSpec) DeepCopy() *VirtualMachineBootstrapC return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachinePoolEntry) DeepCopyInto(out *VirtualMachinePoolEntry) { + *out = *in + if in.CloudInitNetworkData != nil { + in, out := &in.CloudInitNetworkData, &out.CloudInitNetworkData + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachinePoolEntry. +func (in *VirtualMachinePoolEntry) DeepCopy() *VirtualMachinePoolEntry { + if in == nil { + return nil + } + out := new(VirtualMachinePoolEntry) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VirtualMachineTemplateSpec) DeepCopyInto(out *VirtualMachineTemplateSpec) { *out = *in diff --git a/vendor/sigs.k8s.io/kustomize/api/filters/replacement/replacement.go b/vendor/sigs.k8s.io/kustomize/api/filters/replacement/replacement.go index bea5690c4048..a988b60e8d8a 100644 --- a/vendor/sigs.k8s.io/kustomize/api/filters/replacement/replacement.go +++ b/vendor/sigs.k8s.io/kustomize/api/filters/replacement/replacement.go @@ -192,14 +192,14 @@ func copyValueToTarget(target *yaml.RNode, value *yaml.RNode, selector *types.Ta Path: kyaml_utils.SmarterPathSplitter(fp, "."), Create: createKind}) if err != nil { - return errors.WrapPrefixf(err, fieldRetrievalError(fp, createKind != 0)) + return errors.WrapPrefixf(err, fieldRetrievalError(fp, createKind != 0)) //nolint:govet } targetFields, err := targetFieldList.Elements() if err != nil { - return errors.WrapPrefixf(err, fieldRetrievalError(fp, createKind != 0)) + return errors.WrapPrefixf(err, fieldRetrievalError(fp, createKind != 0)) //nolint:govet } if len(targetFields) == 0 { - return errors.Errorf(fieldRetrievalError(fp, createKind != 0)) + return errors.Errorf(fieldRetrievalError(fp, createKind != 0)) //nolint:govet } for _, t := range targetFields { diff --git a/vendor/sigs.k8s.io/kustomize/api/internal/accumulator/resaccumulator.go b/vendor/sigs.k8s.io/kustomize/api/internal/accumulator/resaccumulator.go index 0f4008c97ff5..d3a894123f28 100644 --- a/vendor/sigs.k8s.io/kustomize/api/internal/accumulator/resaccumulator.go +++ b/vendor/sigs.k8s.io/kustomize/api/internal/accumulator/resaccumulator.go @@ -170,7 +170,7 @@ func (ra *ResAccumulator) FixBackReferences() (err error) { // Intersection drops the resources which "other" does not have. func (ra *ResAccumulator) Intersection(other resmap.ResMap) error { - otherIds := other.AllIds() + otherIds := other.AllIds() //nolint:revive for _, curId := range ra.resMap.AllIds() { toDelete := true for _, otherId := range otherIds { diff --git a/vendor/sigs.k8s.io/kustomize/api/internal/builtins/HelmChartInflationGenerator.go b/vendor/sigs.k8s.io/kustomize/api/internal/builtins/HelmChartInflationGenerator.go index 06d13b526139..86017301efc8 100644 --- a/vendor/sigs.k8s.io/kustomize/api/internal/builtins/HelmChartInflationGenerator.go +++ b/vendor/sigs.k8s.io/kustomize/api/internal/builtins/HelmChartInflationGenerator.go @@ -178,6 +178,7 @@ func (p *HelmChartInflationGeneratorPlugin) runHelmCommand( } if err != nil { helm := p.h.GeneralConfig().HelmConfig.Command + //nolint:govet err = errors.WrapPrefixf( fmt.Errorf( "unable to run: '%s %s' with env=%s (is '%s' installed?): %w", @@ -300,7 +301,7 @@ func (p *HelmChartInflationGeneratorPlugin) Generate() (rm resmap.ResMap, err er } // try to remove the contents before first "---" because // helm may produce messages to stdout before it - r := &kio.ByteReader{Reader: bytes.NewBufferString(string(stdout)), OmitReaderAnnotations: true} + r := &kio.ByteReader{Reader: bytes.NewBuffer(stdout), OmitReaderAnnotations: true} nodes, err := r.Read() if err != nil { return nil, fmt.Errorf("error reading helm output: %w", err) diff --git a/vendor/sigs.k8s.io/kustomize/api/internal/builtins/NamespaceTransformer.go b/vendor/sigs.k8s.io/kustomize/api/internal/builtins/NamespaceTransformer.go index 30a88340ff6b..d839fb975182 100644 --- a/vendor/sigs.k8s.io/kustomize/api/internal/builtins/NamespaceTransformer.go +++ b/vendor/sigs.k8s.io/kustomize/api/internal/builtins/NamespaceTransformer.go @@ -14,6 +14,8 @@ import ( ) // Change or set the namespace of non-cluster level resources. +// +//nolint:tagalign type NamespaceTransformerPlugin struct { types.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` FieldSpecs []types.FieldSpec `json:"fieldSpecs,omitempty" yaml:"fieldSpecs,omitempty"` diff --git a/vendor/sigs.k8s.io/kustomize/api/internal/loader/fileloader.go b/vendor/sigs.k8s.io/kustomize/api/internal/loader/fileloader.go index 6ecc9fcefa62..69b8295eb7ab 100644 --- a/vendor/sigs.k8s.io/kustomize/api/internal/loader/fileloader.go +++ b/vendor/sigs.k8s.io/kustomize/api/internal/loader/fileloader.go @@ -169,7 +169,7 @@ func (fl *FileLoader) New(path string) (ifc.Loader, error) { } root, err := filesys.ConfirmDir(fl.fSys, fl.root.Join(path)) if err != nil { - return nil, errors.WrapPrefixf(err, ErrRtNotDir.Error()) + return nil, errors.WrapPrefixf(err, ErrRtNotDir.Error()) //nolint:govet } if err = fl.errIfGitContainmentViolation(root); err != nil { return nil, err diff --git a/vendor/sigs.k8s.io/kustomize/api/internal/loader/loader.go b/vendor/sigs.k8s.io/kustomize/api/internal/loader/loader.go index e10885b9b70f..60b254fa7e71 100644 --- a/vendor/sigs.k8s.io/kustomize/api/internal/loader/loader.go +++ b/vendor/sigs.k8s.io/kustomize/api/internal/loader/loader.go @@ -28,7 +28,7 @@ func NewLoader( } root, err := filesys.ConfirmDir(fSys, target) if err != nil { - return nil, errors.WrapPrefixf(err, ErrRtNotDir.Error()) + return nil, errors.WrapPrefixf(err, ErrRtNotDir.Error()) //nolint:govet } return newLoaderAtConfirmedDir( lr, root, fSys, nil, git.ClonerUsingGitExec), nil diff --git a/vendor/sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig/transformerconfig.go b/vendor/sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig/transformerconfig.go index c539c290d5b3..b5d4b7aec188 100644 --- a/vendor/sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig/transformerconfig.go +++ b/vendor/sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig/transformerconfig.go @@ -15,6 +15,8 @@ import ( ) // TransformerConfig holds the data needed to perform transformations. +// +//nolint:tagalign type TransformerConfig struct { // if any fields are added, update the DeepCopy implementation NamePrefix types.FsSlice `json:"namePrefix,omitempty" yaml:"namePrefix,omitempty"` diff --git a/vendor/sigs.k8s.io/kustomize/api/internal/plugins/execplugin/execplugin.go b/vendor/sigs.k8s.io/kustomize/api/internal/plugins/execplugin/execplugin.go index 71c52884f0d7..108c3b290820 100644 --- a/vendor/sigs.k8s.io/kustomize/api/internal/plugins/execplugin/execplugin.go +++ b/vendor/sigs.k8s.io/kustomize/api/internal/plugins/execplugin/execplugin.go @@ -178,6 +178,7 @@ func (p *ExecPlugin) invokePlugin(input []byte) ([]byte, error) { } result, err := cmd.Output() if err != nil { + //nolint:govet return nil, errors.WrapPrefixf( fmt.Errorf("failure in plugin configured via %s; %w", f.Name(), err), stdErr.String()) diff --git a/vendor/sigs.k8s.io/kustomize/api/internal/plugins/loader/loader.go b/vendor/sigs.k8s.io/kustomize/api/internal/plugins/loader/loader.go index e494df767eb0..2edf8791ff14 100644 --- a/vendor/sigs.k8s.io/kustomize/api/internal/plugins/loader/loader.go +++ b/vendor/sigs.k8s.io/kustomize/api/internal/plugins/loader/loader.go @@ -34,7 +34,8 @@ type Loader struct { } func NewLoader( - pc *types.PluginConfig, rf *resmap.Factory, fs filesys.FileSystem) *Loader { + pc *types.PluginConfig, rf *resmap.Factory, fs filesys.FileSystem, +) *Loader { return &Loader{pc: pc, rf: rf, fs: fs} } @@ -58,7 +59,8 @@ func (l *Loader) Config() *types.PluginConfig { func (l *Loader) LoadGenerators( ldr ifc.Loader, v ifc.Validator, rm resmap.ResMap) ( - result []*resmap.GeneratorWithProperties, err error) { + result []*resmap.GeneratorWithProperties, err error, +) { for _, res := range rm.Resources() { g, err := l.LoadGenerator(ldr, v, res) if err != nil { @@ -74,7 +76,8 @@ func (l *Loader) LoadGenerators( } func (l *Loader) LoadGenerator( - ldr ifc.Loader, v ifc.Validator, res *resource.Resource) (resmap.Generator, error) { + ldr ifc.Loader, v ifc.Validator, res *resource.Resource, +) (resmap.Generator, error) { c, err := l.loadAndConfigurePlugin(ldr, v, res) if err != nil { return nil, err @@ -87,7 +90,8 @@ func (l *Loader) LoadGenerator( } func (l *Loader) LoadTransformers( - ldr ifc.Loader, v ifc.Validator, rm resmap.ResMap) ([]*resmap.TransformerWithProperties, error) { + ldr ifc.Loader, v ifc.Validator, rm resmap.ResMap, +) ([]*resmap.TransformerWithProperties, error) { var result []*resmap.TransformerWithProperties for _, res := range rm.Resources() { t, err := l.LoadTransformer(ldr, v, res) @@ -104,7 +108,8 @@ func (l *Loader) LoadTransformers( } func (l *Loader) LoadTransformer( - ldr ifc.Loader, v ifc.Validator, res *resource.Resource) (*resmap.TransformerWithProperties, error) { + ldr ifc.Loader, v ifc.Validator, res *resource.Resource, +) (*resmap.TransformerWithProperties, error) { c, err := l.loadAndConfigurePlugin(ldr, v, res) if err != nil { return nil, err @@ -179,7 +184,8 @@ func isBuiltinPlugin(res *resource.Resource) bool { func (l *Loader) loadAndConfigurePlugin( ldr ifc.Loader, v ifc.Validator, - res *resource.Resource) (c resmap.Configurable, err error) { + res *resource.Resource, +) (c resmap.Configurable, err error) { if isBuiltinPlugin(res) { switch l.pc.BpLoadingOptions { case types.BploLoadFromFileSys: @@ -192,7 +198,7 @@ func (l *Loader) loadAndConfigurePlugin( c, err = l.makeBuiltinPlugin(res.GetGvk()) default: err = fmt.Errorf( - "unknown plugin loader behavior specified: %v", + "unknown plugin loader behavior specified: %s %v", res.GetGvk().String(), l.pc.BpLoadingOptions) } } else { @@ -282,4 +288,3 @@ func (l *Loader) loadExecOrGoPlugin(resId resid.ResId) (resmap.Configurable, err } return c, nil } - diff --git a/vendor/sigs.k8s.io/kustomize/kyaml/filesys/filesystem.go b/vendor/sigs.k8s.io/kustomize/kyaml/filesys/filesystem.go index 79dfc53bf5db..c29d5ad8a7df 100644 --- a/vendor/sigs.k8s.io/kustomize/kyaml/filesys/filesystem.go +++ b/vendor/sigs.k8s.io/kustomize/kyaml/filesys/filesystem.go @@ -78,6 +78,7 @@ func ConfirmDir(fSys FileSystem, path string) (ConfirmedDir, error) { return "", errors.WrapPrefixf(err, "not a valid directory") } if f != "" { + //nolint:govet return "", errors.WrapPrefixf(errors.Errorf("file is not directory"), fmt.Sprintf("'%s'", path)) } return d, nil