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

✨ Update clustermanager API spec for auto approval identities #357

Conversation

jeffw17
Copy link
Contributor

@jeffw17 jeffw17 commented Feb 6, 2025

Summary

We want to add a new field in the RegistrationHubConfiguration for clustermanager to store AutoApprovalIdentities for both CSR and AWSIRSA auth type.

Related issue(s)

Fixes # #514 and #822

@openshift-ci openshift-ci bot requested review from mdelder and qiujian16 February 6, 2025 16:32
Copy link
Member

@mikeshng mikeshng left a comment

Choose a reason for hiding this comment

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

Type: "FieldValueRequired",
Message: "Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property",
Field: "spec.validation.openAPIV3Schema.properties[spec].properties[registrationConfiguration].properties[autoApprovalIdentities].items.properties[driver].default",

RegistrationDrivers didn't have this issue so maybe use that as reference.

@jeffw17 jeffw17 force-pushed the feature/auto-approval-registration branch 2 times, most recently from 92ff577 to 9492e04 Compare February 6, 2025 22:42

Verified

This commit was signed with the committer’s verified signature.
crazy-max CrazyMax
Signed-off-by: “Jeffrey <jeffreywong0417@gmail.com>
@jeffw17 jeffw17 force-pushed the feature/auto-approval-registration branch from 9492e04 to ec28f1b Compare February 6, 2025 22:46
@qiujian16
Copy link
Member

/assign @skeeey @xuezhaojun

@skeeey
Copy link
Member

skeeey commented Feb 7, 2025

We may need to mark the autoApproveUsers to Deprecated

// +kubebuilder:validation:Enum=csr;awsirsa
Driver string `json:"driver,omitempty"`

// Identities represent a list of users in which we will allow to join with hub cluster
Copy link
Member

Choose a reason for hiding this comment

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

may need more comments here

  • for csr driver, the identities represent a list of users ...
  • for awsirsa driver, the identities represent a list of arns ...

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

@qiujian16
Copy link
Member

rethinking of this...how about we add approvedIdentities in the registrationDrivers field for each driver? It will make the API easier to use.

Verified

This commit was signed with the committer’s verified signature.
crazy-max CrazyMax
Signed-off-by: Amrutha <amrutha.hari12@gmail.com>
@@ -115,6 +115,13 @@ type RegistrationHubConfiguration struct {
// +listType=map
// +listMapKey=authType
RegistrationDrivers []RegistrationDriverHub `json:"registrationDrivers,omitempty"`

// AutoApprovalIdentities represent the list of approved identities which is used to whitelist certain identities to join with the hub cluster
// An ApprovedIdentities contains details of the driver type (csr, awsirsa) and a list of identities to whitelist.
Copy link
Member

Choose a reason for hiding this comment

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

also need to explain this will override the approvedUsers field if it is set.

Driver string `json:"driver,omitempty"`

// Identities represent a list of users in which we will allow to join with hub cluster
// +required
Copy link
Member

Choose a reason for hiding this comment

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

also need to set the minimumItem to 1.

// For csr authentication type, Identities represent a list of approved users
// For awsirsa authentication type, Identities represent a list of approved arn patterns
// +optional
Identities []string `json:"identities,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

maybe approveIdentities or autoApprovedIdentities?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: “Jeffrey <jeffreywong0417@gmail.com>
@qiujian16
Copy link
Member

/approve
/lgtm

Copy link
Contributor

openshift-ci bot commented Feb 19, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jeffw17, qiujian16

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

The pull request process is described 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

@openshift-merge-bot openshift-merge-bot bot merged commit 4281b76 into open-cluster-management-io:main Feb 19, 2025
10 checks passed
@jaswalkiranavtar jaswalkiranavtar deleted the feature/auto-approval-registration branch March 20, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants