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

Volcano admission: Validate that ExactMatch or RegexMatch field not null when MemberSelectorType matches #3883

Open
Monokaix opened this issue Dec 13, 2024 · 4 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@Monokaix
Copy link
Member

Monokaix commented Dec 13, 2024

Part implementation of #3850

MemberSelector field of hyperNode crd:
type MemberSelector struct {
	// Type specifies the selection method (Exact or Regex).
	// +kubebuilder:validation:Enum=Exact;Regex
	// // +required
	Type MemberSelectorType `json:"type"`

	// ExactMatch defines the exact match criteria (required when Type is "Exact").
	// +optional
	ExactMatch *ExactMatch `json:"exactMatch,omitempty"`

	// RegexMatch defines the regex match criteria (required when Type is "Regex").
	// +optional
	RegexMatch *RegexMatch `json:"regexMatch,omitempty"`
}

When MemberSelectorType is set to Exact, should check that ExactMatch is not null, when MemberSelectorType is set to Regex, should check that RegexMatch is not null.

@Monokaix Monokaix converted this from a draft issue Dec 13, 2024
@Xu-Wentao
Copy link

/assign

@Monokaix
Copy link
Member Author

/kind feature

@volcano-sh-bot volcano-sh-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 13, 2024
@JesseStutler
Copy link
Member

JesseStutler commented Dec 13, 2024

@Xu-Wentao
I have a new admission requirement here: node label volcano.sh/hypernodes validation:

  1. The format of the label must be "hypernode-0,hypernode-1,...,hypernode-n", use commas to separate different hypernodes, hypernode name cannot be empty, such as "hypernode-0,,,,", the name of hypernode must be legal.
  2. only the hypernode of tier 1 is allowed to be changed, such as s0,s4,s6 can be updated to s1,s4,s6, but the hypernode of tier > 1 is not allowed to be changed, such as s0,s4,s6 changed to s0,s5,s6. It is also not allowed to increase or decrease the length. For example,s0,s4,s6 cannot be updated to s0,s4 or s0,s4,s6,s7. However, it is allowed to delete the label or set the value to an empty string.

@JesseStutler
Copy link
Member

@Monokaix May need to rewrite the description of this issue and separate ExactMatch or RegexMatch validation and node label volcano.sh/hypernodes as two tasks in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Development

No branches or pull requests

4 participants