1- {{ if eq .Values.createCrds true }}
1+ {{- if .Values.createCrds }}
2+ {{- if has "mongodb" (.Values.operator.watchedResources | default (tuple "mongodb")) }}
23---
34apiVersion : apiextensions.k8s.io/v1beta1
45kind : CustomResourceDefinition
3132 type : date
3233 description : The time since the MongoDB resource was created.
3334 JSONPath : .metadata.creationTimestamp
35+ {{- if .Values.subresourceEnabled }}
3436 subresources :
3537 status : {}
38+ {{- end }}
3639 validation :
3740 openAPIV3Schema :
3841 type : object
@@ -410,7 +413,8 @@ spec:
410413 shardCount :
411414 minimum : 1
412415 type : integer
413-
416+ {{- end }}
417+ {{- if has "mongodbusers" (.Values.operator.watchedResources | default (tuple "mongodbusers")) }}
414418
415419---
416420apiVersion : apiextensions.k8s.io/v1beta1
@@ -436,8 +440,10 @@ spec:
436440 type : date
437441 description : The time since the MongoDB User resource was created
438442 JSONPath : .metadata.creationTimestamp
443+ {{- if .Values.subresourceEnabled }}
439444 subresources :
440445 status : {}
446+ {{- end }}
441447 validation :
442448 openAPIV3Schema :
443449 type : object
@@ -492,6 +498,9 @@ spec:
492498 required :
493499 - username
494500 - db
501+ {{- end }}
502+ {{- if has "opsmanagers" (.Values.operator.watchedResources | default (tuple "opsmanagers")) }}
503+
495504---
496505apiVersion : apiextensions.k8s.io/v1beta1
497506kind : CustomResourceDefinition
@@ -536,8 +545,10 @@ spec:
536545 type : string
537546 description : Warnings
538547 JSONPath : .status.warnings
548+ {{- if .Values.subresourceEnabled }}
539549 subresources :
540550 status : {}
551+ {{- end }}
541552 validation :
542553 openAPIV3Schema :
543554 type : object
@@ -827,6 +838,9 @@ spec:
827838 required :
828839 - version
829840 - applicationDatabase
841+ {{- end }}
842+ {{- end }}
843+
830844
831845# This ClusterRole is necessary in order to use validating webhooks—these will
832846# prevent you from applying a variety of invalid resource definitions. The
@@ -846,5 +860,3 @@ rules:
846860 - create
847861 - update
848862 - delete
849-
850- {{ end }}
0 commit comments