Skip to content

🐛 keep name in ObjectMeta for volumeClaimTemplates #510

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkg/crd/known_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ var KnownPackages = map[string]PackageOverride{
// generate validation for it.
p.Schemata[TypeIdent{Name: "ObjectMeta", Package: pkg}] = apiext.JSONSchemaProps{
Type: "object",
// The name property is an exception, it has a special role volumeClaimTemplates
// so it has to be kept, otherwise it won't be propagated.
Properties: map[string]apiext.JSONSchemaProps{
"name": {
Type: "string",
},
},
}
p.Schemata[TypeIdent{Name: "Time", Package: pkg}] = apiext.JSONSchemaProps{
Type: "string",
Expand Down
9 changes: 9 additions & 0 deletions pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ spec:
type: string
metadata:
type: object
properties:
name:
type: string
spec:
description: CronJobSpec defines the desired state of CronJob
properties:
Expand Down Expand Up @@ -133,6 +136,9 @@ spec:
description: 'Standard object''s metadata of the jobs created
from this template. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata'
type: object
properties:
name:
type: string
spec:
description: 'Specification of the desired behavior of the job.
More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status'
Expand Down Expand Up @@ -233,6 +239,9 @@ spec:
description: 'Standard object''s metadata. More info:
https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata'
type: object
properties:
name:
type: string
spec:
description: 'Specification of the desired behavior of
the pod. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ spec:
type: string
metadata:
type: object
properties:
name:
type: string
spec:
type: object
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ spec:
type: string
metadata:
type: object
properties:
name:
type: string
spec:
type: object
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ spec:
type: string
metadata:
type: object
properties:
name:
type: string
spec:
type: object
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ spec:
type: string
metadata:
type: object
properties:
name:
type: string
spec:
type: object
required:
Expand Down
3 changes: 3 additions & 0 deletions pkg/schemapatcher/testdata/expected/legacy-example-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ spec:
type: string
metadata:
type: object
properties:
name:
type: string
spec:
type: object
required:
Expand Down
3 changes: 3 additions & 0 deletions pkg/schemapatcher/testdata/expected/legacy-unchanged-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ spec:
type: string
metadata:
type: object
properties:
name:
type: string
spec:
type: object
required:
Expand Down