Bug 1833109

Summary: storageManaged stays true if spec.storage is changed
Product: OpenShift Container Platform Reporter: Oleg Bulatov <obulatov>
Component: Image RegistryAssignee: Ricardo Maraschini <rmarasch>
Status: CLOSED ERRATA QA Contact: Wenjing Zheng <wzheng>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.1.zCC: adam.kaplan, aos-bugs, jkaur, joboyer, openshift-bugs-escalate, pasik, pjakobs, rekhan, rkshirsa, wewang
Target Milestone: ---   
Target Release: 4.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: After initial operator bootstrap storageManaged was set to true on status. If user decided to update the storage config manually this field remained as true. Consequence: 1. When setting the registry as Removed it attempts to delete its storage, on the scenario where the user manually updated the config it will attempt to remove user provided storage. 2. With storageManaged as true the operator attempts to sets some defaults on the storage (such as encryption), on the scenario where the user provided config manually this should not be done. Fix: Providing an extra config field (spec.storage.storageManagementState) so user can indicate its intention with regard with managing the storage. This field accepts Managed or Unmanaged, on the latter the operator won't try to delete the storage and or apply its defaults. Result: User can now indicate that the storage should not be managed by the operator by setting it to Unmanaged.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-27 15:58:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Oleg Bulatov 2020-05-07 19:54:35 UTC
Description of problem:

When I create a new bucket and want to use it for the registry instead of the bucket that was provided by the registry operator, the operator starts to manage.

Version-Release number of selected component (if applicable):


How reproducible:

always

Steps to Reproduce:
1. create a new bucket
2. update config.imageregistry spec.storage.s3.bucket, use the new bucket

Actual results:

The operator starts to use the new bucket, but status.storageManaged stays true.

Expected results:

storageManaged should become false.

Additional info:

Comment 3 Oleg Bulatov 2020-05-26 14:46:06 UTC
It's too risky to fix this in 4.5.0, moving to 4.6

Comment 17 Ricardo Maraschini 2020-09-01 08:21:06 UTC
*** Bug 1814709 has been marked as a duplicate of this bug. ***

Comment 18 Wenjing Zheng 2020-09-04 03:19:06 UTC
I still can see status.storageManaged==true when I use self-created bucket on 4.6.0-0.nightly-2020-09-03-191144:
 storage:
    managementState: Managed
    s3:
      bucket: wzheng-test-3
      encrypt: true
      region: us-east-1
      virtualHostedStyle: false
  storageManaged: true

Comment 19 Ricardo Maraschini 2020-09-04 08:44:58 UTC
This is by design, we bootstrap as Managed and only move to Unmanaged (or storageManaged = false) if the user asks for it. The idea here is, if the user wants to manage the storage by herself she must first change the Spec.Storage.ManagementState to Unmanaged, from this point on the operator won't touch the storage anymore.

Comment 20 Wenjing Zheng 2020-09-04 08:52:28 UTC
Thanks for the reply, Ricardo! Then this bug can be verified.

Comment 22 errata-xmlrpc 2020-10-27 15:58:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.6 GA Images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4196