Skip to content

Commit 949931a

Browse files
update: modify TerminationGracePeriodSecs data type to int64 to remove implicit conversion
1 parent 4605e13 commit 949931a

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

apis/v1alpha1/cluster_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ type CrdbClusterSpec struct {
149149
// when marked for deletion or restarted
150150
// Default : 300
151151
// +optional
152-
TerminationGracePeriodSecs int32 `json:"terminationGracePeriodSecs,omitempty"`
152+
TerminationGracePeriodSecs int64 `json:"terminationGracePeriodSecs,omitempty"`
153153
}
154154

155155
// +k8s:openapi-gen=true

config/crd/bases/crdb.cockroachlabs.com_crdbclusters.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,7 @@ spec:
13971397
description: '(Optional) Amount of grace time prior to the container
13981398
being forcibly terminated when marked for deletion or restarted
13991399
Default : 300'
1400-
format: int32
1400+
format: int64
14011401
type: integer
14021402
tlsEnabled:
14031403
description: (Optional) TLSEnabled determines if TLS is enabled for

install/crds.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,7 @@ spec:
13951395
description: '(Optional) Amount of grace time prior to the container
13961396
being forcibly terminated when marked for deletion or restarted
13971397
Default : 300'
1398-
format: int32
1398+
format: int64
13991399
type: integer
14001400
tlsEnabled:
14011401
description: (Optional) TLSEnabled determines if TLS is enabled for

pkg/resource/cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ func (cluster Cluster) SecureMode() string {
330330
return "--insecure"
331331
}
332332

333-
func (cluster Cluster) GetTerminationGracePeriod() int32 {
333+
func (cluster Cluster) GetTerminationGracePeriod() int64 {
334334
if cluster.Spec().TerminationGracePeriodSecs == 0 {
335335
return terminationGracePeriodSecs
336336
}

pkg/resource/statefulset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ func (b StatefulSetBuilder) makePodTemplate() corev1.PodTemplateSpec {
209209
RunAsUser: ptr.Int64(1000581000),
210210
FSGroup: ptr.Int64(1000581000),
211211
},
212-
TerminationGracePeriodSeconds: ptr.Int64(int64(b.GetTerminationGracePeriod())),
212+
TerminationGracePeriodSeconds: ptr.Int64(b.GetTerminationGracePeriod()),
213213
Containers: b.MakeContainers(),
214214
AutomountServiceAccountToken: ptr.Bool(b.Spec().AutomountServiceAccountToken),
215215
ServiceAccountName: b.ServiceAccountName(),

pkg/testutil/builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (b ClusterBuilder) WithAutomountServiceAccountToken(mount bool) ClusterBuil
5656
return b
5757
}
5858

59-
func (b ClusterBuilder) WithTerminationGracePeriodSeconds(s int32) ClusterBuilder {
59+
func (b ClusterBuilder) WithTerminationGracePeriodSeconds(s int64) ClusterBuilder {
6060
b.cluster.Spec.TerminationGracePeriodSecs = s
6161
return b
6262
}

0 commit comments

Comments
 (0)