Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sp98 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
2406192 to
5ace6fd
Compare
if storagecluster spec.ManagedResources.CephObjectStores.DisableHttp is true, then skip creating RGW http routes, delete any existing RGW http route that was created previously and set cephObjectstore spec.gateway.port (unsecure port) to 0. Signed-off-by: Santosh <sapillai@redhat.com>
5ace6fd to
c037106
Compare
| routeName := util.GenerateNameForCephObjectStore(sc) | ||
| foundRoute := &routev1.Route{} | ||
| err := r.Client.Get(context.TODO(), types.NamespacedName{Name: routeName, Namespace: sc.Namespace}, foundRoute) | ||
| if err != nil { | ||
| if errors.IsNotFound(err) { | ||
| r.Log.Info("Http Ceph RGW Route not found, nothing to delete.", "CephRGWRoute", klog.KRef(sc.Namespace, routeName)) | ||
| return nil | ||
| } | ||
| return fmt.Errorf("failed to retrieve Http Ceph RGW Route %v: %v", routeName, err) | ||
| } | ||
|
|
||
| r.Log.Info("Deleting http Ceph RGW Route.", "CephRGWRoute", klog.KRef(sc.Namespace, routeName)) | ||
| err = r.Client.Delete(context.TODO(), foundRoute) | ||
| if err != nil { | ||
| r.Log.Error(err, "Failed to delete http Ceph RGW Route.", "CephRGWRoute", klog.KRef(sc.Namespace, routeName)) | ||
| return fmt.Errorf("failed to delete http Ceph RGW Route %v: %v", routeName, err) | ||
| } |
There was a problem hiding this comment.
Nit: This could be a single delete call instead, which would save a cache lookup in the controller-runtime cahche. This point is pretty minor, however.
BlaineEXE
left a comment
There was a problem hiding this comment.
Looks good to me. I think the ocs-operator team has final approval, so I will just mark a comment for now. LMK if a full approval would be better.
This PR:
DisableHttpatSpec.ManagedResources.CephObjectStores.DisableHttpspec.gateway.port(unsecure port) to 0.PR is related to 4.22 Epic - https://issues.redhat.com/browse/RHSTOR-8168
Testing
Before disabling rgw http
After disabling Http route