Repository navigation
feat(conformity): lint finds resource, version and listener rules no cluster can meet - #432
Merged
Merged
Conversation
…cluster can meet kates conformity lint's incoherence stage gains the last 9 of the 21 core checks. Errors, which no cluster can pass, so check stops with exit 2: - request-above-limit: a cpu or memory request above its limit, with at least one pod of the role. Quantities compare exactly, so 8Gi is above 8G and 700m equals 0.7. - strimzi-1-with-pre-kraft-kafka: Strimzi 1.x or later with Kafka before 3.0, which no such operator runs. - listener-contradicts-every: a required listener's type, tls or auth shares no value with kafka.listeners.every. - listener-port-below-9092: a required listener's port below the minimum Strimzi's Kafka CRD accepts. Each becomes a rule-never-passes warning when a rule it reads is warn or waived. Warnings: - byte-quantity-too-small: a memory or storage size below a mebibyte, such as 512m for 512Mi; a whole min that small is left alone, as a deliberate "must be set". - ephemeral-single-node: one node at most on ephemeral storage. - podmonitor-without-metrics: a PodMonitor with no metrics and no Kafka Exporter to scrape. - authorization-without-authentication: the simple or Keycloak authorizer with every listener anonymous. - setting-without-effect: a custom zoneLabel, or source brokers, that no rule reads.
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.
PR 8c of the conformity pre-flight, and the last (plan D1: the core 21 checks).
kates conformity lint's incoherence stage gains the last 9 checks, inrules_resources.goandrules_language.go. It uses the two-pass engine from #430 unchanged.Errors
No cluster can pass these, so
checkstops with exit 2 before it calls the API. When a rule one of them reads iswarnor waived, it becomesrule-never-passesinstead.request-above-limitstrimzi-1-with-pre-kraft-kafkalistener-contradicts-everykafka.listeners.everylistener-port-below-9092request-above-limitcompares quantities exactly (big.Rat, restored from b60c2ee): 8Gi is above 8G, and 700m equals"0.7". Float64 would put 700m a hair above 0.7 and raise a false error, so this check needs the exact numbers that 8b could do without.TestQuantityEdgescovers both cases.Warnings
byte-quantity-too-small512mfor 512Mi. A wholeminthat small is left alone as a deliberate "must be set"; a fractional one is flaggedephemeral-single-nodepodmonitor-without-metricsauthorization-without-authenticationevery.auth: none(neither tolerated)setting-without-effectzoneLabelwith no zones, skew or rackAwareness rule, orsource: brokerswith no config or rackAwareness ruleWhere this differs from the catalogue spec
request-above-limithas only its error form. The warning for a count that allows 0 pods is left out.rule-never-passescatalogue entry stays onzones-unreachable. Its trigger is shorter than the listener one in b60c2ee.Tests
TestCatalogueandTestEveryCatalogueRuleIsRegistered: each check fires on its trigger and not on its near miss, and the catalogue matches the registered checks both ways.kind-ci,minimalandprod-3azstill lint clean.go test ./...,go vet ./...,golangci-lint run --new-from-rev=origin/main ./...,govulncheck,check-cli-style.sh,check-cli-compat.sh, and the full kates./mvnw test(1,489 tests, 0 failures).