-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add a tool to apply and validate config #4143
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
Add a tool to apply and validate config #4143
Conversation
stevekuznetsov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good mostly!
tools/applyconfig/applyconfig.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: these could be
type level string
const (
standardLevel level = "standard"
adminLevel level = "admin"
allLevel level = "all"
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah.
tools/applyconfig/applyconfig.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't this require a cfg_ prefix? README says any YAML
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This regex is not used anymore, I need to remove it.
tools/applyconfig/applyconfig.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you DRY out the walk to just take the function to call here as a parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I tried to DRY it in one of the earlier iterations, it was hard so gave up. In the current form it should not be hard anymore.
|
Feedback adressed, thanks! |
stevekuznetsov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: petr-muller, stevekuznetsov The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
It's basically a
kubectl apply -f directory/ --recursivethat can ignore some files and distinguishes between normal and admin resources.I dropped the initial idea of descending into directories first, because I would need to write a new
filepath.Walkto do so and it does not seem worth the effort.All
admin_*.yamlfiles are admin resources, all remaining*.yamlfiles are standard resources. Files and directories starting with_are ignored. This has an advantage of never forgetting to apply any config unless it's intentionally named with a_prefix.If this looks good, I'll continue with modifying Makefiles / docs / existing jobs to use it.
/cc @stevekuznetsov @bbguimaraes @hongkailiu @droslean