Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -11759,6 +11759,9 @@ spec:
- size
type: object
type: array
revisionHistoryLimit:
format: int32
type: integer
roles:
items:
properties:
Expand Down
4 changes: 4 additions & 0 deletions deploy/bundle.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if we should have this warning in CRD

Copy link
Author

@myJamong myJamong Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed all the comments.

commit: b910275

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down Expand Up @@ -12646,6 +12647,9 @@ spec:
- size
type: object
type: array
revisionHistoryLimit:
format: int32
type: integer
roles:
items:
properties:
Expand Down
1 change: 1 addition & 0 deletions deploy/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ spec:
# terminationGracePeriod: false
# backupIfUnhealthy: false
updateStrategy: SmartUpdate
# revisionHistoryLimit: 10
# ignoreAnnotations:
# - service.beta.kubernetes.io/aws-load-balancer-backend-protocol
# ignoreLabels:
Expand Down
4 changes: 4 additions & 0 deletions deploy/crd.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down Expand Up @@ -12646,6 +12647,9 @@ spec:
- size
type: object
type: array
revisionHistoryLimit:
format: int32
type: integer
roles:
items:
properties:
Expand Down
4 changes: 4 additions & 0 deletions deploy/cw-bundle.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down Expand Up @@ -12646,6 +12647,9 @@ spec:
- size
type: object
type: array
revisionHistoryLimit:
format: int32
type: integer
roles:
items:
properties:
Expand Down
4 changes: 4 additions & 0 deletions e2e-tests/version-service/conf/crd.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down Expand Up @@ -12646,6 +12647,9 @@ spec:
- size
type: object
type: array
revisionHistoryLimit:
format: int32
type: integer
roles:
items:
properties:
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/psmdb/v1/psmdb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ type PerconaServerMongoDBSpec struct {
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
PMM PMMSpec `json:"pmm,omitempty"`
UpdateStrategy appsv1.StatefulSetUpdateStrategyType `json:"updateStrategy,omitempty"`
RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
UpgradeOptions UpgradeOptions `json:"upgradeOptions,omitempty"`
SchedulerName string `json:"schedulerName,omitempty"`
ClusterServiceDNSSuffix string `json:"clusterServiceDNSSuffix,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/psmdb/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pkg/psmdb/mongos.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ func MongosStatefulsetSpec(cr *api.PerconaServerMongoDB, template corev1.PodTemp
Selector: &metav1.LabelSelector{
MatchLabels: naming.MongosLabels(cr),
},
Template: template,
UpdateStrategy: updateStrategy,
Template: template,
UpdateStrategy: updateStrategy,
RevisionHistoryLimit: cr.Spec.RevisionHistoryLimit,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to add this field with version check to prevent unexpected restarts after operator upgrade. you can check cr.CompareVersion for examples. this will go into v1.23, so we need to check for "1.23.0"

Copy link
Author

@myJamong myJamong Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some changes and added a cr.CompareVersion logic to check for 1.23.0.
Thanks for your guide.

commit: b910275

}
}

Expand Down
1 change: 1 addition & 0 deletions pkg/psmdb/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ func StatefulSpec(ctx context.Context, cr *api.PerconaServerMongoDB, replset *ap
},
},
UpdateStrategy: updateStrategy,
RevisionHistoryLimit: cr.Spec.RevisionHistoryLimit,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need cr version check here as well

Copy link
Author

@myJamong myJamong Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also changed this part.

commit: b910275

VolumeClaimTemplates: volumeClaimTemplates,
}, nil
}
Expand Down
Loading