Skip to content

Commit 8fce413

Browse files
authored
CLOUDP-65796: Update CRD from v1beta1 to v1 (#617)
1 parent 092fe04 commit 8fce413

File tree

8 files changed

+302
-292
lines changed

8 files changed

+302
-292
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ NAMESPACE := $(shell jq -r .namespace < ~/.community-operator-dev/config.json)
77
IMG := $(REPO_URL)/$(OPERATOR_IMAGE)
88
DOCKERFILE ?= operator
99
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
10-
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=true,crdVersions=v1beta1"
10+
CRD_OPTIONS ?= "crd:trivialVersions=true,crdVersions=v1"
1111

1212
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
1313
ifeq (,$(shell go env GOBIN))

PROJECT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: go.kubebuilder.io/v3
33
projectName: mko-v1
44
repo: github.com/mongodb/mongodb-kubernetes-operator
55
resources:
6-
- crdVersion: v1beta1
6+
- crdVersion: v1
77
group: mongodbcommunity
88
kind: MongoDBCommunity
99
version: v1

api/v1/doc.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package v1
2+
3+
// +k8s:deepcopy-gen=package
4+
// +versionName=v1

api/v1/mongodbcommunity_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ type MongoDBCommunitySpec struct {
9090
// configuration file: https://docs.mongodb.com/manual/reference/configuration-options/
9191
// +kubebuilder:validation:Type=object
9292
// +optional
93+
// +kubebuilder:pruning:PreserveUnknownFields
9394
// +nullable
9495
AdditionalMongodConfig MongodConfiguration `json:"additionalMongodConfig,omitempty"`
9596
}
@@ -191,6 +192,7 @@ type AuthenticationRestriction struct {
191192
// StatefulSetConfiguration holds the optional custom StatefulSet
192193
// that should be merged into the operator created one.
193194
type StatefulSetConfiguration struct {
195+
// +kubebuilder:pruning:PreserveUnknownFields
194196
SpecWrapper StatefulSetSpecWrapper `json:"spec"`
195197
}
196198

config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml

Lines changed: 289 additions & 287 deletions
Large diffs are not rendered by default.

config/crd/kustomizeconfig.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ nameReference:
44
version: v1
55
fieldSpecs:
66
- kind: CustomResourceDefinition
7-
version: v1beta1
7+
version: v1
88
group: apiextensions.k8s.io
99
path: spec/conversion/webhook/clientConfig/service/name
1010

1111
namespace:
1212
- kind: CustomResourceDefinition
13-
version: v1beta1
13+
version: v1
1414
group: apiextensions.k8s.io
1515
path: spec/conversion/webhook/clientConfig/service/namespace
1616
create: false

config/manager/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ resources:
44
generatorOptions:
55
disableNameSuffixHash: true
66

7-
apiVersion: kustomize.config.k8s.io/v1beta1
7+
apiVersion: kustomize.config.k8s.io/v1
88
kind: Kustomization
99
images:
1010
- name: mongodb-kubernetes-operator

docs/RELEASE_NOTES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
- Members of a Replica Set can be configured as arbiters.
77
- Reduce the number of permissions for operator role.
88
- Support SHA-1 as an authentication method.
9+
- Upgraded `mongodbcommunity.mongodbcommunity.mongodb.com` CRD to `v1` from `v1beta1`
10+
* Users upgrading their CRD from v1beta1 to v1 need to set: `spec.preserveUnknownFields` to `false` in the CRD file `config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml` before applying the CRD to the cluster.
911

1012
## Updated Image Tags
1113

0 commit comments

Comments
 (0)