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

feat(platform): support skip validate item #2179

Merged
merged 1 commit into from
Nov 21, 2022

Conversation

leoryu
Copy link
Contributor

@leoryu leoryu commented Nov 17, 2022

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:

/kind api-change
/kind bug
/kind cleanup
/kind deprecation
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


if isNeedValidateForDynamicItem(AnywhereValidateItemSelinux, cls) {
selinuxErrs = ValidateSelinux(fldPath, masters)
selinuxResult.Checked = true
log.Infof("cls %s's %s is validated", cls.Spec.DisplayName, AnywhereValidateItemSelinux)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个日志再加一个 cls 的 name 吧,后台查的时候displayname好像不展示

Copy link
Contributor Author

Choose a reason for hiding this comment

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

before cls created, cls doesn't have name.

@@ -30,6 +30,8 @@ const (
AnywhereValidateItemFirewall = "Firewall"
AnywhereValidateItemSelinux = "Selinux"
AnywhereValidateItemStorage = "Storage"
// validate all items
AnywhereValidateItemAll = "All"
Copy link
Collaborator

Choose a reason for hiding this comment

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

再加点前缀吧,其余的check项名字还比较有辨识度,这个all容易和别的anno冲突

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is anno value, not key.

if validateMachine {
allErrs = append(allErrs, ValidateClusterMachines(cls, fldPath.Child("machines"))...)
if isNeedValidateForDynamicItem(AnywhereValidateItemStorage, cls) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个方法要不也挪validateClusterMachines里面?

Copy link
Collaborator

Choose a reason for hiding this comment

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

validateStorage方法

Copy link
Contributor Author

Choose a reason for hiding this comment

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

storage info is not in spec.machines, so we not set storage validate in machine. And storage validate just run once to check storage service, even the number of masters is 3, this is different with all items in machine validate.

Copy link
Collaborator

Choose a reason for hiding this comment

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

主要是你把这个放到 validateMachine==true 判断逻辑里,又搞了处理逻辑差异化~

Copy link
Contributor Author

@leoryu leoryu Nov 21, 2022

Choose a reason for hiding this comment

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

since if we dosen't have machines, we dosen't have any machine to ssh to validate storage service. So I set storage validate after machine validate.

@leoryu leoryu merged commit 0df6aa5 into tkestack:master Nov 21, 2022
@leoryu leoryu deleted the support-skip-validate branch November 21, 2022 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants