Skip to content

Alibaba Cloud Provider: introducing imageregistry types#1082

Merged
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
kwoodson:alibaba_reg_updates
Dec 14, 2021
Merged

Alibaba Cloud Provider: introducing imageregistry types#1082
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
kwoodson:alibaba_reg_updates

Conversation

@kwoodson
Copy link
Copy Markdown

Summary: This PR adds the additional fields necessary to provide support for Alibaba imageregistry.

  • Updated the descriptions
  • updated the kubebuilder fields
  • cleaned up comments on the fields
  • cleaned up the constant / enumerable types to match OpenShift patterns.

This PR replaces the previous #1009.

cc @menglingwei

@kwoodson kwoodson force-pushed the alibaba_reg_updates branch 3 times, most recently from d157107 to 3de2385 Compare December 10, 2021 19:01
Comment thread imageregistry/v1/types.go Outdated
Comment thread imageregistry/v1/types.go
type KMSEncryptionAlibaba struct {
// KeyID holds the KMS encryption key ID
// +kubebuilder:validation:Required
KeyID string `json:"keyID"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be empty? Which format?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the Type is set to KMS then a key would be required. When it is not, it can be empty.

The CMK ID that must be specified when SSEAlgorithm is set to KMS and a specified CMK is used for encryption. In other cases, this element must be set to null.

Comment thread imageregistry/v1/types.go Outdated
Comment thread imageregistry/v1/types.go Outdated
Comment thread imageregistry/v1/types.go Outdated
@kwoodson kwoodson force-pushed the alibaba_reg_updates branch from 3de2385 to 446d3dd Compare December 10, 2021 19:20
Comment thread imageregistry/v1/types.go Outdated
PublicEndpoint EndpointAccessibility = "Public"

// PlainText is an AlibabaEncryptionMode. This means no encryption
PlainText AlibabaEncryptionMode = "PlainText"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be the default value? Then declare a default via marker.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Declared below where Type is defined.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set as default

Comment thread imageregistry/v1/types.go Outdated
Comment thread imageregistry/v1/types.go

// KMS (key management service) is an encryption type provided to encrypt the provider
// +optional
KMS *KMSEncryptionAlibaba `json:"kms,omitempty"`
Copy link
Copy Markdown
Contributor

@sttts sttts Dec 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is only to be set when type matches, you have to add a patch file (can be follow-up), setting

anyOf:
- properties:
       type:
         not:
           enum: ["KMS"]
  not:
      required: ["kms"]
- properties:
    type:
      enum: ["KMS"]
  required: ["kms"]

Double check the logic.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me research how to do this.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kwoodson kwoodson force-pushed the alibaba_reg_updates branch from 446d3dd to 7a60f80 Compare December 10, 2021 19:33
@kwoodson kwoodson force-pushed the alibaba_reg_updates branch 6 times, most recently from 3cb56a8 to 1b438f9 Compare December 10, 2021 21:29
Comment thread imageregistry/v1/types.go Outdated
// EndpointAccessibility specifies whether the registry use the OSS VPC internal endpoint
// Empty value means no opinion and the platform chooses the a default, which is subject to change over time.
// Currently the default is `Internal`.
// +kubebuilder:validation:Enum="Internal";"Public"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also need "", because client side validation does not see the default.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add.

Comment thread imageregistry/v1/types.go Outdated
// Currently the default is `PlainText`.
// +kubebuilder:validation:Enum="PlainText";"KMS";"AES256"
// +kubebuilder:default="PlainText"
// +kubebuilder:validation:Required
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the default this must be optional now because client-side validation does not see the default.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to optional.

@kwoodson kwoodson force-pushed the alibaba_reg_updates branch from 1b438f9 to 6a777a8 Compare December 10, 2021 21:48
@sttts
Copy link
Copy Markdown
Contributor

sttts commented Dec 10, 2021

/lgtm
/approve

/hold
Please test in a real cluster and verify that it behaves as it should.

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 10, 2021
@openshift-ci openshift-ci Bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 10, 2021
@kwoodson
Copy link
Copy Markdown
Author

@sttts Thanks for the help. I'll get a test cluster going now.

Comment thread imageregistry/v1/types.go Outdated
@kwoodson kwoodson force-pushed the alibaba_reg_updates branch from 6a777a8 to 3c20f7b Compare December 14, 2021 01:40
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 14, 2021
@kwoodson
Copy link
Copy Markdown
Author

Fixed typo in description and nothing else.

@kwoodson
Copy link
Copy Markdown
Author

/test verify

@kwoodson
Copy link
Copy Markdown
Author

Verify had a few of these. Wondering if something wrong with the CI.

W1214 01:48:40.137749   14982 clientconn.go:1223] grpc: addrConn.createTransport failed to connect to {http://127.0.0.1:2379  <nil> 0 <nil>}. Err :connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:2379: connect: connection refused". Reconnecting...

@kwoodson
Copy link
Copy Markdown
Author

/test verify

@kwoodson
Copy link
Copy Markdown
Author

@dmage @sttts In order to correctly apply the kubebuilder/openAPI patch to the CRD I had to rename the 00-crd.yaml to 00-imageregistry.crd.yaml. I have noticed that this CRD no longer gets deployed when testing this latest pull request.

Does this require an openshift/client-go and an openshift/library-go update?

@kwoodson kwoodson force-pushed the alibaba_reg_updates branch from 3c20f7b to 6fef1b3 Compare December 14, 2021 14:59
@kwoodson
Copy link
Copy Markdown
Author

I have updated the 00- and 01- CRD files to have a meaningful name 00_imageregistry.crd.yaml as well as 01_imagepruner.crd.yaml. This allows the patch to be applied.

Testing these changes now.

@kwoodson kwoodson force-pushed the alibaba_reg_updates branch from 6fef1b3 to 06e543c Compare December 14, 2021 18:59
Comment thread imageregistry/v1/types.go Outdated
Comment on lines +332 to +338
// Mode defines the different encrytion types available
// Empty value means no opinion and the platform chooses the a default, which is subject to change over time.
// Currently the default is `AES256`.
// +kubebuilder:validation:Enum="PlainText";"KMS";"AES256"
// +kubebuilder:default="AES256"
// +optional
Mode AlibabaEncryptionMode `json:"mode"`
Copy link
Copy Markdown
Contributor

@mtulio mtulio Dec 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sttts @kwoodson I am concerning about the field name mode, looking the Alibaba Console, bucket encryption configuration, we have three methods of encryption:

  • None
  • OSS-Managed
  • KMS

Then it has only one encryption algorithm:

  • AES256

I am concerned if we could rename this field from mode to method, with the default value of OSS-Managed.

I am not sure if we need the field algorithm, but it could be interesting for future capabilities. For now, it will assume only one value: AES256

Screenshot from 2021-12-14 15-34-32
Screenshot from 2021-12-14 15-34-26

Copy link
Copy Markdown
Author

@kwoodson kwoodson Dec 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the Type to Method to align with the API. I updated the default to AES256 after @mtulio's tests. This seems to be what we wanted it to be by default.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have nothing against these changes, but be quick. This should land before FF on Friday (I am out, but David Eads can approve).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sttts Looks like we have been bitten by the yaml_patch issue. I have submitted a PR #1086 to fix it. We would like to merge that one so that I can generate code properly in this PR. Would you please TAL?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tagged

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sttts Awesome, thanks for your help!

@mtulio
Copy link
Copy Markdown
Contributor

mtulio commented Dec 14, 2021

/lgtm /approve

/hold Please test in a real cluster and verify that it behaves as it should.

@kwoodson @sttts please take a look at those tests: openshift/cluster-image-registry-operator#724 (comment)

It's working as expected, but I left some comments regarding the naming conventions of those fields, considering the Console/UI. Please let me know wdyt.

@kwoodson kwoodson force-pushed the alibaba_reg_updates branch from 06e543c to c260fcb Compare December 14, 2021 19:14
@kwoodson
Copy link
Copy Markdown
Author

/hold

I have submitted #1086 to fix the test verify that has been failing.

@kwoodson kwoodson force-pushed the alibaba_reg_updates branch from c260fcb to c5299f9 Compare December 14, 2021 19:59
@kwoodson
Copy link
Copy Markdown
Author

Rebased to clean up commits from the #1086 merge.

@kwoodson
Copy link
Copy Markdown
Author

/hold cancel

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 14, 2021
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Dec 14, 2021

@kwoodson: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@mtulio
Copy link
Copy Markdown
Contributor

mtulio commented Dec 14, 2021

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Dec 14, 2021
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Dec 14, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kwoodson, mtulio, sttts

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 207332e into openshift:master Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants