From 2509d989c6a5af32ad3d835e19e9f76f3a9bab36 Mon Sep 17 00:00:00 2001 From: Blaine Gardner Date: Fri, 14 Jun 2024 10:44:04 -0600 Subject: [PATCH] Revert "rgw: add vhost style support for rgw in ocs-op" and related Revert "Bug 2273553: initalise objectstore.spec.hosting for virtualHostnames" This reverts commit f9d3ce89ea153e36f412f0f4fe72e83481669e3a. This reverts commit 1098627b49fbccc194a0bfe4dc3196efa40c793c. Signed-off-by: Blaine Gardner --- api/v1/storagecluster_types.go | 3 +-- api/v1/zz_generated.deepcopy.go | 5 ---- .../ocs.openshift.io_storageclusters.yaml | 4 --- .../storagecluster/cephobjectstores.go | 25 ------------------- .../ocs/ocs.openshift.io_storageclusters.yaml | 4 --- .../manifests/storagecluster.crd.yaml | 4 --- .../api/v4/v1/storagecluster_types.go | 3 +-- .../api/v4/v1/zz_generated.deepcopy.go | 5 ---- .../api/v4/v1/storagecluster_types.go | 3 +-- .../api/v4/v1/zz_generated.deepcopy.go | 5 ---- 10 files changed, 3 insertions(+), 58 deletions(-) diff --git a/api/v1/storagecluster_types.go b/api/v1/storagecluster_types.go index b22cac4e48..37c6d23ccf 100644 --- a/api/v1/storagecluster_types.go +++ b/api/v1/storagecluster_types.go @@ -290,8 +290,7 @@ type ManageCephObjectStores struct { // StorageClassName specifies the name of the storage class created for ceph obc's // +kubebuilder:validation:MaxLength=253 // +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ - StorageClassName string `json:"storageClassName,omitempty"` - VirtualHostnames []string `json:"virtualHostnames,omitempty"` + StorageClassName string `json:"storageClassName,omitempty"` } // ManageCephObjectStoreUsers defines how to reconcile CephObjectStoreUsers diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index c4344a41f9..0c1983695b 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -400,11 +400,6 @@ func (in *ManageCephObjectStores) DeepCopyInto(out *ManageCephObjectStores) { *out = new(bool) **out = **in } - if in.VirtualHostnames != nil { - in, out := &in.VirtualHostnames, &out.VirtualHostnames - *out = make([]string, len(*in)) - copy(*out, *in) - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManageCephObjectStores. diff --git a/config/crd/bases/ocs.openshift.io_storageclusters.yaml b/config/crd/bases/ocs.openshift.io_storageclusters.yaml index 5063920307..2d6624c337 100644 --- a/config/crd/bases/ocs.openshift.io_storageclusters.yaml +++ b/config/crd/bases/ocs.openshift.io_storageclusters.yaml @@ -1813,10 +1813,6 @@ spec: maxLength: 253 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ type: string - virtualHostnames: - items: - type: string - type: array type: object cephRBDMirror: description: ManageCephRBDMirror defines how to reconcile Ceph diff --git a/controllers/storagecluster/cephobjectstores.go b/controllers/storagecluster/cephobjectstores.go index 04ee9a6571..a36ebd2980 100644 --- a/controllers/storagecluster/cephobjectstores.go +++ b/controllers/storagecluster/cephobjectstores.go @@ -4,7 +4,6 @@ import ( "context" "fmt" - routev1 "github.com/openshift/api/route/v1" ocsv1 "github.com/red-hat-storage/ocs-operator/api/v4/v1" "github.com/red-hat-storage/ocs-operator/v4/controllers/defaults" "github.com/red-hat-storage/ocs-operator/v4/controllers/platform" @@ -202,30 +201,6 @@ func (r *StorageClusterReconciler) newCephObjectStoreInstances(initData *ocsv1.S return nil, err } - if len(initData.Spec.ManagedResources.CephObjectStores.VirtualHostnames) > 0 { - obj.Spec.Hosting = &cephv1.ObjectStoreHostingSpec{ - DNSNames: initData.Spec.ManagedResources.CephObjectStores.VirtualHostnames, - } - route := &routev1.Route{} - err := r.Client.Get(context.TODO(), types.NamespacedName{Name: obj.Name, Namespace: obj.Namespace}, route) - if err != nil { - if errors.IsNotFound(err) { - r.Log.Info("Ceph RGW Route not found.", "CephRGWRoute", klog.KRef(obj.Namespace, obj.Name)) - } - } else { - obj.Spec.Hosting.DNSNames = append(obj.Spec.Hosting.DNSNames, route.Spec.Host) - } - secureRoute := &routev1.Route{} - err = r.Client.Get(context.TODO(), types.NamespacedName{Name: obj.Name + "-secure", Namespace: obj.Namespace}, secureRoute) - if err != nil { - if errors.IsNotFound(err) { - r.Log.Info("Ceph RGW Route not found.", "CephRGWRoute", klog.KRef(obj.Namespace, obj.Name+"-secure")) - } - } else { - obj.Spec.Hosting.DNSNames = append(obj.Spec.Hosting.DNSNames, secureRoute.Spec.Host) - } - } - if initData.Spec.ManagedResources.CephObjectStores.HostNetwork != nil { obj.Spec.Gateway.HostNetwork = initData.Spec.ManagedResources.CephObjectStores.HostNetwork } diff --git a/deploy/csv-templates/crds/ocs/ocs.openshift.io_storageclusters.yaml b/deploy/csv-templates/crds/ocs/ocs.openshift.io_storageclusters.yaml index 5063920307..2d6624c337 100644 --- a/deploy/csv-templates/crds/ocs/ocs.openshift.io_storageclusters.yaml +++ b/deploy/csv-templates/crds/ocs/ocs.openshift.io_storageclusters.yaml @@ -1813,10 +1813,6 @@ spec: maxLength: 253 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ type: string - virtualHostnames: - items: - type: string - type: array type: object cephRBDMirror: description: ManageCephRBDMirror defines how to reconcile Ceph diff --git a/deploy/ocs-operator/manifests/storagecluster.crd.yaml b/deploy/ocs-operator/manifests/storagecluster.crd.yaml index e195fdac1d..cd3cf8dad4 100644 --- a/deploy/ocs-operator/manifests/storagecluster.crd.yaml +++ b/deploy/ocs-operator/manifests/storagecluster.crd.yaml @@ -1812,10 +1812,6 @@ spec: maxLength: 253 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ type: string - virtualHostnames: - items: - type: string - type: array type: object cephRBDMirror: description: ManageCephRBDMirror defines how to reconcile Ceph diff --git a/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storagecluster_types.go b/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storagecluster_types.go index b22cac4e48..37c6d23ccf 100644 --- a/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storagecluster_types.go +++ b/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storagecluster_types.go @@ -290,8 +290,7 @@ type ManageCephObjectStores struct { // StorageClassName specifies the name of the storage class created for ceph obc's // +kubebuilder:validation:MaxLength=253 // +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ - StorageClassName string `json:"storageClassName,omitempty"` - VirtualHostnames []string `json:"virtualHostnames,omitempty"` + StorageClassName string `json:"storageClassName,omitempty"` } // ManageCephObjectStoreUsers defines how to reconcile CephObjectStoreUsers diff --git a/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/zz_generated.deepcopy.go b/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/zz_generated.deepcopy.go index c4344a41f9..0c1983695b 100644 --- a/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/zz_generated.deepcopy.go +++ b/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/zz_generated.deepcopy.go @@ -400,11 +400,6 @@ func (in *ManageCephObjectStores) DeepCopyInto(out *ManageCephObjectStores) { *out = new(bool) **out = **in } - if in.VirtualHostnames != nil { - in, out := &in.VirtualHostnames, &out.VirtualHostnames - *out = make([]string, len(*in)) - copy(*out, *in) - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManageCephObjectStores. diff --git a/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storagecluster_types.go b/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storagecluster_types.go index b22cac4e48..37c6d23ccf 100644 --- a/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storagecluster_types.go +++ b/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storagecluster_types.go @@ -290,8 +290,7 @@ type ManageCephObjectStores struct { // StorageClassName specifies the name of the storage class created for ceph obc's // +kubebuilder:validation:MaxLength=253 // +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ - StorageClassName string `json:"storageClassName,omitempty"` - VirtualHostnames []string `json:"virtualHostnames,omitempty"` + StorageClassName string `json:"storageClassName,omitempty"` } // ManageCephObjectStoreUsers defines how to reconcile CephObjectStoreUsers diff --git a/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/zz_generated.deepcopy.go b/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/zz_generated.deepcopy.go index c4344a41f9..0c1983695b 100644 --- a/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/zz_generated.deepcopy.go @@ -400,11 +400,6 @@ func (in *ManageCephObjectStores) DeepCopyInto(out *ManageCephObjectStores) { *out = new(bool) **out = **in } - if in.VirtualHostnames != nil { - in, out := &in.VirtualHostnames, &out.VirtualHostnames - *out = make([]string, len(*in)) - copy(*out, *in) - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManageCephObjectStores.