Skip to content

✨add ClusterClaimConfiguration to API #363

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

o-farag
Copy link

@o-farag o-farag commented Mar 26, 2025

Summary

Enhances API to allow support for custom ClusterClaim configurations.

Related issue(s)

Required for open-cluster-management-io/ocm#897

Signed-off-by: Omar Farag <omarfarag74@gmail.com>
Signed-off-by: Omar Farag <omarfarag74@gmail.com>
@o-farag o-farag marked this pull request as ready for review April 1, 2025 22:48
@openshift-ci openshift-ci bot requested review from deads2k and mdelder April 1, 2025 22:48
@qiujian16
Copy link
Member

I think this should under registrationConfiguration field

cc @elgnay

@elgnay
Copy link
Contributor

elgnay commented Apr 10, 2025

The structure looks good to me. As @qiujian16 suggested, please move ClusterClaimConfiguration under registrationConfiguration.

@o-farag
Copy link
Author

o-farag commented Apr 11, 2025

@qiujian16 may I get this reviewed? I'd like to merge it for open-cluster-management-io/ocm#933

@qiujian16
Copy link
Member

#363 (comment)

Signed-off-by: Omar Farag <omarfarag74@gmail.com>
@o-farag
Copy link
Author

o-farag commented Apr 14, 2025

@qiujian16 sorry, I didn't see your comments for some reason. Updated!

@qiujian16
Copy link
Member

/approve

looks good to me but I will let @elgnay to final review
/assign @elgnay

Copy link
Contributor

openshift-ci bot commented Apr 14, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: o-farag, 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

// ClusterClaimConfiguration represents the configuration of ClusterClaim
// Effective only when the `ClusterClaim` feature gate is enabled.
// +optional
ClusterClaimConfiguration *ClusterClaimConfiguration `json:"clusterClaimConfiguration,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ClusterClaimConfiguration *ClusterClaimConfiguration `json:"clusterClaimConfiguration,omitempty"`
ClusterClaims *ClusterClaimConfiguration `json:"clusterClaims,omitempty"`

nit, not sure if it is better/simpler to remove the suffix configuration and make it as clusterClaim or clusterClaims

Copy link
Author

Choose a reason for hiding this comment

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

@elgnay what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm good with the name ClusterClaims. @qiujian16 Is there any naming convention or best practice we should follow when defining the API?

Copy link
Member

Choose a reason for hiding this comment

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

I kinda think it is a configuration, clusterClaims might be confusing on allowing user to specify claims they would like to create.

Copy link
Author

Choose a reason for hiding this comment

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

I agree with quijian16, since this configures cluster claims and aren't actual clusterclaims


// Custom suffixes for reserved ClusterClaims.
// +optional
ReservedClusterClaimSuffixes []string `json:"reservedClusterClaimSuffixes,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

I do not quite understand why a customer needs to configure the reserved cluster claims?

Copy link
Author

Choose a reason for hiding this comment

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

I do not quite understand why a customer needs to configure the reserved cluster claims?

@zhujian7 the proposed enhancement outlines this addition, I'm not sure if a specific customer requested it

Copy link
Contributor

Choose a reason for hiding this comment

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

It is guaranteed that reserved ClusterClaims will be reported in the status of the ManagedCluster. However, custom ClusterClaims are not guaranteed to appear due to the limitation on the number of custom ClusterClaims, even if the user sets a relatively high limit.

Copy link
Contributor

Choose a reason for hiding this comment

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

Moreover, ClusterClaims matching the ReservedClusterClaimSuffixes should be treated as additional reserved claims. They must be merged with, not override, the built-in (hardcoded) reserved claims when reported to the hub. Please either include this information in the field comment or consider renaming the field to AdditionalReservedClusterClaimSuffixes for clarity.

Copy link
Member

Choose a reason for hiding this comment

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

We could start with a predefined suffix. I do not know if there are use cases that need is to be configurable, and I am not sure what it should be when user change the suffix from one to another.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants