Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨Add missing Fields to RosaControlPlane - tags, etcdEncryption #4802

Closed

Conversation

xiangjingli
Copy link
Contributor

What type of PR is this?
/kind feature

What this PR does / why we need it:
Adding the missing RosaControlPlan API fields;
Tags,
EtcdEncryption,
EtcdEncryptionKMSArn

Also removing the accountID and creatorARN from ROSA cluster templates as it is not necessary to declare them explicitly in the rosaControlPlane spec along the recent change.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes # #4737

Special notes for your reviewer:
There is another PR for adding different fields to RosaControlplan delivered by @serngawy
#4780

I will rebase the PR after the 4780 PR is merged.

Checklist:

  • squashed commits
  • includes documentation
  • includes emojis
  • adds unit tests
  • adds or updates e2e tests

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority labels Feb 20, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign vincepri for approval. For more information see the Kubernetes Code Review Process.

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

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

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. labels Feb 20, 2024
@xiangjingli
Copy link
Contributor Author

/cc @stevekuznetsov
/cc @muraee

@k8s-ci-robot
Copy link
Contributor

Hi @xiangjingli. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 20, 2024
@xiangjingli
Copy link
Contributor Author

@muraee @stevekuznetsov @serngawy FYI Please review the new PR I created, where I addressed all your comments

@xiangjingli xiangjingli force-pushed the newROSAControlPlaneSpec2 branch 3 times, most recently from 2c65bf7 to 9fb9946 Compare February 22, 2024 16:27
Comment on lines 597 to 605
tagsList := map[string]string{}

if len(rosaScope.ControlPlane.Spec.AdditionalTags) > 0 {
for tagKey, tagVal := range rosaScope.ControlPlane.Spec.AdditionalTags {
tagsList[strings.TrimSpace(tagKey)] = strings.TrimSpace(tagVal)
}
}

rosaScope.ControlPlane.Spec.AdditionalTags = tagsList
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not needed with the validation in the webhook.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

@xiangjingli xiangjingli force-pushed the newROSAControlPlaneSpec2 branch from 9fb9946 to c3e886c Compare February 22, 2024 17:16

// The etcd encryption kms key ARN is the key used to encrypt etcd.
// It is only allowed for hosted cp and it needs to be pre-created in AWS KMS with tag red-hat:true.
// +optional
Copy link
Contributor

@stevekuznetsov stevekuznetsov Feb 23, 2024

Choose a reason for hiding this comment

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

If we ditch the webhook, this is simply:

// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:XValidation:rule=`self.matches('^arn:aws[\\w-]*:kms:[\\w-]+:\\d{12}:key\\/(mrk-[0-9a-f]{32}$|[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$)')`, message="etcdEncryptionKMSArn must be a valid encryption key ARN"

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 28, 2024
@vincepri
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 28, 2024
@vincepri
Copy link
Member

/ok-to-test

@stevekuznetsov
Copy link
Contributor

Superseded by #4832
/close

@k8s-ci-robot
Copy link
Contributor

@stevekuznetsov: Closed this PR.

In response to this:

Superseded by #4832
/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. needs-priority needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants