Bug 1870513

Summary: GCS driver does not create user provided bucket
Product: OpenShift Container Platform Reporter: Ricardo Maraschini <rmarasch>
Component: Image RegistryAssignee: Ricardo Maraschini <rmarasch>
Status: CLOSED ERRATA QA Contact: Wenjing Zheng <wzheng>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.5CC: aos-bugs, pasik
Target Milestone: ---   
Target Release: 4.6.0   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Operator does not create bucket manually provided by the user. Consequence: Operator remains in Progressing. Fix: By correctly validating GCS api return we can now identify the specific error related to a non-existing bucket. Based on the error proper identification we can now create the bucket. Result: User can now provide a bucket name and if it does not exist Operator will create it.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-27 16:29:46 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:

Description Ricardo Maraschini 2020-08-20 09:19:58 UTC
Description of problem:

GCP should (as Azure driver does) create the bucket provided by user if it does not exist. What is happening is that if user manually provides a bucket name the driver does not create it and the operator remains in Progressing.

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


How reproducible:


Steps to Reproduce:
1. Edit the image registry operator config
2. Change the bucket name (spec.storage.gcs.bucket) to a random name

Actual results:

Operator remains in Progressing with the following condition:

$ oc get -o json configs.imageregistry.operator.openshift.io/cluster | jq
    "lastTransitionTime": "2020-08-20T09:12:37Z",
    "message": "storage: bucket doesn't exist",
    "reason": "Unknown Error Occurred",
    "status": "Unknown",
    "type": "StorageExists"
    "lastTransitionTime": "2020-08-20T09:12:37Z",
    "message": "Unable to apply resources: unable to sync storage configuration: storage: bucket doesn't exist",
    "reason": "Error",
    "status": "True",
    "type": "Progressing"

Expected results:

Supplied bucket is created and the container leaves the Progressing.

Additional info:

Comment 3 Wenjing Zheng 2020-08-26 03:33:54 UTC
Verified on 4.6.0-0.nightly-2020-08-25-222652, gcs.bucket can be changed to random one:
      bucket: wzheng-test-gcs
      projectID: openshift-qe
      region: us-central1

Comment 5 errata-xmlrpc 2020-10-27 16:29:46 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.