diff --git a/apis/hive/v1/clusterdeployment_types.go b/apis/hive/v1/clusterdeployment_types.go index bdffe3c4a3e..1a2e2adef96 100644 --- a/apis/hive/v1/clusterdeployment_types.go +++ b/apis/hive/v1/clusterdeployment_types.go @@ -14,7 +14,6 @@ import ( "github.com/openshift/hive/apis/hive/v1/none" "github.com/openshift/hive/apis/hive/v1/nutanix" "github.com/openshift/hive/apis/hive/v1/openstack" - "github.com/openshift/hive/apis/hive/v1/ovirt" "github.com/openshift/hive/apis/hive/v1/vsphere" ) @@ -667,9 +666,6 @@ type Platform struct { // VSphere is the configuration used when installing on vSphere VSphere *vsphere.Platform `json:"vsphere,omitempty"` - // Ovirt is the configuration used when installing on oVirt - Ovirt *ovirt.Platform `json:"ovirt,omitempty"` - // AgentBareMetal is the configuration used when performing an Assisted Agent based installation // to bare metal. AgentBareMetal *agent.BareMetalPlatform `json:"agentBareMetal,omitempty"` diff --git a/apis/hive/v1/clusterdeprovision_types.go b/apis/hive/v1/clusterdeprovision_types.go index 56ff18e153f..a4a6bf79d7f 100644 --- a/apis/hive/v1/clusterdeprovision_types.go +++ b/apis/hive/v1/clusterdeprovision_types.go @@ -51,8 +51,6 @@ type ClusterDeprovisionPlatform struct { OpenStack *OpenStackClusterDeprovision `json:"openstack,omitempty"` // VSphere contains VMWare vSphere-specific deprovision settings VSphere *VSphereClusterDeprovision `json:"vsphere,omitempty"` - // Ovirt contains oVirt-specific deprovision settings - Ovirt *OvirtClusterDeprovision `json:"ovirt,omitempty"` // IBMCloud contains IBM Cloud specific deprovision settings IBMCloud *IBMClusterDeprovision `json:"ibmcloud,omitempty"` // Nutanix contains Nutanix-specific deprovision settings @@ -134,18 +132,6 @@ type VSphereClusterDeprovision struct { VCenter string `json:"vCenter"` } -// OvirtClusterDeprovision contains oVirt-specific configuration for a ClusterDeprovision -type OvirtClusterDeprovision struct { - // The oVirt cluster ID - ClusterID string `json:"clusterID"` - // CredentialsSecretRef is the oVirt account credentials to use for deprovisioning the cluster - // secret fields: ovirt_url, ovirt_username, ovirt_password, ovirt_ca_bundle - CredentialsSecretRef corev1.LocalObjectReference `json:"credentialsSecretRef"` - // CertificatesSecretRef refers to a secret that contains the oVirt CA certificates - // necessary for communicating with the oVirt. - CertificatesSecretRef corev1.LocalObjectReference `json:"certificatesSecretRef"` -} - // IBMClusterDeprovision contains IBM Cloud specific configuration for a ClusterDeprovision type IBMClusterDeprovision struct { // CredentialsSecretRef is the IBM Cloud credentials to use for deprovisioning the cluster diff --git a/apis/hive/v1/machinepool_types.go b/apis/hive/v1/machinepool_types.go index beea46416a2..707536c0505 100644 --- a/apis/hive/v1/machinepool_types.go +++ b/apis/hive/v1/machinepool_types.go @@ -10,7 +10,6 @@ import ( "github.com/openshift/hive/apis/hive/v1/ibmcloud" "github.com/openshift/hive/apis/hive/v1/nutanix" "github.com/openshift/hive/apis/hive/v1/openstack" - "github.com/openshift/hive/apis/hive/v1/ovirt" "github.com/openshift/hive/apis/hive/v1/vsphere" ) @@ -95,8 +94,6 @@ type MachinePoolPlatform struct { OpenStack *openstack.MachinePool `json:"openstack,omitempty"` // VSphere is the configuration used when installing on vSphere VSphere *vsphere.MachinePool `json:"vsphere,omitempty"` - // Ovirt is the configuration used when installing on oVirt. - Ovirt *ovirt.MachinePool `json:"ovirt,omitempty"` // IBMCloud is the configuration used when installing on IBM Cloud. IBMCloud *ibmcloud.MachinePool `json:"ibmcloud,omitempty"` // Nutanix is the configuration used when installing on Nutanix prism central. diff --git a/apis/hive/v1/ovirt/doc.go b/apis/hive/v1/ovirt/doc.go deleted file mode 100644 index b0af1e4e824..00000000000 --- a/apis/hive/v1/ovirt/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Package ovirt contains ovirt-specific structures for -// installer configuration and management. -// +k8s:deepcopy-gen=package -package ovirt diff --git a/apis/hive/v1/ovirt/machinepool.go b/apis/hive/v1/ovirt/machinepool.go deleted file mode 100644 index 5670b4647a9..00000000000 --- a/apis/hive/v1/ovirt/machinepool.go +++ /dev/null @@ -1,61 +0,0 @@ -package ovirt - -// MachinePool stores the configuration for a machine pool installed -// on ovirt. -type MachinePool struct { - // CPU defines the VM CPU. - // +optional - CPU *CPU `json:"cpu,omitempty"` - - // MemoryMB is the size of a VM's memory in MiBs. - // +optional - MemoryMB int32 `json:"memoryMB,omitempty"` - - // OSDisk is the the root disk of the node. - // +optional - OSDisk *Disk `json:"osDisk,omitempty"` - - // VMType defines the workload type of the VM. - // +kubebuilder:validation:Enum="";desktop;server;high_performance - // +optional - VMType VMType `json:"vmType,omitempty"` -} - -// CPU defines the VM cpu, made of (Sockets * Cores). -type CPU struct { - // Sockets is the number of sockets for a VM. - // Total CPUs is (Sockets * Cores) - Sockets int32 `json:"sockets"` - - // Cores is the number of cores per socket. - // Total CPUs is (Sockets * Cores) - Cores int32 `json:"cores"` -} - -// Disk defines a VM disk -type Disk struct { - // SizeGB size of the bootable disk in GiB. - SizeGB int64 `json:"sizeGB"` -} - -// VMType defines the type of the VM, which will change the VM configuration, -// like including or excluding devices (like excluding sound-card), -// device configuration (like using multi-queues for vNic), and several other -// configuration tweaks. This doesn't effect properties like CPU count and amount of memory. -type VMType string - -const ( - // VMTypeDesktop set the VM type to desktop. Virtual machines optimized to act - // as desktop machines do have a sound card, use an image (thin allocation), - // and are stateless. - VMTypeDesktop VMType = "desktop" - // VMTypeServer sets the VM type to server. Virtual machines optimized to act - // as servers have no sound card, use a cloned disk image, and are not stateless. - VMTypeServer VMType = "server" - // VMTypeHighPerformance sets a VM type to high_performance which sets various - // properties of a VM to optimize for performance, like enabling headless mode, - // disabling usb, smart-card, and sound devices, enabling host cpu pass-through, - // multi-queues for vNics and several more items. - // See https://www.ovirt.org/develop/release-management/features/virt/high-performance-vm.html. - VMTypeHighPerformance VMType = "high_performance" -) diff --git a/apis/hive/v1/ovirt/platform.go b/apis/hive/v1/ovirt/platform.go deleted file mode 100644 index fc3b8b27668..00000000000 --- a/apis/hive/v1/ovirt/platform.go +++ /dev/null @@ -1,22 +0,0 @@ -package ovirt - -import ( - corev1 "k8s.io/api/core/v1" -) - -// Platform stores all the global oVirt configuration -type Platform struct { - // The target cluster under which all VMs will run - ClusterID string `json:"ovirt_cluster_id"` - // CredentialsSecretRef refers to a secret that contains the oVirt account access - // credentials with fields: ovirt_url, ovirt_username, ovirt_password, ovirt_ca_bundle - CredentialsSecretRef corev1.LocalObjectReference `json:"credentialsSecretRef"` - // CertificatesSecretRef refers to a secret that contains the oVirt CA certificates - // necessary for communicating with oVirt. - CertificatesSecretRef corev1.LocalObjectReference `json:"certificatesSecretRef"` - // The target storage domain under which all VM disk would be created. - StorageDomainID string `json:"storage_domain_id"` - // The target network of all the network interfaces of the nodes. Omitting defaults to ovirtmgmt - // network which is a default network for evert ovirt cluster. - NetworkName string `json:"ovirt_network_name,omitempty"` -} diff --git a/apis/hive/v1/ovirt/zz_generated.deepcopy.go b/apis/hive/v1/ovirt/zz_generated.deepcopy.go deleted file mode 100644 index b2fe4f9944d..00000000000 --- a/apis/hive/v1/ovirt/zz_generated.deepcopy.go +++ /dev/null @@ -1,82 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package ovirt - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CPU) DeepCopyInto(out *CPU) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CPU. -func (in *CPU) DeepCopy() *CPU { - if in == nil { - return nil - } - out := new(CPU) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Disk) DeepCopyInto(out *Disk) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Disk. -func (in *Disk) DeepCopy() *Disk { - if in == nil { - return nil - } - out := new(Disk) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachinePool) DeepCopyInto(out *MachinePool) { - *out = *in - if in.CPU != nil { - in, out := &in.CPU, &out.CPU - *out = new(CPU) - **out = **in - } - if in.OSDisk != nil { - in, out := &in.OSDisk, &out.OSDisk - *out = new(Disk) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePool. -func (in *MachinePool) DeepCopy() *MachinePool { - if in == nil { - return nil - } - out := new(MachinePool) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Platform) DeepCopyInto(out *Platform) { - *out = *in - out.CredentialsSecretRef = in.CredentialsSecretRef - out.CertificatesSecretRef = in.CertificatesSecretRef - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Platform. -func (in *Platform) DeepCopy() *Platform { - if in == nil { - return nil - } - out := new(Platform) - in.DeepCopyInto(out) - return out -} diff --git a/apis/hive/v1/zz_generated.deepcopy.go b/apis/hive/v1/zz_generated.deepcopy.go index f826cc80293..b6cb96ad331 100644 --- a/apis/hive/v1/zz_generated.deepcopy.go +++ b/apis/hive/v1/zz_generated.deepcopy.go @@ -17,7 +17,6 @@ import ( none "github.com/openshift/hive/apis/hive/v1/none" nutanix "github.com/openshift/hive/apis/hive/v1/nutanix" openstack "github.com/openshift/hive/apis/hive/v1/openstack" - ovirt "github.com/openshift/hive/apis/hive/v1/ovirt" vsphere "github.com/openshift/hive/apis/hive/v1/vsphere" corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" @@ -1072,11 +1071,6 @@ func (in *ClusterDeprovisionPlatform) DeepCopyInto(out *ClusterDeprovisionPlatfo *out = new(VSphereClusterDeprovision) **out = **in } - if in.Ovirt != nil { - in, out := &in.Ovirt, &out.Ovirt - *out = new(OvirtClusterDeprovision) - **out = **in - } if in.IBMCloud != nil { in, out := &in.IBMCloud, &out.IBMCloud *out = new(IBMClusterDeprovision) @@ -3071,11 +3065,6 @@ func (in *MachinePoolPlatform) DeepCopyInto(out *MachinePoolPlatform) { *out = new(vsphere.MachinePool) (*in).DeepCopyInto(*out) } - if in.Ovirt != nil { - in, out := &in.Ovirt, &out.Ovirt - *out = new(ovirt.MachinePool) - (*in).DeepCopyInto(*out) - } if in.IBMCloud != nil { in, out := &in.IBMCloud, &out.IBMCloud *out = new(ibmcloud.MachinePool) @@ -3372,24 +3361,6 @@ func (in *OpenStackClusterDeprovision) DeepCopy() *OpenStackClusterDeprovision { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OvirtClusterDeprovision) DeepCopyInto(out *OvirtClusterDeprovision) { - *out = *in - out.CredentialsSecretRef = in.CredentialsSecretRef - out.CertificatesSecretRef = in.CertificatesSecretRef - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OvirtClusterDeprovision. -func (in *OvirtClusterDeprovision) DeepCopy() *OvirtClusterDeprovision { - if in == nil { - return nil - } - out := new(OvirtClusterDeprovision) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PatchEntity) DeepCopyInto(out *PatchEntity) { *out = *in @@ -3439,11 +3410,6 @@ func (in *Platform) DeepCopyInto(out *Platform) { *out = new(vsphere.Platform) **out = **in } - if in.Ovirt != nil { - in, out := &in.Ovirt, &out.Ovirt - *out = new(ovirt.Platform) - **out = **in - } if in.AgentBareMetal != nil { in, out := &in.AgentBareMetal, &out.AgentBareMetal *out = new(agent.BareMetalPlatform) diff --git a/config/crds/hive.openshift.io_clusterdeployments.yaml b/config/crds/hive.openshift.io_clusterdeployments.yaml index 918602439b3..2a49e3aae7d 100644 --- a/config/crds/hive.openshift.io_clusterdeployments.yaml +++ b/config/crds/hive.openshift.io_clusterdeployments.yaml @@ -975,58 +975,6 @@ spec: - cloud - credentialsSecretRef type: object - ovirt: - description: Ovirt is the configuration used when installing on oVirt - properties: - certificatesSecretRef: - description: |- - CertificatesSecretRef refers to a secret that contains the oVirt CA certificates - necessary for communicating with oVirt. - properties: - name: - default: "" - description: |- - Name of the referent. - This field is effectively required, but due to backwards compatibility is - allowed to be empty. Instances of this type with an empty value here are - almost certainly wrong. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - type: object - x-kubernetes-map-type: atomic - credentialsSecretRef: - description: |- - CredentialsSecretRef refers to a secret that contains the oVirt account access - credentials with fields: ovirt_url, ovirt_username, ovirt_password, ovirt_ca_bundle - properties: - name: - default: "" - description: |- - Name of the referent. - This field is effectively required, but due to backwards compatibility is - allowed to be empty. Instances of this type with an empty value here are - almost certainly wrong. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - type: object - x-kubernetes-map-type: atomic - ovirt_cluster_id: - description: The target cluster under which all VMs will run - type: string - ovirt_network_name: - description: |- - The target network of all the network interfaces of the nodes. Omitting defaults to ovirtmgmt - network which is a default network for evert ovirt cluster. - type: string - storage_domain_id: - description: The target storage domain under which all VM disk would be created. - type: string - required: - - certificatesSecretRef - - credentialsSecretRef - - ovirt_cluster_id - - storage_domain_id - type: object vsphere: description: VSphere is the configuration used when installing on vSphere properties: diff --git a/config/crds/hive.openshift.io_clusterdeprovisions.yaml b/config/crds/hive.openshift.io_clusterdeprovisions.yaml index 1482f726ef5..cdfa876eb6b 100644 --- a/config/crds/hive.openshift.io_clusterdeprovisions.yaml +++ b/config/crds/hive.openshift.io_clusterdeprovisions.yaml @@ -303,49 +303,6 @@ spec: required: - cloud type: object - ovirt: - description: Ovirt contains oVirt-specific deprovision settings - properties: - certificatesSecretRef: - description: |- - CertificatesSecretRef refers to a secret that contains the oVirt CA certificates - necessary for communicating with the oVirt. - properties: - name: - default: "" - description: |- - Name of the referent. - This field is effectively required, but due to backwards compatibility is - allowed to be empty. Instances of this type with an empty value here are - almost certainly wrong. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - type: object - x-kubernetes-map-type: atomic - clusterID: - description: The oVirt cluster ID - type: string - credentialsSecretRef: - description: |- - CredentialsSecretRef is the oVirt account credentials to use for deprovisioning the cluster - secret fields: ovirt_url, ovirt_username, ovirt_password, ovirt_ca_bundle - properties: - name: - default: "" - description: |- - Name of the referent. - This field is effectively required, but due to backwards compatibility is - allowed to be empty. Instances of this type with an empty value here are - almost certainly wrong. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - type: object - x-kubernetes-map-type: atomic - required: - - certificatesSecretRef - - clusterID - - credentialsSecretRef - type: object vsphere: description: VSphere contains VMWare vSphere-specific deprovision settings properties: diff --git a/config/crds/hive.openshift.io_clusterpools.yaml b/config/crds/hive.openshift.io_clusterpools.yaml index ead2c16ba42..e42d41bb471 100644 --- a/config/crds/hive.openshift.io_clusterpools.yaml +++ b/config/crds/hive.openshift.io_clusterpools.yaml @@ -846,58 +846,6 @@ spec: - cloud - credentialsSecretRef type: object - ovirt: - description: Ovirt is the configuration used when installing on oVirt - properties: - certificatesSecretRef: - description: |- - CertificatesSecretRef refers to a secret that contains the oVirt CA certificates - necessary for communicating with oVirt. - properties: - name: - default: "" - description: |- - Name of the referent. - This field is effectively required, but due to backwards compatibility is - allowed to be empty. Instances of this type with an empty value here are - almost certainly wrong. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - type: object - x-kubernetes-map-type: atomic - credentialsSecretRef: - description: |- - CredentialsSecretRef refers to a secret that contains the oVirt account access - credentials with fields: ovirt_url, ovirt_username, ovirt_password, ovirt_ca_bundle - properties: - name: - default: "" - description: |- - Name of the referent. - This field is effectively required, but due to backwards compatibility is - allowed to be empty. Instances of this type with an empty value here are - almost certainly wrong. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - type: object - x-kubernetes-map-type: atomic - ovirt_cluster_id: - description: The target cluster under which all VMs will run - type: string - ovirt_network_name: - description: |- - The target network of all the network interfaces of the nodes. Omitting defaults to ovirtmgmt - network which is a default network for evert ovirt cluster. - type: string - storage_domain_id: - description: The target storage domain under which all VM disk would be created. - type: string - required: - - certificatesSecretRef - - credentialsSecretRef - - ovirt_cluster_id - - storage_domain_id - type: object vsphere: description: VSphere is the configuration used when installing on vSphere properties: diff --git a/config/crds/hive.openshift.io_machinepools.yaml b/config/crds/hive.openshift.io_machinepools.yaml index a8cb1862e53..86aeb52f953 100644 --- a/config/crds/hive.openshift.io_machinepools.yaml +++ b/config/crds/hive.openshift.io_machinepools.yaml @@ -757,51 +757,6 @@ spec: required: - flavor type: object - ovirt: - description: Ovirt is the configuration used when installing on oVirt. - properties: - cpu: - description: CPU defines the VM CPU. - properties: - cores: - description: |- - Cores is the number of cores per socket. - Total CPUs is (Sockets * Cores) - format: int32 - type: integer - sockets: - description: |- - Sockets is the number of sockets for a VM. - Total CPUs is (Sockets * Cores) - format: int32 - type: integer - required: - - cores - - sockets - type: object - memoryMB: - description: MemoryMB is the size of a VM's memory in MiBs. - format: int32 - type: integer - osDisk: - description: OSDisk is the the root disk of the node. - properties: - sizeGB: - description: SizeGB size of the bootable disk in GiB. - format: int64 - type: integer - required: - - sizeGB - type: object - vmType: - description: VMType defines the workload type of the VM. - enum: - - "" - - desktop - - server - - high_performance - type: string - type: object vsphere: description: VSphere is the configuration used when installing on vSphere properties: diff --git a/config/templates/hive-csv-template.yaml b/config/templates/hive-csv-template.yaml index d3d84b64165..8be52734acd 100644 --- a/config/templates/hive-csv-template.yaml +++ b/config/templates/hive-csv-template.yaml @@ -32,7 +32,6 @@ spec: * Google Cloud Platform * IBM Cloud * Red Hat OpenStack - * oVirt * vSphere In the future Hive will support more cloud providers. diff --git a/contrib/pkg/createcluster/create.go b/contrib/pkg/createcluster/create.go index a6679294136..8a9db9c3e54 100644 --- a/contrib/pkg/createcluster/create.go +++ b/contrib/pkg/createcluster/create.go @@ -27,7 +27,6 @@ import ( azurecredutil "github.com/openshift/hive/contrib/pkg/utils/azure" gcputils "github.com/openshift/hive/contrib/pkg/utils/gcp" openstackutils "github.com/openshift/hive/contrib/pkg/utils/openstack" - ovirtutils "github.com/openshift/hive/contrib/pkg/utils/ovirt" "github.com/openshift/hive/pkg/clusterresource" "github.com/openshift/hive/pkg/constants" "github.com/openshift/hive/pkg/gcpclient" @@ -96,7 +95,6 @@ const ( cloudGCP = "gcp" cloudIBM = "ibmcloud" cloudOpenStack = "openstack" - cloudOVirt = "ovirt" cloudVSphere = "vsphere" cloudNutanix = "nutanix" @@ -116,7 +114,6 @@ var ( cloudGCP: true, cloudIBM: true, cloudOpenStack: true, - cloudOVirt: true, cloudVSphere: true, cloudNutanix: true, } @@ -213,14 +210,6 @@ type Options struct { VSpherePlatformSpecJSON string VSphereCACerts string - // Ovirt - OvirtClusterID string - OvirtStorageDomainID string - OvirtNetworkName string - OvirtAPIVIP string - OvirtIngressVIP string - OvirtCACerts string - // IBM IBMCISInstanceCRN string IBMAccountID string @@ -268,8 +257,7 @@ create-cluster CLUSTER_DEPLOYMENT_NAME --cloud=azure --azure-base-domain-resourc create-cluster CLUSTER_DEPLOYMENT_NAME --cloud=gcp create-cluster CLUSTER_DEPLOYMENT_NAME --cloud=ibmcloud --region="us-east" --base-domain=ibm.hive.openshift.com --manifests=/manifests --credentials-mode-manual create-cluster CLUSTER_DEPLOYMENT_NAME --cloud=openstack --openstack-api-floating-ip=192.168.1.2 --openstack-cloud=mycloud -create-cluster CLUSTER_DEPLOYMENT_NAME --cloud=vsphere --vsphere-vcenter=vmware.devcluster.com --vsphere-datacenter=dc1 --vsphere-default-datastore=nvme-ds1 --vsphere-api-vip=192.168.1.2 --vsphere-ingress-vip=192.168.1.3 --vsphere-cluster=devel --vsphere-network="VM Network" --vsphere-ca-certs=/path/to/cert -create-cluster CLUSTER_DEPLOYMENT_NAME --cloud=ovirt --ovirt-api-vip 192.168.1.2 --ovirt-dns-vip 192.168.1.3 --ovirt-ingress-vip 192.168.1.4 --ovirt-network-name ovirtmgmt --ovirt-storage-domain-id 00000000-e77a-456b-uuid --ovirt-cluster-id 00000000-8675-11ea-uuid --ovirt-ca-certs ~/.ovirt/ca`, +create-cluster CLUSTER_DEPLOYMENT_NAME --cloud=vsphere --vsphere-vcenter=vmware.devcluster.com --vsphere-datacenter=dc1 --vsphere-default-datastore=nvme-ds1 --vsphere-api-vip=192.168.1.2 --vsphere-ingress-vip=192.168.1.3 --vsphere-cluster=devel --vsphere-network="VM Network" --vsphere-ca-certs=/path/to/cert`, Short: "Creates a new Hive cluster deployment", Long: fmt.Sprintf(longDesc, defaultSSHPublicKeyFile, defaultPullSecretFile), Args: cobra.ExactArgs(1), @@ -399,14 +387,6 @@ OpenShift Installer publishes all the services of the cluster like API server an flags.StringSliceVar(&opt.NutanixSubnetUUIDs, constants.CliNutanixSubnetUUIDOpt, []string{}, "List of network subnets to be used by the cluster") flags.StringVar(&opt.NutanixCACerts, constants.CliNutanixCACertsOpt, "", "Path to a PEM-encoded CA certificate file used to verify the Nutanix endpoint's TLS certificates") - // oVirt flags - flags.StringVar(&opt.OvirtClusterID, "ovirt-cluster-id", "", "The oVirt cluster id (uuid) under which all VMs will run") - flags.StringVar(&opt.OvirtStorageDomainID, "ovirt-storage-domain-id", "", "oVirt storage domain id (uuid) under which all VM disk would be created") - flags.StringVar(&opt.OvirtNetworkName, "ovirt-network-name", "ovirtmgmt", "oVirt network name") - flags.StringVar(&opt.OvirtAPIVIP, "ovirt-api-vip", "", "IP which will be served by bootstrap and then pivoted masters, using keepalived") - flags.StringVar(&opt.OvirtIngressVIP, "ovirt-ingress-vip", "", "External IP which routes to the default ingress controller") - flags.StringVar(&opt.OvirtCACerts, "ovirt-ca-certs", "", "Path to oVirt CA certificate, multiple CA paths can be : delimited") - // Additional CA Trust Bundle flags.StringVar(&opt.AdditionalTrustBundle, "additional-trust-bundle", "", "Path to a CA Trust Bundle which will be added to the nodes trusted certificate store.") @@ -854,32 +834,6 @@ func (o *Options) GenerateObjects() ([]runtime.Object, error) { CACert: bytes.Join(caCerts, []byte("\n")), } builder.CloudBuilder = vsphereProvider - case cloudOVirt: - oVirtConfig, err := ovirtutils.GetCreds(o.CredsFile) - if err != nil { - return nil, err - } - if o.OvirtCACerts == "" { - return nil, errors.New("must provide --ovirt-ca-certs") - } - caCerts := [][]byte{} - for _, cert := range filepath.SplitList(o.OvirtCACerts) { - caCert, err := os.ReadFile(cert) - if err != nil { - return nil, fmt.Errorf("error reading %s: %w", cert, err) - } - caCerts = append(caCerts, caCert) - } - oVirtProvider := &clusterresource.OvirtCloudBuilder{ - OvirtConfig: oVirtConfig, - ClusterID: o.OvirtClusterID, - StorageDomainID: o.OvirtStorageDomainID, - NetworkName: o.OvirtNetworkName, - APIVIP: o.OvirtAPIVIP, - IngressVIP: o.OvirtIngressVIP, - CACert: bytes.Join(caCerts, []byte("\n")), - } - builder.CloudBuilder = oVirtProvider case cloudIBM: ibmCloudAPIKey := os.Getenv(constants.IBMCloudAPIKeyEnvVar) if ibmCloudAPIKey == "" { diff --git a/contrib/pkg/deprovision/deprovision.go b/contrib/pkg/deprovision/deprovision.go index 24d84639988..81a42f79e87 100644 --- a/contrib/pkg/deprovision/deprovision.go +++ b/contrib/pkg/deprovision/deprovision.go @@ -21,7 +21,6 @@ func NewDeprovisionCommand() *cobra.Command { cmd.AddCommand(NewDeprovisionIBMCloudCommand()) cmd.AddCommand(NewDeprovisionOpenStackCommand()) cmd.AddCommand(NewDeprovisionvSphereCommand()) - cmd.AddCommand(NewDeprovisionOvirtCommand()) cmd.AddCommand(NewDeprovisionNutanixCommand()) return cmd } diff --git a/contrib/pkg/deprovision/ovirt.go b/contrib/pkg/deprovision/ovirt.go deleted file mode 100644 index cef310cbd53..00000000000 --- a/contrib/pkg/deprovision/ovirt.go +++ /dev/null @@ -1,93 +0,0 @@ -package deprovision - -import ( - "github.com/pkg/errors" - log "github.com/sirupsen/logrus" - "github.com/spf13/cobra" - - "github.com/openshift/hive/contrib/pkg/utils" - ovirtutils "github.com/openshift/hive/contrib/pkg/utils/ovirt" - "github.com/openshift/installer/pkg/destroy/ovirt" - "github.com/openshift/installer/pkg/types" - typesovirt "github.com/openshift/installer/pkg/types/ovirt" -) - -// oVirtOptions is the set of options to deprovision an oVirt cluster -type oVirtOptions struct { - logLevel string - infraID string - clusterID string -} - -// NewDeprovisionOvirtCommand is the entrypoint to create the oVirt deprovision subcommand -func NewDeprovisionOvirtCommand() *cobra.Command { - opt := &oVirtOptions{} - cmd := &cobra.Command{ - Use: "ovirt INFRAID", - Short: "Deprovision oVirt assets (as created by openshift-installer)", - Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { - if err := opt.Complete(cmd, args); err != nil { - log.WithError(err).Fatal("failed to complete options") - } - if err := opt.Validate(cmd); err != nil { - log.WithError(err).Fatal("validation failed") - } - if err := opt.Run(); err != nil { - log.WithError(err).Fatal("Runtime error") - } - }, - } - flags := cmd.Flags() - flags.StringVar(&opt.logLevel, "loglevel", "info", "log level, one of: debug, info, warn, error, fatal, panic") - flags.StringVar(&opt.clusterID, "ovirt-cluster-id", "", "oVirt cluster ID") - return cmd -} - -// Complete finishes parsing arguments for the command -func (o *oVirtOptions) Complete(cmd *cobra.Command, args []string) error { - o.infraID = args[0] - - client, err := utils.GetClient("hiveutil-deprovision-ovirt") - if err != nil { - return errors.Wrap(err, "failed to get client") - } - ovirtutils.ConfigureCreds(client) - - return nil -} - -// Validate ensures that option values make sense -func (o *oVirtOptions) Validate(cmd *cobra.Command) error { - if o.clusterID == "" { - return errors.New("must provide --ovirt-cluster-id or set") - } - return nil -} - -// Run executes the command -func (o *oVirtOptions) Run() error { - logger, err := utils.NewLogger(o.logLevel) - if err != nil { - return err - } - - metadata := &types.ClusterMetadata{ - InfraID: o.infraID, - ClusterPlatformMetadata: types.ClusterPlatformMetadata{ - Ovirt: &typesovirt.Metadata{ - ClusterID: o.clusterID, - RemoveTemplate: true, - }, - }, - } - - destroyer, err := ovirt.New(logger, metadata) - if err != nil { - return err - } - - // ClusterQuota stomped in return - _, err = destroyer.Run() - return err -} diff --git a/contrib/pkg/utils/ovirt/ovirt.go b/contrib/pkg/utils/ovirt/ovirt.go deleted file mode 100644 index e859220423a..00000000000 --- a/contrib/pkg/utils/ovirt/ovirt.go +++ /dev/null @@ -1,48 +0,0 @@ -package ovirt - -import ( - "os" - "path/filepath" - - "k8s.io/client-go/util/homedir" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/openshift/hive/contrib/pkg/utils" - "github.com/openshift/hive/pkg/constants" -) - -// GetCreds reads oVirt credentials either from the specified credentials file, -// or ~/.ovirt/ovirt-config.yaml -func GetCreds(credsFile string) ([]byte, error) { - if credsFile == "" { - for _, filePath := range []string{filepath.Join(homedir.HomeDir(), ".ovirt", constants.OvirtCredentialsName)} { - - _, err := os.Stat(filePath) - if err != nil && !os.IsNotExist(err) { - return nil, err - } - if os.IsNotExist(err) { - continue - } - credsFile = filePath - break - } - } - return os.ReadFile(credsFile) -} - -// ConfigureCreds loads secrets designated by the environment variables CLUSTERDEPLOYMENT_NAMESPACE, -// CREDS_SECRET_NAME, and CERTS_SECRET_NAME and configures Ovirt credential environment variables -// and config files accordingly. -func ConfigureCreds(c client.Client) { - if credsSecret := utils.LoadSecretOrDie(c, "CREDS_SECRET_NAME"); credsSecret != nil { - utils.ProjectToDir(credsSecret, constants.OvirtCredentialsDir, nil) - os.Setenv(constants.OvirtConfigEnvVar, constants.OvirtCredentialsDir+"/"+constants.OvirtCredentialsName) - } - if certsSecret := utils.LoadSecretOrDie(c, "CERTS_SECRET_NAME"); certsSecret != nil { - utils.ProjectToDir(certsSecret, constants.OvirtCertificatesDir, nil) - utils.InstallCerts(constants.OvirtCertificatesDir) - } - // Install cluster proxy trusted CA bundle - utils.InstallCerts(constants.TrustedCABundleDir) -} diff --git a/go.mod b/go.mod index d910c0dff08..e6b0cfdf186 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,6 @@ require ( github.com/onsi/gomega v1.36.2 github.com/openshift/api v0.0.0-20250313134101-8a7efbfb5316 github.com/openshift/build-machinery-go v0.0.0-20240613134303-8359781da660 - github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20220323121149-e3f2850dd519 github.com/openshift/cluster-autoscaler-operator v0.0.1-0.20250219201631-227f7537c3b4 github.com/openshift/generic-admission-server v1.14.1-0.20250715141119-66c5d0a9c5e6 github.com/openshift/hive/apis v0.0.0 diff --git a/go.sum b/go.sum index c119bf8f790..13862949e22 100644 --- a/go.sum +++ b/go.sum @@ -781,8 +781,6 @@ github.com/openshift/cloud-provider-vsphere v1.19.1-0.20240626105621-6464d0bb492 github.com/openshift/cloud-provider-vsphere v1.19.1-0.20240626105621-6464d0bb4928/go.mod h1:eVEtCena8tmeeYDKwZlA2w+xBKzBHbQZ4CNHV8KL4ho= github.com/openshift/cluster-api-actuator-pkg/testutils v0.0.0-20240626103413-ddea9c7c0aca h1:HFFzJznFQVudyVSpMa+hZwXZpc0ZvFCIpiMNFdf21g8= github.com/openshift/cluster-api-actuator-pkg/testutils v0.0.0-20240626103413-ddea9c7c0aca/go.mod h1:osVq9/R6qKHBQxDP4cYTvkgXVBKOMs1SOfPLFfn0m7A= -github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20220323121149-e3f2850dd519 h1:foU7/s6DQczTFdZ/8H++pUC2Pzygqdz5ZgqUakksR5w= -github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20220323121149-e3f2850dd519/go.mod h1:C7unCUThP8eqT4xQfbvg3oIDn2S9TYtb0wbBoH/SR2U= github.com/openshift/cluster-autoscaler-operator v0.0.1-0.20250219201631-227f7537c3b4 h1:Xepsi7/s1kHkemmhyWDFV21dijgXZUcT0+8YWh6CbxU= github.com/openshift/cluster-autoscaler-operator v0.0.1-0.20250219201631-227f7537c3b4/go.mod h1:zCklcJwbnaNx46KvR38Rh86uZdow5gvub4ATcNDopTM= github.com/openshift/cluster-control-plane-machine-set-operator v0.0.0-20240909043600-373ac49835bf h1:mfMmaD9+vZIZQq3MGXsS/AGHXekj4wIn3zc1Cs1EY8M= diff --git a/hack/app-sre/saas-template.yaml b/hack/app-sre/saas-template.yaml index 1b9a75995bf..1c927bd47c7 100644 --- a/hack/app-sre/saas-template.yaml +++ b/hack/app-sre/saas-template.yaml @@ -1865,75 +1865,6 @@ objects: - cloud - credentialsSecretRef type: object - ovirt: - description: Ovirt is the configuration used when installing - on oVirt - properties: - certificatesSecretRef: - description: 'CertificatesSecretRef refers to a secret that - contains the oVirt CA certificates - - necessary for communicating with oVirt.' - properties: - name: - default: '' - description: 'Name of the referent. - - This field is effectively required, but due to backwards - compatibility is - - allowed to be empty. Instances of this type with an - empty value here are - - almost certainly wrong. - - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - type: object - x-kubernetes-map-type: atomic - credentialsSecretRef: - description: 'CredentialsSecretRef refers to a secret that - contains the oVirt account access - - credentials with fields: ovirt_url, ovirt_username, ovirt_password, - ovirt_ca_bundle' - properties: - name: - default: '' - description: 'Name of the referent. - - This field is effectively required, but due to backwards - compatibility is - - allowed to be empty. Instances of this type with an - empty value here are - - almost certainly wrong. - - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - type: object - x-kubernetes-map-type: atomic - ovirt_cluster_id: - description: The target cluster under which all VMs will - run - type: string - ovirt_network_name: - description: 'The target network of all the network interfaces - of the nodes. Omitting defaults to ovirtmgmt - - network which is a default network for evert ovirt cluster.' - type: string - storage_domain_id: - description: The target storage domain under which all VM - disk would be created. - type: string - required: - - certificatesSecretRef - - credentialsSecretRef - - ovirt_cluster_id - - storage_domain_id - type: object vsphere: description: VSphere is the configuration used when installing on vSphere @@ -3697,62 +3628,6 @@ objects: required: - cloud type: object - ovirt: - description: Ovirt contains oVirt-specific deprovision settings - properties: - certificatesSecretRef: - description: 'CertificatesSecretRef refers to a secret that - contains the oVirt CA certificates - - necessary for communicating with the oVirt.' - properties: - name: - default: '' - description: 'Name of the referent. - - This field is effectively required, but due to backwards - compatibility is - - allowed to be empty. Instances of this type with an - empty value here are - - almost certainly wrong. - - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - type: object - x-kubernetes-map-type: atomic - clusterID: - description: The oVirt cluster ID - type: string - credentialsSecretRef: - description: 'CredentialsSecretRef is the oVirt account - credentials to use for deprovisioning the cluster - - secret fields: ovirt_url, ovirt_username, ovirt_password, - ovirt_ca_bundle' - properties: - name: - default: '' - description: 'Name of the referent. - - This field is effectively required, but due to backwards - compatibility is - - allowed to be empty. Instances of this type with an - empty value here are - - almost certainly wrong. - - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - type: object - x-kubernetes-map-type: atomic - required: - - certificatesSecretRef - - clusterID - - credentialsSecretRef - type: object vsphere: description: VSphere contains VMWare vSphere-specific deprovision settings @@ -5072,75 +4947,6 @@ objects: - cloud - credentialsSecretRef type: object - ovirt: - description: Ovirt is the configuration used when installing - on oVirt - properties: - certificatesSecretRef: - description: 'CertificatesSecretRef refers to a secret that - contains the oVirt CA certificates - - necessary for communicating with oVirt.' - properties: - name: - default: '' - description: 'Name of the referent. - - This field is effectively required, but due to backwards - compatibility is - - allowed to be empty. Instances of this type with an - empty value here are - - almost certainly wrong. - - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - type: object - x-kubernetes-map-type: atomic - credentialsSecretRef: - description: 'CredentialsSecretRef refers to a secret that - contains the oVirt account access - - credentials with fields: ovirt_url, ovirt_username, ovirt_password, - ovirt_ca_bundle' - properties: - name: - default: '' - description: 'Name of the referent. - - This field is effectively required, but due to backwards - compatibility is - - allowed to be empty. Instances of this type with an - empty value here are - - almost certainly wrong. - - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - type: object - x-kubernetes-map-type: atomic - ovirt_cluster_id: - description: The target cluster under which all VMs will - run - type: string - ovirt_network_name: - description: 'The target network of all the network interfaces - of the nodes. Omitting defaults to ovirtmgmt - - network which is a default network for evert ovirt cluster.' - type: string - storage_domain_id: - description: The target storage domain under which all VM - disk would be created. - type: string - required: - - certificatesSecretRef - - credentialsSecretRef - - ovirt_cluster_id - - storage_domain_id - type: object vsphere: description: VSphere is the configuration used when installing on vSphere @@ -9232,53 +9038,6 @@ objects: required: - flavor type: object - ovirt: - description: Ovirt is the configuration used when installing - on oVirt. - properties: - cpu: - description: CPU defines the VM CPU. - properties: - cores: - description: 'Cores is the number of cores per socket. - - Total CPUs is (Sockets * Cores)' - format: int32 - type: integer - sockets: - description: 'Sockets is the number of sockets for a - VM. - - Total CPUs is (Sockets * Cores)' - format: int32 - type: integer - required: - - cores - - sockets - type: object - memoryMB: - description: MemoryMB is the size of a VM's memory in MiBs. - format: int32 - type: integer - osDisk: - description: OSDisk is the the root disk of the node. - properties: - sizeGB: - description: SizeGB size of the bootable disk in GiB. - format: int64 - type: integer - required: - - sizeGB - type: object - vmType: - description: VMType defines the workload type of the VM. - enum: - - '' - - desktop - - server - - high_performance - type: string - type: object vsphere: description: VSphere is the configuration used when installing on vSphere diff --git a/pkg/clusterresource/ovirt.go b/pkg/clusterresource/ovirt.go deleted file mode 100644 index ce89b4bd899..00000000000 --- a/pkg/clusterresource/ovirt.go +++ /dev/null @@ -1,132 +0,0 @@ -package clusterresource - -import ( - "fmt" - - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - - installertypes "github.com/openshift/installer/pkg/types" - installerovirt "github.com/openshift/installer/pkg/types/ovirt" - - hivev1 "github.com/openshift/hive/apis/hive/v1" - hivev1ovirt "github.com/openshift/hive/apis/hive/v1/ovirt" - "github.com/openshift/hive/pkg/constants" -) - -var _ CloudBuilder = (*OvirtCloudBuilder)(nil) - -// OvirtCloudBuilder encapsulates cluster artifact generation logic specific to oVirt. -type OvirtCloudBuilder struct { - // OvirtConfig is the data that will be used as the ovirt-config.yaml file for - // cluster provisioning. - OvirtConfig []byte - // The target cluster under which all VMs will run - ClusterID string - // The target storage domain under which all VM disk would be created. - StorageDomainID string - // The target network of all the network interfaces of the nodes. Omitting defaults to ovirtmgmt - // network which is a default network for every oVirt cluster. - NetworkName string - // APIVIP is an IP which will be served by bootstrap and then pivoted masters, using keepalived - APIVIP string - // IngressIP is an external IP which routes to the default ingress controller. - // The IP is a suitable target of a wildcard DNS record used to resolve default route host names. - IngressVIP string - // CACert is the CA certificate(s) used to communicate with oVirt. - CACert []byte -} - -func NewOvirtCloudBuilderFromSecret(credsSecret *corev1.Secret) *OvirtCloudBuilder { - ovirtConfigYamlContent := credsSecret.Data[constants.OvirtCredentialsName] - return &OvirtCloudBuilder{ - OvirtConfig: ovirtConfigYamlContent, - } -} - -func (p *OvirtCloudBuilder) GenerateCredentialsSecret(o *Builder) *corev1.Secret { - return &corev1.Secret{ - TypeMeta: metav1.TypeMeta{ - Kind: "Secret", - APIVersion: corev1.SchemeGroupVersion.String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: p.CredsSecretName(o), - Namespace: o.Namespace, - }, - Type: corev1.SecretTypeOpaque, - Data: map[string][]byte{ - constants.OvirtCredentialsName: p.OvirtConfig, - }, - } -} - -func (p *OvirtCloudBuilder) GenerateCloudObjects(o *Builder) []runtime.Object { - return []runtime.Object{ - &corev1.Secret{ - TypeMeta: metav1.TypeMeta{ - Kind: "Secret", - APIVersion: corev1.SchemeGroupVersion.String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: p.certificatesSecretName(o), - Namespace: o.Namespace, - }, - Type: corev1.SecretTypeOpaque, - Data: map[string][]byte{ - ".cacert": p.CACert, - }, - }, - } -} - -func (p *OvirtCloudBuilder) GetCloudPlatform(o *Builder) hivev1.Platform { - return hivev1.Platform{ - Ovirt: &hivev1ovirt.Platform{ - ClusterID: p.ClusterID, - CredentialsSecretRef: corev1.LocalObjectReference{ - Name: p.CredsSecretName(o), - }, - CertificatesSecretRef: corev1.LocalObjectReference{ - Name: p.certificatesSecretName(o), - }, - StorageDomainID: p.StorageDomainID, - NetworkName: p.NetworkName, - }, - } -} - -func (p *OvirtCloudBuilder) addMachinePoolPlatform(o *Builder, mp *hivev1.MachinePool) { - mp.Spec.Platform.Ovirt = &hivev1ovirt.MachinePool{ - CPU: &hivev1ovirt.CPU{ - Sockets: 1, - Cores: 4, - }, - MemoryMB: 16348, - OSDisk: &hivev1ovirt.Disk{ - SizeGB: 120, - }, - VMType: hivev1ovirt.VMTypeServer, - } -} - -func (p *OvirtCloudBuilder) addInstallConfigPlatform(o *Builder, ic *installertypes.InstallConfig) { - ic.Platform = installertypes.Platform{ - Ovirt: &installerovirt.Platform{ - ClusterID: p.ClusterID, - StorageDomainID: p.StorageDomainID, - NetworkName: p.NetworkName, - APIVIPs: []string{p.APIVIP}, - IngressVIPs: []string{p.IngressVIP}, - }, - } -} - -func (p *OvirtCloudBuilder) CredsSecretName(o *Builder) string { - return fmt.Sprintf("%s-ovirt-creds", o.Name) -} - -func (p *OvirtCloudBuilder) certificatesSecretName(o *Builder) string { - return fmt.Sprintf("%s-ovirt-certs", o.Name) -} diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index 285d367d9fc..cbad16193ba 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -16,7 +16,6 @@ const ( PlatformIBMCloud = "ibmcloud" PlatformNone = "none-platform" PlatformOpenStack = "openstack" - PlatformOvirt = "ovirt" PlatformUnknown = "unknown" PlatformVSphere = "vsphere" PlatformNutanix = "nutanix" @@ -365,18 +364,6 @@ const ( // next minor version. i.e 4.y -> 4.(y+1) MinorVersionUpgradeUnavailable = "hive.openshift.io/minor-version-upgrade-unavailable" - // OvirtCredentialsDir is the directory containing Ovirt credentials files. - OvirtCredentialsDir = "/.ovirt" - - // OvirtCertificatesDir is the directory containing Ovirt certificate files. - OvirtCertificatesDir = "/.ovirt-ca" - - // OvirtCredentialsName is the name of the oVirt credentials file. - OvirtCredentialsName = "ovirt-config.yaml" - - // OvirtConfigEnvVar is the environment variable specifying the oVirt config path - OvirtConfigEnvVar = "OVIRT_CONFIG" - // InstallLogsUploadProviderEnvVar is used to specify which object store provider is being used. InstallLogsUploadProviderEnvVar = "HIVE_INSTALL_LOGS_UPLOAD_PROVIDER" diff --git a/pkg/controller/clusterdeployment/clusterdeployment_controller.go b/pkg/controller/clusterdeployment/clusterdeployment_controller.go index c6dd9e3c68d..6714fc252dc 100644 --- a/pkg/controller/clusterdeployment/clusterdeployment_controller.go +++ b/pkg/controller/clusterdeployment/clusterdeployment_controller.go @@ -2024,12 +2024,6 @@ func generateDeprovision(cd *hivev1.ClusterDeployment) (*hivev1.ClusterDeprovisi CertificatesSecretRef: cd.Spec.Platform.VSphere.CertificatesSecretRef, VCenter: cd.Spec.Platform.VSphere.VCenter, } - case cd.Spec.Platform.Ovirt != nil: - req.Spec.Platform.Ovirt = &hivev1.OvirtClusterDeprovision{ - CredentialsSecretRef: cd.Spec.Platform.Ovirt.CredentialsSecretRef, - CertificatesSecretRef: cd.Spec.Platform.Ovirt.CertificatesSecretRef, - ClusterID: cd.Spec.Platform.Ovirt.ClusterID, - } case cd.Spec.Platform.IBMCloud != nil: req.Spec.Platform.IBMCloud = &hivev1.IBMClusterDeprovision{ CredentialsSecretRef: cd.Spec.Platform.IBMCloud.CredentialsSecretRef, @@ -2726,8 +2720,6 @@ func getClusterPlatform(cd *hivev1.ClusterDeployment) string { return constants.PlatformIBMCloud case cd.Spec.Platform.None != nil: return constants.PlatformNone - case cd.Spec.Platform.Ovirt != nil: - return constants.PlatformOvirt case cd.Spec.Platform.Nutanix != nil: return constants.PlatformNutanix } diff --git a/pkg/controller/clusterpool/clusterpool_controller.go b/pkg/controller/clusterpool/clusterpool_controller.go index 7a848d63ebe..f493118398d 100644 --- a/pkg/controller/clusterpool/clusterpool_controller.go +++ b/pkg/controller/clusterpool/clusterpool_controller.go @@ -303,7 +303,7 @@ func (r *ReconcileClusterPool) Reconcile(ctx context.Context, request reconcile. logger = controllerutils.AddLogFields(controllerutils.MetaObjectLogTagger{Object: clp}, logger) if clp.Spec.RunningCount != clp.Spec.Size && poolAlwaysRunning(clp) { - return reconcile.Result{}, errors.New("Hibernation is not supported on Openstack, VShpere and Ovirt. Must set runningCount==size.") + return reconcile.Result{}, errors.New("Hibernation is not supported on Openstack and VSphere. Must set runningCount==size.") } // Initialize cluster pool conditions if not set @@ -1096,7 +1096,7 @@ func poolReference(pool *hivev1.ClusterPool) hivev1.ClusterPoolReference { // poolAlwaysRunning returns true if the Platrform, cloud provider, machines can only be in running state func poolAlwaysRunning(pool *hivev1.ClusterPool) bool { p := pool.Spec.Platform - return p.OpenStack != nil || p.Ovirt != nil || p.VSphere != nil + return p.OpenStack != nil || p.VSphere != nil } func (r *ReconcileClusterPool) getCredentialsSecret(pool *hivev1.ClusterPool, secretName string, logger log.FieldLogger) (*corev1.Secret, error) { @@ -1334,28 +1334,6 @@ func (r *ReconcileClusterPool) createCloudBuilder(pool *hivev1.ClusterPool, logg cloudBuilder.Network = platform.VSphere.Network return cloudBuilder, nil - case platform.Ovirt != nil: - credsSecret, err := r.getCredentialsSecret(pool, platform.Ovirt.CredentialsSecretRef.Name, logger) - if err != nil { - return nil, err - } - - certsSecret, err := r.getCredentialsSecret(pool, platform.Ovirt.CertificatesSecretRef.Name, logger) - if err != nil { - return nil, err - } - - if _, ok := certsSecret.Data[".cacert"]; !ok { - return nil, err - } - - cloudBuilder := clusterresource.NewOvirtCloudBuilderFromSecret(credsSecret) - cloudBuilder.StorageDomainID = platform.Ovirt.StorageDomainID - cloudBuilder.ClusterID = platform.Ovirt.ClusterID - cloudBuilder.NetworkName = platform.Ovirt.NetworkName - - return cloudBuilder, nil - default: logger.Info("unsupported platform") return nil, errors.New("unsupported platform") diff --git a/pkg/controller/clusterpool/clusterpool_controller_test.go b/pkg/controller/clusterpool/clusterpool_controller_test.go index a0586dd2af7..fc1a236ffdf 100644 --- a/pkg/controller/clusterpool/clusterpool_controller_test.go +++ b/pkg/controller/clusterpool/clusterpool_controller_test.go @@ -51,11 +51,11 @@ func TestReconcileClusterPool(t *testing.T) { // See calculatePoolVersion. If these change, the easiest way to figure out the new value is // to pull it from the test failure :) - initialPoolVersion := "9127d5c28667b49b" - inventoryPoolVersion := "576ffe9da20c8cf3" - inventoryAndCustomizationPoolVersion := "2f0b1beae43348b1" - customizationPoolVersion := "e2af66b3a60ab6a1" - openstackPoolVersion := "a7130cc122b079dc" + initialPoolVersion := "04a8f79a4a2e9733" + inventoryPoolVersion := "a6dcbd6776a3c92b" + inventoryAndCustomizationPoolVersion := "f1a16535dbc27559" + customizationPoolVersion := "564f99a732a771e9" + openstackPoolVersion := "0be50b7ba396d313" poolBuilder := testcp.FullBuilder(testNamespace, testLeasePoolName, scheme). GenericOptions( diff --git a/pkg/controller/machinepool/machinepool_controller.go b/pkg/controller/machinepool/machinepool_controller.go index 8a1c3e5a6f1..61d2fdfeaaf 100644 --- a/pkg/controller/machinepool/machinepool_controller.go +++ b/pkg/controller/machinepool/machinepool_controller.go @@ -1377,8 +1377,6 @@ func (r *ReconcileMachinePool) createActuator( return NewIBMCloudActuator(creds, r.scheme, logger) case cd.Spec.Platform.Nutanix != nil: return NewNutanixActuator(r.Client, masterMachine) - case cd.Spec.Platform.Ovirt != nil: - return NewOvirtActuator(masterMachine, r.scheme, logger) case cd.Spec.Platform.OpenStack != nil: return NewOpenStackActuator(masterMachine, r.Client, logger) case cd.Spec.Platform.VSphere != nil: diff --git a/pkg/controller/machinepool/ovirt.go b/pkg/controller/machinepool/ovirt.go deleted file mode 100644 index ddf5a6a3d3a..00000000000 --- a/pkg/controller/machinepool/ovirt.go +++ /dev/null @@ -1,137 +0,0 @@ -package machinepool - -import ( - "fmt" - - "github.com/pkg/errors" - log "github.com/sirupsen/logrus" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/serializer" - - machineapi "github.com/openshift/api/machine/v1beta1" - ovirtproviderv1beta1 "github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1" - installovirt "github.com/openshift/installer/pkg/asset/machines/ovirt" - installertypes "github.com/openshift/installer/pkg/types" - installertypesovirt "github.com/openshift/installer/pkg/types/ovirt" - - hivev1 "github.com/openshift/hive/apis/hive/v1" -) - -// OvirtActuator encapsulates the pieces necessary to be able to generate -// a list of MachineSets to sync to the remote cluster -type OvirtActuator struct { - logger log.FieldLogger - osImage string -} - -var _ Actuator = &OvirtActuator{} - -// NewOvirtActuator is the constructor for building a OvirtActuator -func NewOvirtActuator(masterMachine *machineapi.Machine, scheme *runtime.Scheme, logger log.FieldLogger) (*OvirtActuator, error) { - osImage, err := getOvirtOSImage(masterMachine, scheme, logger) - if err != nil { - logger.WithError(err).Error("error getting os image from master machine") - return nil, err - } - actuator := &OvirtActuator{ - logger: logger, - osImage: osImage, - } - return actuator, nil -} - -// GenerateMachineSets satisfies the Actuator interface and will take a clusterDeployment and return a list of MachineSets -// to sync to the remote cluster. -func (a *OvirtActuator) GenerateMachineSets(cd *hivev1.ClusterDeployment, pool *hivev1.MachinePool, logger log.FieldLogger) ([]*machineapi.MachineSet, bool, error) { - if cd.Spec.ClusterMetadata == nil { - return nil, false, errors.New("ClusterDeployment does not have cluster metadata") - } - if cd.Spec.Platform.Ovirt == nil { - return nil, false, errors.New("ClusterDeployment is not for oVirt") - } - if pool.Spec.Platform.Ovirt == nil { - return nil, false, errors.New("MachinePool is not for oVirt") - } - - computePool := baseMachinePool(pool) - - computePool.Platform.Ovirt = &installertypesovirt.MachinePool{} - - if cpu := pool.Spec.Platform.Ovirt.CPU; cpu != nil { - computePool.Platform.Ovirt.CPU = &installertypesovirt.CPU{ - Cores: cpu.Cores, - Sockets: cpu.Sockets, - } - } - - if pool.Spec.Platform.Ovirt.MemoryMB != int32(0) { - computePool.Platform.Ovirt.MemoryMB = pool.Spec.Platform.Ovirt.MemoryMB - } - - if disk := pool.Spec.Platform.Ovirt.OSDisk; disk != nil { - computePool.Platform.Ovirt.OSDisk = &installertypesovirt.Disk{ - SizeGB: disk.SizeGB, - } - } - - if vmType := pool.Spec.Platform.Ovirt.VMType; vmType != "" { - computePool.Platform.Ovirt.VMType = installertypesovirt.VMType(vmType) - } - - // Fake an install config as we do with other actuators. We only populate what we know is needed today. - // WARNING: changes to use more of installconfig in the MachineSets function can break here. Hopefully - // will be caught by unit tests. - ic := &installertypes.InstallConfig{ - Platform: installertypes.Platform{ - Ovirt: &installertypesovirt.Platform{ - ClusterID: cd.Spec.Platform.Ovirt.ClusterID, - StorageDomainID: cd.Spec.Platform.Ovirt.StorageDomainID, - NetworkName: cd.Spec.Platform.Ovirt.NetworkName, - }, - }, - } - - installerMachineSets, err := installovirt.MachineSets( - cd.Spec.ClusterMetadata.InfraID, - ic, - computePool, - a.osImage, - workerRole, - workerUserDataName, - ) - if err != nil { - return nil, false, errors.Wrap(err, "failed to generate machinesets") - } - - return installerMachineSets, true, nil -} - -// Get the OS image from an existing master machine. -func getOvirtOSImage(masterMachine *machineapi.Machine, scheme *runtime.Scheme, logger log.FieldLogger) (string, error) { - providerSpec, err := decodeOvirtMachineProviderSpec(masterMachine.Spec.ProviderSpec.Value, scheme) - if err != nil { - logger.WithError(err).Warn("cannot decode OvirtMachineProviderSpec from master machine") - return "", errors.Wrap(err, "cannot decode OvirtMachineProviderSpec from master machine") - } - osImage := providerSpec.TemplateName - logger.WithField("image", osImage).Debug("resolved image to use for new machinesets") - return osImage, nil -} - -func decodeOvirtMachineProviderSpec(rawExt *runtime.RawExtension, scheme *runtime.Scheme) (*ovirtproviderv1beta1.OvirtMachineProviderSpec, error) { - codecFactory := serializer.NewCodecFactory(scheme) - decoder := codecFactory.UniversalDecoder(ovirtproviderv1beta1.SchemeGroupVersion) - if rawExt == nil { - return nil, fmt.Errorf("MachineSet has no ProviderSpec") - } - obj, gvk, err := decoder.Decode([]byte(rawExt.Raw), nil, nil) - if err != nil { - return nil, fmt.Errorf("could not decode Ovirt ProviderSpec: %v", err) - } - spec, ok := obj.(*ovirtproviderv1beta1.OvirtMachineProviderSpec) - if !ok { - return nil, fmt.Errorf("unexpected object: %#v", gvk) - } - return spec, nil -} diff --git a/pkg/controller/machinepool/ovirt_test.go b/pkg/controller/machinepool/ovirt_test.go deleted file mode 100644 index df316be342a..00000000000 --- a/pkg/controller/machinepool/ovirt_test.go +++ /dev/null @@ -1,134 +0,0 @@ -package machinepool - -import ( - "fmt" - "testing" - - log "github.com/sirupsen/logrus" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - corev1 "k8s.io/api/core/v1" - - machineapi "github.com/openshift/api/machine/v1beta1" - ovirtprovider "github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1" - - hivev1 "github.com/openshift/hive/apis/hive/v1" - hivev1ovirt "github.com/openshift/hive/apis/hive/v1/ovirt" -) - -const ( - vmTypeServer string = "server" - cores int32 = 4 - sockets int32 = 1 - memoryMB int32 = 16384 - sizeGB int64 = 120 -) - -func TestOvirtActuator(t *testing.T) { - tests := []struct { - name string - clusterDeployment *hivev1.ClusterDeployment - pool *hivev1.MachinePool - expectedMachineSetReplicas map[string]int64 - expectedErr bool - validatePlatform func(*testing.T, *ovirtprovider.OvirtMachineProviderSpec) - }{ - { - name: "generate machineset", - clusterDeployment: testOvirtClusterDeployment(), - pool: testOvirtPool(), - expectedMachineSetReplicas: map[string]int64{ - fmt.Sprintf("%s-worker", testInfraID): 3, - }, - validatePlatform: func(t *testing.T, ovirtProvider *ovirtprovider.OvirtMachineProviderSpec) { - assert.Equal(t, memoryMB, ovirtProvider.MemoryMB, "unexpected MemeoryMiB") - assert.Equal(t, cores, ovirtProvider.CPU.Cores, "unexpected number of CPU Cores") - assert.Equal(t, sockets, ovirtProvider.CPU.Sockets, "unexpected number of CPU Sockets") - assert.Equal(t, sizeGB, ovirtProvider.OSDisk.SizeGB, "unexpected DiskGiB") - assert.Equal(t, vmTypeServer, ovirtProvider.VMType, "unexpected VMType") - }, - }, - { - name: "empty pool platform config", - clusterDeployment: testOvirtClusterDeployment(), - pool: func() *hivev1.MachinePool { - m := testOvirtPool() - m.Spec.Platform.Ovirt = &hivev1ovirt.MachinePool{} - return m - }(), - expectedMachineSetReplicas: map[string]int64{ - fmt.Sprintf("%s-worker", testInfraID): 3, - }, - validatePlatform: func(t *testing.T, ovirtProvider *ovirtprovider.OvirtMachineProviderSpec) { - assert.Equal(t, workerUserDataName, ovirtProvider.UserDataSecret.Name, "unexpected UserDataSecret") - }, - }, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - actuator := &OvirtActuator{ - logger: log.WithField("actuator", "ovirtactuator_test"), - } - - generatedMachineSets, _, err := actuator.GenerateMachineSets(test.clusterDeployment, test.pool, actuator.logger) - - if test.expectedErr { - assert.Error(t, err, "expected error for test case") - } else { - require.NoError(t, err, "unexpected error for test cast") - validateOvirtMachineSets(t, generatedMachineSets, test.expectedMachineSetReplicas, test.validatePlatform) - } - }) - } -} - -func validateOvirtMachineSets(t *testing.T, - mSets []*machineapi.MachineSet, - expectedMSReplicas map[string]int64, - validatePlatform func(*testing.T, *ovirtprovider.OvirtMachineProviderSpec)) { - assert.Equal(t, len(expectedMSReplicas), len(mSets), "different number of machine sets generated than expected") - - for _, ms := range mSets { - expectedReplicas, ok := expectedMSReplicas[ms.Name] - if assert.True(t, ok, "unexpected machine set") { - assert.Equal(t, expectedReplicas, int64(*ms.Spec.Replicas), "replica mismatch") - } - - ovirtProvider, ok := ms.Spec.Template.Spec.ProviderSpec.Value.Object.(*ovirtprovider.OvirtMachineProviderSpec) - if assert.True(t, ok, "failed to convert to ovirt provider spec") { - validatePlatform(t, ovirtProvider) - } - } -} - -func testOvirtPool() *hivev1.MachinePool { - p := testMachinePool() - p.Spec.Platform = hivev1.MachinePoolPlatform{ - Ovirt: &hivev1ovirt.MachinePool{ - CPU: &hivev1ovirt.CPU{ - Cores: cores, - Sockets: sockets, - }, - MemoryMB: memoryMB, - OSDisk: &hivev1ovirt.Disk{ - SizeGB: sizeGB, - }, - VMType: hivev1ovirt.VMType(vmTypeServer), - }, - } - return p -} - -func testOvirtClusterDeployment() *hivev1.ClusterDeployment { - cd := testClusterDeployment() - cd.Spec.Platform = hivev1.Platform{ - Ovirt: &hivev1ovirt.Platform{ - CredentialsSecretRef: corev1.LocalObjectReference{ - Name: "ovirt-credentials", - }, - }, - } - return cd -} diff --git a/pkg/controller/utils/clusterdeployment.go b/pkg/controller/utils/clusterdeployment.go index e7c631e80f3..efcff03460f 100644 --- a/pkg/controller/utils/clusterdeployment.go +++ b/pkg/controller/utils/clusterdeployment.go @@ -129,8 +129,6 @@ func CredentialsSecretName(cd *hivev1.ClusterDeployment) string { return cd.Spec.Platform.Azure.CredentialsSecretRef.Name case p.OpenStack != nil: return cd.Spec.Platform.OpenStack.CredentialsSecretRef.Name - case p.Ovirt != nil: - return cd.Spec.Platform.Ovirt.CredentialsSecretRef.Name case p.BareMetal != nil: return "" case p.AgentBareMetal != nil: diff --git a/pkg/install/generate.go b/pkg/install/generate.go index eaec5f23447..7485dca6526 100644 --- a/pkg/install/generate.go +++ b/pkg/install/generate.go @@ -240,10 +240,6 @@ func InstallerPodSpec( // TODO: I don't think we actually use this dir. Can we get rid of it? emptyDirs["vsphere-credentials"] = constants.VSphereCredentialsDir emptyDirs["vsphere-certificates"] = constants.VSphereCertificatesDir - case cd.Spec.Platform.Ovirt != nil: - credentialRef, certificateRef = cd.Spec.Platform.Ovirt.CredentialsSecretRef.Name, cd.Spec.Platform.Ovirt.CertificatesSecretRef.Name - emptyDirs["ovirt-credentials"] = constants.OvirtCredentialsDir - emptyDirs["ovirt-certificates"] = constants.OvirtCertificatesDir case cd.Spec.Platform.IBMCloud != nil: credentialRef = cd.Spec.Platform.IBMCloud.CredentialsSecretRef.Name case cd.Spec.Platform.BareMetal != nil: @@ -531,8 +527,6 @@ func GenerateUninstallerJobForDeprovision( completeOpenStackDeprovisionJob(req, job) case req.Spec.Platform.VSphere != nil: completeVSphereDeprovisionJob(req, job) - case req.Spec.Platform.Ovirt != nil: - completeOvirtDeprovisionJob(req, job) case req.Spec.Platform.IBMCloud != nil: completeIBMCloudDeprovisionJob(req, job) case req.Spec.Platform.Nutanix != nil: @@ -841,32 +835,6 @@ func completeVSphereDeprovisionJob(req *hivev1.ClusterDeprovision, job *batchv1. job.Spec.Template.Spec.Volumes = volumes } -func completeOvirtDeprovisionJob(req *hivev1.ClusterDeprovision, job *batchv1.Job) { - env, volumes, volumeMounts := envAndVolumes( - req.Namespace, - "ovirt-credentials", constants.OvirtCredentialsDir, req.Spec.Platform.Ovirt.CredentialsSecretRef.Name, - "ovirt-certificates", constants.OvirtCertificatesDir, req.Spec.Platform.Ovirt.CertificatesSecretRef.Name) - - job.Spec.Template.Spec.Containers = []corev1.Container{ - { - Name: "deprovision", - Image: images.GetHiveImage(), - ImagePullPolicy: images.GetHiveImagePullPolicy(), - Env: env, - Command: []string{"/usr/bin/hiveutil"}, - Args: []string{ - "deprovision", "ovirt", - "--ovirt-cluster-id", req.Spec.Platform.Ovirt.ClusterID, - "--loglevel", "debug", - "--creds-dir", constants.OvirtCredentialsDir, - req.Spec.InfraID, - }, - VolumeMounts: volumeMounts, - }, - } - job.Spec.Template.Spec.Volumes = volumes -} - func completeIBMCloudDeprovisionJob(req *hivev1.ClusterDeprovision, job *batchv1.Job) { env, _, _ := envAndVolumes( req.Namespace, diff --git a/pkg/installmanager/installmanager.go b/pkg/installmanager/installmanager.go index 80b3ae969bb..267ce1143c6 100644 --- a/pkg/installmanager/installmanager.go +++ b/pkg/installmanager/installmanager.go @@ -47,7 +47,6 @@ import ( "github.com/openshift/installer/pkg/destroy/ibmcloud" "github.com/openshift/installer/pkg/destroy/nutanix" "github.com/openshift/installer/pkg/destroy/openstack" - "github.com/openshift/installer/pkg/destroy/ovirt" "github.com/openshift/installer/pkg/destroy/providers" "github.com/openshift/installer/pkg/destroy/vsphere" installertypes "github.com/openshift/installer/pkg/types" @@ -56,7 +55,6 @@ import ( installertypesibmcloud "github.com/openshift/installer/pkg/types/ibmcloud" installertypesnutanix "github.com/openshift/installer/pkg/types/nutanix" installertypesopenstack "github.com/openshift/installer/pkg/types/openstack" - installertypesovirt "github.com/openshift/installer/pkg/types/ovirt" installertypesvsphere "github.com/openshift/installer/pkg/types/vsphere" jsoniter "github.com/json-iterator/go" @@ -68,7 +66,6 @@ import ( ibmutils "github.com/openshift/hive/contrib/pkg/utils/ibmcloud" nutanixutils "github.com/openshift/hive/contrib/pkg/utils/nutanix" openstackutils "github.com/openshift/hive/contrib/pkg/utils/openstack" - ovirtutils "github.com/openshift/hive/contrib/pkg/utils/ovirt" vsphereutils "github.com/openshift/hive/contrib/pkg/utils/vsphere" "github.com/openshift/hive/pkg/awsclient" "github.com/openshift/hive/pkg/constants" @@ -548,8 +545,6 @@ func loadSecrets(m *InstallManager, cd *hivev1.ClusterDeployment) { openstackutils.ConfigureCreds(m.DynamicClient) case cd.Spec.Platform.VSphere != nil: vsphereutils.ConfigureCreds(m.DynamicClient) - case cd.Spec.Platform.Ovirt != nil: - ovirtutils.ConfigureCreds(m.DynamicClient) case cd.Spec.Platform.IBMCloud != nil: ibmutils.ConfigureCreds(m.DynamicClient) case cd.Spec.Platform.Nutanix != nil: @@ -765,21 +760,6 @@ func cleanupFailedProvision(dynClient client.Client, cd *hivev1.ClusterDeploymen if err != nil { return err } - case cd.Spec.Platform.Ovirt != nil: - metadata := &installertypes.ClusterMetadata{ - InfraID: infraID, - ClusterPlatformMetadata: installertypes.ClusterPlatformMetadata{ - Ovirt: &installertypesovirt.Metadata{ - ClusterID: cd.Spec.Platform.Ovirt.ClusterID, - RemoveTemplate: true, - }, - }, - } - var err error - uninstaller, err = ovirt.New(logger, metadata) - if err != nil { - return err - } case cd.Spec.Platform.IBMCloud != nil: // Create IBMCloud Client ibmCloudAPIKey := os.Getenv(constants.IBMCloudAPIKeyEnvVar) diff --git a/pkg/util/scheme/scheme.go b/pkg/util/scheme/scheme.go index d65d20b8823..0dd543aa330 100644 --- a/pkg/util/scheme/scheme.go +++ b/pkg/util/scheme/scheme.go @@ -31,7 +31,6 @@ import ( crv1alpha1 "k8s.io/cluster-registry/pkg/apis/clusterregistry/v1alpha1" apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1" - ovirtprovider "github.com/openshift/cluster-api-provider-ovirt/pkg/apis" hivev1 "github.com/openshift/hive/apis/hive/v1" hivecontractsv1alpha1 "github.com/openshift/hive/apis/hivecontracts/v1alpha1" hiveintv1alpha1 "github.com/openshift/hive/apis/hiveinternal/v1alpha1" @@ -68,7 +67,6 @@ func init() { monitoringv1.AddToScheme(hive_scheme) oappsv1.Install(hive_scheme) orbacv1.Install(hive_scheme) - ovirtprovider.AddToScheme(hive_scheme) rbacv1.AddToScheme(hive_scheme) routev1.AddToScheme(hive_scheme) velerov1.AddToScheme(hive_scheme) diff --git a/pkg/validating-webhooks/hive/v1/clusterdeployment_validating_admission_hook.go b/pkg/validating-webhooks/hive/v1/clusterdeployment_validating_admission_hook.go index a4a7119c2dd..e8c2597ea9c 100644 --- a/pkg/validating-webhooks/hive/v1/clusterdeployment_validating_admission_hook.go +++ b/pkg/validating-webhooks/hive/v1/clusterdeployment_validating_admission_hook.go @@ -529,22 +529,6 @@ func validateClusterPlatform(path *field.Path, platform hivev1.Platform) field.E allErrs = append(allErrs, field.Required(vspherePath.Child("defaultDatastore"), "must specify vSphere defaultDatastore")) } } - if ovirt := platform.Ovirt; ovirt != nil { - numberOfPlatforms++ - ovirtPath := path.Child("ovirt") - if ovirt.CredentialsSecretRef.Name == "" { - allErrs = append(allErrs, field.Required(ovirtPath.Child("credentialsSecretRef", "name"), "must specify secrets for oVirt access")) - } - if ovirt.CertificatesSecretRef.Name == "" { - allErrs = append(allErrs, field.Required(ovirtPath.Child("certificatesSecretRef", "name"), "must specify certificates for oVirt access")) - } - if ovirt.ClusterID == "" { - allErrs = append(allErrs, field.Required(ovirtPath.Child("ovirt_cluster_id"), "must specify ovirt_cluster_id")) - } - if ovirt.StorageDomainID == "" { - allErrs = append(allErrs, field.Required(ovirtPath.Child("ovirt_storage_domain_id"), "must specify ovirt_storage_domain_id")) - } - } if ibmCloud := platform.IBMCloud; ibmCloud != nil { numberOfPlatforms++ ibmCloudPath := path.Child("ibmcloud") diff --git a/pkg/validating-webhooks/hive/v1/clusterdeployment_validating_admission_hook_test.go b/pkg/validating-webhooks/hive/v1/clusterdeployment_validating_admission_hook_test.go index 29ede736d71..ea5e50b282a 100644 --- a/pkg/validating-webhooks/hive/v1/clusterdeployment_validating_admission_hook_test.go +++ b/pkg/validating-webhooks/hive/v1/clusterdeployment_validating_admission_hook_test.go @@ -22,7 +22,6 @@ import ( hivev1ibmcloud "github.com/openshift/hive/apis/hive/v1/ibmcloud" hivev1nutanix "github.com/openshift/hive/apis/hive/v1/nutanix" hivev1openstack "github.com/openshift/hive/apis/hive/v1/openstack" - hivev1ovirt "github.com/openshift/hive/apis/hive/v1/ovirt" hivev1vsphere "github.com/openshift/hive/apis/hive/v1/vsphere" hivecontractsv1alpha1 "github.com/openshift/hive/apis/hivecontracts/v1alpha1" @@ -156,17 +155,6 @@ func validNutanixClusterDeployment() *hivev1.ClusterDeployment { return cd } -func validOvirtClusterDeployment() *hivev1.ClusterDeployment { - cd := clusterDeploymentTemplate() - cd.Spec.Platform.Ovirt = &hivev1ovirt.Platform{ - ClusterID: "fake-cluster-uuid", - CredentialsSecretRef: corev1.LocalObjectReference{Name: "fake-creds-secret"}, - CertificatesSecretRef: corev1.LocalObjectReference{Name: "fake-cert-secret"}, - StorageDomainID: "fake-storage-domain-uuid", - } - return cd -} - func validIBMCloudClusterDeployment() *hivev1.ClusterDeployment { cd := clusterDeploymentTemplate() cd.Spec.Platform.IBMCloud = &hivev1ibmcloud.Platform{ @@ -1475,12 +1463,6 @@ func TestClusterDeploymentValidate(t *testing.T) { operation: admissionv1beta1.Create, expectedAllowed: true, }, - { - name: "oVirt create valid", - newObject: validOvirtClusterDeployment(), - operation: admissionv1beta1.Create, - expectedAllowed: true, - }, { name: "IBMCloud create valid", newObject: validIBMCloudClusterDeployment(), diff --git a/pkg/validating-webhooks/hive/v1/machinepool_validating_admission_hook.go b/pkg/validating-webhooks/hive/v1/machinepool_validating_admission_hook.go index 50fad0ba2ee..e25f90cd930 100644 --- a/pkg/validating-webhooks/hive/v1/machinepool_validating_admission_hook.go +++ b/pkg/validating-webhooks/hive/v1/machinepool_validating_admission_hook.go @@ -25,7 +25,6 @@ import ( hivev1ibmcloud "github.com/openshift/hive/apis/hive/v1/ibmcloud" hivev1nutanix "github.com/openshift/hive/apis/hive/v1/nutanix" hivev1openstack "github.com/openshift/hive/apis/hive/v1/openstack" - hivev1ovirt "github.com/openshift/hive/apis/hive/v1/ovirt" hivev1vsphere "github.com/openshift/hive/apis/hive/v1/vsphere" "github.com/openshift/hive/pkg/constants" ) @@ -304,10 +303,6 @@ func validateMachinePoolSpecInvariants(spec *hivev1.MachinePoolSpec, fldPath *fi platforms = append(platforms, "vsphere") allErrs = append(allErrs, validateVSphereMachinePoolPlatformInvariants(p, platformPath.Child("vsphere"))...) } - if p := spec.Platform.Ovirt; p != nil { - platforms = append(platforms, "ovirt") - allErrs = append(allErrs, validateOvirtMachinePoolPlatformInvariants(p, platformPath.Child("ovirt"))...) - } if p := spec.Platform.IBMCloud; p != nil { platforms = append(platforms, "ibmcloud") allErrs = append(allErrs, validateIBMCloudMachinePoolPlatformInvariants(p, platformPath.Child("ibmcloud"))...) @@ -428,11 +423,6 @@ func validateVSphereMachinePoolPlatformInvariants(platform *hivev1vsphere.Machin return allErrs } -func validateOvirtMachinePoolPlatformInvariants(platform *hivev1ovirt.MachinePool, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - return allErrs -} - func validateIBMCloudMachinePoolPlatformInvariants(platform *hivev1ibmcloud.MachinePool, fldPath *field.Path) field.ErrorList { allErrs := field.ErrorList{} return allErrs diff --git a/vendor/github.com/openshift/cluster-api-provider-ovirt/LICENSE b/vendor/github.com/openshift/cluster-api-provider-ovirt/LICENSE deleted file mode 100644 index a55243b7611..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-ovirt/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ -Copyright oVirt 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. - -A copy of the Apache License, Version 2.0 is included with the program -in the file ASL2. diff --git a/vendor/github.com/openshift/cluster-api-provider-ovirt/pkg/apis/apis.go b/vendor/github.com/openshift/cluster-api-provider-ovirt/pkg/apis/apis.go deleted file mode 100644 index d7a1c9ae8a6..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-ovirt/pkg/apis/apis.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright 2018 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. -*/ - -// Generate deepcopy for apis -//go:generate go run ../../vendor/sigs.k8s.io/controller-tools/cmd/controller-gen paths=./... object:headerFile=../../hack/boilerplate.go.txt - -// Package apis contains Kubernetes API groups. -package apis - -import ( - "k8s.io/apimachinery/pkg/runtime" - - "github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1" -) - -// AddToSchemes may be used to add all resources defined in the project to a Scheme -var AddToSchemes runtime.SchemeBuilder - -func init() { - // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back - AddToSchemes = append(AddToSchemes, v1beta1.SchemeBuilder.AddToScheme) -} - -// AddToScheme adds all Resources to the Scheme -func AddToScheme(s *runtime.Scheme) error { - return AddToSchemes.AddToScheme(s) -} diff --git a/vendor/github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1/doc.go b/vendor/github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1/doc.go deleted file mode 100644 index 74e1b67aaf3..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=github.com/rgolangh/cluster-api/cluster-api-provider-ovirt/pkg/apis/ovirtprovider -// +k8s:openapi-gen=true -// +k8s:defaulter-gen=TypeMeta -// +groupName=ovirtprovider.machine.openshift.io -package v1beta1 diff --git a/vendor/github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1/register.go b/vendor/github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1/register.go deleted file mode 100644 index 53f0b0931c8..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1/register.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -Copyright 2018 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. -*/ -// Package v1beta1 contains API Schema definitions for the ovirtprovider v1beta1 API group -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider -// +k8s:defaulter-gen=TypeMeta -// +groupName=ovirtprovider.machine.openshift.io -package v1beta1 - -import ( - "encoding/json" - "errors" - "fmt" - - machinev1 "github.com/openshift/api/machine/v1beta1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/klog" - "sigs.k8s.io/controller-runtime/pkg/scheme" - "sigs.k8s.io/yaml" -) - -const GroupName = "ovirtproviderconfig" - -var ( - // SchemeGroupVersion is group version used to register these objects - SchemeGroupVersion = schema.GroupVersion{Group: fmt.Sprintf("%s.machine.openshift.io", GroupName), Version: "v1beta1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} -) - -// MachineSpecFromProviderSpec -func MachineSpecFromProviderSpec(providerSpec machinev1.ProviderSpec) (*OvirtMachineProviderSpec, error) { - if providerSpec.Value == nil { - return nil, errors.New("no such providerSpec found in manifest") - } - var config OvirtMachineProviderSpec - if err := yaml.Unmarshal(providerSpec.Value.Raw, &config); err != nil { - return nil, err - } - return &config, nil -} - -// RawExtensionFromProviderSpec marshals the machine provider spec. -func RawExtensionFromProviderSpec(spec *OvirtMachineProviderSpec) (*runtime.RawExtension, error) { - if spec == nil { - return &runtime.RawExtension{}, nil - } - - var rawBytes []byte - var err error - if rawBytes, err = json.Marshal(spec); err != nil { - return nil, fmt.Errorf("error marshalling providerSpec: %v", err) - } - - return &runtime.RawExtension{ - Raw: rawBytes, - }, nil -} - -// RawExtensionFromProviderStatus marshals the provider status -func RawExtensionFromProviderStatus(status *OvirtMachineProviderStatus) (*runtime.RawExtension, error) { - if status == nil { - return &runtime.RawExtension{}, nil - } - - var rawBytes []byte - var err error - if rawBytes, err = json.Marshal(status); err != nil { - return nil, fmt.Errorf("error marshalling providerStatus: %v", err) - } - - return &runtime.RawExtension{ - Raw: rawBytes, - }, nil -} - -// ProviderSpecFromRawExtension unmarshals the JSON-encoded spec -func ProviderSpecFromRawExtension(rawExtension *runtime.RawExtension) (*OvirtMachineProviderSpec, error) { - if rawExtension == nil { - return &OvirtMachineProviderSpec{}, nil - } - - spec := new(OvirtMachineProviderSpec) - if err := yaml.Unmarshal(rawExtension.Raw, &spec); err != nil { - return nil, fmt.Errorf("error unmarshalling providerSpec: %v", err) - } - - klog.V(5).Infof("Got provider spec from raw extension: %+v", spec) - return spec, nil -} - -// ProviderStatusFromRawExtension unmarshals a raw extension into a OvirtMachineProviderStatus type -func ProviderStatusFromRawExtension(rawExtension *runtime.RawExtension) (*OvirtMachineProviderStatus, error) { - if rawExtension == nil { - return &OvirtMachineProviderStatus{}, nil - } - - providerStatus := new(OvirtMachineProviderStatus) - if err := yaml.Unmarshal(rawExtension.Raw, providerStatus); err != nil { - return nil, fmt.Errorf("error unmarshalling providerStatus: %v", err) - } - - klog.V(5).Infof("Got provider Status from raw extension: %+v", providerStatus) - return providerStatus, nil -} diff --git a/vendor/github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1/types.go b/vendor/github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1/types.go deleted file mode 100644 index 717f4c2b72e..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1/types.go +++ /dev/null @@ -1,187 +0,0 @@ -/* -Copyright 2018 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. -*/ - -package v1beta1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// OvirtMachineProviderSpec is the type that will be embedded in a Machine.Spec.ProviderSpec field -// for an Ovirt VM. It is used by the Ovirt machine actuator to create a single machine instance. -type OvirtMachineProviderSpec struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // UserDataSecret contains a local reference to a secret that contains the - // UserData to apply to the instance - UserDataSecret *corev1.LocalObjectReference `json:"userDataSecret,omitempty"` - - // CredentialsSecret is a reference to the secret with oVirt credentials. - CredentialsSecret *corev1.LocalObjectReference `json:"credentialsSecret,omitempty"` - - // Id is the UUID of the VM - Id string `json:"id"` - - // Name is the VM name - Name string `json:"name"` - - // The VM template this instance will be created from. - TemplateName string `json:"template_name"` - - // the oVirt cluster this VM instance belongs too. - ClusterId string `json:"cluster_id"` - - // InstanceTypeId defines the VM instance type and overrides - // the hardware parameters of the created VM, including cpu and memory. - // If InstanceTypeId is passed, all memory and cpu variables will be ignored. - InstanceTypeId string `json:"instance_type_id,omitempty"` - - // CPU defines the VM CPU. - CPU *CPU `json:"cpu,omitempty"` - - // MemoryMB is the size of a VM's memory in MiBs. - MemoryMB int32 `json:"memory_mb,omitempty"` - - // OSDisk is the the root disk of the node. - OSDisk *Disk `json:"os_disk,omitempty"` - - // VMType defines the workload type the instance will - // be used for and this effects the instance parameters. - // One of "desktop, server, high_performance" - VMType string `json:"type,omitempty"` - - // NetworkInterfaces defines the list of the network interfaces of the VM. - // All network interfaces from the template are discarded and new ones will - // be created, unless the list is empty or nil - NetworkInterfaces []*NetworkInterface `json:"network_interfaces,omitempty"` - - // VMAffinityGroup contains the name of the OpenShift cluster affinity groups - // It will be used to add the newly created machine to the affinity groups - AffinityGroupsNames []string `json:"affinity_groups_names,omitempty"` - - // AutoPinningPolicy defines the policy to automatically set the CPU - // and NUMA including pinning to the host for the instance. - // One of "none, resize_and_pin" - AutoPinningPolicy string `json:"auto_pinning_policy,omitempty"` - - // Hugepages is the size of a VM's hugepages to use in KiBs. - // Only 2048 and 1048576 supported. - Hugepages int32 `json:"hugepages,omitempty"` - - // GuaranteedMemoryMB is the size of a VM's guaranteed memory in MiBs. - GuaranteedMemoryMB int32 `json:"guaranteed_memory_mb,omitempty"` - - // Clone makes sure that the disks are cloned from the template and are not linked. - // Defaults to true for high performance and server VM types, false for desktop types. - // - // Note: this option is not documented in the OpenShift documentation. This is intentional as it has sane defaults - // that shouldn't be changed unless needed for debugging or resolving issues in cooperation with Red Hat support. - // - // +optional - Clone *bool `json:"clone,omitempty"` - - // Sparse indicates that sparse provisioning should not be used and disks should be preallocated. - // Defaults to true. - // +optional - Sparse *bool `json:"sparse,omitempty"` - - // Format is the disk format that the disks are in. Can be "cow" or "raw". "raw" disables several features that - // may be needed, such as incremental backups. Defaults to "cow". - // +kubebuilder:validation:Enum="";raw;cow - // +optional - Format string `json:"format,omitempty"` -} - -// CPU defines the VM cpu, made of (Sockets * Cores * Threads) -type CPU struct { - // Sockets is the number of sockets for a VM. - // Total CPUs is (Sockets * Cores * Threads) - Sockets int32 `json:"sockets"` - - // Cores is the number of cores per socket. - // Total CPUs is (Sockets * Cores * Threads) - Cores int32 `json:"cores"` - - // Thread is the number of thread per core. - // Total CPUs is (Sockets * Cores * Threads) - Threads int32 `json:"threads"` -} - -type Disk struct { - // SizeGB size of the bootable disk in GiB. - SizeGB int64 `json:"size_gb"` -} - -// NetworkInterface defines a VM network interface -type NetworkInterface struct { - // VNICProfileID the id of the vNic profile - VNICProfileID string `json:"vnic_profile_id"` -} - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// OvirtClusterProviderSpec of an oVirt cluster -// +k8s:openapi-gen=true -type OvirtClusterProviderSpec struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` -} - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// OvirtClusterProviderStatus -// +k8s:openapi-gen=true -type OvirtClusterProviderStatus struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // CACertificate is a PEM encoded CA Certificate for the control plane nodes. - CACertificate []byte - - // CAPrivateKey is a PEM encoded PKCS1 CA PrivateKey for the control plane nodes. - CAPrivateKey []byte -} - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// OvirtMachineProviderStatus -type OvirtMachineProviderStatus struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // InstanceID is the ID of the instance in oVirt - // +optional - InstanceID *string `json:"instanceId,omitempty"` - - // InstanceState is the provisioning state of the oVirt Instance. - // +optional - InstanceState *string `json:"instanceState,omitempty"` -} - -func init() { - SchemeBuilder.Register(&OvirtMachineProviderSpec{}) - SchemeBuilder.Register(&OvirtMachineProviderStatus{}) - SchemeBuilder.Register(&OvirtClusterProviderSpec{}) - SchemeBuilder.Register(&OvirtClusterProviderStatus{}) -} diff --git a/vendor/github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1/zz_generated.deepcopy.go b/vendor/github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1/zz_generated.deepcopy.go deleted file mode 100644 index 873a50a7c66..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1/zz_generated.deepcopy.go +++ /dev/null @@ -1,217 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright oVirt Authors -SPDX-License-Identifier: Apache-2.0 -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CPU) DeepCopyInto(out *CPU) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CPU. -func (in *CPU) DeepCopy() *CPU { - if in == nil { - return nil - } - out := new(CPU) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Disk) DeepCopyInto(out *Disk) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Disk. -func (in *Disk) DeepCopy() *Disk { - if in == nil { - return nil - } - out := new(Disk) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NetworkInterface) DeepCopyInto(out *NetworkInterface) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkInterface. -func (in *NetworkInterface) DeepCopy() *NetworkInterface { - if in == nil { - return nil - } - out := new(NetworkInterface) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OvirtClusterProviderSpec) DeepCopyInto(out *OvirtClusterProviderSpec) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OvirtClusterProviderSpec. -func (in *OvirtClusterProviderSpec) DeepCopy() *OvirtClusterProviderSpec { - if in == nil { - return nil - } - out := new(OvirtClusterProviderSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OvirtClusterProviderSpec) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OvirtClusterProviderStatus) DeepCopyInto(out *OvirtClusterProviderStatus) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.CACertificate != nil { - in, out := &in.CACertificate, &out.CACertificate - *out = make([]byte, len(*in)) - copy(*out, *in) - } - if in.CAPrivateKey != nil { - in, out := &in.CAPrivateKey, &out.CAPrivateKey - *out = make([]byte, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OvirtClusterProviderStatus. -func (in *OvirtClusterProviderStatus) DeepCopy() *OvirtClusterProviderStatus { - if in == nil { - return nil - } - out := new(OvirtClusterProviderStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OvirtClusterProviderStatus) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OvirtMachineProviderSpec) DeepCopyInto(out *OvirtMachineProviderSpec) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.UserDataSecret != nil { - in, out := &in.UserDataSecret, &out.UserDataSecret - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.CredentialsSecret != nil { - in, out := &in.CredentialsSecret, &out.CredentialsSecret - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.CPU != nil { - in, out := &in.CPU, &out.CPU - *out = new(CPU) - **out = **in - } - if in.OSDisk != nil { - in, out := &in.OSDisk, &out.OSDisk - *out = new(Disk) - **out = **in - } - if in.NetworkInterfaces != nil { - in, out := &in.NetworkInterfaces, &out.NetworkInterfaces - *out = make([]*NetworkInterface, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(NetworkInterface) - **out = **in - } - } - } - if in.AffinityGroupsNames != nil { - in, out := &in.AffinityGroupsNames, &out.AffinityGroupsNames - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OvirtMachineProviderSpec. -func (in *OvirtMachineProviderSpec) DeepCopy() *OvirtMachineProviderSpec { - if in == nil { - return nil - } - out := new(OvirtMachineProviderSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OvirtMachineProviderSpec) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OvirtMachineProviderStatus) DeepCopyInto(out *OvirtMachineProviderStatus) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.InstanceID != nil { - in, out := &in.InstanceID, &out.InstanceID - *out = new(string) - **out = **in - } - if in.InstanceState != nil { - in, out := &in.InstanceState, &out.InstanceState - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OvirtMachineProviderStatus. -func (in *OvirtMachineProviderStatus) DeepCopy() *OvirtMachineProviderStatus { - if in == nil { - return nil - } - out := new(OvirtMachineProviderStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OvirtMachineProviderStatus) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} diff --git a/vendor/github.com/openshift/hive/apis/hive/v1/clusterdeployment_types.go b/vendor/github.com/openshift/hive/apis/hive/v1/clusterdeployment_types.go index bdffe3c4a3e..1a2e2adef96 100644 --- a/vendor/github.com/openshift/hive/apis/hive/v1/clusterdeployment_types.go +++ b/vendor/github.com/openshift/hive/apis/hive/v1/clusterdeployment_types.go @@ -14,7 +14,6 @@ import ( "github.com/openshift/hive/apis/hive/v1/none" "github.com/openshift/hive/apis/hive/v1/nutanix" "github.com/openshift/hive/apis/hive/v1/openstack" - "github.com/openshift/hive/apis/hive/v1/ovirt" "github.com/openshift/hive/apis/hive/v1/vsphere" ) @@ -667,9 +666,6 @@ type Platform struct { // VSphere is the configuration used when installing on vSphere VSphere *vsphere.Platform `json:"vsphere,omitempty"` - // Ovirt is the configuration used when installing on oVirt - Ovirt *ovirt.Platform `json:"ovirt,omitempty"` - // AgentBareMetal is the configuration used when performing an Assisted Agent based installation // to bare metal. AgentBareMetal *agent.BareMetalPlatform `json:"agentBareMetal,omitempty"` diff --git a/vendor/github.com/openshift/hive/apis/hive/v1/clusterdeprovision_types.go b/vendor/github.com/openshift/hive/apis/hive/v1/clusterdeprovision_types.go index 56ff18e153f..a4a6bf79d7f 100644 --- a/vendor/github.com/openshift/hive/apis/hive/v1/clusterdeprovision_types.go +++ b/vendor/github.com/openshift/hive/apis/hive/v1/clusterdeprovision_types.go @@ -51,8 +51,6 @@ type ClusterDeprovisionPlatform struct { OpenStack *OpenStackClusterDeprovision `json:"openstack,omitempty"` // VSphere contains VMWare vSphere-specific deprovision settings VSphere *VSphereClusterDeprovision `json:"vsphere,omitempty"` - // Ovirt contains oVirt-specific deprovision settings - Ovirt *OvirtClusterDeprovision `json:"ovirt,omitempty"` // IBMCloud contains IBM Cloud specific deprovision settings IBMCloud *IBMClusterDeprovision `json:"ibmcloud,omitempty"` // Nutanix contains Nutanix-specific deprovision settings @@ -134,18 +132,6 @@ type VSphereClusterDeprovision struct { VCenter string `json:"vCenter"` } -// OvirtClusterDeprovision contains oVirt-specific configuration for a ClusterDeprovision -type OvirtClusterDeprovision struct { - // The oVirt cluster ID - ClusterID string `json:"clusterID"` - // CredentialsSecretRef is the oVirt account credentials to use for deprovisioning the cluster - // secret fields: ovirt_url, ovirt_username, ovirt_password, ovirt_ca_bundle - CredentialsSecretRef corev1.LocalObjectReference `json:"credentialsSecretRef"` - // CertificatesSecretRef refers to a secret that contains the oVirt CA certificates - // necessary for communicating with the oVirt. - CertificatesSecretRef corev1.LocalObjectReference `json:"certificatesSecretRef"` -} - // IBMClusterDeprovision contains IBM Cloud specific configuration for a ClusterDeprovision type IBMClusterDeprovision struct { // CredentialsSecretRef is the IBM Cloud credentials to use for deprovisioning the cluster diff --git a/vendor/github.com/openshift/hive/apis/hive/v1/machinepool_types.go b/vendor/github.com/openshift/hive/apis/hive/v1/machinepool_types.go index beea46416a2..707536c0505 100644 --- a/vendor/github.com/openshift/hive/apis/hive/v1/machinepool_types.go +++ b/vendor/github.com/openshift/hive/apis/hive/v1/machinepool_types.go @@ -10,7 +10,6 @@ import ( "github.com/openshift/hive/apis/hive/v1/ibmcloud" "github.com/openshift/hive/apis/hive/v1/nutanix" "github.com/openshift/hive/apis/hive/v1/openstack" - "github.com/openshift/hive/apis/hive/v1/ovirt" "github.com/openshift/hive/apis/hive/v1/vsphere" ) @@ -95,8 +94,6 @@ type MachinePoolPlatform struct { OpenStack *openstack.MachinePool `json:"openstack,omitempty"` // VSphere is the configuration used when installing on vSphere VSphere *vsphere.MachinePool `json:"vsphere,omitempty"` - // Ovirt is the configuration used when installing on oVirt. - Ovirt *ovirt.MachinePool `json:"ovirt,omitempty"` // IBMCloud is the configuration used when installing on IBM Cloud. IBMCloud *ibmcloud.MachinePool `json:"ibmcloud,omitempty"` // Nutanix is the configuration used when installing on Nutanix prism central. diff --git a/vendor/github.com/openshift/hive/apis/hive/v1/ovirt/doc.go b/vendor/github.com/openshift/hive/apis/hive/v1/ovirt/doc.go deleted file mode 100644 index b0af1e4e824..00000000000 --- a/vendor/github.com/openshift/hive/apis/hive/v1/ovirt/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Package ovirt contains ovirt-specific structures for -// installer configuration and management. -// +k8s:deepcopy-gen=package -package ovirt diff --git a/vendor/github.com/openshift/hive/apis/hive/v1/ovirt/machinepool.go b/vendor/github.com/openshift/hive/apis/hive/v1/ovirt/machinepool.go deleted file mode 100644 index 5670b4647a9..00000000000 --- a/vendor/github.com/openshift/hive/apis/hive/v1/ovirt/machinepool.go +++ /dev/null @@ -1,61 +0,0 @@ -package ovirt - -// MachinePool stores the configuration for a machine pool installed -// on ovirt. -type MachinePool struct { - // CPU defines the VM CPU. - // +optional - CPU *CPU `json:"cpu,omitempty"` - - // MemoryMB is the size of a VM's memory in MiBs. - // +optional - MemoryMB int32 `json:"memoryMB,omitempty"` - - // OSDisk is the the root disk of the node. - // +optional - OSDisk *Disk `json:"osDisk,omitempty"` - - // VMType defines the workload type of the VM. - // +kubebuilder:validation:Enum="";desktop;server;high_performance - // +optional - VMType VMType `json:"vmType,omitempty"` -} - -// CPU defines the VM cpu, made of (Sockets * Cores). -type CPU struct { - // Sockets is the number of sockets for a VM. - // Total CPUs is (Sockets * Cores) - Sockets int32 `json:"sockets"` - - // Cores is the number of cores per socket. - // Total CPUs is (Sockets * Cores) - Cores int32 `json:"cores"` -} - -// Disk defines a VM disk -type Disk struct { - // SizeGB size of the bootable disk in GiB. - SizeGB int64 `json:"sizeGB"` -} - -// VMType defines the type of the VM, which will change the VM configuration, -// like including or excluding devices (like excluding sound-card), -// device configuration (like using multi-queues for vNic), and several other -// configuration tweaks. This doesn't effect properties like CPU count and amount of memory. -type VMType string - -const ( - // VMTypeDesktop set the VM type to desktop. Virtual machines optimized to act - // as desktop machines do have a sound card, use an image (thin allocation), - // and are stateless. - VMTypeDesktop VMType = "desktop" - // VMTypeServer sets the VM type to server. Virtual machines optimized to act - // as servers have no sound card, use a cloned disk image, and are not stateless. - VMTypeServer VMType = "server" - // VMTypeHighPerformance sets a VM type to high_performance which sets various - // properties of a VM to optimize for performance, like enabling headless mode, - // disabling usb, smart-card, and sound devices, enabling host cpu pass-through, - // multi-queues for vNics and several more items. - // See https://www.ovirt.org/develop/release-management/features/virt/high-performance-vm.html. - VMTypeHighPerformance VMType = "high_performance" -) diff --git a/vendor/github.com/openshift/hive/apis/hive/v1/ovirt/platform.go b/vendor/github.com/openshift/hive/apis/hive/v1/ovirt/platform.go deleted file mode 100644 index fc3b8b27668..00000000000 --- a/vendor/github.com/openshift/hive/apis/hive/v1/ovirt/platform.go +++ /dev/null @@ -1,22 +0,0 @@ -package ovirt - -import ( - corev1 "k8s.io/api/core/v1" -) - -// Platform stores all the global oVirt configuration -type Platform struct { - // The target cluster under which all VMs will run - ClusterID string `json:"ovirt_cluster_id"` - // CredentialsSecretRef refers to a secret that contains the oVirt account access - // credentials with fields: ovirt_url, ovirt_username, ovirt_password, ovirt_ca_bundle - CredentialsSecretRef corev1.LocalObjectReference `json:"credentialsSecretRef"` - // CertificatesSecretRef refers to a secret that contains the oVirt CA certificates - // necessary for communicating with oVirt. - CertificatesSecretRef corev1.LocalObjectReference `json:"certificatesSecretRef"` - // The target storage domain under which all VM disk would be created. - StorageDomainID string `json:"storage_domain_id"` - // The target network of all the network interfaces of the nodes. Omitting defaults to ovirtmgmt - // network which is a default network for evert ovirt cluster. - NetworkName string `json:"ovirt_network_name,omitempty"` -} diff --git a/vendor/github.com/openshift/hive/apis/hive/v1/ovirt/zz_generated.deepcopy.go b/vendor/github.com/openshift/hive/apis/hive/v1/ovirt/zz_generated.deepcopy.go deleted file mode 100644 index b2fe4f9944d..00000000000 --- a/vendor/github.com/openshift/hive/apis/hive/v1/ovirt/zz_generated.deepcopy.go +++ /dev/null @@ -1,82 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package ovirt - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CPU) DeepCopyInto(out *CPU) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CPU. -func (in *CPU) DeepCopy() *CPU { - if in == nil { - return nil - } - out := new(CPU) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Disk) DeepCopyInto(out *Disk) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Disk. -func (in *Disk) DeepCopy() *Disk { - if in == nil { - return nil - } - out := new(Disk) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachinePool) DeepCopyInto(out *MachinePool) { - *out = *in - if in.CPU != nil { - in, out := &in.CPU, &out.CPU - *out = new(CPU) - **out = **in - } - if in.OSDisk != nil { - in, out := &in.OSDisk, &out.OSDisk - *out = new(Disk) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePool. -func (in *MachinePool) DeepCopy() *MachinePool { - if in == nil { - return nil - } - out := new(MachinePool) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Platform) DeepCopyInto(out *Platform) { - *out = *in - out.CredentialsSecretRef = in.CredentialsSecretRef - out.CertificatesSecretRef = in.CertificatesSecretRef - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Platform. -func (in *Platform) DeepCopy() *Platform { - if in == nil { - return nil - } - out := new(Platform) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/github.com/openshift/hive/apis/hive/v1/zz_generated.deepcopy.go b/vendor/github.com/openshift/hive/apis/hive/v1/zz_generated.deepcopy.go index f826cc80293..b6cb96ad331 100644 --- a/vendor/github.com/openshift/hive/apis/hive/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/hive/apis/hive/v1/zz_generated.deepcopy.go @@ -17,7 +17,6 @@ import ( none "github.com/openshift/hive/apis/hive/v1/none" nutanix "github.com/openshift/hive/apis/hive/v1/nutanix" openstack "github.com/openshift/hive/apis/hive/v1/openstack" - ovirt "github.com/openshift/hive/apis/hive/v1/ovirt" vsphere "github.com/openshift/hive/apis/hive/v1/vsphere" corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" @@ -1072,11 +1071,6 @@ func (in *ClusterDeprovisionPlatform) DeepCopyInto(out *ClusterDeprovisionPlatfo *out = new(VSphereClusterDeprovision) **out = **in } - if in.Ovirt != nil { - in, out := &in.Ovirt, &out.Ovirt - *out = new(OvirtClusterDeprovision) - **out = **in - } if in.IBMCloud != nil { in, out := &in.IBMCloud, &out.IBMCloud *out = new(IBMClusterDeprovision) @@ -3071,11 +3065,6 @@ func (in *MachinePoolPlatform) DeepCopyInto(out *MachinePoolPlatform) { *out = new(vsphere.MachinePool) (*in).DeepCopyInto(*out) } - if in.Ovirt != nil { - in, out := &in.Ovirt, &out.Ovirt - *out = new(ovirt.MachinePool) - (*in).DeepCopyInto(*out) - } if in.IBMCloud != nil { in, out := &in.IBMCloud, &out.IBMCloud *out = new(ibmcloud.MachinePool) @@ -3372,24 +3361,6 @@ func (in *OpenStackClusterDeprovision) DeepCopy() *OpenStackClusterDeprovision { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OvirtClusterDeprovision) DeepCopyInto(out *OvirtClusterDeprovision) { - *out = *in - out.CredentialsSecretRef = in.CredentialsSecretRef - out.CertificatesSecretRef = in.CertificatesSecretRef - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OvirtClusterDeprovision. -func (in *OvirtClusterDeprovision) DeepCopy() *OvirtClusterDeprovision { - if in == nil { - return nil - } - out := new(OvirtClusterDeprovision) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PatchEntity) DeepCopyInto(out *PatchEntity) { *out = *in @@ -3439,11 +3410,6 @@ func (in *Platform) DeepCopyInto(out *Platform) { *out = new(vsphere.Platform) **out = **in } - if in.Ovirt != nil { - in, out := &in.Ovirt, &out.Ovirt - *out = new(ovirt.Platform) - **out = **in - } if in.AgentBareMetal != nil { in, out := &in.AgentBareMetal, &out.AgentBareMetal *out = new(agent.BareMetalPlatform) diff --git a/vendor/github.com/openshift/installer/pkg/asset/machines/ovirt/OWNERS b/vendor/github.com/openshift/installer/pkg/asset/machines/ovirt/OWNERS deleted file mode 100644 index 0c8d12c37a6..00000000000 --- a/vendor/github.com/openshift/installer/pkg/asset/machines/ovirt/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md -# This file just uses aliases defined in OWNERS_ALIASES. - -approvers: - - ovirt-approvers -reviewers: - - ovirt-reviewers diff --git a/vendor/github.com/openshift/installer/pkg/asset/machines/ovirt/machines.go b/vendor/github.com/openshift/installer/pkg/asset/machines/ovirt/machines.go deleted file mode 100644 index 059b5b037d2..00000000000 --- a/vendor/github.com/openshift/installer/pkg/asset/machines/ovirt/machines.go +++ /dev/null @@ -1,107 +0,0 @@ -// Package ovirt generates Machine objects for ovirt. -package ovirt - -import ( - "fmt" - - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - - machineapi "github.com/openshift/api/machine/v1beta1" - ovirtprovider "github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1" - "github.com/openshift/installer/pkg/types" - "github.com/openshift/installer/pkg/types/ovirt" -) - -// Machines returns a list of machines for a machinepool. -func Machines(clusterID string, config *types.InstallConfig, pool *types.MachinePool, osImage, role, userDataSecret string) ([]machineapi.Machine, error) { - if configPlatform := config.Platform.Name(); configPlatform != ovirt.Name { - return nil, fmt.Errorf("non-ovirt configuration: %q", configPlatform) - } - if poolPlatform := pool.Platform.Name(); poolPlatform != ovirt.Name { - return nil, fmt.Errorf("non-ovirt machine-pool: %q", poolPlatform) - } - platform := config.Platform.Ovirt - - total := int64(1) - if pool.Replicas != nil { - total = *pool.Replicas - } - provider := provider(platform, pool, userDataSecret, clusterID, osImage) - var machines []machineapi.Machine - for idx := int64(0); idx < total; idx++ { - machine := machineapi.Machine{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "machine.openshift.io/v1beta1", - Kind: "Machine", - }, - ObjectMeta: metav1.ObjectMeta{ - Namespace: "openshift-machine-api", - Name: fmt.Sprintf("%s-%s-%d", clusterID, pool.Name, idx), - Labels: map[string]string{ - "machine.openshift.io/cluster-api-cluster": clusterID, - "machine.openshift.io/cluster-api-machine-role": role, - "machine.openshift.io/cluster-api-machine-type": role, - }, - }, - Spec: machineapi.MachineSpec{ - ProviderSpec: machineapi.ProviderSpec{ - Value: &runtime.RawExtension{Object: provider}, - }, - // we don't need to set Versions, because we control those via cluster operators. - }, - } - machines = append(machines, machine) - } - - return machines, nil -} - -func provider(platform *ovirt.Platform, pool *types.MachinePool, userDataSecret string, clusterID string, osImage string) *ovirtprovider.OvirtMachineProviderSpec { - spec := ovirtprovider.OvirtMachineProviderSpec{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "ovirtproviderconfig.machine.openshift.io/v1beta1", - Kind: "OvirtMachineProviderSpec", - }, - UserDataSecret: &corev1.LocalObjectReference{Name: userDataSecret}, - CredentialsSecret: &corev1.LocalObjectReference{Name: "ovirt-credentials"}, - TemplateName: osImage, - ClusterId: platform.ClusterID, - InstanceTypeId: pool.Platform.Ovirt.InstanceTypeID, - MemoryMB: pool.Platform.Ovirt.MemoryMB, - VMType: string(pool.Platform.Ovirt.VMType), - AutoPinningPolicy: string(pool.Platform.Ovirt.AutoPinningPolicy), - Hugepages: int32(pool.Platform.Ovirt.Hugepages), - Clone: pool.Platform.Ovirt.Clone, - Sparse: pool.Platform.Ovirt.Sparse, - Format: pool.Platform.Ovirt.Format, - } - uniqueNewAG := make(map[string]ovirt.AffinityGroup) - for _, ag := range platform.AffinityGroups { - uniqueNewAG[ag.Name] = ag - } - ags := make([]string, len(pool.Platform.Ovirt.AffinityGroupsNames)) - for i, agName := range pool.Platform.Ovirt.AffinityGroupsNames { - if _, ok := uniqueNewAG[agName]; ok { - // add the cluster name only if the affinity group is created by the installer - ags[i] = clusterID + "-" + agName - } else { - ags[i] = agName - } - } - spec.AffinityGroupsNames = ags - if pool.Platform.Ovirt.CPU != nil { - spec.CPU = &ovirtprovider.CPU{ - Cores: pool.Platform.Ovirt.CPU.Cores, - Sockets: pool.Platform.Ovirt.CPU.Sockets, - Threads: 1, - } - } - if pool.Platform.Ovirt.OSDisk != nil { - spec.OSDisk = &ovirtprovider.Disk{ - SizeGB: pool.Platform.Ovirt.OSDisk.SizeGB, - } - } - return &spec -} diff --git a/vendor/github.com/openshift/installer/pkg/asset/machines/ovirt/machinesets.go b/vendor/github.com/openshift/installer/pkg/asset/machines/ovirt/machinesets.go deleted file mode 100644 index b83586ae9ea..00000000000 --- a/vendor/github.com/openshift/installer/pkg/asset/machines/ovirt/machinesets.go +++ /dev/null @@ -1,77 +0,0 @@ -// Package ovirt generates Machine objects for ovirt. -package ovirt - -import ( - "fmt" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/utils/pointer" - - machineapi "github.com/openshift/api/machine/v1beta1" - "github.com/openshift/installer/pkg/types" - "github.com/openshift/installer/pkg/types/ovirt" -) - -// MachineSets returns a list of machinesets for a machinepool. -func MachineSets(clusterID string, config *types.InstallConfig, pool *types.MachinePool, osImage, role, - userDataSecret string) ([]*machineapi.MachineSet, error) { - - if configPlatform := config.Platform.Name(); configPlatform != ovirt.Name { - return nil, fmt.Errorf("non-ovirt configuration: %q", configPlatform) - } - if poolPlatform := pool.Platform.Name(); poolPlatform != "" && poolPlatform != ovirt.Name { - return nil, fmt.Errorf("non-ovirt machine-pool: %q", poolPlatform) - } - platform := config.Platform.Ovirt - - total := int64(0) - if pool.Replicas != nil { - total = *pool.Replicas - } - - provider := provider(platform, pool, userDataSecret, clusterID, osImage) - name := fmt.Sprintf("%s-%s", clusterID, pool.Name) - mset := &machineapi.MachineSet{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "machine.openshift.io/v1beta1", - Kind: "MachineSet", - }, - ObjectMeta: metav1.ObjectMeta{ - Namespace: "openshift-machine-api", - Name: name, - Labels: map[string]string{ - "machine.openshift.io/cluster-api-cluster": clusterID, - "machine.openshift.io/cluster-api-machine-role": role, - "machine.openshift.io/cluster-api-machine-type": role, - }, - }, - Spec: machineapi.MachineSetSpec{ - Replicas: pointer.Int32Ptr(int32(total)), - Selector: metav1.LabelSelector{ - MatchLabels: map[string]string{ - "machine.openshift.io/cluster-api-machineset": name, - "machine.openshift.io/cluster-api-cluster": clusterID, - }, - }, - Template: machineapi.MachineTemplateSpec{ - ObjectMeta: machineapi.ObjectMeta{ - Labels: map[string]string{ - "machine.openshift.io/cluster-api-machineset": name, - "machine.openshift.io/cluster-api-cluster": clusterID, - "machine.openshift.io/cluster-api-machine-role": role, - "machine.openshift.io/cluster-api-machine-type": role, - }, - }, - Spec: machineapi.MachineSpec{ - ProviderSpec: machineapi.ProviderSpec{ - Value: &runtime.RawExtension{Object: provider}, - }, - // we don't need to set Versions, because we control those via cluster operators. - }, - }, - }, - } - - return []*machineapi.MachineSet{mset}, nil -} diff --git a/vendor/github.com/openshift/installer/pkg/destroy/ovirt/OWNERS b/vendor/github.com/openshift/installer/pkg/destroy/ovirt/OWNERS deleted file mode 100644 index 0c8d12c37a6..00000000000 --- a/vendor/github.com/openshift/installer/pkg/destroy/ovirt/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md -# This file just uses aliases defined in OWNERS_ALIASES. - -approvers: - - ovirt-approvers -reviewers: - - ovirt-reviewers diff --git a/vendor/github.com/openshift/installer/pkg/destroy/ovirt/destroyer.go b/vendor/github.com/openshift/installer/pkg/destroy/ovirt/destroyer.go deleted file mode 100644 index 9031dd9340f..00000000000 --- a/vendor/github.com/openshift/installer/pkg/destroy/ovirt/destroyer.go +++ /dev/null @@ -1,176 +0,0 @@ -package ovirt - -import ( - "fmt" - "strings" - "sync" - "time" - - "github.com/ovirt/go-ovirt" - "github.com/sirupsen/logrus" - - "github.com/openshift/installer/pkg/asset/installconfig/ovirt" - "github.com/openshift/installer/pkg/destroy/providers" - "github.com/openshift/installer/pkg/types" -) - -// ClusterUninstaller holds the various options for the cluster we want to delete. -type ClusterUninstaller struct { - Metadata types.ClusterMetadata - Logger logrus.FieldLogger -} - -// Run is the entrypoint to start the uninstall process. -func (uninstaller *ClusterUninstaller) Run() (*types.ClusterQuota, error) { - con, err := ovirt.NewConnection() - if err != nil { - return nil, fmt.Errorf("failed to initialize connection to ovirt-engine's %s", err) - } - defer con.Close() - - // Tags - tagVMs := uninstaller.Metadata.InfraID - tagVMbootstrap := uninstaller.Metadata.InfraID + "-bootstrap" - tags := [2]string{tagVMs, tagVMbootstrap} - - for _, tag := range tags { - if err := uninstaller.removeVMs(con, tag); err != nil { - uninstaller.Logger.Errorf("failed to remove VMs: %s", err) - } - if err := uninstaller.removeTag(con, tag); err != nil { - uninstaller.Logger.Errorf("failed to remove tag: %s", err) - } - } - if err := uninstaller.removeTemplate(con); err != nil { - uninstaller.Logger.Errorf("Failed to remove template: %s", err) - } - if err := uninstaller.removeAffinityGroups(con); err != nil { - uninstaller.Logger.Errorf("Failed to removing Affinity Groups: %s", err) - } - - return nil, nil -} - -func (uninstaller *ClusterUninstaller) removeVMs(con *ovirtsdk.Connection, tag string) error { - // - find all vms by tag name=infraID - vmsService := con.SystemService().VmsService() - searchTerm := fmt.Sprintf("tag=%s", tag) - uninstaller.Logger.Debugf("Searching VMs by %s", searchTerm) - vmsResponse, err := vmsService.List().Search(searchTerm).Send() - if err != nil { - return err - } - // - stop + delete VMS - vms := vmsResponse.MustVms().Slice() - uninstaller.Logger.Debugf("Found %d VMs", len(vms)) - wg := sync.WaitGroup{} - wg.Add(len(vms)) - for _, vm := range vms { - go func(vm *ovirtsdk.Vm) { - uninstaller.stopVM(vmsService, vm) - uninstaller.removeVM(vmsService, vm) - wg.Done() - }(vm) - } - wg.Wait() - return nil -} - -func (uninstaller *ClusterUninstaller) removeTag(con *ovirtsdk.Connection, tag string) error { - // finally remove the tag - tagsService := con.SystemService().TagsService() - tagsServiceListResponse, err := tagsService.List().Send() - if err != nil { - return err - } - if tagsServiceListResponse != nil { - for _, t := range tagsServiceListResponse.MustTags().Slice() { - if t.MustName() == tag { - uninstaller.Logger.Infof("Removing tag %s", t.MustName()) - _, err := tagsService.TagService(t.MustId()).Remove().Send() - if err != nil { - return err - } - } - } - } - return nil -} - -func (uninstaller *ClusterUninstaller) stopVM(vmsService *ovirtsdk.VmsService, vm *ovirtsdk.Vm) { - vmService := vmsService.VmService(vm.MustId()) - // this is a teardown, stopping instead of shutting down. - _, err := vmService.Stop().Send() - if err == nil { - uninstaller.Logger.Infof("Stopping VM %s", vm.MustName()) - } else { - uninstaller.Logger.Errorf("Failed to stop VM %s: %s", vm.MustName(), err) - } - waitForDownDuration := time.Minute * 10 - err = vmService.Connection().WaitForVM(vm.MustId(), ovirtsdk.VMSTATUS_DOWN, waitForDownDuration) - if err == nil { - uninstaller.Logger.Infof("VM %s powered off", vm.MustName()) - } else { - uninstaller.Logger.Warnf("Waited %d for VM %s to power off: %s", waitForDownDuration, vm.MustName(), err) - } -} - -func (uninstaller *ClusterUninstaller) removeVM(vmsService *ovirtsdk.VmsService, vm *ovirtsdk.Vm) { - vmService := vmsService.VmService(vm.MustId()) - _, err := vmService.Remove().Send() - if err == nil { - uninstaller.Logger.Infof("Removing VM %s", vm.MustName()) - } else { - uninstaller.Logger.Errorf("Failed to remove VM %s: %s", vm.MustName(), err) - } -} - -func (uninstaller *ClusterUninstaller) removeTemplate(con *ovirtsdk.Connection) error { - if uninstaller.Metadata.Ovirt.RemoveTemplate { - search, err := con.SystemService().TemplatesService(). - List().Search(fmt.Sprintf("name=%s-rhcos", uninstaller.Metadata.InfraID)).Send() - if err != nil { - return fmt.Errorf("couldn't find a template with name %s", uninstaller.Metadata.InfraID) - } - if result, ok := search.Templates(); ok { - // the results can potentially return a list of template - // because the search uses wildcards - for _, tmp := range result.Slice() { - uninstaller.Logger.Infof("Removing Template %s", tmp.MustName()) - service := con.SystemService().TemplatesService().TemplateService(tmp.MustId()) - _, err := service.Remove().Send() - if err != nil { - return err - } - } - } - } - return nil -} - -func (uninstaller *ClusterUninstaller) removeAffinityGroups(con *ovirtsdk.Connection) error { - cID := uninstaller.Metadata.Ovirt.ClusterID - affinityGroupService := con.SystemService().ClustersService().ClusterService(cID).AffinityGroupsService() - res, err := affinityGroupService.List().Send() - if err != nil { - return err - } - for _, ag := range res.MustGroups().Slice() { - if strings.HasPrefix(ag.MustName(), fmt.Sprintf("%s-", uninstaller.Metadata.InfraID)) { - uninstaller.Logger.Infof("Removing AffinityGroup %s", ag.MustName()) - _, err := affinityGroupService.GroupService(ag.MustId()).Remove().Send() - if err != nil { - uninstaller.Logger.Errorf("failed to remove AffinityGroup: %s", err) - } - } - } - return nil -} - -// New returns oVirt Uninstaller from ClusterMetadata. -func New(logger logrus.FieldLogger, metadata *types.ClusterMetadata) (providers.Destroyer, error) { - return &ClusterUninstaller{ - Metadata: *metadata, - Logger: logger, - }, nil -} diff --git a/vendor/github.com/openshift/installer/pkg/destroy/ovirt/doc.go b/vendor/github.com/openshift/installer/pkg/destroy/ovirt/doc.go deleted file mode 100644 index d19b31a1a8f..00000000000 --- a/vendor/github.com/openshift/installer/pkg/destroy/ovirt/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package ovirt provides a cluster-destroyer for ovirt clusters. -package ovirt diff --git a/vendor/github.com/openshift/installer/pkg/destroy/ovirt/register.go b/vendor/github.com/openshift/installer/pkg/destroy/ovirt/register.go deleted file mode 100644 index caeef6b7ea1..00000000000 --- a/vendor/github.com/openshift/installer/pkg/destroy/ovirt/register.go +++ /dev/null @@ -1,7 +0,0 @@ -package ovirt - -import "github.com/openshift/installer/pkg/destroy/providers" - -func init() { - providers.Registry["ovirt"] = New -} diff --git a/vendor/modules.txt b/vendor/modules.txt index f5c744c098f..9af89ada167 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1826,10 +1826,6 @@ github.com/openshift/client-go/machine/listers/machine/v1beta1 github.com/openshift/cloud-credential-operator/pkg/apis/cloudcredential/v1 github.com/openshift/cloud-credential-operator/pkg/aws github.com/openshift/cloud-credential-operator/pkg/version -# github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20220323121149-e3f2850dd519 -## explicit; go 1.17 -github.com/openshift/cluster-api-provider-ovirt/pkg/apis -github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1 # github.com/openshift/cluster-autoscaler-operator v0.0.1-0.20250219201631-227f7537c3b4 ## explicit; go 1.23.0 github.com/openshift/cluster-autoscaler-operator/pkg/apis/autoscaling/v1 @@ -1860,7 +1856,6 @@ github.com/openshift/hive/apis/hive/v1/metricsconfig github.com/openshift/hive/apis/hive/v1/none github.com/openshift/hive/apis/hive/v1/nutanix github.com/openshift/hive/apis/hive/v1/openstack -github.com/openshift/hive/apis/hive/v1/ovirt github.com/openshift/hive/apis/hive/v1/vsphere github.com/openshift/hive/apis/hivecontracts/v1alpha1 github.com/openshift/hive/apis/hiveinternal/v1alpha1 @@ -1888,7 +1883,6 @@ github.com/openshift/installer/pkg/asset/machines/gcp github.com/openshift/installer/pkg/asset/machines/ibmcloud github.com/openshift/installer/pkg/asset/machines/nutanix github.com/openshift/installer/pkg/asset/machines/openstack -github.com/openshift/installer/pkg/asset/machines/ovirt github.com/openshift/installer/pkg/asset/machines/vsphere github.com/openshift/installer/pkg/asset/manifests/capiutils github.com/openshift/installer/pkg/asset/manifests/gcp @@ -1899,7 +1893,6 @@ github.com/openshift/installer/pkg/destroy/gcp github.com/openshift/installer/pkg/destroy/ibmcloud github.com/openshift/installer/pkg/destroy/nutanix github.com/openshift/installer/pkg/destroy/openstack -github.com/openshift/installer/pkg/destroy/ovirt github.com/openshift/installer/pkg/destroy/providers github.com/openshift/installer/pkg/destroy/vsphere github.com/openshift/installer/pkg/hostcrypt