Bug 2050557

Summary: Can not push images to image-registry when enabling KMS encryption in AlibabaCloud
Product: OpenShift Container Platform Reporter: OpenShift BugZilla Robot <openshift-bugzilla-robot>
Component: Image RegistryAssignee: Oleg Bulatov <obulatov>
Status: CLOSED ERRATA QA Contact: XiuJuan Wang <xiuwang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.10CC: aos-bugs, jsafrane, kwoodson
Target Milestone: ---   
Target Release: 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-10 16:43:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 2048214    
Bug Blocks:    

Comment 3 XiuJuan Wang 2022-02-09 09:47:48 UTC
Test on 4.10.0-0.nightly-2022-02-09-054720 cluster.

Scenario 1: Configure with KMS encrytions with valid keyid.
$oc patch config.image/cluster -p '{"spec":{"storage":{"oss":{"encryption":{"method":"KMS","kms":{"keyID":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx"}}}}}}' --type=merge

Could push and pull images from internal registry.

Scenarion 2: Configure with KMS encrytions with invalid keyid.
Can't push images to internal registry, but registry has clear error, 

time="2022-02-09T09:28:48.599903309Z" level=error msg="Failed for move from docker/registry/v2/repositories/wxj1/httpd-ex/_uploads/f76aecff-cbb2-4d6e-80a6-a034e35ab2c5/data to docker/registry/v2/blobs/sha256/f3/f3c9d28767ea6b8d2a66b5bfe5833035a2ff6a04c3a3f69e33f7af72d48b5108/data: Aliyun API Error: RequestId: 62038950C6024338369FC676 Status Code: 400 Code: InvalidParameter Message: The specified parameter KMS keyId is not valid."

Scenarion 3: Disable the KMS
Can't push images to internal registry, but registry has clear error, 

time="2022-02-09T09:32:09.531569657Z" level=error msg="Failed for move from docker/registry/v2/repositories/wxj1/httpd-ex/_uploads/fde6946a-d3d9-40e7-9e1e-9c9d6cca324c/data to docker/registry/v2/blobs/sha256/e7/e7dccfb28c2eb3623d7596353d179ca46b2267c82a840804ed8c3c9159120901/data: Aliyun API Error: RequestId: 62038A190C7DCC32335E8DCB Status Code: 409 Code: KeyDisabled Message: The request was rejected because the key state is Disabled."

Comment 6 errata-xmlrpc 2022-03-10 16:43:22 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 (Moderate: OpenShift Container Platform 4.10.3 security update), and where to find the updated
files, follow the link below.

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