Skip to content

Commit ce489fa

Browse files
authored
fix: avoid apply additional properties too much (#143)
1 parent c352c42 commit ce489fa

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

.cspell.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
{
2-
"ignorePaths": ["go.mod", "go.sum"],
2+
"ignorePaths": [
3+
"go.mod",
4+
"go.sum"
5+
],
36
"language": "en",
47
"version": "0.2",
58
"words": [
9+
"apiextensions",
10+
"apimachinery",
11+
"apiserver",
12+
"APIV",
613
"buildvcs",
714
"chartutil",
815
"checkmake",

internal/command/updater_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func assertDirectories(t *testing.T, a, b string) {
184184
// Test is skipped during unit testing and meant for step-debugging a local check
185185
func TestCheckLocal(t *testing.T) {
186186
output := "../../build/ephemeral/schema"
187-
config := "../../test/configuration.yaml"
187+
config := "../../build/configuration.yaml"
188188
updater := NewUpdater(config, output, output, nil, nil)
189189

190190
err := updater.Run()

internal/crd/crd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func (s *CrdMetaSchema) Filepath() string {
196196
}
197197

198198
func applyDefaults(schema *v1.JSONSchemaProps, skip bool) {
199-
if !skip && len(schema.Properties) > 0 && schema.AdditionalProperties == nil {
199+
if !skip && schema.Type == "object" && len(schema.Properties) > 0 && schema.AdditionalProperties == nil {
200200
schema.AdditionalProperties = &v1.JSONSchemaPropsOrBool{Allows: false}
201201
}
202202

0 commit comments

Comments
 (0)