karmada icon indicating copy to clipboard operation
karmada copied to clipboard

feature: add name length check for fedresourcequota

Open likakuli opened this issue 3 years ago • 4 comments

Signed-off-by: likakuli [email protected]

What type of PR is this? /kind feature

What this PR does / why we need it:

FedResourceQuota is a user-facing resource and its name is used in work's label. So the length should be no more than 63 characters like other resource. e.g. PropagationPolicy

Which issue(s) this PR fixes: Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

likakuli avatar Jul 11 '22 07:07 likakuli

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign kevin-wangzefeng after the PR has been reviewed. You can assign the PR to them by writing /assign @kevin-wangzefeng in a comment when ready.

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

karmada-bot avatar Jul 11 '22 07:07 karmada-bot

I think it makes sense to add this validation. However, it may be not a bug fix but only a verification enhancement.

OK,let me update the kind.

likakuli avatar Jul 12 '22 04:07 likakuli

This failing e2e case will be fixed by #2177

XiShanYongYe-Chang avatar Jul 13 '22 03:07 XiShanYongYe-Chang

FedResourceQuota is a user-facing resource and its name is used in work's label.

I'm afraid this is the wrong decision that directly takes name as the label. We already have lessons learned about that. We should use the hash value, just like what we did for ResourceBinding.

By the way, restricting the name length definitely a cheaper way, but we should avoid doing that as we don't know exactly the use case and should not make the assumption that the name length never exceeds 63.

RainbowMango avatar Jul 13 '22 06:07 RainbowMango