Skip to content

Commit 0f2fb2e

Browse files
authored
spec.terminationGracePeriodSeconds parameter to specify in podSpec (#167)
1 parent d13219f commit 0f2fb2e

File tree

8 files changed

+43
-14
lines changed

8 files changed

+43
-14
lines changed

api/v1alpha1/database_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type DatabaseSpec struct {
1414
DatabaseNodeSpec `json:",inline"`
1515

1616
// (Optional) NodeSet inline configuration to split into multiple StatefulSets
17+
// Default: (not specified)
1718
// +optional
1819
NodeSets []DatabaseNodeSetSpecInline `json:"nodeSets,omitempty"`
1920
}
@@ -156,6 +157,10 @@ type DatabaseNodeSpec struct {
156157
// +optional
157158
PriorityClassName string `json:"priorityClassName,omitempty"`
158159

160+
// (Optional) If specified, the pod's terminationGracePeriodSeconds.
161+
// +optional
162+
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
163+
159164
// (Optional) Additional custom resource labels that are added to all resources
160165
// +optional
161166
AdditionalLabels map[string]string `json:"additionalLabels,omitempty"`

api/v1alpha1/storage_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ type StorageNodeSpec struct {
149149
// +optional
150150
PriorityClassName string `json:"priorityClassName,omitempty"`
151151

152+
// (Optional) If specified, the pod's terminationGracePeriodSeconds.
153+
// +optional
154+
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
155+
152156
// (Optional) Additional custom resource labels that are added to all resources
153157
// +optional
154158
AdditionalLabels map[string]string `json:"additionalLabels,omitempty"`

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deploy/ydb-operator/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.4.38
18+
version: 0.4.39
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "0.4.38"
24+
appVersion: "0.4.39"

deploy/ydb-operator/crds/database.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4063,6 +4063,10 @@ spec:
40634063
required:
40644064
- name
40654065
type: object
4066+
terminationGracePeriodSeconds:
4067+
description: (Optional) If specified, the pod's terminationGracePeriodSeconds.
4068+
format: int64
4069+
type: integer
40664070
storageEndpoint:
40674071
description: YDB Storage Node broker address
40684072
type: string

deploy/ydb-operator/crds/storage.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4177,6 +4177,10 @@ spec:
41774177
type: string
41784178
type: object
41794179
type: object
4180+
terminationGracePeriodSeconds:
4181+
description: (Optional) If specified, the pod's terminationGracePeriodSeconds.
4182+
format: int64
4183+
type: integer
41804184
tolerations:
41814185
description: (Optional) If specified, the pod's tolerations.
41824186
items:

internal/resources/database_statefulset.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,13 @@ func (b *DatabaseStatefulSetBuilder) buildPodTemplateSpec() corev1.PodTemplateSp
8989
Annotations: CopyDict(b.Spec.AdditionalAnnotations),
9090
},
9191
Spec: corev1.PodSpec{
92-
Containers: []corev1.Container{b.buildContainer()},
93-
NodeSelector: b.Spec.NodeSelector,
94-
Affinity: b.Spec.Affinity,
95-
Tolerations: b.Spec.Tolerations,
96-
PriorityClassName: b.Spec.PriorityClassName,
97-
TopologySpreadConstraints: b.Spec.TopologySpreadConstraints,
92+
Containers: []corev1.Container{b.buildContainer()},
93+
NodeSelector: b.Spec.NodeSelector,
94+
Affinity: b.Spec.Affinity,
95+
Tolerations: b.Spec.Tolerations,
96+
PriorityClassName: b.Spec.PriorityClassName,
97+
TopologySpreadConstraints: b.Spec.TopologySpreadConstraints,
98+
TerminationGracePeriodSeconds: b.Spec.TerminationGracePeriodSeconds,
9899

99100
Volumes: b.buildVolumes(),
100101

internal/resources/storage_statefulset.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,13 @@ func (b *StorageStatefulSetBuilder) buildPodTemplateSpec() corev1.PodTemplateSpe
107107
Annotations: CopyDict(b.Spec.AdditionalAnnotations),
108108
},
109109
Spec: corev1.PodSpec{
110-
Containers: []corev1.Container{b.buildContainer()},
111-
NodeSelector: b.Spec.NodeSelector,
112-
Affinity: b.Spec.Affinity,
113-
Tolerations: b.Spec.Tolerations,
114-
PriorityClassName: b.Spec.PriorityClassName,
115-
TopologySpreadConstraints: b.buildTopologySpreadConstraints(),
110+
Containers: []corev1.Container{b.buildContainer()},
111+
NodeSelector: b.Spec.NodeSelector,
112+
Affinity: b.Spec.Affinity,
113+
Tolerations: b.Spec.Tolerations,
114+
PriorityClassName: b.Spec.PriorityClassName,
115+
TopologySpreadConstraints: b.buildTopologySpreadConstraints(),
116+
TerminationGracePeriodSeconds: b.Spec.TerminationGracePeriodSeconds,
116117

117118
Volumes: b.buildVolumes(),
118119

0 commit comments

Comments
 (0)