-
Notifications
You must be signed in to change notification settings - Fork 28
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
values schema #811
base: main
Are you sure you want to change the base?
values schema #811
Conversation
@d7oc could you skim those changes to check if you agree with the principle of this change? Most interesting from my side:
If we can agree on the schema beeing a good thing, I'll gonna do some polishing on this PR, especially on the configuration documentation that received a small fallout. |
34c49fa
to
06f3d2b
Compare
@d7oc I'd like to get this into the chart soonish or agree on a timeframe when this change does fits our risk analysis / schedule / ... This week I had another occurence where this schema feature would have saved a college and my like 2 hours each because we had fine looking configuration on a wrong indention level. |
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.
Submitting first feedback. Check until line 800 in values.yaml
sha: | ||
# @schema | ||
# type: [string, null] | ||
# required: true | ||
# @schema |
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.
We should somehow limit the allowed strings here, as per Kubernetes API this can only be Always
, Never
or IfNotPresent
.
sha: | |
# @schema | |
# type: [string, null] | |
# required: true | |
# @schema | |
sha: | |
# @schema | |
# enum: ["Always", "Never", "IfNotPresent", null] | |
# required: true | |
# @schema |
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.
adding null
to to the enum field does actually not end up in the final schema.
This would be no blocker for .Values.image.pullPolicy
, because it is never null.
But .Values.services.<service>.image.pullPolicy
needs to be nullable to fallback to .Values.image.pullPolicy
With your changes, liniting fails:
DEBU[2024-12-09T08:01:38+01:00] Using template files [charts/ocis/docs/templates/values-desc-table.adoc.gotmpl] for chart charts/ocis
/home/wkloucek/go/bin/gomplate-v3.11.8 --file=charts/ocis/docs/templates/values.adoc.yaml.gotmpl --out=charts/ocis/docs/values.adoc.yaml
/home/wkloucek/go/bin/helm-v3.16.2 lint charts/ocis -f 'charts/ocis/ci/absolute-minimum-values.yaml'
==> Linting charts/ocis
[INFO] Chart.yaml: icon is recommended
[ERROR] values.yaml: - services.activitylog.image.pullPolicy: services.activitylog.image.pullPolicy must be one of the following: "Always", "Never", "IfNotPresent"
As said, this is because the schema doesn't inherit the null:
"pullPolicy": {
"default": "",
"description": "Image pull policy",
+ "enum": [
+ "Always",
+ "Never",
+ "IfNotPresent"
+ ],
"required": [],
- "title": "pullPolicy",
- "type": [
- "string",
- "null"
- ]
+ "title": "pullPolicy"
},
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.
After some further reading I guess we need to set type
and enum
. With type
set to string
and null
as before and enum
with the allowed string values. This should do the trick.
I'm missing the command here to generate the schema from the |
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.
Finished review.
# @schema | ||
# type: [string, null] | ||
# required: false | ||
# @schema | ||
# -- UUID of the initial admin user. | ||
# If the given value matches a user's value from `features.externalUserManagement.oidc.userIDClaim`, the admin role will be assigned. |
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.
We could used format: "uuid"
here
# @schema | ||
# type: string | ||
# required: true | ||
# @schema |
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.
We could use format: "email"
here
# @schema | ||
# type: [string, null] | ||
# required: false | ||
# @schema |
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.
We could use format: "uri"
here
# @schema | ||
# type: [string, null] | ||
# required: false | ||
# @schema |
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.
We could use format: "uri"
here
# -- The object class to use for users in the default user search filter like `inetOrgPerson`. | ||
objectClass: inetOrgPerson |
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.
Was this skipped intentionally?
# @schema | ||
# type: [string, null] | ||
# required: false | ||
# @schema |
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.
We could use format: "uri"
here.
# -- Configure the {"styles": []} section in the Web config.json. | ||
styles: | ||
[] | ||
# - href: /theme/foo.css | ||
# @schema | ||
# additionalProperties: true | ||
# @schema | ||
# -- Configure the {"styles": []} section in the Web config.json. |
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.
Seems to me that this description of the setting is wrong.
postLogoutRedirectURI: | ||
# @schema | ||
# type: [string, null] | ||
# required: false | ||
# @schema |
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.
We could add format: "uri"
here.
# @schema | ||
# type: [string, null] | ||
# required: false | ||
# @schema |
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.
We could add format: "uri"
here.
# @schema | ||
# type: [string, null] | ||
# required: false | ||
# @schema |
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.
We could add format: "uri"
here.
Description
Maintain a schema file to find misconfigurations.
There were already some misconfigurations found in the deployment examples (see the diff).
Related Issue
Motivation and Context
How Has This Been Tested?
helm lint charts/ocis -f ~/Projects/gitlab.xxx/exxx/ocis-infra/common/ocis/values.yaml -f ~/Projects/gitlab.xxx/exxx/ocis-infra/prod/apps/ocis/values.yaml
Screenshots (if appropriate):
Types of changes
Checklist:
make docs
) and committed