Repository navigation
fix: Reject zero and empty values admission used to let through - #73
Merged
Merged
Conversation
Four fields accepted a value that only failed, or silently changed meaning, after admission: - monitoring.vmagentRemote.scrapeInterval matched "" (every unit in its duration pattern is optional). A written "" is stored as is, since a schema default fills only a missing field, and the builder then ran vmagent on its own 15s fallback. MinLength=1. - securityContext.runAsUser allowed 0, but the Memgraph container sets runAsNonRoot, so the kubelet refused to start it. Minimum=1; runAsGroup and fsGroup keep 0, which is a legitimate gid. - coreDumps.uploader.envFromSecrets items had no constraint, so "" or a non-DNS name surfaced as ApplyFailed. Items now carry the Secret name rules every other secretName has. - storage.<role>.libPVCSize and coreDumps.<role>.size accepted 0 and negative quantities at creation; the existing rules only stop a shrink. Both must now be greater than zero. An existing object holding one of these values fails its next update until it is corrected. The validation test's raw manifests share a rawCluster helper now that there are three.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Follow-up to #72's API audit: "if you really want to disallow zero values or empty strings for a field, use
MinLength=1/Minimum=1". Four fields accepted a value that only failed after admission (asApplyFailedor a pod that never starts), or that silently meant something else.What
monitoring.vmagentRemote.scrapeInterval""(every unit in the duration pattern is optional)"", because a schema default only fills a missing field; the builder then quietly used15sMinLength=1securityContext.runAsUser0runAsNonRoot, so the kubelet refuses to start itMinimum=1(runAsGroup/fsGroupkeep0, a legitimate gid)coreDumps.uploader.envFromSecrets[]""secretRef.name, so the StatefulSet apply failed withApplyFailedMinLength/MaxLength/DNS-subdomain rules as everysecretNamestorage.<role>.libPVCSize,coreDumps.<role>.size0,-1Giat creation (the existing rules only block a shrink)Left alone on purpose: the storage class names (
""disables dynamic provisioning, as documented),EnvVar.value,FlagValue, the uploader'scommand/argsitems, andpriorityClassName/serviceMonitor.interval(optional, where""already means unset).Compatibility: this only tightens validation. An existing object holding one of these values fails its next update until it is corrected; nothing changes for valid objects or their pods.
Chart
version1.0.1-rc.1 → 1.0.1-rc.2 for the CRD change. #72 makes the same bump, so whichever merges second needs rc.3.Testing
""). The raw manifests now share arawClusterhelper.make test,make lint,make chart-verify,make helm-lint,make chart-version-check.