Skip to content

Commit

Permalink
generate Embedded ObjectMeta in the CRDs
Browse files Browse the repository at this point in the history
Currently its not possible to specify the fields like
name,namespace etc in the embeded metadata objects in the
volumeClaim templates etc. adding generateEmbeddedObjectMeta
to the controller-gen which allow us generated the CRD's
with ObjectMeta.

Ref: kubernetes-sigs/controller-tools#557

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
  • Loading branch information
Madhu-1 committed Sep 9, 2022
1 parent 0b92390 commit bf31aff
Show file tree
Hide file tree
Showing 4 changed files with 307 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ generate: controller-gen
# Generate manifests e.g. CRD, RBAC etc.
manifests: controller-gen
@echo Updating generated manifests
$(CONTROLLER_GEN) rbac:roleName=manager-role crd paths=./api/... webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) rbac:roleName=manager-role crd:generateEmbeddedObjectMeta=true paths=./api/... webhook paths="./..." output:crd:artifacts:config=config/crd/bases

verify-deps: deps-update
@echo "Verifying dependency files"
Expand Down
102 changes: 102 additions & 0 deletions config/crd/bases/ocs.openshift.io_storageclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,23 @@ spec:
type: string
metadata:
description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata'
properties:
annotations:
additionalProperties:
type: string
type: object
finalizers:
items:
type: string
type: array
labels:
additionalProperties:
type: string
type: object
name:
type: string
namespace:
type: string
type: object
spec:
description: 'Spec defines the desired characteristics of
Expand Down Expand Up @@ -361,6 +378,23 @@ spec:
for StorageDeviceSet
properties:
metadata:
properties:
annotations:
additionalProperties:
type: string
type: object
finalizers:
items:
type: string
type: array
labels:
additionalProperties:
type: string
type: object
name:
type: string
namespace:
type: string
type: object
parameters:
additionalProperties:
Expand Down Expand Up @@ -673,6 +707,23 @@ spec:
type: string
metadata:
description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata'
properties:
annotations:
additionalProperties:
type: string
type: object
finalizers:
items:
type: string
type: array
labels:
additionalProperties:
type: string
type: object
name:
type: string
namespace:
type: string
type: object
spec:
description: 'Spec defines the desired characteristics of a volume
Expand Down Expand Up @@ -2265,6 +2316,23 @@ spec:
type: string
metadata:
description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata'
properties:
annotations:
additionalProperties:
type: string
type: object
finalizers:
items:
type: string
type: array
labels:
additionalProperties:
type: string
type: object
name:
type: string
namespace:
type: string
type: object
spec:
description: 'Spec defines the desired characteristics of
Expand Down Expand Up @@ -2578,6 +2646,23 @@ spec:
type: string
metadata:
description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata'
properties:
annotations:
additionalProperties:
type: string
type: object
finalizers:
items:
type: string
type: array
labels:
additionalProperties:
type: string
type: object
name:
type: string
namespace:
type: string
type: object
spec:
description: 'Spec defines the desired characteristics of
Expand Down Expand Up @@ -5006,6 +5091,23 @@ spec:
type: string
metadata:
description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata'
properties:
annotations:
additionalProperties:
type: string
type: object
finalizers:
items:
type: string
type: array
labels:
additionalProperties:
type: string
type: object
name:
type: string
namespace:
type: string
type: object
spec:
description: 'Spec defines the desired characteristics of
Expand Down
102 changes: 102 additions & 0 deletions deploy/bundle/manifests/storagecluster.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,23 @@ spec:
type: string
metadata:
description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata'
properties:
annotations:
additionalProperties:
type: string
type: object
finalizers:
items:
type: string
type: array
labels:
additionalProperties:
type: string
type: object
name:
type: string
namespace:
type: string
type: object
spec:
description: 'Spec defines the desired characteristics of
Expand Down Expand Up @@ -360,6 +377,23 @@ spec:
for StorageDeviceSet
properties:
metadata:
properties:
annotations:
additionalProperties:
type: string
type: object
finalizers:
items:
type: string
type: array
labels:
additionalProperties:
type: string
type: object
name:
type: string
namespace:
type: string
type: object
parameters:
additionalProperties:
Expand Down Expand Up @@ -672,6 +706,23 @@ spec:
type: string
metadata:
description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata'
properties:
annotations:
additionalProperties:
type: string
type: object
finalizers:
items:
type: string
type: array
labels:
additionalProperties:
type: string
type: object
name:
type: string
namespace:
type: string
type: object
spec:
description: 'Spec defines the desired characteristics of a volume
Expand Down Expand Up @@ -2264,6 +2315,23 @@ spec:
type: string
metadata:
description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata'
properties:
annotations:
additionalProperties:
type: string
type: object
finalizers:
items:
type: string
type: array
labels:
additionalProperties:
type: string
type: object
name:
type: string
namespace:
type: string
type: object
spec:
description: 'Spec defines the desired characteristics of
Expand Down Expand Up @@ -2577,6 +2645,23 @@ spec:
type: string
metadata:
description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata'
properties:
annotations:
additionalProperties:
type: string
type: object
finalizers:
items:
type: string
type: array
labels:
additionalProperties:
type: string
type: object
name:
type: string
namespace:
type: string
type: object
spec:
description: 'Spec defines the desired characteristics of
Expand Down Expand Up @@ -5005,6 +5090,23 @@ spec:
type: string
metadata:
description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata'
properties:
annotations:
additionalProperties:
type: string
type: object
finalizers:
items:
type: string
type: array
labels:
additionalProperties:
type: string
type: object
name:
type: string
namespace:
type: string
type: object
spec:
description: 'Spec defines the desired characteristics of
Expand Down
Loading

0 comments on commit bf31aff

Please sign in to comment.