Installation defaults: an allOf/anyOf/oneOf branch over a dictionary rejects a valid entry
Les mainteneurs répondent en général sous 3 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 54/100
Piste de recherche
Start with prepareInstallationDefaultsFragment in pkg/registry/apps/application/installation_defaults.go and trace how it handles object branches under allOf, anyOf and oneOf. Reproduce the issue with the schema and entry in the report, then check that the entry is accepted and merged without the forbidden-property warning. The report notes that no current ApplicationDefinition has this shape, so testing requires a hand-written schema.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Describe the bug
Before merging an applicationDefaults entry the API checks it against the application schema and closes objects to unknown keys (additionalProperties: false) unless they declare a dictionary or preserve unknown fields. It does that also for an object inside an allOf, anyOf or oneOf branch, even when the property this branch constrains is declared as a dictionary next to it. A valid entry is refused, and every create of that kind goes on without defaults and returns a Warning.
Environment
- Cozystack: main (since #5107)
To Reproduce
Application schema:
{"type":"object","properties":{"options":{"type":"object","additionalProperties":{"type":"string"}}},"allOf":[{"properties":{"options":{"type":"object","minProperties":1}}}]}
Entry {"options":{"a":"x"}}. The plain OpenAPI validator accepts it, applyInstallationDefaults refuses it.
Expected behaviour
Entry is accepted and merged.
Actual behaviour
options.a in body is a forbidden property
Additional context
prepareInstallationDefaultsFragment in pkg/registry/apps/application/installation_defaults.go. A branch fragment should take its openness from the declared property, not close itself. Same for an object without type inside a branch whose declared counterpart has no properties. None of the 32 ApplicationDefinitions in the tree has this shape and cozyvalues-gen does not produce it, so only a hand-written schema of an external catalog can hit it.
- Langage dominant
- Go
- Étoiles
- 2.2k
- Forks
- 209
- Merge moyen
- 4 j 14 h
- PR mergées (30 j)
- 140
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de cozystack/cozystack
-
triage/needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
cozystack/cozystack#5464 · 1 réaction ·
Les mainteneurs répondent en général sous 3 jours
-
test(kubernetes-nodes): stop hand-typing the default Talos version in tests that are not about itOuvertearea/testing kind/cleanup triage/needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
cozystack/cozystack#5456 · 1 réaction ·
Les mainteneurs répondent en général sous 3 jours
-
area/testing kind/cleanup triage/needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
cozystack/cozystack#5447 · 1 réaction ·
Les mainteneurs répondent en général sous 3 jours
-
area/kubernetes kind/bug triage/needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
cozystack/cozystack#5445 · 1 réaction ·
Les mainteneurs répondent en général sous 3 jours
-
kind/bug triage/needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
cozystack/cozystack#5438 · 1 réaction ·
Les mainteneurs répondent en général sous 3 jours
Toutes les issues de cozystack/cozystack
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Correct local module testing instructions for Go sample contributorsPeut-être pris @slievrly l’a pris aujourd’hui. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
-
internal/core: cleanAttachmentName splits a rune at the 255-byte cap and stores invalid UTF-8Peut-être pris @pacwestnobody l’a pris aujourd’hui. Ouvertego good first issue help wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
Podiom/Podiom#427 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
TestLaunchGolden spends about 98 seconds on fake-agent exit delays under -racePeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 1 jour
-
factory:subtask
Difficulté 1/5 Moins d'une heure Accessibilité débutants 95/100
Les mainteneurs répondent en général sous 1 jour